PairDrop/README.md

104 lines
6.1 KiB
Markdown
Raw Normal View History

2020-03-24 00:40:23 +01:00
# Snapdrop
2015-12-18 16:50:36 +01:00
2020-07-14 21:32:50 +02:00
[Snapdrop](https://snapdrop.net): local file sharing in your browser. Inspired by Apple's Airdrop.
2017-01-14 21:52:52 +01:00
2020-07-14 21:32:50 +02:00
#### Snapdrop is built with the following awesome technologies:
2018-09-21 19:51:29 +02:00
* Vanilla HTML5 / ES6 / CSS3
* Progressive Web App
2015-12-29 01:42:01 +01:00
* [WebRTC](http://webrtc.org/)
2020-07-14 21:32:50 +02:00
* [WebSockets](http://www.websocket.org/)
2015-12-29 01:42:01 +01:00
* [NodeJS](https://nodejs.org/en/)
* [Material Design](https://material.google.com/)
2015-12-18 16:50:36 +01:00
2020-01-16 09:07:37 +01:00
## Support the Snapdrop Community
Snadprop is free. Still, we have to pay for the server. If you want to contribute, please use PayPal:
2020-01-31 09:17:35 +01:00
[<img src="https://www.paypalobjects.com/en_US/i/btn/btn_donateCC_LG.gif">](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=74D2NE84JHCWG&source=url)
or Bitcoin:
2020-01-16 09:10:40 +01:00
[<img src="https://coins.github.io/thx/logo-color-large-pill-320px.png" alt="CoinThx" width="200"/>](https://coins.github.io/thx/#1K9zQ8f4iTyhKyHWmiDKt21cYX2QSDckWB?label=Snapdrop&message=Thanks!%20Your%20contribution%20helps%20to%20keep%20Snapdrop%20free%20for%20everybody!)
2018-09-21 16:12:21 +02:00
2020-07-14 22:30:09 +02:00
Alternatively, you can become a [Github Sponsor](https://github.com/sponsors/RobinLinus).
2020-01-16 09:07:37 +01:00
Thanks a lot for supporting free and open software!
## Frequently Asked Questions
2015-12-18 16:50:36 +01:00
2015-12-30 23:00:29 +01:00
### Instructions
* [Video Instructions](https://www.youtube.com/watch?v=4XN02GkcHUM) (Big thanks to [TheiTeckHq](https://www.youtube.com/channel/UC_DUzWMb8gZZnAbISQjmAfQ))
2015-12-31 02:17:02 +01:00
* [idownloadblog](http://www.idownloadblog.com/2015/12/29/snapdrop/)
* [thenextweb](http://thenextweb.com/insider/2015/12/27/snapdrop-is-a-handy-web-based-replacement-for-apples-fiddly-airdrop-file-transfer-tool/)
* [winboard](http://www.winboard.org/artikel-ratgeber/6253-dateien-vom-desktop-pc-mit-anderen-plattformen-teilen-mit-snapdrop.html)
Squashed commit of the following: commit c04cdad7db20fcd66a8e191c99282d21aa1a4ca2 Author: RobinLinus <robinlinus@users.noreply.github.com> Date: Sat Sep 22 08:47:40 2018 +0200 Cleanup commit 891859680a1565cead8fe3dca771449b5e1e3035 Author: RobinLinus <robinlinus@users.noreply.github.com> Date: Sat Sep 22 05:55:09 2018 +0200 Refactor about page commit 04415ef28f8e7281c13546f168f2582a82bcb34f Author: RobinLinus <robinlinus@users.noreply.github.com> Date: Sat Sep 22 04:44:17 2018 +0200 Cleanup commit 52bd7692e951c5fafdcdb182a69646b78f03884d Author: RobinLinus <robinlinus@users.noreply.github.com> Date: Fri Sep 21 23:19:54 2018 +0200 Notifications Android & Desktop commit f537b9621350fd1ea6694e7a2a8d3eca1edbf012 Author: RobinLinus <robinlinus@users.noreply.github.com> Date: Fri Sep 21 22:32:39 2018 +0200 Notifications commit 476cb0ae6525177d7ea0519c9f0c4de67d2bf0f3 Author: RobinLinus <robinlinus@users.noreply.github.com> Date: Fri Sep 21 22:31:46 2018 +0200 Notifications commit 5a631d3833a63e76d3611dc97ec073e471af58ba Author: RobinLinus <robinlinus@users.noreply.github.com> Date: Fri Sep 21 21:21:44 2018 +0200 Notfication API on android commit 600d3551f4765d65a4348a33012b57ee370b3da3 Author: RobinLinus <robinlinus@users.noreply.github.com> Date: Fri Sep 21 21:12:11 2018 +0200 Add will-change commit 3ac40fb3d7467df6c0f66b0d156202cbfbf80f09 Author: RobinLinus <robinlinus@users.noreply.github.com> Date: Fri Sep 21 21:04:48 2018 +0200 Don’t reconnect if already connecting commit 9c9ca70d05fb2894d4e8113acc3a99a7b582ec78 Author: RobinLinus <robinlinus@users.noreply.github.com> Date: Fri Sep 21 20:55:15 2018 +0200 Reconnect on rejoin room commit 7194c65c74681883089d21c574275dfc01864d50 Author: RobinLinus <robinlinus@users.noreply.github.com> Date: Fri Sep 21 20:51:56 2018 +0200 Reconnect on rejoin room commit 0ede41f8d5397e8b7beb62ba6abe2571296f4690 Author: RobinLinus <robinlinus@users.noreply.github.com> Date: Fri Sep 21 20:34:49 2018 +0200 Cancel keep alive on join room commit 1d9581632fe3a99c2068d8c0cece9345c9397cc8 Author: RobinLinus <robinlinus@users.noreply.github.com> Date: Fri Sep 21 20:25:54 2018 +0200 Cancel keep alive on join room commit e71564a97cc083b606f144db4de3e35e5e172bfb Author: RobinLinus <robinlinus@users.noreply.github.com> Date: Fri Sep 21 20:15:55 2018 +0200 Cancel keep alive on join room commit 0731a21d685c35e45985a39e3df32549730953db Author: RobinLinus <robinlinus@users.noreply.github.com> Date: Fri Sep 21 20:09:49 2018 +0200 Cancel keep alive on join room commit 61697d3abc5430ad58478b12a9b7fc36d8978881 Author: RobinLinus <robinlinus@users.noreply.github.com> Date: Fri Sep 21 20:01:59 2018 +0200 Cancel keep alive on join room commit b0fd89eb96f69279a01b64ce5db29c020838f87d Merge: 4cf2bed b67afca Author: RobinLinus <robinlinus@users.noreply.github.com> Date: Fri Sep 21 19:55:32 2018 +0200 Merge remote-tracking branch 'origin/master' into dev # Conflicts: # server/index.js commit 4cf2beda9075d75e1efc6dca3dc0e390612882fd Author: RobinLinus <robinlinus@users.noreply.github.com> Date: Fri Sep 21 19:49:16 2018 +0200 Fix beforeunload on iphone commit 728aabd449ed8f70231c643d756488fef7431aae Author: RobinLinus <robinlinus@users.noreply.github.com> Date: Fri Sep 21 19:32:59 2018 +0200 Fix typo in server commit 96e37aef40c7a69203b172655b290732dc236dc3 Author: RobinLinus <robinlinus@users.noreply.github.com> Date: Fri Sep 21 19:25:01 2018 +0200 Fix typo commit 31e5f635d19a69ebe719194aeb8465368e9f672d Author: RobinLinus <robinlinus@users.noreply.github.com> Date: Fri Sep 21 19:24:01 2018 +0200 Add connection state handler commit e573d5741979fa48fdbfebed4f3cedd7f82f9ea5 Author: RobinLinus <robinlinus@users.noreply.github.com> Date: Fri Sep 21 19:17:07 2018 +0200 STUN server tests commit 6a1de2926782ad0ca861b078c31ad3de2bc6e172 Merge: 6317c25 92a5f3b Author: RobinLinus <robinlinus@users.noreply.github.com> Date: Fri Sep 21 19:15:31 2018 +0200 Merge branch 'dev' of github.com:RobinLinus/snapdrop into dev # Conflicts: # client/scripts/network.js commit 6317c25b10f3d885c8ccc3374fb1e873e2c18f44 Author: RobinLinus <robinlinus@users.noreply.github.com> Date: Fri Sep 21 19:14:25 2018 +0200 Cleanup; fix STUN servers commit 92a5f3b782b4037beaf9b404683239cf71105586 Author: RobinLinus <robinlinus@users.noreply.github.com> Date: Fri Sep 21 19:14:25 2018 +0200 Cleanup; fix STUN servers commit e9eeea48e5ea76214971daa1a879b0ae2ba1a196 Author: RobinLinus <robinlinus@users.noreply.github.com> Date: Fri Sep 21 18:54:52 2018 +0200 Fix notifications on android commit 36ec13d4285b1d8633cc3bddd26df8fddbb8e59e Author: RobinLinus <robinlinus@users.noreply.github.com> Date: Fri Sep 21 18:53:31 2018 +0200 Fix uncaught error in server commit abf96c02282c5171793f5487880918f4719e8f15 Author: RobinLinus <robinlinus@users.noreply.github.com> Date: Fri Sep 21 16:36:59 2018 +0200 Test
2018-09-24 13:14:11 +02:00
* [免費資源網路社群](https://free.com.tw/snapdrop/)
2015-12-30 23:00:29 +01:00
2015-12-29 01:45:10 +01:00
##### What about the connection? Is it a P2P-connection directly from device to device or is there any third-party-server?
It uses a P2P connection if WebRTC is supported by the browser. WebRTC needs a Signaling Server, but it is only used to establish a connection and is not involved in the file transfer.
2015-12-18 16:50:36 +01:00
2015-12-29 01:45:10 +01:00
##### What about privacy? Will files be saved on third-party-servers?
2020-06-05 23:44:34 +02:00
None of your files are ever sent to any server. Files are sent only between peers. Snapdrop doesn't even use a database. If you are curious have a look [at the Server](https://github.com/RobinLinus/snapdrop/blob/master/server/). Even if Snapdrop was able to view the files being transfered, WebRTC encrypts the files on transit, so the server would be unable to read them.
##### What about security? Are my files encrypted while being sent between the computers?
Yes. Your files are sent using WebRTC, which encrypts them on transit.
2015-12-18 16:50:36 +01:00
2020-07-14 21:32:50 +02:00
##### Why don't you implement feature xyz?
Snapdrop is a study in radical simplicity. The user interface is insanely simple. Features are chosen very carefully because complexity grows quadratically since every feature potentially interfears with each other feature. We focus very narrowly on a single use case: instant file transfer.
We are not trying to optimize for some edge-cases. We are optimizing the userflow of the average users. Don't be sad if we decline your feature request for the sake of simplicity.
2015-12-18 16:50:36 +01:00
2015-12-29 01:42:01 +01:00
### Snapdrop is awesome! How can I support it?
2020-07-14 21:32:50 +02:00
* [Donate via PayPal to help cover the server costs](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=74D2NE84JHCWG&source=url)
2016-12-07 01:30:43 +01:00
* [File bugs, give feedback, submit suggestions](https://github.com/RobinLinus/snapdrop/issues)
2015-12-30 23:00:29 +01:00
* Share Snapdrop on your social media.
Squashed commit of the following: commit c04cdad7db20fcd66a8e191c99282d21aa1a4ca2 Author: RobinLinus <robinlinus@users.noreply.github.com> Date: Sat Sep 22 08:47:40 2018 +0200 Cleanup commit 891859680a1565cead8fe3dca771449b5e1e3035 Author: RobinLinus <robinlinus@users.noreply.github.com> Date: Sat Sep 22 05:55:09 2018 +0200 Refactor about page commit 04415ef28f8e7281c13546f168f2582a82bcb34f Author: RobinLinus <robinlinus@users.noreply.github.com> Date: Sat Sep 22 04:44:17 2018 +0200 Cleanup commit 52bd7692e951c5fafdcdb182a69646b78f03884d Author: RobinLinus <robinlinus@users.noreply.github.com> Date: Fri Sep 21 23:19:54 2018 +0200 Notifications Android & Desktop commit f537b9621350fd1ea6694e7a2a8d3eca1edbf012 Author: RobinLinus <robinlinus@users.noreply.github.com> Date: Fri Sep 21 22:32:39 2018 +0200 Notifications commit 476cb0ae6525177d7ea0519c9f0c4de67d2bf0f3 Author: RobinLinus <robinlinus@users.noreply.github.com> Date: Fri Sep 21 22:31:46 2018 +0200 Notifications commit 5a631d3833a63e76d3611dc97ec073e471af58ba Author: RobinLinus <robinlinus@users.noreply.github.com> Date: Fri Sep 21 21:21:44 2018 +0200 Notfication API on android commit 600d3551f4765d65a4348a33012b57ee370b3da3 Author: RobinLinus <robinlinus@users.noreply.github.com> Date: Fri Sep 21 21:12:11 2018 +0200 Add will-change commit 3ac40fb3d7467df6c0f66b0d156202cbfbf80f09 Author: RobinLinus <robinlinus@users.noreply.github.com> Date: Fri Sep 21 21:04:48 2018 +0200 Don’t reconnect if already connecting commit 9c9ca70d05fb2894d4e8113acc3a99a7b582ec78 Author: RobinLinus <robinlinus@users.noreply.github.com> Date: Fri Sep 21 20:55:15 2018 +0200 Reconnect on rejoin room commit 7194c65c74681883089d21c574275dfc01864d50 Author: RobinLinus <robinlinus@users.noreply.github.com> Date: Fri Sep 21 20:51:56 2018 +0200 Reconnect on rejoin room commit 0ede41f8d5397e8b7beb62ba6abe2571296f4690 Author: RobinLinus <robinlinus@users.noreply.github.com> Date: Fri Sep 21 20:34:49 2018 +0200 Cancel keep alive on join room commit 1d9581632fe3a99c2068d8c0cece9345c9397cc8 Author: RobinLinus <robinlinus@users.noreply.github.com> Date: Fri Sep 21 20:25:54 2018 +0200 Cancel keep alive on join room commit e71564a97cc083b606f144db4de3e35e5e172bfb Author: RobinLinus <robinlinus@users.noreply.github.com> Date: Fri Sep 21 20:15:55 2018 +0200 Cancel keep alive on join room commit 0731a21d685c35e45985a39e3df32549730953db Author: RobinLinus <robinlinus@users.noreply.github.com> Date: Fri Sep 21 20:09:49 2018 +0200 Cancel keep alive on join room commit 61697d3abc5430ad58478b12a9b7fc36d8978881 Author: RobinLinus <robinlinus@users.noreply.github.com> Date: Fri Sep 21 20:01:59 2018 +0200 Cancel keep alive on join room commit b0fd89eb96f69279a01b64ce5db29c020838f87d Merge: 4cf2bed b67afca Author: RobinLinus <robinlinus@users.noreply.github.com> Date: Fri Sep 21 19:55:32 2018 +0200 Merge remote-tracking branch 'origin/master' into dev # Conflicts: # server/index.js commit 4cf2beda9075d75e1efc6dca3dc0e390612882fd Author: RobinLinus <robinlinus@users.noreply.github.com> Date: Fri Sep 21 19:49:16 2018 +0200 Fix beforeunload on iphone commit 728aabd449ed8f70231c643d756488fef7431aae Author: RobinLinus <robinlinus@users.noreply.github.com> Date: Fri Sep 21 19:32:59 2018 +0200 Fix typo in server commit 96e37aef40c7a69203b172655b290732dc236dc3 Author: RobinLinus <robinlinus@users.noreply.github.com> Date: Fri Sep 21 19:25:01 2018 +0200 Fix typo commit 31e5f635d19a69ebe719194aeb8465368e9f672d Author: RobinLinus <robinlinus@users.noreply.github.com> Date: Fri Sep 21 19:24:01 2018 +0200 Add connection state handler commit e573d5741979fa48fdbfebed4f3cedd7f82f9ea5 Author: RobinLinus <robinlinus@users.noreply.github.com> Date: Fri Sep 21 19:17:07 2018 +0200 STUN server tests commit 6a1de2926782ad0ca861b078c31ad3de2bc6e172 Merge: 6317c25 92a5f3b Author: RobinLinus <robinlinus@users.noreply.github.com> Date: Fri Sep 21 19:15:31 2018 +0200 Merge branch 'dev' of github.com:RobinLinus/snapdrop into dev # Conflicts: # client/scripts/network.js commit 6317c25b10f3d885c8ccc3374fb1e873e2c18f44 Author: RobinLinus <robinlinus@users.noreply.github.com> Date: Fri Sep 21 19:14:25 2018 +0200 Cleanup; fix STUN servers commit 92a5f3b782b4037beaf9b404683239cf71105586 Author: RobinLinus <robinlinus@users.noreply.github.com> Date: Fri Sep 21 19:14:25 2018 +0200 Cleanup; fix STUN servers commit e9eeea48e5ea76214971daa1a879b0ae2ba1a196 Author: RobinLinus <robinlinus@users.noreply.github.com> Date: Fri Sep 21 18:54:52 2018 +0200 Fix notifications on android commit 36ec13d4285b1d8633cc3bddd26df8fddbb8e59e Author: RobinLinus <robinlinus@users.noreply.github.com> Date: Fri Sep 21 18:53:31 2018 +0200 Fix uncaught error in server commit abf96c02282c5171793f5487880918f4719e8f15 Author: RobinLinus <robinlinus@users.noreply.github.com> Date: Fri Sep 21 16:36:59 2018 +0200 Test
2018-09-24 13:14:11 +02:00
* Fix bugs and make a pull request.
* Do security analysis and suggestions
2015-12-18 16:50:36 +01:00
2018-09-21 16:12:21 +02:00
## Local Development
2019-06-13 16:47:25 +02:00
[Install docker with docker-compose.](https://docs.docker.com/compose/install/)
2020-03-24 15:11:08 +01:00
Clone the repository:
2018-09-21 16:12:21 +02:00
```
2020-04-13 14:50:25 +02:00
git clone https://github.com/RobinLinus/snapdrop.git
2019-06-13 16:47:25 +02:00
cd snapdrop
2020-03-24 15:11:08 +01:00
docker-compose up -d
2018-09-21 16:12:21 +02:00
```
2020-03-24 15:11:08 +01:00
To restart the containers run `docker-compose restart`.
To stop the containers run `docker-compose stop`.
Now point your browser to `http://localhost:8080`.
### Testing PWA related features
PWAs require that the app is served under a correctly set up and trusted TLS endpoint.
2020-07-14 22:14:55 +02:00
The nginx container creates a CA certificate and a website certificate for you. To correctly set the common name of the certificate, you need to change the FQDN environment variable in `docker/fqdn.env` to the fully qualified domain name of your workstation.
2020-03-24 15:11:08 +01:00
If you want to test PWA features, you need to trust the CA of the certificate for your local deployment. For your convenience, you can download the crt file from `http://<Your FQDN>:8080/ca.crt`. Install that certificate to the trust store of your operating system.
- On Windows, make sure to install it to the `Trusted Root Certification Authorities` store.
- On MacOS, double click the installed CA certificate in `Keychain Access`, expand `Trust`, and select `Always Trust` for SSL.
- Firefox uses its own trust store. To install the CA, point Firefox at `http://<Your FQDN>:8080/ca.crt`. When prompted, select `Trust this CA to identify websites` and click OK.
- When using Chrome, you need to restart Chrome so it reloads the trust store (`chrome://restart`). Additionally, after installing a new cert, you need to clear the Storage (DevTools -> Application -> Clear storagae -> Clear site data).
2020-03-24 15:11:08 +01:00
Please note that the certificates (CA and webserver cert) expire after a day.
Also, whenever you restart the nginx docker, container new certificates are created.
2020-03-24 15:15:52 +01:00
The site is served on `https://<Your FQDN>:443`.
2018-09-21 16:12:21 +02:00
   
## Deployment Notes
The client expects the server at http(s)://your.domain/server.
When serving the node server behind a proxy, the `X-Forwarded-For` header has to be set by the proxy. Otherwise, all clients that are served by the proxy will be mutually visible.
By default, the server listens on port 3000.
2016-01-02 14:19:11 +01:00
2020-07-14 22:14:55 +02:00
For an nginx configuration example, see `docker/nginx/default.conf`.
2020-01-31 09:31:00 +01:00
## Desktop App
Note: if you are using Google Chrome, you can easily install Snapdrop PWA on your desktop by clicking the install button in the top-right corner.
2020-01-31 09:31:00 +01:00
2020-07-14 22:14:55 +02:00
If you are not using Chrome or Edge, you can install the [Snapdrop Desktop App](https://github.com/infin1tyy/snapdrop-desktop) built on top of Electrum. (Thanks to Infin1tyy!).
2020-01-31 09:31:00 +01:00