Repository navigation
Description
What's the problem
Part of #4464. DIY users cannot choose between the browser wizard and the terminal at setup. The CLI three-question change (#3577, PR #4465) deliberately held the interface-choice prompt back so no dead option ships; #4464's ruling is that DIY must be as easy as the appliance. This chunk adds the choice to ./pithead setup on a tty and the DIY browser leg behind it: one URL and a one-time setup token printed, the wizard endpoint rejecting requests without the token, and a terminal fallback that prints the reason when the browser leg cannot be served.
What it impacts
Every new DIY user, ./pithead setup, the pinned prompt list in tests/stack/test-wizard-setup.sh, the pithead-wizard container path, and the docs line that describes the setup prompts. The appliance first boot is unchanged; existing installs are asked nothing.
How I found it
Carried from #3577 to #4464 by the owner. Today on develop-v2.1.0: firstboot_wizard() (lib/pithead/12-firstboot-wizard.sh) is the only entry to wizard_start_page() (lib/pithead/12a-wizard-page.sh); the wizard server already has a one-time token gate with 403 rejection (_authed/auth in dashboard/mining_dashboard/wizard/server.py); ensure_config_exists() already refuses non-interactive (lib/pithead/24-config-wizard.sh); the pinned list is still the old read-count pins on develop-v2.1.0 because PR #4465 has not merged (draft, CONFLICTING, as of 2026-11-26).
How important is it
High: it is the #3557 ruling that DIY must be as easy as the appliance; it is the user-visible half of #4464.
Acceptance criteria
- Prereqs stated in-body, not in this issue's face: the spike sibling's decisions (image source, TLS, port, engine gating) bind this work, and Ask three questions at setup on the CLI and in the browser wizard #3577 (PR setup: fix #3577, #3707 — three CLI questions and the donation route in the profiles #4465) must merge first — it rewrites the same wizard prompts and the pinned list; do not preempt it.
- Tier-1 (stubbed container engine): on a tty
./pithead setupoffers the interface choice;--cliand no tty skip it; if the browser leg cannot be served (no engine, no image, port taken, per the spike) it falls back to the terminal and prints the reason. - Tier-1 (stubbed container engine): the browser leg prints exactly one URL and a one-time setup token; the wizard endpoint rejects a request without the token (dashboard/tests/web pytest beside the existing token-gate tests).
- The interface choice joins the pinned ordered prompt list in tests/stack/test-wizard-setup.sh ahead of the three questions (interface choice, Monero wallet, Tari wallet, profile; consents listed separately); adding any prompt fails the test.
- tier4-e2e
targetedon the head, base develop-v2.1.0, proving the wizard container starts on DIY (this change starts a container); quote its evidence block unedited. - Docs describing the setup prompts (getting-started.md DIY section, help text) corrected in the same change; the full single-path rewrite is the docs sibling.
- No new explanatory code comments. Prefer a flag/path on the existing
setupverb; if a new verb is introduced it gets the full registration (completion, CVL, ROV, strategy-doc ledger row).
Possible solutions
- Reuse
wizard_start_page()from a new DIY entry (a sibling to the 12a slice), gated per the spike's engine/image/port decision, terminal as fallback. - A short-lived container started by
setuponly after dependencies and the image are present; fall back to the terminal otherwise.
Parent: #4464
Worker brief: Test tier: tier 1 (tests/stack with a stubbed engine, dashboard/tests/web pytest) plus tier4-e2e targeted on the head (this starts a container; --base develop-v2.1.0; quote the evidence block). Wait for PR #4465 (#3577) to merge before touching lib/pithead/24-config-wizard.sh or the pinned list in tests/stack/test-wizard-setup.sh, and take the image/TLS/port/engine gating decisions from the spike child of #4464. Add the interface choice to ./pithead setup on a tty (--cli and no tty skip it), serve the token-gated wizard to DIY (one URL + one-time token printed; endpoint rejects a request without the token; reuse wizard_start_page / the 12a machinery and the existing WIZARD_TOKEN gate in dashboard/mining_dashboard/wizard/server.py), and fall back to the terminal with the reason printed when the browser leg cannot be served. The interface choice leads the pinned ordered prompt list. Correct the docs lines your change makes stale. No new explanatory comments; new verbs need full registration.
Activity