own-VPS fleet/enrolment: stand up SSH -L forwards to the box so the 127.0.0.1 gateway polls stay byte-identical (split from #436) #437

Closed
opened 2026-08-11 15:44:58 +00:00 by ben · 1 comment
Owner

Split out of #436's hand-back (Ben's ruling, 2026-08-11 ~15:50Z) — the supply half landed as 8dabf03; this ticket is the remaining half, pre-filed instead of paying a drive to red on it (the fault shape is fully known from the worker's trace).

The gap

Fleet and Enrolment poll the gateway over the LOCAL-GUEST VM's loopback port-forwards, which do not exist on an own-VPS drive:

  • Fleet.pollUntil → http://127.0.0.1:<APIPort>
  • Enrolment.liveIDP → kanidm client against https://localhost:<KanidmPort>
  • both resolve ports via newGuestVM().SSHPort/APIPort/KanidmPort — the private VM's forward map.

The gateway binds kanidm and the control plane loopback-only on the box (publicKanidmLoopbackPort=8443, gateURL=127.0.0.1:8080), so the public IP is not a path either — by design (the front door is Caddy alone, ADR 0074).

The shape (preserves ADR 0126's byte-identical-loopback posture)

Stand up SSH local forwards to the own-VPS box over the carrier's connection (guest-trust identity from #432, accept-new + pinned own-VPS known-hosts per ADR 0152 — the same posture 8dabf03 gave supply): -L <localAPIPort>:127.0.0.1:8080 and -L <localKanidmPort>:127.0.0.1:8443 (ports per the gateway render), held open for the fleet/enrolment phase and torn down after. Fleet/Enrolment then keep their 127.0.0.1:<port> contract BYTE-IDENTICAL — the own-VPS path swaps the thing behind the loopback (VM forward → ssh -L), never the callers. Port resolution needs an own-VPS-aware source in place of newGuestVM()'s map (the wiring layer knows which path founded; thread the forward ports the same way Seed(ctx, host, sshPort) threads the host).

Seam tests in the #432/8dabf03 lineage: fakes record which forward map the pollers resolved against; an own-VPS founding that reaches fleet with the VM's map is a red.

ChallengeSource needs nothing (own-VPS pointing writes A+wildcard alone, the heartbeat re-points the challenge — ADR 0136, per the #436 worker's trace).

Blocks the standing drive issue #378 via native dependency — the next drive past supply reds exactly here without it. These legs have never run on a real droplet: expect the drive to find the NEXT tooth behind this one (pairing ceremony territory).

Split out of #436's hand-back (Ben's ruling, 2026-08-11 ~15:50Z) — the supply half landed as `8dabf03`; this ticket is the remaining half, pre-filed instead of paying a drive to red on it (the fault shape is fully known from the worker's trace). ## The gap `Fleet` and `Enrolment` poll the gateway over the LOCAL-GUEST VM's loopback port-forwards, which do not exist on an own-VPS drive: - `Fleet.pollUntil` → `http://127.0.0.1:<APIPort>` - `Enrolment.liveIDP` → kanidm client against `https://localhost:<KanidmPort>` - both resolve ports via `newGuestVM().SSHPort/APIPort/KanidmPort` — the private VM's forward map. The gateway binds kanidm and the control plane loopback-only on the box (`publicKanidmLoopbackPort=8443`, `gateURL=127.0.0.1:8080`), so the public IP is not a path either — by design (the front door is Caddy alone, ADR 0074). ## The shape (preserves ADR 0126's byte-identical-loopback posture) Stand up SSH local forwards to the own-VPS box over the carrier's connection (guest-trust identity from #432, accept-new + pinned own-VPS known-hosts per ADR 0152 — the same posture `8dabf03` gave supply): `-L <localAPIPort>:127.0.0.1:8080` and `-L <localKanidmPort>:127.0.0.1:8443` (ports per the gateway render), held open for the fleet/enrolment phase and torn down after. Fleet/Enrolment then keep their `127.0.0.1:<port>` contract BYTE-IDENTICAL — the own-VPS path swaps the thing behind the loopback (VM forward → ssh -L), never the callers. Port resolution needs an own-VPS-aware source in place of `newGuestVM()`'s map (the wiring layer knows which path founded; thread the forward ports the same way `Seed(ctx, host, sshPort)` threads the host). Seam tests in the #432/`8dabf03` lineage: fakes record which forward map the pollers resolved against; an own-VPS founding that reaches fleet with the VM's map is a red. `ChallengeSource` needs nothing (own-VPS pointing writes A+wildcard alone, the heartbeat re-points the challenge — ADR 0136, per the #436 worker's trace). Blocks the standing drive issue #378 via native dependency — the next drive past supply reds exactly here without it. These legs have never run on a real droplet: expect the drive to find the NEXT tooth behind this one (pairing ceremony territory).
Author
Owner

Landed as ae7586e on main.

The remaining half of #436 is closed: the own-VPS fleet/enrolment legs now reach the operator's box through ssh -L forwards instead of the private path's VM loopback map.

Shape (preserves ADR 0126's byte-identical-loopback posture):

  • New fleetwire.GuestForwards — the one own-VPS-aware source the Fleet + Enrolment adapters share. The private path resolves the committed VM forward map through it byte-identically (loopback target, the VM's ports). An own-VPS journey calls UseOwnVPS(ip): SSH lands on root@<ip>:22 (RemoteTarget, accept-new + pinned own-VPS known-hosts, ADR 0152) and the control-plane/kanidm loopback ports (:8080/:8443, ADR 0074) become the local ends of ssh -L forwards to the box — stood up lazily and held open (the enrolment ceremony spans separate stdio ops after the finish leg), torn down by Close.
  • Fleet/Enrolment keep their 127.0.0.1:<port> contract BYTE-IDENTICAL — the own-VPS path swaps the thing behind the loopback (VM forward → ssh -L), never the callers (optional Forwards field on their configs; nil keeps the pre-seam static fields).
  • Founding switches the source per journey the same way Seed(ctx, host, sshPort) threads the supply host: new founding.GuestForwards seam (WithGuestForwards), with ensureGuestForwards called at every guest-facing entry (RunSeed, OpenEnrolment, AwaitEnrolment — resume-safe). Private path never switches. ChallengeSource untouched (ADR 0136).
  • Wiring builds one shared GuestForwards (real ssh -N -L forwarder) for fleet + enrolment + the founding seam; new guest-forwards boot-seam port.

Evidence: new fleetwire seam tests (private resolves the VM map; own-VPS stands up + reuses the forwards behind the loopback; SeedLedger/Enrolment reads land on root@<box>:22, not 127.0.0.1; forwardArgs posture) and founding tests (own-VPS switches to the box before fleet; private path never does) — internal/fleetwire/forwards_test.go, internal/founding/{ownvpspath,privatepath}_test.go. Full go test ./... + golangci-lint green.

Not yet run on a real droplet — as the ticket anticipated, expect the next own-VPS drive past supply to red on the NEXT tooth (pairing-ceremony territory). This unblocks the standing drive #378.

Landed as `ae7586e` on `main`. The remaining half of #436 is closed: the own-VPS fleet/enrolment legs now reach the operator's box through `ssh -L` forwards instead of the private path's VM loopback map. **Shape (preserves ADR 0126's byte-identical-loopback posture):** - New `fleetwire.GuestForwards` — the one own-VPS-aware source the `Fleet` + `Enrolment` adapters share. The private path resolves the committed VM forward map through it byte-identically (loopback target, the VM's ports). An own-VPS journey calls `UseOwnVPS(ip)`: SSH lands on `root@<ip>:22` (`RemoteTarget`, accept-new + pinned own-VPS known-hosts, ADR 0152) and the control-plane/kanidm loopback ports (`:8080`/`:8443`, ADR 0074) become the local ends of `ssh -L` forwards to the box — stood up lazily and held open (the enrolment ceremony spans separate stdio ops after the finish leg), torn down by `Close`. - `Fleet`/`Enrolment` keep their `127.0.0.1:<port>` contract **BYTE-IDENTICAL** — the own-VPS path swaps the thing behind the loopback (VM forward → ssh -L), never the callers (optional `Forwards` field on their configs; nil keeps the pre-seam static fields). - Founding switches the source per journey the same way `Seed(ctx, host, sshPort)` threads the supply host: new `founding.GuestForwards` seam (`WithGuestForwards`), with `ensureGuestForwards` called at every guest-facing entry (`RunSeed`, `OpenEnrolment`, `AwaitEnrolment` — resume-safe). Private path never switches. `ChallengeSource` untouched (ADR 0136). - Wiring builds one shared `GuestForwards` (real `ssh -N -L` forwarder) for fleet + enrolment + the founding seam; new `guest-forwards` boot-seam port. **Evidence:** new fleetwire seam tests (private resolves the VM map; own-VPS stands up + reuses the forwards behind the loopback; `SeedLedger`/`Enrolment` reads land on `root@<box>:22`, not `127.0.0.1`; `forwardArgs` posture) and founding tests (own-VPS switches to the box before fleet; private path never does) — `internal/fleetwire/forwards_test.go`, `internal/founding/{ownvpspath,privatepath}_test.go`. Full `go test ./...` + `golangci-lint` green. **Not yet run on a real droplet** — as the ticket anticipated, expect the next own-VPS drive past supply to red on the NEXT tooth (pairing-ceremony territory). This unblocks the standing drive #378.
ben closed this issue 2026-08-11 16:45:26 +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#437
No description provided.