Repository: ShareDropio/sharedrop
Branch: master
Commit: 2b6a9fe5e6ca
Files: 93
Total size: 131.4 KB
Directory structure:
gitextract_vxj0u4do/
├── .editorconfig
├── .ember-cli
├── .eslintignore
├── .eslintrc.js
├── .gitignore
├── .prettierignore
├── .template-lintrc.js
├── .travis.yml
├── .watchmanconfig
├── Dockerfile
├── LICENSE
├── Procfile
├── Procfile.dev
├── README.md
├── app/
│ ├── app.js
│ ├── components/
│ │ ├── circular-progress.hbs
│ │ ├── circular-progress.js
│ │ ├── file-field.js
│ │ ├── modal-dialog.js
│ │ ├── peer-avatar.js
│ │ ├── peer-widget.js
│ │ ├── popover-confirm.js
│ │ ├── room-url.js
│ │ └── user-widget.js
│ ├── controllers/
│ │ ├── application.js
│ │ └── index.js
│ ├── helpers/
│ │ └── is-equal.js
│ ├── index.html
│ ├── initializers/
│ │ └── prerequisites.js
│ ├── models/
│ │ ├── peer.js
│ │ └── user.js
│ ├── router.js
│ ├── routes/
│ │ ├── application.js
│ │ ├── error.js
│ │ ├── index.js
│ │ └── room.js
│ ├── services/
│ │ ├── analytics.js
│ │ ├── avatar.js
│ │ ├── file.js
│ │ ├── room.js
│ │ └── web-rtc.js
│ ├── styles/
│ │ ├── app.sass
│ │ ├── base/
│ │ │ ├── _element_defaults.sass
│ │ │ ├── _glyphicons_filetypes.sass
│ │ │ ├── _mixins.sass
│ │ │ ├── _reset.sass
│ │ │ └── _variables.sass
│ │ ├── layout/
│ │ │ ├── _content.sass
│ │ │ ├── _footer.sass
│ │ │ ├── _header.sass
│ │ │ └── _media.sass
│ │ └── modules/
│ │ ├── _modal.sass
│ │ ├── _modules.sass
│ │ ├── _popover.sass
│ │ └── _users.sass
│ └── templates/
│ ├── about-app.hbs
│ ├── about-room.hbs
│ ├── about-you.hbs
│ ├── application.hbs
│ ├── components/
│ │ ├── modal-dialog.hbs
│ │ ├── peer-widget.hbs
│ │ ├── popover-confirm.hbs
│ │ └── user-widget.hbs
│ ├── errors/
│ │ ├── browser-unsupported.hbs
│ │ ├── filesystem-unavailable.hbs
│ │ └── popovers/
│ │ ├── connection-failed.hbs
│ │ └── multiple-files.hbs
│ └── index.hbs
├── config/
│ ├── dotenv.js
│ ├── environment.js
│ ├── optional-features.json
│ └── targets.js
├── ember-cli-build.js
├── firebase_rules.json
├── lib/
│ └── google-analytics/
│ ├── index.js
│ └── package.json
├── newrelic.js
├── package.json
├── prettier.config.js
├── public/
│ ├── .gitkeep
│ ├── .well-known/
│ │ └── brave-rewards-verification.txt
│ ├── crossdomain.xml
│ └── robots.txt
├── server.js
├── sharedrop.crx
├── testem.js
├── tests/
│ ├── helpers/
│ │ └── .gitkeep
│ ├── index.html
│ ├── integration/
│ │ └── .gitkeep
│ ├── test-helper.js
│ └── unit/
│ └── .gitkeep
└── vendor/
├── .gitkeep
└── peer.js
================================================
FILE CONTENTS
================================================
================================================
FILE: .editorconfig
================================================
# EditorConfig helps developers define and maintain consistent
# coding styles between different editors and IDEs
# editorconfig.org
root = true
[*]
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true
indent_style = space
indent_size = 2
[*.hbs]
insert_final_newline = false
[*.{diff,md}]
trim_trailing_whitespace = false
================================================
FILE: .ember-cli
================================================
{
/**
Ember CLI sends analytics information by default. The data is completely
anonymous, but there are times when you might want to disable this behavior.
Setting `disableAnalytics` to true will prevent any data from being sent.
*/
"disableAnalytics": false
}
================================================
FILE: .eslintignore
================================================
# unconventional js
/blueprints/*/files/
/vendor/
# compiled output
/dist/
/tmp/
# dependencies
/bower_components/
/node_modules/
# misc
/coverage/
!.*
# ember-try
/.node_modules.ember-try/
/bower.json.ember-try
/package.json.ember-try
================================================
FILE: .eslintrc.js
================================================
const eslintPluginNode = require('eslint-plugin-node');
module.exports = {
root: true,
parser: 'babel-eslint',
parserOptions: {
ecmaVersion: 2018,
sourceType: 'module',
ecmaFeatures: {
legacyDecorators: true,
},
},
plugins: ['ember', 'prettier'],
extends: ['airbnb-base', 'plugin:ember/recommended', 'prettier'],
env: {
browser: true,
},
rules: {
'func-names': 'off',
'no-console': 'off',
'no-underscore-dangle': 'off',
'import/no-extraneous-dependencies': 'off',
'import/no-unresolved': 'off',
'prettier/prettier': 'error',
// TODO: Enable these
'ember/no-jquery': 'off',
'ember/no-observers': 'off',
'ember/no-get': 'off',
},
overrides: [
// node files
{
files: [
'.eslintrc.js',
'.template-lintrc.js',
'ember-cli-build.js',
'testem.js',
'blueprints/*/index.js',
'config/**/*.js',
'lib/*/index.js',
'server/**/*.js',
],
parserOptions: {
sourceType: 'script',
},
env: {
browser: false,
node: true,
},
plugins: ['node'],
rules: {
...eslintPluginNode.configs.recommended.rules,
// add your custom rules and overrides for node files here
// this can be removed once the following is fixed
// https://github.com/mysticatea/eslint-plugin-node/issues/77
'node/no-unpublished-require': 'off',
},
},
],
};
================================================
FILE: .gitignore
================================================
# See https://help.github.com/ignore-files/ for more about ignoring files.
# compiled output
/dist/
/tmp/
# dependencies
/bower_components/
/node_modules/
# misc
/.env*
/.pnp*
/.sass-cache
/connect.lock
/coverage/
/libpeerconnection.log
/npm-debug.log*
/testem.log
/yarn-error.log
# ember-try
/.node_modules.ember-try/
/bower.json.ember-try
/package.json.ember-try
================================================
FILE: .prettierignore
================================================
##########
# Common
##########
# Duh
.git/
# Third party
/node_modules/
/vendor/
# Build products
/dist/
/tmp/
/coverage/
/.sass-cache/
================================================
FILE: .template-lintrc.js
================================================
module.exports = {
extends: 'octane',
// TODO: enable these
rules: {
'no-action': false,
'no-curly-component-invocation': false,
'no-implicit-this': false,
'no-partial': false,
},
};
================================================
FILE: .travis.yml
================================================
---
language: node_js
node_js:
- "12"
dist: xenial
addons:
chrome: stable
cache:
yarn: true
env:
global:
# See https://git.io/vdao3 for details.
- JOBS=1
before_install:
- curl -o- -L https://yarnpkg.com/install.sh | bash
- export PATH=$HOME/.yarn/bin:$PATH
script:
- yarn test
================================================
FILE: .watchmanconfig
================================================
{
"ignore_dirs": [
"tmp",
"dist"
]
}
================================================
FILE: Dockerfile
================================================
FROM node:14-buster
RUN mkdir -p /srv/app
WORKDIR /srv/app
COPY package.json yarn.lock ./
RUN yarn --frozen-lockfile --non-interactive
COPY . /srv/app
EXPOSE 8000
CMD [ "yarn", "develop" ]
================================================
FILE: LICENSE
================================================
The MIT License
Copyright (c) 2014-2024 Szymon Nowak
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
================================================
FILE: Procfile
================================================
web: node server.js
================================================
FILE: Procfile.dev
================================================
server: node server.js
web: ember build --watch
================================================
FILE: README.md
================================================
# ShareDrop is now LimeWire
Dear ShareDrop community,
ShareDrop has been acquired by LimeWire, a leading file sharing platform with integrated AI tools. You can continue to share any files between devices, while benefitting from:
* sharing files between devices in the same network
* anonymous up- & downloads
* end-to-end encryption
* up to 40GB storage for free users
* integrated AI tools for signed-up users
Visit [sharedrop.io](https://sharedrop.io) or [limewire.com](https://limewire.com)
The Github repository will stay as-is and you can still go ahead and download and run the classic ShareDrop on your own infrastructure.
# ShareDrop Classic
ShareDrop is a web application inspired by Apple [AirDrop](http://support.apple.com/kb/ht4783) service. It allows you to transfer files directly between devices, without having to upload them to any server first. It uses [WebRTC](http://www.webrtc.org) for secure peer-to-peer file transfer and [Firebase](https://www.firebase.com) for presence management and WebRTC signaling.
ShareDrop allows you to send files to other devices in the same local network (i.e. devices with the same public IP address) without any configuration - simply open on all devices and they will see each other. It also allows you to send files between networks - just click the `+` button in the top right corner of the page to create a room with a unique URL and share this URL with other people you want to send a file to. Once they open this page in a browser on their devices, you'll see each other's avatars.
The main difference between ShareDrop and AirDrop is that ShareDrop requires Internet connection to discover other devices, while AirDrop doesn't need one, as it creates ad-hoc wireless network between them. On the other hand, ShareDrop allows you to share files between mobile (Android and iOS) and desktop devices and even between networks.
## Supported browsers
- Chrome
- Edge (Chromium based)
- Firefox
- Opera
- Safari 13+
## Local development
1. Setup Firebase:
1. [Sign up](https://www.firebase.com) for a Firebase account and create a database.
2. Go to "Security Rules" tab, click "Load Rules" button and select `firebase_rules.json` file.
3. Take note of your database URL and its secret, which can be found in "Secrets" tab.
2. Run `npm install -g ember-cli` to install Ember CLI.
3. Run `yarn` to install app dependencies.
4. Run `cp .env{.sample,}` to create `.env` file. This file will be used by Foreman to set environment variables when running the app locally.
- `SECRET` key is used to encrypt cookies and generate room name based on public IP address for `/` route. It can be any random string - you can generate one using e.g. `date | md5sum`
- `NEW_RELIC_*` keys are only necessary in production
5. Run `yarn develop` to start the app.
## Deployment
### Heroku
Create a new Heroku app:
```
heroku create
```
and push the app to Heroku repo:
```
git push heroku master
```
================================================
FILE: app/app.js
================================================
import Application from '@ember/application';
import Resolver from 'ember-resolver';
import loadInitializers from 'ember-load-initializers';
import config from 'sharedrop/config/environment';
import * as Sentry from '@sentry/browser';
import { Ember as EmberIntegration } from '@sentry/integrations';
Sentry.init({
dsn:
'https://ba1292a9c759401dbbda4272f183408d@o432021.ingest.sentry.io/5384091',
integrations: [new EmberIntegration()],
});
export default class App extends Application {
modulePrefix = config.modulePrefix;
podModulePrefix = config.podModulePrefix;
Resolver = Resolver;
}
loadInitializers(App, config.modulePrefix);
================================================
FILE: app/components/circular-progress.hbs
================================================
================================================
FILE: app/components/circular-progress.js
================================================
import Component from '@glimmer/component';
import { htmlSafe } from '@ember/template';
const COLORS = {
blue: '0, 136, 204',
orange: '197, 197, 51',
};
export default class CircularProgress extends Component {
constructor(owner, args) {
super(owner, args);
const rgb = COLORS[args.color];
this.style = htmlSafe(`fill: rgba(${rgb}, .5)`);
}
get path() {
const π = Math.PI;
const α = this.args.value * 360;
const r = (α * π) / 180;
const mid = α > 180 ? 1 : 0;
const x = Math.sin(r) * 38;
const y = Math.cos(r) * -38;
return `M 0 0 v -38 A 38 38 1 ${mid} 1 ${x} ${y} z`;
}
}
================================================
FILE: app/components/file-field.js
================================================
import TextField from '@ember/component/text-field';
import $ from 'jquery';
export default TextField.extend({
type: 'file',
classNames: ['invisible'],
click(event) {
event.stopPropagation();
},
change(event) {
const input = event.target;
const { files } = input;
this.onChange({ files });
this.reset();
},
// Hackish way to reset file input when sender cancels file transfer,
// so if sender wants later to send the same file again,
// the 'change' event is triggered correctly.
reset() {
const field = $(this.element);
field.wrap('