DroppX Remote relay on your own server

The relay is where your devices meet. It only passes data along: everything between your devices is
end-to-end encrypted, and every device checks for itself which devices are yours.

INSTALL (Debian or Ubuntu)
  tar xzf droppx-remote-relay.tar.gz
  sudo ./droppx-remote-relay/install-relay.sh
It installs Node.js if needed, runs the relay as the service droppx-relay on TCP port 21140, opens that port
in ufw if ufw is on, and shows a one-time setup code (valid 1 hour).

On your first device, in DroppX Remote: "My own server", then
  address  ws://<your server's public address>:21140
  code     the setup code
Your other devices join with a code from that device (Devices -> Show a code); the code includes the server.
Lost the setup code? sudo ./droppx-remote-relay/install-relay.sh setup

HTTPS WITH A DOMAIN (optional, recommended)
Your devices' data is already end-to-end encrypted; HTTPS also hides which devices connect when. With a
domain pointing at the server, put Caddy in front (it gets the certificate by itself):
  sudo apt install caddy
  /etc/caddy/Caddyfile:
      remote.example.com {
          reverse_proxy 127.0.0.1:21140
      }
  sudo systemctl reload caddy
Then use the address https://remote.example.com, and stop the direct port: sudo ufw delete allow 21140/tcp
and set REMOTE_HOST=127.0.0.1 in /etc/systemd/system/droppx-relay.service (then systemctl daemon-reload and
systemctl restart droppx-relay).

OTHER
  status:   systemctl status droppx-relay
  devices:  sudo -u droppx-relay env REMOTE_STATE=/var/lib/droppx-relay node /opt/droppx-relay/relay.js devices
  remove:   sudo systemctl disable --now droppx-relay && sudo rm -rf /opt/droppx-relay /var/lib/droppx-relay /etc/systemd/system/droppx-relay.service
