Skip to content

Deployment

Compose stack

Run the scripts from src/relay.

Script Purpose
deploy/scripts/build.sh Build relay-go and relay-hyper
deploy/scripts/up.sh Build, generate secrets and keys, and start everything
deploy/scripts/smoke.sh End-to-end checks against the running stack
deploy/scripts/test.sh Unit and integration tests of both code bases
deploy/scripts/rn.sh, deploy/scripts/hn.sh Command-line clients
deploy/scripts/compose.sh Run Compose with the environment loaded
deploy/scripts/logs.sh Follow logs
deploy/scripts/down.sh Stop. Keeps data
deploy/scripts/purge.sh --yes Delete keys, logs and databases

Secrets and keys are created in deploy/.state with owner-only permissions.

Services

Service Local port Role
personal Personal relay of the author
relay-0, relay-1 7440, 7441 Public relays
registry-0, registry-1 Registry providers
archive-0, archive-1 Archivers
assets-0, assets-1 Asset stores
search 7450 Federated search
hyper-0 to hyper-2 Sidecars of the replicated log
hrelay-0 to hrelay-2 7460 to 7462 Replicated relays
l1-0, l1-1 7470, 7471 Gossip nodes
agg-0 to agg-2 7480 to 7482 Aggregators
ui 7490 Verified search page
dht DHT bootstrap node

Ports are bound to the loopback interface. The variables RELAY0_PORT, SEARCH_PORT, UI_PORT and so on change them, and SUBNET, IP_RANGE and DHT_IP change the network.

Containers

All services run as an unprivileged user with a read-only root file system, no capabilities and no-new-privileges. Only /data is writable.

Production notes

  • Terminate TLS in front of relays and APIs, and set RELAY_URL to the public wss:// address.
  • Back up the key files. A relay, provider or node with a new key is a new identity.
  • Keep ADMIN_SEED on one node only, and back it up offline. It is needed to add or revoke nodes.
  • Leave ALLOW_PRIVATE unset where a service follows addresses that others supply.