README.md

ziran-relay — sm service #

The hosted relay for Ziran live sessions (wss://relay.ziran.space/ws), run behind the supramundane Caddy front.

Deploy:

deno task build:relay   # cross-compiles the relay → deploy/relay/relay-linux-x64
cd deploy/relay
sm deploy               # or: sm deploy --local (serves relay.ziran.bast)

Notes:

  • No secrets. Production auth is atproto service-auth: the relay verifies each caller's ~60s JWT against their public DID document. Dev HMAC tokens are disabled via ZIRAN_RELAY_DEV_AUTH=off (set in the Dockerfile). If an override is ever needed, put it in an uncommitted .env here — compose loads it when present.
  • The binary is a build artifact (gitignored); rebuild it before every deploy so the image matches the repo.
  • State lives in the shared sm data root (…/data/ziran-relay), so the standard backups cover it. The host dir is root-owned; the container's entrypoint chowns it and then drops to the unprivileged ziran user (running as that user directly would die on mkdir /data/docs).
  • https://relay.ziran.space/.well-known/did.json is served by the relay itself, making did:web:relay.ziran.space resolvable.