From 3439e7f6d4b345c117f762aaf158e51a169726f8 Mon Sep 17 00:00:00 2001 From: schlagmichdoch Date: Wed, 8 Nov 2023 20:31:57 +0100 Subject: [PATCH] Decrease redundancy by changing the way the websocket fallback is included; Adding new env var SIGNALING_SERVER to host client files but use another server for signaling. --- docs/host-your-own.md | 25 + public/index.html | 5 + public/lang/en.json | 3 +- public/scripts/network.js | 231 +- public/scripts/ui.js | 80 +- public/scripts/util.js | 45 + public/styles.css | 36 +- .../android-chrome-192x192-maskable.png | Bin 8512 -> 0 bytes .../images/android-chrome-192x192.png | Bin 16490 -> 0 bytes .../android-chrome-512x512-maskable.png | Bin 31075 -> 0 bytes .../images/android-chrome-512x512.png | Bin 53321 -> 0 bytes .../images/apple-touch-icon.png | Bin 13729 -> 0 bytes .../images/favicon-96x96-notification.png | Bin 7181 -> 0 bytes .../images/favicon-96x96.png | Bin 7137 -> 0 bytes .../images/logo_blue_512x512.png | Bin 33906 -> 0 bytes .../images/logo_transparent_128x128.png | Bin 10568 -> 0 bytes .../images/logo_transparent_512x512.png | Bin 53321 -> 0 bytes .../images/logo_transparent_white_512x512.png | Bin 26049 -> 0 bytes .../images/logo_white_512x512.png | Bin 31289 -> 0 bytes .../images/mstile-150x150.png | Bin 3577 -> 0 bytes .../images/pairdrop_screenshot_mobile_1.png | Bin 237780 -> 0 bytes .../images/pairdrop_screenshot_mobile_2.png | Bin 237110 -> 0 bytes .../images/pairdrop_screenshot_mobile_3.png | Bin 1087772 -> 0 bytes .../images/pairdrop_screenshot_mobile_4.png | Bin 237059 -> 0 bytes .../images/pairdrop_screenshot_mobile_5.png | Bin 1832450 -> 0 bytes .../images/pairdrop_screenshot_mobile_6.png | Bin 184729 -> 0 bytes .../images/pairdrop_screenshot_mobile_7.png | Bin 206125 -> 0 bytes .../images/safari-pinned-tab.svg | 251 -- .../images/snapdrop-graphics.sketch | Bin 930794 -> 0 bytes public_included_ws_fallback/index.html | 613 ---- public_included_ws_fallback/lang/ar.json | 159 - public_included_ws_fallback/lang/de.json | 167 - public_included_ws_fallback/lang/en.json | 165 - public_included_ws_fallback/lang/es.json | 165 - public_included_ws_fallback/lang/fr.json | 160 - public_included_ws_fallback/lang/id.json | 165 - public_included_ws_fallback/lang/it.json | 165 - public_included_ws_fallback/lang/ja.json | 165 - public_included_ws_fallback/lang/nb.json | 138 - public_included_ws_fallback/lang/nl.json | 159 - public_included_ws_fallback/lang/ro.json | 165 - public_included_ws_fallback/lang/ru.json | 167 - public_included_ws_fallback/lang/tr.json | 25 - public_included_ws_fallback/lang/zh-CN.json | 166 - public_included_ws_fallback/manifest.json | 281 -- public_included_ws_fallback/robots.txt | 2 - .../scripts/NoSleep.min.js | 2 - .../scripts/QRCode.min.js | 2 - .../scripts/localization.js | 176 - .../scripts/network.js | 1299 -------- public_included_ws_fallback/scripts/theme.js | 83 - public_included_ws_fallback/scripts/ui.js | 2920 ----------------- public_included_ws_fallback/scripts/util.js | 438 --- .../scripts/zip.min.js | 1 - public_included_ws_fallback/service-worker.js | 175 - public_included_ws_fallback/sounds/blop.mp3 | Bin 1992 -> 0 bytes public_included_ws_fallback/sounds/blop.ogg | Bin 5802 -> 0 bytes public_included_ws_fallback/styles.css | 1619 --------- server/index.js | 56 +- server/peer.js | 9 +- server/server.js | 29 +- server/ws-server.js | 28 +- 62 files changed, 439 insertions(+), 10101 deletions(-) delete mode 100644 public_included_ws_fallback/images/android-chrome-192x192-maskable.png delete mode 100644 public_included_ws_fallback/images/android-chrome-192x192.png delete mode 100644 public_included_ws_fallback/images/android-chrome-512x512-maskable.png delete mode 100644 public_included_ws_fallback/images/android-chrome-512x512.png delete mode 100644 public_included_ws_fallback/images/apple-touch-icon.png delete mode 100644 public_included_ws_fallback/images/favicon-96x96-notification.png delete mode 100644 public_included_ws_fallback/images/favicon-96x96.png delete mode 100644 public_included_ws_fallback/images/logo_blue_512x512.png delete mode 100644 public_included_ws_fallback/images/logo_transparent_128x128.png delete mode 100644 public_included_ws_fallback/images/logo_transparent_512x512.png delete mode 100644 public_included_ws_fallback/images/logo_transparent_white_512x512.png delete mode 100644 public_included_ws_fallback/images/logo_white_512x512.png delete mode 100644 public_included_ws_fallback/images/mstile-150x150.png delete mode 100644 public_included_ws_fallback/images/pairdrop_screenshot_mobile_1.png delete mode 100644 public_included_ws_fallback/images/pairdrop_screenshot_mobile_2.png delete mode 100644 public_included_ws_fallback/images/pairdrop_screenshot_mobile_3.png delete mode 100644 public_included_ws_fallback/images/pairdrop_screenshot_mobile_4.png delete mode 100644 public_included_ws_fallback/images/pairdrop_screenshot_mobile_5.png delete mode 100644 public_included_ws_fallback/images/pairdrop_screenshot_mobile_6.png delete mode 100644 public_included_ws_fallback/images/pairdrop_screenshot_mobile_7.png delete mode 100644 public_included_ws_fallback/images/safari-pinned-tab.svg delete mode 100644 public_included_ws_fallback/images/snapdrop-graphics.sketch delete mode 100644 public_included_ws_fallback/index.html delete mode 100644 public_included_ws_fallback/lang/ar.json delete mode 100644 public_included_ws_fallback/lang/de.json delete mode 100644 public_included_ws_fallback/lang/en.json delete mode 100644 public_included_ws_fallback/lang/es.json delete mode 100644 public_included_ws_fallback/lang/fr.json delete mode 100644 public_included_ws_fallback/lang/id.json delete mode 100644 public_included_ws_fallback/lang/it.json delete mode 100644 public_included_ws_fallback/lang/ja.json delete mode 100644 public_included_ws_fallback/lang/nb.json delete mode 100644 public_included_ws_fallback/lang/nl.json delete mode 100644 public_included_ws_fallback/lang/ro.json delete mode 100644 public_included_ws_fallback/lang/ru.json delete mode 100644 public_included_ws_fallback/lang/tr.json delete mode 100644 public_included_ws_fallback/lang/zh-CN.json delete mode 100644 public_included_ws_fallback/manifest.json delete mode 100644 public_included_ws_fallback/robots.txt delete mode 100644 public_included_ws_fallback/scripts/NoSleep.min.js delete mode 100644 public_included_ws_fallback/scripts/QRCode.min.js delete mode 100644 public_included_ws_fallback/scripts/localization.js delete mode 100644 public_included_ws_fallback/scripts/network.js delete mode 100644 public_included_ws_fallback/scripts/theme.js delete mode 100644 public_included_ws_fallback/scripts/ui.js delete mode 100644 public_included_ws_fallback/scripts/util.js delete mode 100644 public_included_ws_fallback/scripts/zip.min.js delete mode 100644 public_included_ws_fallback/service-worker.js delete mode 100644 public_included_ws_fallback/sounds/blop.mp3 delete mode 100644 public_included_ws_fallback/sounds/blop.ogg delete mode 100644 public_included_ws_fallback/styles.css diff --git a/docs/host-your-own.md b/docs/host-your-own.md index ffa03c1..32385a2 100644 --- a/docs/host-your-own.md +++ b/docs/host-your-own.md @@ -107,6 +107,7 @@ docker run -d \ -p 127.0.0.1:3000:3000 \ -e PUID=1000 \ -e PGID=1000 \ + -e WS_SERVER=false \ -e WS_FALLBACK=false \ -e RTC_CONFIG=false \ -e RATE_LIMIT=false \ @@ -396,6 +397,30 @@ RTC_CONFIG="rtc_config.json"
+You can host an instance that uses another signaling server +This can be useful if you don't want to trust the client files that are hosted on another instance but still want to connect to devices that use https://pairdrop.net. +### Host Websocket Server (for VPN) + +```bash +SIGNALING_SERVER="pairdrop.net" +``` + +> Default: `false` +> +> By default, clients connecting to your instance use the signaling server of your instance to connect to other devices. +> +> By using `SIGNALING_SERVER`, you can host an instance that uses another signaling server. +> +> This can be useful if you want to ensure the integrity of the client files and don't want to trust the client files that are hosted on another PairDrop instance but still want to connect to devices that use the other instance. +> E.g. host your own client files under *pairdrop.your-domain.com* but use the official signaling server under *pairdrop.net* +> This way devices connecting to *pairdrop.your-domain.com* and *pairdrop.net* can discover each other. +> +> Beware that the version of your PairDrop server is compatible with the version of the signaling server. +> +> `WS_SERVER` must be a valid url without the protocol prefix. +> Examples of valid values: `pairdrop.net`, `pairdrop.your-domain.com:3000`, `your-domain.com/pairdrop` +
+ ## Healthcheck > The Docker Image hosted on `ghcr.io` and the self-built Docker Image include a healthcheck. diff --git a/public/index.html b/public/index.html index 20c7862..671c4c9 100644 --- a/public/index.html +++ b/public/index.html @@ -108,6 +108,11 @@

+