feat(deploy): add device-pairing sidecar to the compose stack - #4656
Open
vishoo7 wants to merge 1 commit into
Open
feat(deploy): add device-pairing sidecar to the compose stack#4656vishoo7 wants to merge 1 commit into
vishoo7 wants to merge 1 commit into
Conversation
Mobile QR pairing was broken out of the box for compose deployments: a membership-gated (NIP-43) relay makes the desktop app point the phone at the legacy <relay>/pair fallback, but the compose stack never ran the buzz-pair-relay sidecar or routed /pair, so pairing always failed with a WebSocket 404. The Helm chart already supports this via pairingRelay.enabled; this brings the compose bundle to parity. - compose.pair.yml runs buzz-pair-relay from the existing relay image (entrypoint override — the image ENTRYPOINT is buzz-relay) and sets BUZZ_PAIRING_RELAY_URL so the relay advertises the pairing URL in NIP-11 instead of relying on the legacy path fallback. - Caddyfile routes /pair to the sidecar via exclusive handle blocks. - run.sh includes the overlay by default with BUZZ_COMPOSE_TLS=true; BUZZ_COMPOSE_PAIRING=false opts out. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Voret84oXtBS5hfRo66uGS Signed-off-by: vishoo7 <19656433+vishoo7@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
Mobile QR pairing fails out of the box for
deploy/composedeployments. A membership-gated (NIP-43) relay can't accept unpaired devices, so the desktop app falls back to pointing the phone at the legacy<relay>/pairpath (resolve_pairing_relay_urlindesktop/src-tauri/src/commands/pairing.rs). The compose stack never runs thebuzz-pair-relaysidecar or routes/pair, so the phone's WebSocket upgrade lands on the main relay's router and pairing always dies with "websocket connection failed: http error: 404 not found".The Helm chart already handles this (
pairingRelay.enabledruns the sidecar from the relay image and advertises it in NIP-11); this PR brings the compose bundle to parity.Changes
compose.pair.yml(new overlay): runs/usr/local/bin/buzz-pair-relayfrom the existing relay image via anentrypoint:override (the imageENTRYPOINTisbuzz-relay, socommand:alone would silently start a second main relay), binds0.0.0.0:5000, and adds a bash/dev/tcphealthcheck matching the relay's approach. It also setsBUZZ_PAIRING_RELAY_URL=wss://$BUZZ_DOMAIN/pairon the relay so clients get the pairing URL from NIP-11 instead of relying on the legacy path fallback.Caddyfile: exclusivehandleblocks —/pair→pair-relay:5000, everything else →relay:3000.run.sh: includes the overlay by default whenBUZZ_COMPOSE_TLS=true;BUZZ_COMPOSE_PAIRING=falseopts out. Not wired for the non-TLS stack (no reverse proxy to route/pair, and iOS requireswss://).README.md: new "Device pairing" section with verification steps.Testing
docker compose -f compose.yml -f compose.caddy.yml -f compose.pair.yml configrenders the merged stack correctly (sidecar entrypoint/env/healthcheck, relayBUZZ_PAIRING_RELAY_URL).pairing_relay_url,GET /pairreturns the sidecar's 400 for non-WebSocket requests (previously the relay's 404), and iOS QR pairing against the desktop app completes through SAS confirmation.🤖 Generated with Claude Code
https://claude.ai/code/session_01Voret84oXtBS5hfRo66uGS