Files
Meets-Relay/README.md
T

58 lines
4.4 KiB
Markdown

# Meets Relay
Self-hostable relay for pairing and synchronization between the Meets Mac backend and its paired iPhone app. Recording content and RPC payloads are end-to-end encrypted by the clients before transfer. The relay stores encrypted chunks and the metadata required to route them.
## Requirements and network setup
- Docker Engine with Docker Compose v2.
- A public HTTPS hostname configured by you in a reverse proxy.
- A TURN service you operate separately if your network requires TURN.
DNS, TLS certificates, reverse proxy, firewall rules, and TURN are deliberately outside this project. The container listens on loopback by default. Do not expose its HTTP port directly to the internet.
## First start
1. Create a private deployment directory and copy `.env.example` to `.env`.
2. Set `TURN_HOST`, `TURN_PORT`, `TURN_SHARED_SECRET`, and `RELAY_SETUP_CODE_FILE` in `.env`. The TURN secret must match the separately operated TURN service.
3. Create the one-time administrator setup code outside the repository:
```sh
mkdir -p secrets
openssl rand -base64 32 > secrets/relay-setup-code
chmod 600 secrets/relay-setup-code
```
Set `RELAY_SETUP_CODE_FILE=./secrets/relay-setup-code`. Keep this file private and back it up securely until the first administrator account is created. The Docker daemon must be able to read it.
4. Start the service with `docker compose up -d`.
5. In the Meets app, enter your own HTTPS relay URL. Create the first administrator account using the setup code. The setup code is one-use; after account creation, setup is permanently disabled.
The administrator can create time-limited, one-use invitations for other people and revoke member accounts. There is no open registration. Accounts control who can create and claim pairings on this relay. Each pairing remains cryptographically isolated by its own random pairing secret.
## Compose deployment
The supplied Compose file uses a read-only root filesystem, an unprivileged container user, no Linux capabilities, a process limit, a memory limit, and a private named volume. Only the relay data volume and a small temporary filesystem are writable. Edit resource limits to suit your host, while retaining the other restrictions.
The default relay quotas are 10 GiB total and 1 GiB per pairing. Completed transfers expire after seven days; incomplete transfers expire after one day. Pairings expire after 30 days without a heartbeat. The named volume contains account and pairing state plus encrypted transfer data. Back it up securely if you need to preserve pairings across host replacement.
Set your reverse proxy to forward your HTTPS hostname to `127.0.0.1:8080`. Configure that same HTTPS base URL in the Mac app before creating new pairings. Existing pairings keep the relay address embedded when they were created.
## Security and privacy
- Transfer chunks are end-to-end encrypted. The relay cannot decrypt recordings, transcripts, notes, or RPC content. It can observe traffic metadata such as pairing identifiers, sizes, chunk counts, and timestamps.
- Self-hosted deployments do not enable or configure push notifications and do not accept or persist APNs device registrations.
- The relay does not contain a TURN server. Configure the hostname, port, and shared secret of a separately operated TURN service. Depending on the network, direct or STUN-only connectivity may work without TURN.
- The relay HTTP API must be protected by HTTPS at your reverse proxy. Keep the container port bound to loopback. Disable proxy caching for API routes.
- Account passwords are stored as scrypt hashes with individual salts. Refresh tokens are stored hashed. Setup, login, invitations, and other sensitive operations are rate limited.
- The administrator setup code is read from a Docker secret, not an environment value. Do not put it in source control or logs.
- Docker host access is equivalent to host administrator access. Restrict membership in the Docker administration group.
## Operations
`GET /health` provides a health check. The service does not log request bodies, authorization headers, setup codes, pairing secrets, or recording content.
Run `docker compose up -d`; update with `docker compose pull && docker compose up -d`. Pin a version tag or image digest for reproducible deployments. To build and publish a multi-architecture image, use `scripts/publish-image.sh <version-tag>` after configuring access to the image registry and Docker Buildx.
## License
MIT. See [LICENSE](LICENSE).