fix(compose): wire buzz-pair-relay so mobile QR pairing works
Summary
- Stand up the
buzz-pair-relaysidecar indeploy/compose(usingentrypoint, notcommand, so Compose does not append args tobuzz-relay). - Advertise
BUZZ_PAIRING_RELAY_URLin NIP-11 and proxy/pair*through Caddy so membership-enforcing self-hosts stop 404ing on legacy/pair. - Document TLS vs direct-port URL shapes in
.env.example, README, andrun.sh help.
Fixes #3842
Test plan
- [ ]
cd deploy/compose && cp .env.example .env(fill CHANGE_ME) and./run.sh configsucceeds withBUZZ_PAIRING_RELAY_URLset - [ ]
BUZZ_COMPOSE_TLS=true ./run.sh startbrings uppairing-relayhealthy; Caddy/pairreaches it - [ ] Desktop/mobile QR pairing completes against the compose stack without
HTTP 404 - [ ] Without Caddy, pairing still works when
BUZZ_PAIRING_RELAY_URLpoints at the published:5000port
Made with Cursor
@tlongwell-block @wesbillman @wpfleger96 mind taking a look when you get a chance?
Confirming this from a production self-host: I've been running the buzz-pair-relay sidecar on ghcr.io/block/buzz:main since Aug 4, and the shape this PR proposes is exactly what works in practice.
Verified working snippet:
pair:
image: ${BUZZ_IMAGE:-ghcr.io/block/buzz:main}
entrypoint: ["/usr/local/bin/buzz-pair-relay"]
environment:
BUZZ_PAIR_RELAY_BIND_ADDR: 0.0.0.0:5000
ports:
- "5000:5000"
restart: unless-stopped
networks:
- buzz-net
Notes that line up with this PR:
entrypoint(notcommand) is the right call — withcommand, Compose appends args to thebuzz-relaybinary and the sidecar never behaves as a pairing relay.- The stock compose Caddyfile only routes to
relay:3000, so/pair*404s unless the sidecar is on a direct port or Caddy adds thehandle_path /pair*route. The Caddyfile change here closes exactly that gap. - Set
BUZZ_PAIRING_RELAY_URL=wss://<domain>/pairin.envso NIP-11 advertises the pairing endpoint.
Thanks for landing this — it makes compose self-hosts work out of the box for mobile pairing.
rebased onto main. kept the pairing-relay note and the mobile push note.
🔐 Codex Security Review
Status: review required for the current range.
The current range is
930b8bb800d8149ce29a881ba4c5d9f424580434...d4402ba3cc8b504d2504d3abaaf328cc49e7c2fb. A new review must complete for this exact range. When manual authorization is required, a Block organization member must comment exactly@buzz-security-review d4402ba3cc8b504d2504d3abaaf328cc49e7c2fbto authorize a new review. Any previous review applies only to its recorded range.