founding: the _acme-challenge CNAME is never written — wildcard DNS-01 cannot complete on the subdomain path #324

Closed
opened 2026-08-07 17:32:34 +00:00 by ben · 4 comments
Owner

The broker accepts an acme_challenge field on /v1/subdomains/point and writes the _acme-challenge.<slug> CNAME from it (broker/internal/broker/http.go:25-32, broker.go:206, zone.go:190-200). The field is documented as gateway-supplied.

No Go caller ever populates it. The seam verb carries no such argument — founding.BrokerClient.PointSubdomain(ctx, host, ip) (internal/founding/access.go:208) — and the client sends only {host, ip} (internal/brokerclient/client.go:95).

The value it wants is already produced and published gateway-side, world-readable, at /var/lib/ourcloud-acmedns/fulldomain (internal/clan/acmedns.go:60, republished every boot at :218-231). It has no reader.

So on the <slug>.idss.nz path the delegation CNAME is never created, and Caddy's wildcard DNS-01 against the self-hosted acme-dns cannot complete.

Related: RenderAcmeDNS has no production caller at all (see the Attach-layer ticket), so this is currently latent rather than a live outage — but the two must land together.

Definition of done

The acme-dns registration's fulldomain reaches PointSubdomain and lands as the _acme-challenge.<slug> CNAME, with the ADR 0100 posture kept: an absent challenge writes A + wildcard alone, never a fabricated delegation.


Found 2026-08-07 while scoping home-gateway reachability (dynamic address / automatic port opening / IPv6). Full trace in docs/research/2026-08-07-home-gateway-reachability-scope.md.

The broker accepts an `acme_challenge` field on `/v1/subdomains/point` and writes the `_acme-challenge.<slug>` CNAME from it (`broker/internal/broker/http.go:25-32`, `broker.go:206`, `zone.go:190-200`). The field is documented as gateway-supplied. **No Go caller ever populates it.** The seam verb carries no such argument — `founding.BrokerClient.PointSubdomain(ctx, host, ip)` (`internal/founding/access.go:208`) — and the client sends only `{host, ip}` (`internal/brokerclient/client.go:95`). The value it wants is already produced and published gateway-side, world-readable, at `/var/lib/ourcloud-acmedns/fulldomain` (`internal/clan/acmedns.go:60`, republished every boot at `:218-231`). It has no reader. So on the `<slug>.idss.nz` path the delegation CNAME is never created, and Caddy's wildcard DNS-01 against the self-hosted acme-dns cannot complete. Related: `RenderAcmeDNS` has no production caller at all (see the Attach-layer ticket), so this is currently latent rather than a live outage — but the two must land together. ## Definition of done The acme-dns registration's fulldomain reaches `PointSubdomain` and lands as the `_acme-challenge.<slug>` CNAME, with the ADR 0100 posture kept: an absent challenge writes A + wildcard alone, never a fabricated delegation. --- Found 2026-08-07 while scoping home-gateway reachability (dynamic address / automatic port opening / IPv6). Full trace in `docs/research/2026-08-07-home-gateway-reachability-scope.md`.
Author
Owner

This was generated by AI during triage.

Verified: broker's /v1/subdomains/point confirmed to accept and write an AcmeChallenge/acme_challenge field (http.go, broker.go, zone.go). Confirmed founding.BrokerClient.PointSubdomain(ctx, host, ip) and the concrete brokerclient.Client.PointSubdomain both carry only host+ip, no challenge value. Confirmed the acme-dns fulldomain file is published gateway-side with no reader anywhere in the repo. Claim holds.

Agent Brief

Category: bug
Summary: Wire acme-dns's published fulldomain value through to the broker's PointSubdomain call so the _acme-challenge CNAME actually gets written.

Current behavior:
The broker already accepts and writes an acme_challenge field via its point-subdomain endpoint, but no Go caller populates it — the seam between founding and the broker client carries only host+ip. The acme-dns fulldomain value that should fill it is already produced and published gateway-side (a world-readable file, republished every boot), but nothing reads it.

Desired behavior:
The acme-dns registration's fulldomain value is read gateway-side and threaded through the point-subdomain call so the broker writes the _acme-challenge.<slug> CNAME. When no challenge value is available/known, behavior stays exactly as today: A + wildcard alone, never a fabricated delegation.

Key interfaces:

  • The seam interface that currently exposes PointSubdomain(ctx, host, ip) error needs an optional challenge value threaded through (both the interface and the concrete HTTP client that implements it).
  • Whatever reads the acme-dns published fulldomain gateway-side is the source of that value — it currently has no reader anywhere in the repo; one needs to be added.

Dependency note: this depends on #327 landing first (or alongside it). The module that produces the acme-dns fulldomain file has no production caller yet (#327), so acme-dns doesn't run in a real deployment until #327 wires it in — landing this ticket alone is inert without it. Filed as a blocking dependency on #327.

Acceptance criteria:

  • When the acme-dns fulldomain value is available, the point-subdomain call to the broker includes it and the broker writes the _acme-challenge.<slug> CNAME.
  • When the value is unavailable, behavior is unchanged (A + wildcard only, no delegation).
  • A test covers both the present and absent value.

Out of scope:

  • The Attach-layer / provisioning-slice wiring itself (#327) — this ticket only wires the value through once acme-dns is running.
  • Broker-side zone-write logic (already implemented and already tested).
> *This was generated by AI during triage.* **Verified:** broker's `/v1/subdomains/point` confirmed to accept and write an `AcmeChallenge`/`acme_challenge` field (http.go, broker.go, zone.go). Confirmed `founding.BrokerClient.PointSubdomain(ctx, host, ip)` and the concrete `brokerclient.Client.PointSubdomain` both carry only host+ip, no challenge value. Confirmed the acme-dns fulldomain file is published gateway-side with no reader anywhere in the repo. Claim holds. ## Agent Brief **Category:** bug **Summary:** Wire acme-dns's published fulldomain value through to the broker's PointSubdomain call so the `_acme-challenge` CNAME actually gets written. **Current behavior:** The broker already accepts and writes an `acme_challenge` field via its point-subdomain endpoint, but no Go caller populates it — the seam between founding and the broker client carries only host+ip. The acme-dns fulldomain value that should fill it is already produced and published gateway-side (a world-readable file, republished every boot), but nothing reads it. **Desired behavior:** The acme-dns registration's fulldomain value is read gateway-side and threaded through the point-subdomain call so the broker writes the `_acme-challenge.<slug>` CNAME. When no challenge value is available/known, behavior stays exactly as today: A + wildcard alone, never a fabricated delegation. **Key interfaces:** - The seam interface that currently exposes `PointSubdomain(ctx, host, ip) error` needs an optional challenge value threaded through (both the interface and the concrete HTTP client that implements it). - Whatever reads the acme-dns published fulldomain gateway-side is the source of that value — it currently has no reader anywhere in the repo; one needs to be added. **Dependency note:** this depends on #327 landing first (or alongside it). The module that produces the acme-dns fulldomain file has no production caller yet (#327), so acme-dns doesn't run in a real deployment until #327 wires it in — landing this ticket alone is inert without it. Filed as a blocking dependency on #327. **Acceptance criteria:** - [ ] When the acme-dns fulldomain value is available, the point-subdomain call to the broker includes it and the broker writes the `_acme-challenge.<slug>` CNAME. - [ ] When the value is unavailable, behavior is unchanged (A + wildcard only, no delegation). - [ ] A test covers both the present and absent value. **Out of scope:** - The Attach-layer / provisioning-slice wiring itself (#327) — this ticket only wires the value through once acme-dns is running. - Broker-side zone-write logic (already implemented and already tested).
Author
Owner

Landed in main as 9e7b361.

founding.BrokerClient.PointSubdomain now carries an acmeChallenge, threaded through the production brokerclient.Client (sent as acme_challenge, omitted when empty) and FakeBroker. A new founding.ChallengeSource port (WithChallengeSource) reads the gateway-published fulldomain, and wireName threads it through on the subdomain path. When present, the broker delegates the _acme-challenge.<slug> CNAME; when absent (no source wired, or the gateway's acme-dns not yet registered — a missing/empty fact is honest, not a fault) the name is wired with A + wildcard alone, never a fabricated delegation (ADR 0100/0118).

Production reader acmeChallengeReader over clan.AcmeDNSFulldomainFact is wired in both helper builds (newChallengeSourceOption); the boot seam test names the new challenge-source port. Depended on #327's composition, which had landed.

Evidence: seam tests both ways at the founding seam (internal/founding/standup_test.go: TestStory20_AcmeChallengeThreadedWhenPublished, TestStory20_AcmeChallengeAbsentWritesNoDelegation) and the brokerclient seam (internal/brokerclient/client_test.go: present sends acme_challenge, empty is omitted). go build/vet/test green under nix develop .#go-ci (incl. the pre-push full-suite run).

Landed in main as `9e7b361`. `founding.BrokerClient.PointSubdomain` now carries an `acmeChallenge`, threaded through the production `brokerclient.Client` (sent as `acme_challenge`, **omitted** when empty) and `FakeBroker`. A new `founding.ChallengeSource` port (`WithChallengeSource`) reads the gateway-published fulldomain, and `wireName` threads it through on the subdomain path. When present, the broker delegates the `_acme-challenge.<slug>` CNAME; when absent (no source wired, or the gateway's acme-dns not yet registered — a missing/empty fact is honest, not a fault) the name is wired with A + wildcard alone, never a fabricated delegation (ADR 0100/0118). Production reader `acmeChallengeReader` over `clan.AcmeDNSFulldomainFact` is wired in both helper builds (`newChallengeSourceOption`); the boot seam test names the new `challenge-source` port. Depended on #327's composition, which had landed. Evidence: seam tests both ways at the founding seam (`internal/founding/standup_test.go`: `TestStory20_AcmeChallengeThreadedWhenPublished`, `TestStory20_AcmeChallengeAbsentWritesNoDelegation`) and the brokerclient seam (`internal/brokerclient/client_test.go`: present sends `acme_challenge`, empty is omitted). `go build/vet/test` green under `nix develop .#go-ci` (incl. the pre-push full-suite run).
ben closed this issue 2026-08-07 19:58:16 +00:00
Author
Owner

Reopening on the 2026-08-08 whole-branch review's evidence: 9e7b361 wired PointSubdomain's acmeChallenge end to end, but the ChallengeSource the helper registers reads the gateway-published fulldomain with a plain LOCAL os.ReadFile of /var/lib/acme-dns/fulldomain on the operator's host (app/helper/cmd/helper/acmechallenge.go). On any real topology that path exists only on the gateway, so the read is always ErrNotExist → the honest-absent branch fires every time → A + wildcard are written with no _acme-challenge delegation, silently — the honest-absent design (ADR 0100/0118) is standing in for a missing transport.

Remaining scope: a real transport for the fact (read it over the established clan/fleetwire channel the way other gateway facts travel — e.g. alongside clan.AcmeDNSFulldomainFact's existing consumers), so absent means "the gateway hasn't registered yet", never "we looked on the wrong machine". Re-queued ready-for-agent.

Reopening on the 2026-08-08 whole-branch review's evidence: `9e7b361` wired `PointSubdomain`'s `acmeChallenge` end to end, but the `ChallengeSource` the helper registers reads the gateway-published fulldomain with a plain LOCAL `os.ReadFile` of `/var/lib/acme-dns/fulldomain` **on the operator's host** (`app/helper/cmd/helper/acmechallenge.go`). On any real topology that path exists only on the gateway, so the read is always `ErrNotExist` → the honest-absent branch fires every time → A + wildcard are written with no `_acme-challenge` delegation, silently — the honest-absent design (ADR 0100/0118) is standing in for a missing transport. Remaining scope: a real transport for the fact (read it over the established clan/fleetwire channel the way other gateway facts travel — e.g. alongside `clan.AcmeDNSFulldomainFact`'s existing consumers), so absent means "the gateway hasn't registered yet", never "we looked on the wrong machine". Re-queued ready-for-agent.
ben reopened this issue 2026-08-08 15:28:18 +00:00
Author
Owner

Fixed in e297924 (on origin/main).

The reopen was right: 9e7b361 wired PointSubdomain's acmeChallenge end-to-end, but the production ChallengeSource read the gateway-published fulldomain with a plain os.ReadFile on the operator's host — a path that exists only on the gateway — so the read was always ErrNotExist, the honest-absent branch fired every drive, and A + wildcard were written with no _acme-challenge delegation. ADR 0100/0118's honest-absent design was standing in for a missing transport.

Real transport added. A new fleetwire.ChallengeSource (internal/fleetwire/challenge.go) reads clan.AcmeDNSFulldomainFact over the guest-trust SSH connection — the same channel Enrolment.liveIDP reads the kanidm CA/idm_admin credential over (ssh … cat …). A not-yet-published fact (cat … 2>/dev/null || true → empty, zero exit) or an unreachable gateway is honest-absent ""; it never surfaces the transport error to founding, so a missing challenge decorates but never aborts the A + wildcard name-wiring. So absent now means only "the gateway's acme-dns has not registered yet", never "we looked on the wrong machine".

  • wiring_prod.go: challenge-source now wires fleetwire.NewChallengeSource over newGuestVM().SSHPort + the guest-trust identity + ExecRunner (the guest-facing adapter family's shape).
  • wiring_dev.go: the dev/demo build (no real guest) wires the scripted honest-absent foundingtesting source.
  • The obsolete operator-host reader app/helper/cmd/helper/acme_challenge.go is deleted; the boot-seam comment (wiring_test.go) updated.

Evidence: seam-tested three ways at the fleetwire seam (internal/fleetwire/challenge_test.go): published → read & trimmed and read over ssh root@127.0.0.1 cat <fact>; not-yet-registered → absent; unreachable gateway → absent, never fatal. Existing founding + brokerclient seam tests unchanged and green. go build/vet/test green under nix develop .#go-ci on both build tags (pre-push full-suite gate passed).

Fixed in `e297924` (on `origin/main`). The reopen was right: `9e7b361` wired `PointSubdomain`'s `acmeChallenge` end-to-end, but the production `ChallengeSource` read the gateway-published fulldomain with a plain `os.ReadFile` on the **operator's host** — a path that exists only on the gateway — so the read was always `ErrNotExist`, the honest-absent branch fired every drive, and A + wildcard were written with no `_acme-challenge` delegation. ADR 0100/0118's honest-absent design was standing in for a missing transport. **Real transport added.** A new `fleetwire.ChallengeSource` (`internal/fleetwire/challenge.go`) reads `clan.AcmeDNSFulldomainFact` **over the guest-trust SSH connection** — the same channel `Enrolment.liveIDP` reads the kanidm CA/idm_admin credential over (`ssh … cat …`). A not-yet-published fact (`cat … 2>/dev/null || true` → empty, zero exit) or an unreachable gateway is honest-absent `""`; it never surfaces the transport error to founding, so a missing challenge decorates but never aborts the A + wildcard name-wiring. So **absent now means only "the gateway's acme-dns has not registered yet", never "we looked on the wrong machine".** - `wiring_prod.go`: `challenge-source` now wires `fleetwire.NewChallengeSource` over `newGuestVM().SSHPort` + the guest-trust identity + `ExecRunner` (the guest-facing adapter family's shape). - `wiring_dev.go`: the dev/demo build (no real guest) wires the scripted honest-absent `foundingtesting` source. - The obsolete operator-host reader `app/helper/cmd/helper/acme_challenge.go` is deleted; the boot-seam comment (`wiring_test.go`) updated. **Evidence:** seam-tested three ways at the fleetwire seam (`internal/fleetwire/challenge_test.go`): published → read & trimmed and read over `ssh root@127.0.0.1 cat <fact>`; not-yet-registered → absent; unreachable gateway → absent, never fatal. Existing founding + brokerclient seam tests unchanged and green. `go build/vet/test` green under `nix develop .#go-ci` on both build tags (pre-push full-suite gate passed).
ben closed this issue 2026-08-09 01:52:43 +00:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
Matou/idss#324
No description provided.