Skip to content

Remove the relay watchdog and require the address lookup service with custom relays - #122

Closed
andrewchen5678 wants to merge 2 commits into
mainfrom
mandatory-lookup
Closed

andrewchen5678 wants to merge 2 commits into
mainfrom
mandatory-lookup

Conversation

@andrewchen5678

Copy link
Copy Markdown
Contributor

What

The branch carries two commits:

  1. Use native relay recovery (already on release-v0.6.3-native-relay): the home-relay watchdog and the server endpoint rebuild are gone; servers keep one endpoint and rely on iroh 1.1 for reconnects and re-homing.
  2. Require the address lookup service with custom relays, adopting flexaccess-iroh v0.0.6 (Remove the server watchdog and require a self-hosted address lookup with custom relays flexaccess-iroh#5). Custom relays come with one self-hosted iroh-dns-server behind a secret-gated reverse proxy; servers publish their relay URL there and clients resolve it, so a server can move to another relay without every client being reconfigured. That publish path is what the watchdog's rebuild-with-the-same-identity was papering over.
    • [iroh].lookup_url / lookup_secret, --lookup-url / --lookup-secret, TUNNEL_RS_LOOKUP_URL / TUNNEL_RS_LOOKUP_SECRET; both required with relay_urls, rejected without.
    • tunnel-rs generate-lookup-secret (and --json): the crate's checksummed lks1-… secret.
    • Servers publish in the foreground at startup and refuse to start if the service rejects it (a wrong secret is a 404); clients never publish.

Design and deployment recipe: flexaccessdev/iroh-common-architecture#6.

Tests

  • cargo clippy, cargo test (72 tests).
  • run_e2e.sh --relay-url … --relay-only --local-lookup: local dev relay plus a local iroh-dns-server behind caddy gated by a fresh secret (lookup_dev.sh). Asserts the server's record is published, readable only through the secret-gated URL, and names a configured relay. Pass.
  • run_relay_failover_e2e.sh: two relays plus the lookup stack. New assertions: B1 the record names the server's home relay; B2 kills that relay and requires the record to be republished naming the survivor before a client configured with only the survivor reconnects; B4 the record names a live relay after both relays restart. All 9 scenarios pass.
  • run_lookup_cloudflare_e2e.sh (new): the lookup service published through a real Cloudflare quick tunnel (cloudflared tunnel --url), then run_e2e.sh relay-only against it. Confirms the gate holds through Cloudflare (secret path 200, ungated path 404) and the record round-trips through the tunnel. Pass.

Two things the e2e work caught and that are fixed in the docs PR: the dns.toml example had its top-level keys after table headers and lacked the root origin, and a Caddy site block named by host matches nothing behind Cloudflare (bare port is required).

Merge order

flexaccessdev/flexaccess-iroh#5 first (its v0.0.6 is already tagged as a prerelease from the branch, so this builds as is), then this. ezvpn and flextunnel follow separately.

🤖 Generated with Claude Code

https://claude.ai/code/session_01D3hEPd7ueTS7hchgGK6Fqf

Andrew Chen and others added 2 commits September 4, 2026 16:49
…h v0.0.6)

Adopt the shared crate's mandatory lookup service, on top of the watchdog
removal already on this branch. Custom relays now come with one self-hosted
iroh-dns-server behind a secret-gated reverse proxy; servers publish their
relay URL there and clients resolve it, so a server can move to another
relay without every client being reconfigured.

- `[iroh].lookup_url` / `lookup_secret`, `--lookup-url` / `--lookup-secret`,
  `TUNNEL_RS_LOOKUP_URL` / `TUNNEL_RS_LOOKUP_SECRET`; both required with
  `relay_urls` and rejected without, resolved through the crate's
  `RelayConfig::resolve(RelaySettings)`.
- `generate-lookup-secret` (`--json` form too), printing the crate's
  checksummed `lks1-` secret.
- Servers publish in the foreground at startup and fail if rejected; clients
  never publish.
- e2e: `run_e2e.sh` takes `--lookup-url`/`--lookup-secret` or `--local-lookup`
  (a local iroh-dns-server behind caddy, via `lookup_dev.sh`) and asserts the
  record is published, readable only through the secret-gated URL, and names
  a configured relay. `run_relay_failover_e2e.sh` runs the lookup stack and
  asserts the record is republished naming the survivor after the server's
  home relay is killed. `run_lookup_cloudflare_e2e.sh` runs the whole thing
  with the lookup service behind a real Cloudflare quick tunnel.
- Docs: README, architecture doc (watchdog section replaced), TOML examples,
  test-scripts README, AGENTS.md.

Verified: cargo clippy, cargo test (72), and all three e2e suites pass
(local lookup, relay failover with republish, Cloudflare quick tunnel).

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01D3hEPd7ueTS7hchgGK6Fqf
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant