Remove the server watchdog and require a self-hosted address lookup with custom relays - #5
Closed
andrewchen5678 wants to merge 4 commits into
Closed
andrewchen5678 wants to merge 4 commits into
andrewchen5678 wants to merge 4 commits into
Conversation
Custom relays disabled every internet address lookup, so a server that moved to another relay had no way to tell its clients; the removed watchdog compensated by pinning the server to a relay clients already knew. Put the publish path back instead: `RelayConfig::resolve` now takes `RelaySettings` and rejects custom relay URLs without a `lookup_url` and `lookup_secret`, the address of one self-hosted iroh-dns-server behind a reverse proxy that serves only `/<lookup_secret>/…`. - `lookup`: `LookupSecret` (`lks1-` + 39 lowercase z-base-32 characters encoding 20 random bytes and their CRC-32, so a typo fails at config load on either side; never case-folded, redacted in Debug) and `LookupConfig` (scheme-and-host URL, composes `<url>/<secret>/pkarr`). - `endpoint_builder` installs iroh's pkarr resolver on every custom-relay endpoint and its publisher on endpoints that publish, relay-only mode included; nothing goes to n0 with custom relays. - `create_endpoint` takes `publishes_address` and, on custom relays, publishes the record in the foreground once the endpoint is online, failing with the HTTP status when the service rejects it (a wrong secret is a 404 from the proxy). Rebuilds leave it to the background publisher. - Integration test: in-process plain-HTTP relay, a secret-gated pkarr store behaving like the documented Caddy block, a server that must publish through it, and a client that dials by endpoint id with no relay hints and reaches the server through the lookup alone. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01D3hEPd7ueTS7hchgGK6Fqf
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.
What
Two changes toward the standard iroh architecture, in order:
relay_watchdogmodule, its test-only Tokio feature): servers rely on iroh 1.1.x for relay reconnects and re-homing and keep the same endpoint through relay outages.RebuildableEndpointstays for client reconnect escalation.RelayConfig::resolve(RelaySettings)rejects customrelay_urlswithoutlookup_urlandlookup_secret, and rejects either without custom relays.lookup::LookupSecret:lks1-+ 39 lowercase z-base-32 characters encoding 20 random bytes and their CRC-32, so a typo fails at config load on either side (never case-folded; redacted inDebug).lookup::LookupConfigtakes a scheme-and-host URL and composes<url>/<secret>/pkarr.endpoint_builderinstalls iroh's pkarr resolver on every custom-relay endpoint and its publisher on endpoints that publish (relay-only mode included). Nothing goes to n0 with custom relays.create_endpointtakespublishes_addressand, on custom relays, publishes the record in the foreground once online, failing with the HTTP status if the service rejects it (a wrong secret is a 404 from the reverse proxy). Rebuilds leave publishing to iroh's background publisher.Design and deployment recipe: flexaccessdev/iroh-common-architecture#6.
Tests
RelayConfiggating.tests/lookup.rs, in process, no network): a plain-HTTPiroh-relayserver, a pkarr store gated by the secret prefix exactly like the documented Caddyhandle_pathblock, a server that must publish through it, and a client that dials by endpoint id with no relay hints and reaches the server through the lookup alone. Plus: a well-formed but wrong secret fails endpoint creation with the 404; a client never publishes.cargo clippy --all-targets --all-features -- -D warningsandcargo test --all-featurespass.Consumers
tunnel-rs is the first consumer (
lookup_url/lookup_secretconfig,generate-lookup-secret, e2e scripts). ezvpn and flextunnel follow once that is good.🤖 Generated with Claude Code
https://claude.ai/code/session_01D3hEPd7ueTS7hchgGK6Fqf