Repository navigation
Description
What's the problem
Part of #3557, split from #3577. ./pithead setup now asks three questions on the CLI (Monero wallet, Tari wallet, profile), but DIY users still cannot choose between the browser wizard and the terminal at setup. The browser wizard exists only for the appliance first boot (firstboot_wizard in lib/pithead/12-firstboot-wizard.sh, token-gated, served from the dashboard image in a pithead-wizard container). Four facts must be settled in a spike before the DIY browser leg can be built:
- Whether the dashboard image exists when
setupstarts on DIY. - How the wizard page gets TLS on a non-appliance host (the appliance mints it via
26-appliance-tls-provisioning.sh). - Which port the page uses on shared hosts (
dashboard.portexists for co-hosting). - Whether a container engine is present before dependencies are installed.
What it impacts
Every new DIY user who prefers the browser to the terminal, ./pithead setup, docs/getting-started.md, and the tests that pin the setup prompts. Existing installs are not asked anything. The appliance first boot is unchanged.
How I found it
Split out of #3577 by the owner's ruling on that issue: its PR ships the CLI side and holds the interface-choice prompt back so no dead option ships. The four unknowns above are copied from #3577's "How I found it". Nothing here has been run.
How important is it
High: "DIY must be as easy as the appliance" (ruling 1 on #3577) depends on it. It follows the CLI three-question change and does not block it.
Acceptance criteria
- Tier-1 (stubbed container engine): on a tty
./pithead setupoffers the choice;--cliand no tty skip it (asensure_config_existsrefuses non-interactive today,24-config-wizard.sh:18-20); if the browser leg cannot be served it falls back to the terminal and prints the reason. - Tier-1 (stubbed container engine): the browser leg prints one URL and a one-time setup token, and the wizard endpoint rejects a request without the token.
- The interface choice joins the pinned ordered prompt list in
tests/stack/test-wizard-setup.sh(interface choice, Monero wallet, Tari wallet, profile; consents listed separately), so adding any prompt fails the test. - A spike PR (or a documented decision in this issue) settles the four unknowns above before the browser leg is built.
docs/getting-started.mdbecomes the single path from deployment choice to first accepted share (closes Guide new users from deployment choice to their first accepted mining work #3182); this line is carried here because Ask three questions at setup on the CLI and in the browser wizard #3577's PR does not complete it.- No new explanatory code comments.
Possible solutions
- Reuse
firstboot_wizardfor DIY behind the choice prompt, with the spike deciding image and TLS handling. - Browser wizard served by a short-lived container started by
setuponly after dependencies and the image are present; fall back to the terminal otherwise. - One shared builder (Python, called from bash) so the CLI stops carrying its own jq assembly; larger change, removes the parity risk. Otherwise keep three builders and rely on the parity test (
tests/stack/fixtures/wizard-parity/three-answers.golden.json).
Activity
pithead-architect commentedon Nov 27, 2026
A local session judged this too big for one local session (Too big for one local session: #4464 carries a spike, a wizard-behavior change, a container-serving browser leg and a docs completion, and its build leg sits on the three-question rewrite PR #4465 (#3577) that is still an open CONFLICTING draft. I read the issue, #3557, #3577 (incl. #4465's body and). The runner filed 3 chunks as sub-issues and marked this issue a tracker, so it is not picked again:
pithead-developer commentedon Dec 4, 2026
Decision: DIY browser wizard (spike #4548, parent #4464)
Read at develop-v2.1.0
190234b0. Reading settled all four unknowns, so no bench job was submitted and nothing changed in the repo.The four answers
Dashboard image at
setupstart on DIY: absent.setup_confirmed(lib/pithead/38-setup-command.sh:20-60) callsload_baked_imagesonly whenis_appliance(:23), andis_applianceneeds the RAUC config andpithead-install(10-installer-preseed.sh:165-170). The archive load in11-baked-images.sh:33is never reached on DIY.export_build_provenance(19-small-utilities.sh:147-157). A source checkout getspithead-dashboard:dev, built by compose. A release bundle gets:vX.Y.Z, pulled from the registry.provision_toronly brings uptor(32-onion-provisioning.sh:20,--pullpolicy fromresolve_pull_policy,01-lifecycle.sh:53-59). The dashboard comes up instack_up, afterprompt_start_stack(38-setup-command.sh:60).verify_release_images,03-release-verify.sh:93, called fromstack_up01-lifecycle.sh:228). The browser leg must not pull the dashboard image outside that path.TLS on a non-appliance host: the mint code already works there.
stage_wizard_spool→wizard_mint_cert→appliance_mint_cert(11a-wizard-spool.sh:178,26-appliance-tls-provisioning.sh:292,320) needs onlyopenssl. It writes a self-signed RSA-2048 pair underappliance_tls_dir($PWD/data/tls,:44) and copies it into the spool.appliance_site_names(:86). On DIY,is_applianceis false, so it holds only$HOST_IPorhostname(:60-68). Thehostname -Iaddress expansion (:90-97) and the<host>.localname run only on the appliance. A DIY cert therefore does not cover the LAN IP or mDNS name the operator types.dashboard/mining_dashboard/wizard/server.py:642-650). Otherwise it serves plain HTTP, so a failed mint silently drops TLS. The existing banner already prints the right scheme (12a-wizard-addresses.sh:35-48).Port on a shared host: the wizard's 80/443 publish is hard-coded and
dashboard.portdoes not apply.wizard_start_pagepublishes-p 80:8000 -p 443:8443(12a-wizard-page.sh:9). If either is taken,runfails anderrorstops setup (:14-18), so there is no fallback today.dashboard.portisHOST_PORT, read inparse_and_validate_config(28-parse-and-validate-config.sh:284) and used only to render Caddy's site address (35-caddyfile-and-auth-helpers.sh:88-100). No config exists yet when the browser leg would start, because the wizard is what writes it (ensure_config_exists,38-setup-command.sh:25). So the setup page cannot honordashboard.port.server.py:21-22) and the host side of each publish is free to change.Engine before dependency install: not guaranteed.
check_prerequisites(38-setup-command.sh:24,23-setup-and-credentials.sh:36-94) is where docker is detected, offered through apt, and then proven reachable (docker info,:89).container_engine(05-doctor-checks.sh:54-66) returnsdockerwhen nothing is installed, so its answer is not evidence that an engine exists.--skip-depsskips all of this (:37-40).Design decision
setup. Callstage_wizard_spool,wizard_start_pageand the spool-consume loop, because they already do the token gate, the TLS fallback and the host-side validation. Starting a second container would duplicate that trust shape. Reuse needs three DIY adjustments:wizard_start_pagetakes the host ports as parameters instead of the fixed 80/443.wizard_host_addressesneeds a path that does not depend onagettyand/run/issue.d(12a-wizard-addresses.sh). Those are console-only, and on DIY the URL and token go to the terminal.restore_submission_dirdefaults to/run/pithead-restore-submit(09a-restore-volatile.sh:8).check_prerequisitesand beforeensure_config_exists, so between38-setup-command.sh:24and:25. The engine is proven there, and nothing has been written yet.--skip-deps, run"$(container_engine)" infofirst and fall back to the terminal if it fails.[ ! -t 0 ]): terminal path only. The browser option is never offered.stack_upwould use.docker compose build dashboard, or fall back to the terminal ifdocker image inspect pithead-dashboard:devis missing and the build fails.verify_release_images. If the pull or the verify fails, fall back to the terminal with the reason.server.py:645-648).12-firstboot-wizard.sh:104).run, not by parsing the engine's error.dashboard.portis already set in an existingconfig.json(re-run), prefer it as the first candidate. A fresh DIY has no value to read.ensure_config_exists) at the same point, with no state left behind (pithead-wizardcontainer removed, spool cleared).What is not settled by reading
Whether a DIY host's real LAN addresses all reach the container through the engine's port publish, and rootless Docker or podman edge cases. The first browser-leg PR should prove these with a
tier4-e2etargeted job.pithead-developer commentedon Dec 4, 2026
Carry-forward for the first browser-leg PR (from spike #4548)
The operator accepted the spike decision above. Two items were not settled by reading and the first browser-leg PR must prove both:
That PR touches the wizard, setup and port-publish paths, so it needs a
tier4-e2ejob on its head, targeted at those paths. The terminal path stays as it is: any browser-leg failure falls back to it with a stated reason.