rented gateway config double-declares services.kanidm (VMMode baseline + public front-door collide) #693
Labels
No labels
agent-blocked
agent-working
autopilot
bug
deferred
deploy-pending
enhancement
landing-pr
model-haiku
model-opus
model-sonnet
needs-design
needs-info
needs-triage
no-triage
out-of-scope
priority
ready-for-agent
ready-for-human
ready-for-session
rehearsal-183
snapshot-pending
standing-drive
wayfinder:grilling
wayfinder:map
wayfinder:prototype
wayfinder:research
wayfinder:task
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Reference
Matou/idss#693
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?
Failure
Drive
20260823T071501Z, legenroll-configure(sigcdebd4257a3d): the rented gateway's node config fails to eval —Evidence
The run's captured
state/clan-config/machines/gateway/carries both:gateway-guest.nix:137—bindaddress = "0.0.0.0:8443";(inline VM-mode kanidm)front-door.nix:16—bindaddress = "127.0.0.1:8443"; # loopback ONLY(public front-door kanidm)Both attrpaths (
server.settings.bindaddressand the olderenableServer/serverSettingsnames) alias onto the same final option, so nixpkgs sees two conflicting definitions on the one machine.Root cause
internal/founding/rentedpath.go:297setsInstall: clan.VMModefor the rented carrier'sconfigureleg (a singleclan update, no takeover — deliberate, per thestanduprented.go:19-23comment), butrentedpath.go:320pairs it withGateway: publicGatewayFacts(d, ip, claim, smtp)— the exact same "public gateway" facts constructorownvpspath.go:619andselfhostedpath.go:231use, but those always pair it withInstall: clan.FullInstall.The two Install modes drive genuinely different (and, per
docs/GOTCHAS.md#12 / issue #443's "Ben's 2026-08-11 ruling", deliberately mutually exclusive) machine-config shapes:internal/clan/enrollment.go:418-438(writeNodeConfig'ss.NodeConfig == nilbranch) bakesgateway-guest.nixviarenderGatewayGuest(vmguest.go:114-146), which unconditionally splices inkanidmServer(g)(vmguest.go:259-269) — an inlineservices.kanidmbound0.0.0.0:8443, designed for the private/QEMU-demo gateway that has no separate front door.Gateway.Public != nil) →assembleGatewayLiveSet(internal/clan/gateway_attach.go) takes the publicFrontDoorLiveSetbranch (noPrivatefield), soAttachGatewayalso writesfront-door.nixviaRenderFrontDoor→renderKanidmLoopback(frontdoor.go:261-278), which declares its ownservices.kanidmbound127.0.0.1:8443behind Caddy.The #443 closure (
docs/GOTCHAS.md§12 update) established exactly two shapes — VM-mode-with-inline-kanidm (no front door) vs. own-VPS-full-install-with-front-door (no inline kanidm, viacontrol-plane.nix/renderControlPlaneSurface) — and documented them as never combined. The rented carrier (added later, commit516c5054, ADR 0189/DDR 0190-191) needed "no takeover" (VMMode's install semantics) but is also a genuinely public gateway (front-door's shape), and nothing reconciled that: it inherited VMMode's baseline and the public front-door facts, recombining two ingredients the #443 ruling kept apart. This was latent and unexercised until#692(this repo,af942243) fixed the earlier SSH-identity fault blockingsupply/configureon the same journey, letting the drive reach eval for the first time.Suspected layer / what plugging it needs
A design decision, not a mechanical patch — options include:
Installvalue, or a flagwriteNodeConfig/renderGatewayGuestcan read to skip the inlinekanidmServer(+ its brand/credential-floor/idp-bridge blocks) and instead take the full-install-stylecontrol-plane.nixkanidm-provision surface, whenGateway.Public != nileven under VMMode.Whichever direction, it touches
internal/founding/rentedpath.go,internal/clan/enrollment.go, andinternal/clan/vmguest.go/frontdoor.gotogether, plus the doc invariants indocs/GOTCHAS.md#12 and therenderGatewayGuest/kanidmServer/renderControlPlaneSurfacecomments that currently assert these two shapes never combine — those comments need updating in the same commit as the fix (ADR 0042 same-commit law). Needs a maintainer call on which shape the rented gateway should actually carry before a worker touches this.drive
20260823T071501Zred atpair:journey leg "enroll-configure" went red: founding: the rented server stand-up did not complete (status "blocked"): the node's config does not evaluate — fix it so the node evaluates, then re-drive:evidence:
test-results/…/20260823T071501Z/on matou-workstation (legs.json, droplet-journal.txt, trace) — a representative screenshot is attached here if one was captured (#596)Ruled by agent under ADR 0174 — veto anytime.
Root cause confirmed exactly as the ticket's own analysis: GOTCHAS #12's #443 closure named only two gateway shapes (VM-mode-inline-kanidm/no-front-door vs full-install-front-door/no-inline-kanidm) and asserted they never combine. The rented carrier recombined them —
Install: clan.VMMode(no takeover) paired withGateway: publicGatewayFacts(...)(the same public-facts builder own-VPS/self-hosted pair withFullInstall) — sowriteNodeConfigbakedgateway-guest.nix's inline kanidm (0.0.0.0:8443) andassembleGatewayLiveSetcomposedfront-door.nix's public kanidm (127.0.0.1:8443) onto the one machine.Ruling: adopted the ticket's own favoured direction (option 1) — decouple "no-takeover install" from "which kanidm shape a gateway renders".
renderGatewayGuest(internal/clan/vmguest.go) now branches onGatewayFacts.Public, notInstallalone: a public gateway (VMMode or full-install) never bakes the private inlinekanidmServer/idpLoopbackBridge/brand-CSS-duplicate/credential-floor-duplicate/VM-shaped-assertions blocks — it takes the SAMEgatewayKanidmProvision+gatewayBrandPush+gatewayGateConsentBlock+gatewayControlPlaneAssertionsblocksrenderControlPlaneSurfacealready proved out for own-VPS/self-hosted (#443/#452/#453/#454). The VM host baseline (sshd/boot/disk) is untouched — this fix touches only the kanidm/idp surface the eval error actually named.Recorded as DDR 0193 (
docs/adr/0193-design-public-vmmode-gateway-shares-the-full-install-kanidm-shape.md); GOTCHAS #12 gained an Update; the affected doc comments (kanidmServer,renderGatewayGuest) were corrected in the same commit (ADR 0042).Why a two-way door: revertible by commit; provable by a new fast unit test,
TestRenderGatewayGuest_PublicGatewaySkipsInlineKanidmServer(internal/clan/vmguest_test.go) — proven RED before the fix (asserted the conflictingservices.kanidm = {...}block was absent and failed), GREEN after — plusnix-instantiate --parseon the composed output. Not a security-posture widening: the change removes a conflicting declaration and the surviving one is the exact block set production already runs successfully for every other public gateway.Proof:
go build ./... && go vet ./... && go test ./...— all green (full repo,internal/clan13.5s).TestRenderGatewayGuest_PublicGatewaySkipsInlineKanidmServer— red before / green after (TDD).TestRentedGateway_EvalSmoke(internal/clan/seedcommunity_eval_test.go, gatedIDSS_EVAL_SMOKE=1) reproducesinstallRented's exact composition end to end against a realnix eval— could not run to a verdict in this session-runner checkout: it hits a pre-existing "No SOPS key found" gap (no sops-age key pre-registered on this host). This is NOT specific to my change — the already-mergedTestOwnVPSGateway_EvalSmokefails identically here, confirmed by running it directly. Filed as a follow-up (see below) rather than worked here (out of #693's scope).5a53b04conmain(pushed).Left open, filed as a follow-up (out of this ticket's scope):
gatewayFleetPorts()opens 8080/8443 in the firewall for everyrenderGatewayGuestcaller, including the now-public VMMode branch — harmless on the private QEMU path (NAT'd hostfwd) but a real internet-facing rented droplet publicly exposing the control-plane API port (8080) is a security-posture question this ticket's evidence never raised, so it stays on the ADR 0174 one-way-door list rather than getting bundled into this ruling. Also filed a lighter follow-up for the eval-smoke sops-key gap discovered while proving this fix.Close-report: the eval-conflict is fixed, proven by unit test + full suite, and documented (DDR 0193 + GOTCHAS #12). advances #693.