Repository navigation
Description
What's the problem
Flipping dashboard.mode is an apply-time config change that recreates the dashboard and caddy containers, but lib/pithead/39-describe-change.sh has no row for it — operators apply a mode switch blind, unlike every other dashboard surface (login, control, onion, update-check all describe themselves with their container effects). There is also no guard: an appliance can be set to dashboard.mode=api with dashboard.control.enabled unset (default off), which removes the UI, keeps no control channel and — until #3895's machine credentials land — leaves no credential of any kind: the appliance has no shell, so the operator is locked out with a config that validated cleanly.
What it impacts
Every operator switching modes on appliance or DIY; pithead apply's preview contract (#3974 acceptance: the switch "appears in the describe-change preview, names the containers recreated (dashboard, caddy) and takes effect on apply, never live").
How I found it
Grepped 39-describe-change.sh for mode — no hit, while sibling dashboard keys (login line, control line, onion line) each describe their recreate set; read the validation slice 28-parse-and-validate-config.sh where DASHBOARD_MODE is validated (lines 368-371) and where the onion/control lockout refusals already live as the precedent for a lockout guard.
How important is it
Medium. #3974 acceptance criterion. Blind mode switches plus a silent lockout path on an appliance with no shell is how operators end up reinstalling.
Acceptance criteria
- describe-change prints a row for each of the six dashboard.mode transitions, naming what stops or starts serving and the recreated containers (dashboard and caddy), in the house style of the existing dashboard lines; a tests/stack case pins at least both directions with the container names.
- Validation: dashboard.mode=api with dashboard.control.enabled false on an appliance (is_appliance) errors with an actionable message (enable the control channel, or ship machine credentials once those exist); on DIY the same config passes with a loud warning naming the lockout risk.
- mode=api with control enabled, and modes dashboard/both, validate and render unchanged.
- Tiers 1–3 are the proof row (shell suites); the PR body names it.
Possible solutions
- Add the key to the describe-change case chain beside the other dashboard keys, reusing their message/recreate idiom.
- Put the guard in the validation slice beside the onion-without-password and control-without-password refusals; default is refuse on appliance, warn on DIY (the issue allows "refused or loudly warned"; fail-closed matches the neighbouring refusals, and Add dashboard login sessions with admin and viewer roles #3895's machine credentials will widen the accepted condition when they merge).
Parent: #3974
Worker brief: Test tier: tier1 tests/stack shell suite (tiers 1–3 are the proof row; no rendering changes, so no tier4 job needed — say so in the PR body).
Objective: make a dashboard.mode switch visible in the apply preview and impossible to lock out an appliance with. Files expected: lib/pithead/39-describe-change.sh (new case beside the other dashboard keys — copy the msg= idiom, name the dashboard and caddy recreate) and lib/pithead/28-parse-and-validate-config.sh (guard beside the existing lockout refusals: api + control off + is_appliance → error; api + control off + DIY → warn; do not touch the already-pinned value validation).
Tests: extend the describe-change suite idiom used by the existing dashboard-key lines (find how they are asserted in tests/stack) with both switch directions; a validation test pinning refuse-on-appliance, warn-on-DIY, and clean pass for api+control and for dashboard/both. RED without the change. No route or Caddyfile changes (separate issue), no credentials.
Activity
pithead-architect commentedon Nov 27, 2026
Release regroom (owner request, 2026-11-27): moved from v2.1.0 to v2.1.3. Headless-dashboard and system-info UI chain depends on the login work in 2.1.0; second UI chunk.
dashboard.mode preview: say only what apply does (dashboard recreated…
pithead-developer commentedon Dec 4, 2026
Blocked on #4644. The only red checks on PR #4682 are
Build image (dashboard)andBuild image (tor), both in the Trivy scan of the digest-pinned base images.Build image (dashboard)fails on libzstd1 CVE-2026-124851 in the Debian base, tracked by #4644.Build image (tor)fails on busybox CVE-2026-140044 in the Alpine base, tracked by #4676. Both have fixes available, and the fix is a bump of the pinned base image. This PR changes neither Dockerfile, and the base branch tip has not moved, so new advisories alone turned the checks red. Everything else is green on head: shell suite blocks 1 to 5, shell lint and the standalone suites. The work is finished and the blocker is explained in a PR comment. It clears when #4644 and #4676 land on the 2.0.5 line and reach develop-v2.1.0 by forward merge, which is operator work. After that, bring the base in, push and re-check. I did not bump the pins in this PR, because that would mix an unrelated change into #4539.The runner resumes this issue when that one closes.