diff --git a/README.md b/README.md index b1c279c..bdb7895 100644 --- a/README.md +++ b/README.md @@ -1,9 +1,31 @@ -# Snapdrop +# Pairdrop -[Snapdrop](https://snapdrop.net): local file sharing in your browser. Inspired by Apple's Airdrop. +[Pairdrop](https://pairdrop.net): local file sharing in your browser. Inspired by Apple's Airdrop. + +Developed based on [Snapdrop](https://github.com/RobinLinus/snapdrop) + +## Differences to Snapdrop + +### Device Pairing +* Pair devices via 6-digit code or QR-Code +* Pair devices outside your local network or in complex network environment (public wifi, company network, Apple Private Relay, VPN etc.). +* Paired devices will always find each other via shared secrets even after reopening the browser or the Progressive Web App +* You will always discover devices on your local network. Paired devices are shown additionally. +* Paired devices outside your local network that are behind a NAT are connected automatically via [Open Relay: Free WebRTC TURN Server](https://www.metered.ca/tools/openrelay/) -#### Snapdrop is built with the following awesome technologies: +### Other changes +* node-only implementation (thanks [@Bellisario](https://github.com/Bellisario)) +* automatic restart on error (thanks [@KaKi87](https://github.com/KaKi87)) +* lots of stability fixes (thanks [@MWY001](https://github.com/MWY001) [@skiby7](https://github.com/skiby7) [@willstott101](https://github.com/willstott101)) +* [Paste Mode](https://github.com/RobinLinus/snapdrop/pull/534) +* [Video and Audio preview](https://github.com/RobinLinus/snapdrop/pull/455) (thanks [@victorwads](https://github.com/victorwads)) + +## Screenshot +![test](/docs/pairdrop_screenshot_desktop.png) + + +## Snapdrop and Pairdrop are built with the following awesome technologies: * Vanilla HTML5 / ES6 / CSS3 frontend * [WebRTC](http://webrtc.org/) / [WebSockets](http://www.websocket.org/) * [NodeJS](https://nodejs.org/en/) backend @@ -15,18 +37,13 @@ Have any questions? Read our [FAQ](/docs/faq.md). You can [host your own instance with Docker](/docs/host-your-own.md). -## Support the Snapdrop Community -Snapdrop is free. Still, we have to pay for the server. If you want to contribute, please use PayPal: +## Support the Community +Pairdrop is free and always will be! -[](https://www.paypal.com/donate/?hosted_button_id=MG8GV7YCYT352) +If you want to support me and my work you can [buy me a coffee](https://www.buymeacoffee.com/pairdrop) ☕ -or Bitcoin: +
-[CoinThx](https://coins.github.io/thx/#1K9zQ8f4iTyhKyHWmiDKt21cYX2QSDckWB?label=Snapdrop&message=Thanks!%20Your%20contribution%20helps%20to%20keep%20Snapdrop%20free%20for%20everybody!) - -Alternatively, you can become a [Github Sponsor](https://github.com/sponsors/RobinLinus). +To support the original Snapdrop and its creator go to [his GitHub page](https://github.com/RobinLinus/snapdrop). Thanks a lot for supporting free and open software! - - - diff --git a/docker/openssl/snapdropCert.cnf b/docker/openssl/snapdropCert.cnf index a98b70d..876d873 100644 --- a/docker/openssl/snapdropCert.cnf +++ b/docker/openssl/snapdropCert.cnf @@ -9,7 +9,7 @@ string_mask = utf8only prompt = no [ subject ] -organizationName = Snapdrop +organizationName = Pairdrop OU = Development # Use a friendly name here because it's presented to the user. The server's DNS @@ -26,4 +26,4 @@ basicConstraints = CA:FALSE keyUsage = digitalSignature, keyEncipherment subjectAltName = DNS:${ENV::FQDN} nsComment = "OpenSSL Generated Certificate" -extendedKeyUsage = serverAuth \ No newline at end of file +extendedKeyUsage = serverAuth diff --git a/docs/faq.md b/docs/faq.md index 7557779..29c9fbd 100644 --- a/docs/faq.md +++ b/docs/faq.md @@ -11,65 +11,36 @@ * [Producthunt](https://www.producthunt.com/posts/snapdrop) ### Help! I can't install the PWA! -if you are using a Chromium-based browser (Chrome, Edge, Brave, etc.), you can easily install Snapdrop PWA on your desktop by clicking the install button in the top-right corner while on [snapdrop.net](https://snapdrop.net) (see below). +if you are using a Chromium-based browser (Chrome, Edge, Brave, etc.), you can easily install Pairdrop PWA on your desktop by clicking the install button in the top-right corner while on [pairdrop.net](https://pairdrop.net) (see below). ### 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. +If your devices are paired and behind a NAT, the public TURN Server from [Open Relay](https://www.metered.ca/tools/openrelay/) is used to route your files and messages. + ### What about privacy? Will files be saved on third-party-servers? -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. +None of your files are ever sent to any server. Files are sent only between peers. Pairdrop doesn't even use a database. If you are curious have a look [at the Server](https://github.com/schlagmichdoch/pairdrop/blob/master/server/). +WebRTC encrypts the files on transit. + +If your devices are paired and behind a NAT, the public TURN Server from [Open Relay](https://www.metered.ca/tools/openrelay/) is used to route your files and messages. ### 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. ### 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 interferes with each other feature. We focus very narrowly on a single use case: instant file transfer. +Snapdrop and Pairdrop are a study in radical simplicity. The user interface is insanely simple. Features are chosen very carefully because complexity grows quadratically since every feature potentially interferes 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 user flow of the average users. Don't be sad if we decline your feature request for the sake of simplicity. If you want to learn more about simplicity you can read [Insanely Simple: The Obsession that Drives Apple's Success](https://www.amazon.com/Insanely-Simple-Ken-Segall-audiobook/dp/B007Z9686O) or [Thinking, Fast and Slow](https://www.amazon.com/Thinking-Fast-Slow-Daniel-Kahneman/dp/0374533555). -### Snapdrop is awesome! How can I support it? -* [Donate via PayPal to help cover the server costs](https://www.paypal.com/donate/?hosted_button_id=FTP9DXUR7LA7Q) -* [File bugs, give feedback, submit suggestions](https://github.com/RobinLinus/snapdrop/issues) -* Share Snapdrop on your social media. +### Snapdrop and Pairdrop are awesome! How can I support them? +* [Buy me a cover to support open source software](https://www.buymeacoffee.com/pairdrop) +* [File bugs, give feedback, submit suggestions](https://github.com/schlagmichdoch/pairdrop/issues) +* Share Pairdrop on social media. * Fix bugs and make a pull request. * Do security analysis and suggestions -## "Inofficial" Instances -Here's a list of other people hosting inofficial instances of Snapdrop: - -- https://snapdrop.k26.ch/ -- https://snapdrop.9pfs.repl.co/ -- https://filedrop.codext.de/ -- https://s.hoothin.com/ -- https://www.wulingate.com/ -- https://snapdrop.fairysoft.net/ -- https://airtransferer.web.app/ -- https://drop.wuyuan.dev - -DISCLAIMER: WE ARE NOT IN ANY WAY AFFILIATED WITH THE PEOPLE WHO RUN THESE INSTANCES. WE DO NOT KNOW THEM. WE CANNOT VERIFY THE CODE THEY ARE RUNNING! - - -## Third-Party Apps -Here's a list of some third-party Snapdrop apps: - -1. [Snapdrop Desktop App](https://github.com/alextwothousand/snapdrop-desktop) built on top of Electron. (Thanks to [alextwothousand!](https://github.com/alextwothousand/)). - -1. [Snapdrop Android App](https://github.com/fm-sys/snapdrop-android) allows you to also send files directly from other apps via the share action. - -1. [Snapdrop Flutter App](https://github.com/congnguyendinh0/snapdrop_flutter) - -1. [Snapdrop iOS App](https://github.com/CDsigma/Snapdrop-iOS-App) - -1. [Snapdrop Node App (with completely Node server)](https://github.com/Bellisario/node-snapdrop) - -1. [SnapDrop VSCode Extension](https://github.com/Yash-Garg/snapdrop-vsc) - -1. Feel free to make one :) - - - [< Back](/README.md) diff --git a/docs/host-your-own.md b/docs/host-your-own.md index a8d5232..1632da3 100644 --- a/docs/host-your-own.md +++ b/docs/host-your-own.md @@ -5,10 +5,10 @@ First, [Install docker with docker-compose.](https://docs.docker.com/compose/ins Then, clone the repository and run docker-compose: ```shell - git clone https://github.com/RobinLinus/snapdrop.git + git clone https://github.com/schlagmichdoch/pairdrop.git ``` ```shell - cd snapdrop + cd pairdrop ``` ```shell docker-compose up -d @@ -17,21 +17,9 @@ Now point your browser to `http://localhost:8080`. - To restart the containers run `docker-compose restart`. - To stop the containers run `docker-compose stop`. -- To debug the NodeJS server run `docker logs snapdrop_node_1`. +- To debug the NodeJS server run `docker logs pairdrop_node_1`. -## Run locally by pulling image from Docker Hub - -Have docker installed, then use the command: -```shell - docker pull linuxserver/snapdrop -``` - -To run the image, type (if port 8080 is occupied by host use another random port :80): -```shell - docker run -d -p 8080:80 linuxserver/snapdrop -``` -
## Testing PWA related features @@ -69,7 +57,7 @@ server { expires epoch; location / { - root /var/www/snapdrop/client; + root /var/www/pairdrop/client; index index.html index.htm; } @@ -84,13 +72,13 @@ server { server { listen 443 ssl http2; - ssl_certificate /etc/ssl/certs/snapdrop-dev.crt; - ssl_certificate_key /etc/ssl/certs/snapdrop-dev.key; + ssl_certificate /etc/ssl/certs/pairdrop-dev.crt; + ssl_certificate_key /etc/ssl/certs/pairdrop-dev.key; expires epoch; location / { - root /var/www/snapdrop/client; + root /var/www/pairdrop/client; index index.html; } @@ -107,7 +95,7 @@ server { ### Using Apache ``` - DocumentRoot "/var/www/snapdrop/client" + DocumentRoot "/var/www/pairdrop/client" DirectoryIndex index.html RewriteEngine on @@ -116,7 +104,7 @@ server { RewriteRule ^/?(.*) "ws://127.0.0.1:3000/$1" [P,L] - DocumentRoot "/var/www/snapdrop/client" + DocumentRoot "/var/www/pairdrop/client" DirectoryIndex index.html RewriteEngine on @@ -127,11 +115,11 @@ server { ``` ## Deployment with Docker -The easiest way to get snapdrop up and running is by using Docker. +The easiest way to get Pairdrop up and running is by using Docker. By default, docker listens on ports 8080 (http) and 8443 (https) (specified in `docker-compose.yml`). -When running Snapdrop via Docker, the `X-Forwarded-For` header has to be set by a proxy. Otherwise, all clients will be mutually visible. +When running Pairdrop via Docker, the `X-Forwarded-For` header has to be set by a proxy. Otherwise, all clients will be mutually visible. ### Installation [See Local Development > Install](#install) @@ -162,8 +150,8 @@ server { server { listen 443 ssl http2; - ssl_certificate /etc/ssl/certs/snapdrop-dev.crt; - ssl_certificate_key /etc/ssl/certs/snapdrop-dev.key; + ssl_certificate /etc/ssl/certs/pairdrop-dev.crt; + ssl_certificate_key /etc/ssl/certs/pairdrop-dev.key; expires epoch; @@ -198,7 +186,7 @@ a2enmod proxy_wstunnel Create a new configuration file under `/etc/apache2/sites-available` (on debian) -**snapdrop.conf** +**pairdrop.conf** ``` ProxyPass / http://127.0.0.1:8080/ @@ -217,7 +205,7 @@ Create a new configuration file under `/etc/apache2/sites-available` (on debian) ``` Activate the new virtual host and reload apache: ```shell -a2ensite snapdrop +a2ensite pairdrop ``` ```shell service apache2 reload diff --git a/docs/pairdrop_screenshot_desktop.png b/docs/pairdrop_screenshot_desktop.png new file mode 100644 index 0000000..626153a Binary files /dev/null and b/docs/pairdrop_screenshot_desktop.png differ diff --git a/index.js b/index.js index df486c4..2f96761 100644 --- a/index.js +++ b/index.js @@ -81,7 +81,7 @@ server.listen(port); const parser = require('ua-parser-js'); const { uniqueNamesGenerator, animals, colors } = require('unique-names-generator'); -class SnapdropServer { +class PairdropServer { constructor() { const WebSocket = require('ws'); @@ -91,7 +91,7 @@ class SnapdropServer { this._rooms = {}; this._roomSecrets = {}; - console.log('Snapdrop is running on port', port); + console.log('Pairdrop is running on port', port); } _onConnection(peer) { @@ -588,4 +588,4 @@ Object.defineProperty(String.prototype, 'hashCode', { } }); -new SnapdropServer(); +new PairdropServer(); diff --git a/package-lock.json b/package-lock.json index ebfec64..1272554 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,11 +1,11 @@ { - "name": "snapdrop", + "name": "pairdrop", "version": "1.0.0", "lockfileVersion": 2, "requires": true, "packages": { "": { - "name": "snapdrop", + "name": "pairdrop", "version": "1.0.0", "license": "ISC", "dependencies": { diff --git a/package.json b/package.json index ae1f04b..3d4d12f 100644 --- a/package.json +++ b/package.json @@ -1,5 +1,5 @@ { - "name": "snapdrop", + "name": "pairdrop", "version": "1.0.0", "description": "", "main": "index.js", diff --git a/public/index.html b/public/index.html index 9110d0c..c0b136f 100644 --- a/public/index.html +++ b/public/index.html @@ -5,22 +5,22 @@ - Snapdrop + Pairdrop - - + + - + - - - + + + @@ -30,8 +30,8 @@ - - + + @@ -39,7 +39,7 @@
- + @@ -54,7 +54,7 @@ -
+ @@ -204,12 +204,12 @@ - + - + @@ -286,7 +286,7 @@