Research: the apex cutover inventory — everything that opens the control panel at the bare apex today #1338

Closed
opened 2026-09-09 03:59:15 +00:00 by ben · 2 comments
Owner

Parent

The Portal map (#1336)

Question

The Portal takes the apex root and the operator SPA moves to admin.<apex> only, with a redirect (charting ruling 7). Inventory every consumer of the apex-as-panel so the spec can retarget them and nothing goes dark:

  1. Routes: renderPortalRoute / renderAdminRoute / the private front door (internal/clan/frontdoor.go), hostnames.Portal vs hostnames.Dashboard callers, controlapi.WithDashboard and the SPA's catch-all GET / (internal/controlapi/dashboard.go), the /get install path, /brand/*, /join, /mail, /authz/*, /api/* — which stay on the apex, which move.
  2. The app: S12 "Open your dashboard" click-completes (operator app, app/), Operator home's dashboard link (ADR 0019), any deep links (open-recovery-readiness, DDR 0101), the dashboard navigator's URL ↔ tab wiring (dashboard/src/entry/served.ts, tabRouting.ts).
  3. The harness: every e2e/rehearsal leg that opens the panel at the apex (grep the journeys, .sandcastle/, tests/, e2e for the apex URL / admin. usage); the reseed/publish chain that pins served bits (GOTCHAS: served bits vs main).
  4. DDR 0172's built state: is admin.<apex> served and gated today on both paths (spec #511 stories landed?), and what the DA-S2 refusal's "the community portal" door currently points at.
  5. Redirect semantics: which old apex paths are panel paths (a finite tab list) vs member/portal paths — so the redirect is exact, not a catch-all that steals the Portal's routes.

Deliver: a table of consumers → today's target → post-cutover target → change needed, and the redirect rule. Write to a research/portal-apex-cutover branch under docs/research/2026-09-08-portal-apex-cutover.md; link from this ticket.

## Parent [The Portal map (#1336)](https://git.matou.nz/Matou/idss/issues/1336) ## Question The Portal takes the apex root and the operator SPA moves to `admin.<apex>` only, with a redirect (charting ruling 7). Inventory every consumer of the apex-as-panel so the spec can retarget them and nothing goes dark: 1. **Routes**: `renderPortalRoute` / `renderAdminRoute` / the private front door (`internal/clan/frontdoor.go`), `hostnames.Portal` vs `hostnames.Dashboard` callers, `controlapi.WithDashboard` and the SPA's catch-all `GET /` (`internal/controlapi/dashboard.go`), the `/get` install path, `/brand/*`, `/join`, `/mail`, `/authz/*`, `/api/*` — which stay on the apex, which move. 2. **The app**: S12 "Open your dashboard" click-completes (operator app, `app/`), Operator home's dashboard link (ADR 0019), any deep links (`open-recovery-readiness`, DDR 0101), the dashboard navigator's URL ↔ tab wiring (`dashboard/src/entry/served.ts`, `tabRouting.ts`). 3. **The harness**: every e2e/rehearsal leg that opens the panel at the apex (grep the journeys, `.sandcastle/`, `tests/`, `e2e` for the apex URL / `admin.` usage); the reseed/publish chain that pins served bits (GOTCHAS: served bits vs main). 4. **DDR 0172's built state**: is `admin.<apex>` served and gated today on both paths (spec #511 stories landed?), and what the DA-S2 refusal's "the community portal" door currently points at. 5. **Redirect semantics**: which old apex paths are panel paths (a finite tab list) vs member/portal paths — so the redirect is exact, not a catch-all that steals the Portal's routes. Deliver: a table of consumers → today's target → post-cutover target → change needed, and the redirect rule. Write to a `research/portal-apex-cutover` branch under `docs/research/2026-09-08-portal-apex-cutover.md`; link from this ticket.
Author
Owner

Research landed — branch research/portal-apex-cutover, commit 54048ed9 (not pushed): docs/research/2026-09-08-portal-apex-cutover.md — 24-row consumer table (today → post-cutover → change needed, every cell path:line), the exact redirect rule, per-path differences, 13 numbered gaps, and a touch-list for the spec.

Findings (≤25 lines):

  1. The apex and admin.<apex> are the SAME host-blind control plane. Caddy proxies both to loopback (frontdoor.go:400-401), the Go mux has no host matching (dashboard.go:39), the SPA picks its surface by path only (main.ts:32-39). The only difference is forward_auth on the admin route (:445-475); the apex route is ungated by design (:557-575, #512). The cutover = splitting one origin into two hosts with different owners.
  2. Consequence today: the operator API is open at the apex — /api/v1/members, /fleet, /provision/* … have no in-handler auth; only IDIP steward/mail/logs/catalogue read a session. Ruling 7's "/api/* stays" must decide the apex API posture (allow-list + gate vs. wholesale) or the panel's data stays open after its pages move. Gap 1, the one that matters.
  3. Nothing on the public path composes the admin door. hostnames.Portal has zero callers; hostnames.Dashboard is reached only via DashboardReachable on the private path (seat.go:101, handoff.go:366). S12 opens https://<apex> after the credential lands (enrolment.go:336-341 ← handoff.go:355, portalAddress :723-733); Operator home's button falls back to community.portalUrl, which the seat never fills (seatSource.ts:34-49) — a no-op on the public path today.
  4. Redirect rule = the closed tab list (tabRouting.ts:17-27): /overview /fleet /services /members /backups /settings (+ /* under each) → 308 https://admin.<apex>{uri}, rendered in renderPortalRoute BEFORE the proxy, both renders. Portal-owned, never redirected: /, /haere-mai/*, /idip/join/*, /mail, /authz/*, /get, /brand/*, assets. / is ALSO Overview's path (pathForTab → /) — a root bookmark lands on the Portal by construction; the Portal's operator face needs a control-panel door.
  5. Real paths: there is no /join (it is /haere-mai/<token> kanidm, /idip/join/<token> IDIP) and no /.well-known on the apex (that is id.<apex>).
  6. Hard constraint: the device agent hits https://<apex>/api/v1/enroll/* + /api/v1/fleet/report with no browser (wiring_prod.go:150-165); /get pins IDSS_COMMUNITY_ORIGIN to the apex Host. These prefixes must keep proxying untouched.
  7. DDR 0172 built state: admin.<apex> IS gated on both paths and the OIDC round trip is real (IDIP drive proves it). Unbuilt: the CA-pinned app window (story 2 — the app hands the OS browser admin.<slug>.idss.internal:<port>, unresolvable off-harness), sign-out (no /authz/signout; chrome jumps to id.<apex>), signed-in label, DA-S3 frames.
  8. DA-S2's "Go to " door loops: production passes no RefusalBrand (main.go:1428) so the door is / on admin.<apex> → gate → refusal again (refusal.go:156-159). Fix = PortalURL: hostnames.Portal(apex).
  9. /mail at the apex is dead: WithMemberMail(…, nil) trusts the identity header the apex route strips (main.go:1487, frontdoor.go:570). #1342's rehomed claim inherits this.
  10. Harness: private-path drives already use admin.<apex>:<port> (provision.ts:79-87). Public-path journeys (droplet/idip/selfhosted/device + fixtures idip/provision/deviceProvision) read S12's portal-address and use it as the PANEL base — ~80 sites, one panelAddress fixture fixes them. Served bits: the dashboard bundle + control plane are seeded from the APP PAYLOAD (supply.go:214-258), the agent from get.idss.nz — a cutover drive needs a payload re-warm + reseed-publish.yml.
  11. Private path open question (#1341 c): a 308 to admin.<apex>{uri} rendered without the host-side forward port is unreachable; carry the port or skip the redirect on the private render.
  12. Minor: the kanidm invite link is host-less (invite.go:256) and will resolve under admin.<apex> once the roster lives there — mint it absolute on hostnames.Portal.

Not pushed; branch is in the agent worktree. Ready for #1341.

**Research landed** — branch `research/portal-apex-cutover`, commit `54048ed9` (not pushed): `docs/research/2026-09-08-portal-apex-cutover.md` — 24-row consumer table (today → post-cutover → change needed, every cell `path:line`), the exact redirect rule, per-path differences, 13 numbered gaps, and a touch-list for the spec. **Findings (≤25 lines):** 1. **The apex and `admin.<apex>` are the SAME host-blind control plane.** Caddy proxies both to loopback (`frontdoor.go:400-401`), the Go mux has no host matching (`dashboard.go:39`), the SPA picks its surface by path only (`main.ts:32-39`). The only difference is `forward_auth` on the admin route (`:445-475`); the apex route is ungated by design (`:557-575`, #512). The cutover = splitting one origin into two hosts with different owners. 2. **Consequence today: the operator API is open at the apex** — `/api/v1/members`, `/fleet`, `/provision/*` … have no in-handler auth; only IDIP steward/mail/logs/catalogue read a session. Ruling 7's "`/api/*` stays" must decide the apex API posture (allow-list + gate vs. wholesale) or the panel's data stays open after its pages move. **Gap 1, the one that matters.** 3. **Nothing on the public path composes the admin door.** `hostnames.Portal` has zero callers; `hostnames.Dashboard` is reached only via `DashboardReachable` on the private path (`seat.go:101`, `handoff.go:366`). S12 opens `https://<apex>` after the credential lands (`enrolment.go:336-341` ← `handoff.go:355`, `portalAddress` `:723-733`); Operator home's button falls back to `community.portalUrl`, which the seat never fills (`seatSource.ts:34-49`) — a no-op on the public path today. 4. **Redirect rule** = the closed tab list (`tabRouting.ts:17-27`): `/overview /fleet /services /members /backups /settings` (+ `/*` under each) → `308 https://admin.<apex>{uri}`, rendered in `renderPortalRoute` BEFORE the proxy, both renders. Portal-owned, never redirected: `/`, `/haere-mai/*`, `/idip/join/*`, `/mail`, `/authz/*`, `/get`, `/brand/*`, assets. **`/` is ALSO Overview's path** (`pathForTab` → `/`) — a root bookmark lands on the Portal by construction; the Portal's operator face needs a control-panel door. 5. **Real paths**: there is no `/join` (it is `/haere-mai/<token>` kanidm, `/idip/join/<token>` IDIP) and no `/.well-known` on the apex (that is `id.<apex>`). 6. **Hard constraint**: the device agent hits `https://<apex>/api/v1/enroll/*` + `/api/v1/fleet/report` with no browser (`wiring_prod.go:150-165`); `/get` pins `IDSS_COMMUNITY_ORIGIN` to the apex Host. These prefixes must keep proxying untouched. 7. **DDR 0172 built state**: `admin.<apex>` IS gated on both paths and the OIDC round trip is real (IDIP drive proves it). Unbuilt: the CA-pinned app window (story 2 — the app hands the OS browser `admin.<slug>.idss.internal:<port>`, unresolvable off-harness), sign-out (no `/authz/signout`; chrome jumps to `id.<apex>`), signed-in label, DA-S3 frames. 8. **DA-S2's "Go to <community>" door loops**: production passes no `RefusalBrand` (`main.go:1428`) so the door is `/` on `admin.<apex>` → gate → refusal again (`refusal.go:156-159`). Fix = `PortalURL: hostnames.Portal(apex)`. 9. **`/mail` at the apex is dead**: `WithMemberMail(…, nil)` trusts the identity header the apex route strips (`main.go:1487`, `frontdoor.go:570`). #1342's rehomed claim inherits this. 10. **Harness**: private-path drives already use `admin.<apex>:<port>` (`provision.ts:79-87`). Public-path journeys (droplet/idip/selfhosted/device + fixtures idip/provision/deviceProvision) read S12's `portal-address` and use it as the PANEL base — ~80 sites, one `panelAddress` fixture fixes them. Served bits: the dashboard bundle + control plane are seeded from the APP PAYLOAD (`supply.go:214-258`), the agent from get.idss.nz — a cutover drive needs a payload re-warm + `reseed-publish.yml`. 11. **Private path open question (#1341 c)**: a `308` to `admin.<apex>{uri}` rendered without the host-side forward port is unreachable; carry the port or skip the redirect on the private render. 12. Minor: the kanidm invite link is host-less (`invite.go:256`) and will resolve under `admin.<apex>` once the roster lives there — mint it absolute on `hostnames.Portal`. Not pushed; branch is in the agent worktree. Ready for #1341.
Author
Owner

Resolution

Findings on research/portal-apex-cutover @ 54048ed9 → docs/research/2026-09-08-portal-apex-cutover.md (land on main when reviewed). Gist:

  • The apex and admin.<apex> are the SAME host-blind control plane: Caddy proxies both to loopback, the Go mux has no host matching, the SPA picks its surface by path. The only difference is forward_auth on the admin route. The cutover splits one origin into two hosts with different owners.
  • The operator API is open at the apex today (/api/v1/members, /fleet, /provision/* have no in-handler auth). "/api/* stays" must decide the apex API posture (allow-list + gate vs wholesale) or the panel's data stays open after its pages move.
  • Nothing on the public path composes the admin door: hostnames.Portal has zero callers; S12 opens https://<apex>; Operator home's button falls back to a portalUrl the seat never fills (a no-op on the public path).
  • Redirect rule = the closed tab list /overview /fleet /services /members /backups /settings (+ subpaths) → 308 https://admin.<apex>{uri}, rendered in renderPortalRoute before the proxy. Portal-owned, never redirected: /, /haere-mai/*, /idip/join/*, /mail, /authz/*, /get, /brand/*, assets. / is ALSO Overview's path — a root bookmark lands on the Portal by construction.
  • Real paths: there is no /join (kanidm = /haere-mai/<token>, IDIP = /idip/join/<token>); no /.well-known on the apex.
  • Hard constraint: the device agent hits https://<apex>/api/v1/enroll/* + /api/v1/fleet/report browserless; /get pins the origin to the apex host — these prefixes keep proxying untouched.
  • DDR 0172 built state: admin.<apex> IS gated on both paths, OIDC round trip real. Unbuilt: the CA-pinned app window, sign-out, the signed-in label, the DA-S3 frames. DA-S2's "Go to " door loops (no RefusalBrand in production → / on admin.<apex> → gate → refusal) — filed as a defect.
  • Harness: private-path drives already use admin.<apex>:<port>; public-path journeys use S12's portal-address as the panel base (~80 sites, one panelAddress fixture fixes them). A cutover drive needs a payload re-warm + reseed-publish.yml.
  • Private-path open question for the cutover grill: a 308 to admin.<apex>{uri} without the host-side forward port is unreachable — carry the port or skip the redirect on the private render.
  • Minor: the kanidm invite link is host-less and will resolve under admin.<apex> once the roster lives there — mint it absolute on hostnames.Portal.

Unblocks the apex cutover grill.

## Resolution Findings on `research/portal-apex-cutover` @ `54048ed9` → `docs/research/2026-09-08-portal-apex-cutover.md` (land on main when reviewed). Gist: - **The apex and `admin.<apex>` are the SAME host-blind control plane**: Caddy proxies both to loopback, the Go mux has no host matching, the SPA picks its surface by path. The only difference is `forward_auth` on the admin route. The cutover splits one origin into two hosts with different owners. - **The operator API is open at the apex today** (`/api/v1/members`, `/fleet`, `/provision/*` have no in-handler auth). "`/api/*` stays" must decide the apex API posture (allow-list + gate vs wholesale) or the panel's data stays open after its pages move. - **Nothing on the public path composes the admin door**: `hostnames.Portal` has zero callers; S12 opens `https://<apex>`; Operator home's button falls back to a `portalUrl` the seat never fills (a no-op on the public path). - **Redirect rule** = the closed tab list `/overview /fleet /services /members /backups /settings` (+ subpaths) → `308 https://admin.<apex>{uri}`, rendered in `renderPortalRoute` before the proxy. Portal-owned, never redirected: `/`, `/haere-mai/*`, `/idip/join/*`, `/mail`, `/authz/*`, `/get`, `/brand/*`, assets. `/` is ALSO Overview's path — a root bookmark lands on the Portal by construction. - **Real paths**: there is no `/join` (kanidm = `/haere-mai/<token>`, IDIP = `/idip/join/<token>`); no `/.well-known` on the apex. - **Hard constraint**: the device agent hits `https://<apex>/api/v1/enroll/*` + `/api/v1/fleet/report` browserless; `/get` pins the origin to the apex host — these prefixes keep proxying untouched. - **DDR 0172 built state**: `admin.<apex>` IS gated on both paths, OIDC round trip real. Unbuilt: the CA-pinned app window, sign-out, the signed-in label, the DA-S3 frames. **DA-S2's "Go to <community>" door loops** (no `RefusalBrand` in production → `/` on `admin.<apex>` → gate → refusal) — filed as a defect. - **Harness**: private-path drives already use `admin.<apex>:<port>`; public-path journeys use S12's `portal-address` as the panel base (~80 sites, one `panelAddress` fixture fixes them). A cutover drive needs a payload re-warm + `reseed-publish.yml`. - **Private-path open question** for the cutover grill: a `308` to `admin.<apex>{uri}` without the host-side forward port is unreachable — carry the port or skip the redirect on the private render. - Minor: the kanidm invite link is host-less and will resolve under `admin.<apex>` once the roster lives there — mint it absolute on `hostnames.Portal`. Unblocks the apex cutover grill.
ben closed this issue 2026-09-09 04:17:23 +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#1338
No description provided.