Separate canonical relay identity from WebSocket transport endpoint #1
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Problem
Beekeeper currently uses
relay_urlfor three distinct concerns:connect_async.Hostused by Buzz for host-bound tenant selection.This prevents a co-located Beekeeper deployment from connecting directly to its relay. For example, the canonical identity may be
wss://buzz.example.com, while the relay is directly reachable atws://10.0.0.10:3000. Using the canonical URL sends local traffic through the public TLS proxy and back to the same network. Using the internal URL directly changes both the tenant host and NIP-42 relay tag, so the relay rejects authentication.We encountered this operationally when the public hairpin was blackholed by policy routing: the local relay health endpoint was healthy, but
beekeeper-preparerepeatedly failed withTimeout waiting for relay messagebecause it depended on the external route.Proposed design
Separate logical relay identity from physical connection transport:
relay_connect_urlshould be optional and default torelay_urlfor backwards compatibility.When it is set, the client should:
relay_connect_url.Hostwith the authority derived fromrelay_url.relay_url.This permits an unencrypted connection only on the trusted local network while retaining the canonical public identity and TLS posture in the signed authentication event.
The NixOS module could expose this as
services.beekeeper.relayConnectUrl. The generated fleet configuration should carry both values. Agent units should also receive an equivalent transport override such asBUZZ_RELAY_CONNECT_URL, coordinated withbuzz-ws-clientand the Buzz agent runtime.Acceptance criteria
relay_urlbehave unchanged.ws://IP:porttransport while sending the canonical public Host.wss://relay URL.