Easy P2P file transfer powered by WebRTC - inspired by Apple AirDrop 一个开源的 Web 应用,允许用户在局域网里通过 WebRTC 分享文件。如果不在同一局域网,可以进入同一个页面进行分享。
Go to file
Szymon Nowak ee7d48a13f
Merge pull request #90 from cowbell/ember-upgrade
Upgrade Ember and other dependencies
2020-07-19 22:04:49 +02:00
app Update packages 2020-07-19 17:29:17 +02:00
config Enable ember-export-application-global 2020-07-19 20:11:41 +02:00
public Change the way peers are displayed 2019-01-16 20:49:25 +01:00
tests Fix running tests, even though there are none... 2020-07-19 22:03:44 +02:00
vendor Update Ember, filer.js and idb.filesystem.js 2020-07-19 16:59:15 +02:00
.editorconfig Update Ember, filer.js and idb.filesystem.js 2020-07-19 16:59:15 +02:00
.ember-cli Seems like it's more or less working 2015-01-04 18:22:23 +01:00
.env.sample Remove Persona 😭 2017-05-19 20:46:24 +02:00
.eslintignore Update ember to 2.18.2. 2019-01-15 16:06:19 +01:00
.eslintrc.js Update Ember, filer.js and idb.filesystem.js 2020-07-19 16:59:15 +02:00
.gitignore Update Ember, filer.js and idb.filesystem.js 2020-07-19 16:59:15 +02:00
.gitkeep Seems like it's more or less working 2015-01-04 18:22:23 +01:00
.prettierignore Add prettier 2019-01-15 17:18:44 +01:00
.template-lintrc.js Update Ember, filer.js and idb.filesystem.js 2020-07-19 16:59:15 +02:00
.travis.yml Update ember to 3.7.1 2019-01-16 13:00:28 +01:00
.watchmanconfig Update Ember, filer.js and idb.filesystem.js 2020-07-19 16:59:15 +02:00
ember-cli-build.js Update packages 2020-07-19 17:29:17 +02:00
firebase_rules.json Validate user data in Firebase to prevent incomplete records 2014-03-29 21:35:22 +01:00
LICENSE Add license 2014-03-19 18:23:30 +01:00
newrelic.js Fix all eslint errors 2019-01-16 11:49:14 +01:00
package.json Enable ember-export-application-global 2020-07-19 20:11:41 +02:00
prettier.config.js Update Ember, filer.js and idb.filesystem.js 2020-07-19 16:59:15 +02:00
Procfile Update ember to 3.7.1 2019-01-16 13:00:28 +01:00
Procfile.dev Update ember to 3.7.1 2019-01-16 13:00:28 +01:00
README.md Merge pull request #90 from cowbell/ember-upgrade 2020-07-19 22:04:49 +02:00
server.js Update packages 2020-07-19 17:29:17 +02:00
sharedrop.crx Seems like it's more or less working 2015-01-04 18:22:23 +01:00
testem.js Update Ember, filer.js and idb.filesystem.js 2020-07-19 16:59:15 +02:00
yarn.lock Update packages 2020-07-19 17:29:17 +02:00

ShareDrop

ShareDrop is a web application inspired by Apple AirDrop service. It allows you to transfer files directly between devices, without having to upload them to any server first. It uses WebRTC for secure peer-to-peer file transfer and Firebase 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 https://www.sharedrop.io 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+

How to set it up for local development

  1. Setup Firebase:
    1. Sign up 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 ember install 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 npm run dev to start the app.

Deployment

Heroku

When deploying to Heroku, use multi buildpack.

For new apps:

heroku create myapp --buildpack https://github.com/heroku/heroku-buildpack-multi.git

For existing apps:

heroku config:set BUILDPACK_URL=https://github.com/heroku/heroku-buildpack-multi.git

Then run

heroku config:set NPM_CONFIG_PRODUCTION=false

to make Node.js buildpack install development dependencies necessary to build Ember CLI app as well as the production ones.

It uses the default Heroku Node.js buildpack to install Node.js, npm and Node.js packages and then uses Ember CLI buildpack to install Bower packages and build Ember CLI app.