Skip to content

feat: first-run setup wizard and WAN detection - #139

Merged
Cd1s merged 21 commits into
mainfrom
feat/first-run-wizard
Oct 17, 2026
Merged

Cd1s merged 21 commits into
mainfrom
feat/first-run-wizard

Conversation

@Cd1s

@Cd1s Cd1s commented Oct 17, 2026 •

Copy link
Copy Markdown
Owner

What

  • Add the first-run setup wizard for factory images and Alpine installs, including browser timezone guidance, WAN protocol detection, LAN conflict handling, WiFi setup, and the normal plan/apply/confirm flow.
  • Add mr wan detect and POST net.wan_detect with bounded PPPoE, DHCP OFFER, and IPv6 RA probing.
  • Add first-run markers for new or erased writable storage and GET wifi.defaults for factory radios.
  • Improve the wizard for non-expert users: no raw JSON preview, readable WAN results, required first-run passwords, shared WiFi-name control, optional regulatory region selection, and no literal null placeholders.

Why

Fresh AX6000 images start with no WiFi radios and no administrator password, while deferred Alpine installs previously left Alpine networking services competing with the router. New users need one guided flow that detects the upstream connection, avoids LAN overlap, enables WiFi, and applies changes through the existing rollback safety window.

The first-run marker is the authoritative wizard signal. A factory marker remains pending after the initial password is set so the user continues into the wizard; old overlays without a marker do not re-enter it after an upgrade. install.sh writes the marker only for MR_APPLY=0; an install that already asked for WAN/password and applied with MR_APPLY=1 goes directly to the overview. Disabling WiFi in the wizard removes its radios and country from the pending configuration, restoring them if WiFi is enabled again.

Verification

  • cd mr && go vet ./... && go test ./...
  • sh tools/ci.sh — ALL CHECKS PASSED
  • GitHub Actions installs ppp and pppoe for the real WAN-detect integration test.
  • Static CI assertion verifies install.sh writes first-run only inside the MR_APPLY=0 branch.
  • Chinese 360px mock screenshots cover all five steps, PPPoE detection, DHCP/upstream conflict, and LAN conflict guidance: runs/2026-10-17-minirouter/a4-wizard-shots.tgz
  • Firmware logs: runs/2026-10-17-minirouter/pr139-build.log and runs/2026-10-17-minirouter/pr139-selftest.log
  • WAN fixture cleanup verified: no pppoe-server -I pps or detect dnsmasq processes remain after CI.

Related to #86

@Cd1s

Cd1s commented Oct 17, 2026

Copy link
Copy Markdown
Owner Author

Validation

  • Fixed P3b first-run marker handling: provisioned .firstboot no longer creates a marker; markers are created only for fresh or factory-reset rootfs_data.
  • Added server-side upgrade safety: an existing accepted generation plus administrator password suppresses stale markers, while a factory marker without a password still enters first setup.
  • Prevented unknown WAN detection recommendations from being written to router configuration.
  • Added/updated selftest coverage for P1, P3b, P4, and P6 first-run state.

Evidence:

  • Build log: runs/2026-10-17-minirouter/pr139-build.log
  • Selftest log: runs/2026-10-17-minirouter/pr139-selftest.log
  • Firmware selftest: P1 ok, P2 ok, P3 ok, P3b ok, P4 ok, P5 ok, P5b ok, P6 ok, P7 ok, P8 ok; all self-tests passed.
  • go vet ./... and go test ./...: passed.
  • sh tools/ci.sh: ALL CHECKS PASSED.
  • Final commit: 74323a8.

@Cd1s

Cd1s commented Oct 17, 2026

Copy link
Copy Markdown
Owner Author

Final-head verification (2a8e57f):

  • go vet ./... and go test ./...: passed.
  • sh tools/ci.sh: ALL CHECKS PASSED.
  • Rebuilt m3 image: BUILD_EXIT:0.
  • Re-ran firmware selftest: P1, P2, P3, P3b, P4, P5, P5b, P6, P7, P8 all ok; all self-tests passed.
  • Logs (updated in place): runs/2026-10-17-minirouter/pr139-build.log and runs/2026-10-17-minirouter/pr139-selftest.log.

@Cd1s

Cd1s commented Oct 17, 2026

Copy link
Copy Markdown
Owner Author

Final head 2c6ac15 is pushed. The last full local CI run passed (ALL CHECKS PASSED), including the real PPPoE/dnsmasq WAN-detect integration after adding dnsmasq readiness synchronization. The final m3 rebuild returned BUILD_EXIT:0; final firmware selftest reports P1, P2, P3, P3b, P4, P5, P5b, P6, P7, P8 all ok and all self-tests passed.

Updated evidence:

  • runs/2026-10-17-minirouter/pr139-build.log
  • runs/2026-10-17-minirouter/pr139-selftest.log

@Cd1s

Cd1s commented Oct 17, 2026

Copy link
Copy Markdown
Owner Author

Merged origin/main into the wizard branch with a regular merge commit f7d4319 (no rebase/force push).

Conflict resolution:

  • tools/ci.d/net.sh: retained the wizard branch's PPPoE/DHCP detect namespaces and dnsmasq readiness wait, plus main's modem/macvlan namespace cleanup.
  • apply.go, hooks.go, mod_net*.go, api.go, and mr-preinit merged cleanly; both service restart filtering, gateway /32/proxy-ARP/DNS6/lan6 handling, REMOTE_ADDR normalization, and first-run/firstboot behavior are present.

Verification after merge:

  • go vet ./... and go test ./...: passed.
  • sh tools/ci.sh: ALL CHECKS PASSED.
  • m3 rebuild: BUILD_EXIT:0.
  • selftest: P1, P2, P3, P3b, P4, P5, P5b, P6, P7, P8 all ok; all self-tests passed.
  • Logs updated: runs/2026-10-17-minirouter/pr139-build.log and runs/2026-10-17-minirouter/pr139-selftest.log.

@Cd1s

Cd1s commented Oct 17, 2026

Copy link
Copy Markdown
Owner Author

Final N1 regression test update is pushed at ccdf52f: the test now models factory-done plus administrator password, render-produced gen/applied.yaml, and an empty history directory, and confirms session.wizard remains pending via firstRunPending().

Final verification:

  • Local go vet ./... and go test ./...: passed.
  • Local sh tools/ci.sh: ALL CHECKS PASSED.
  • WAN fixture cleanup: pgrep -af '[p]ppoe-server -I pps' and detect dnsmasq process scan are empty after CI.
  • GitHub checks for ccdf52f: both passed.
  • No mr-preinit or build/m3 files changed in this remediation, so the previously uploaded green firmware selftest logs remain applicable.

@Cd1s
Cd1s merged commit 84146da into main Oct 17, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant