buzz icon indicating copy to clipboard operation
buzz copied to clipboard

fix(compose): wire buzz-pair-relay so mobile QR pairing works

Open chessing234 opened this issue 4 months ago • 1 comments

Summary

  • Stand up the buzz-pair-relay sidecar in deploy/compose (using entrypoint, not command, so Compose does not append args to buzz-relay).
  • Advertise BUZZ_PAIRING_RELAY_URL in 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, and run.sh help.

Fixes #3842

Test plan

  • [ ] cd deploy/compose && cp .env.example .env (fill CHANGE_ME) and ./run.sh config succeeds with BUZZ_PAIRING_RELAY_URL set
  • [ ] BUZZ_COMPOSE_TLS=true ./run.sh start brings up pairing-relay healthy; Caddy /pair reaches it
  • [ ] Desktop/mobile QR pairing completes against the compose stack without HTTP 404
  • [ ] Without Caddy, pairing still works when BUZZ_PAIRING_RELAY_URL points at the published :5000 port

Made with Cursor

chessing234 avatar Jul 31 '26 08:07 chessing234

@tlongwell-block @wesbillman @wpfleger96 mind taking a look when you get a chance?

chessing234 avatar Aug 02 '26 08:08 chessing234

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 (not command) is the right call — with command, Compose appends args to the buzz-relay binary 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 the handle_path /pair* route. The Caddyfile change here closes exactly that gap.
  • Set BUZZ_PAIRING_RELAY_URL=wss://<domain>/pair in .env so NIP-11 advertises the pairing endpoint.

Thanks for landing this — it makes compose self-hosts work out of the box for mobile pairing.

Tony-ooo avatar Aug 07 '26 18:08 Tony-ooo

rebased onto main. kept the pairing-relay note and the mobile push note.

chessing234 avatar Sep 25 '26 15:09 chessing234

🔐 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 d4402ba3cc8b504d2504d3abaaf328cc49e7c2fb to authorize a new review. Any previous review applies only to its recorded range.

github-actions[bot] avatar Sep 25 '26 15:09 github-actions[bot]