Repository navigation
fix(setup): staged secret files carry install-time credentials through apk (#888) - #894
Amperstrand wants to merge 3 commits into
Conversation
…entials through apk — the environment channel does not survive apk-tools (#888) operator_chosen_admin_password and the private-WiFi key now fall back to consumed-on-read, mode-600-enforced secret files (/tmp/tollgate-admin-password, /tmp/tollgate-wifi-key) when the environment is absent: apk-tools on 25.12 does not deliver the installer's environment to package scripts (verified end-to-end on the vlab lane — hash-mismatch proof plus a manual sh -x run that honors the env), so the documented env-only UX silently degraded to the provisional path. Files are unlinked on first read (a stale file can never re-apply an old password on a later boot) and a world-readable staging is refused and removed. The env channel stays for manual re-runs.
…add credentials-consumed check; env mode kept as #888's living demonstration
…pplet is absent on real router images (25.12.5 x86 verified), which refused every staging
|
Nominated to the v0.6.0 release scope (#909). If the scope holds, this is on the critical path for final — review priority requested. Deferred PRs: no action needed; the scope issue lists you for 0.6.1+. |
|
Closing as superseded — the content was absorbed and then superseded by design on main: #897 took the staged-secret file channel (including this PR's |
…add credentials-consumed check; env mode kept as #888's living demonstration
What
99-tollgate-setupgains the apk-reliable delivery channel for the operator-chosen credentials: when the environment is absent (which, per #888, is ALWAYS the case underapk addon 25.12 — apk-tools does not hand the installer's environment to package scripts),operator_chosen_admin_password()and the private-WiFi key reader fall back to root-only staged secret files, consumed on first read:Properties: mode-600 enforced (a world-readable staging is refused, logged, and removed — the value never sits on a world-readable path); unlinked on first read so a stale file can never re-apply an old password on a later boot; never echoed; env channel unchanged for manual re-runs (
TOLLGATE_ADMIN_PASSWORD=… /etc/uci-defaults/99-tollgate-setup— proven working undersh -xin #888's evidence).Verification
sh -nclean;tests/packaging/uci-defaults-run-order_test.sh8/8;tests/packaging/admin-board-requires-credential_test.sh78/4 — the 4 failures are identical on pristine main (that suite still expects the pre-fix(setup): never print generated credentials; add TOLLGATE_PRIVATE_WIFI_PASSWORD #850 print-the-credential contract; separate follow-up, not widened here).contract:credential-appliedgoes green (sha256crypt match against the staged value),contract:credentials-consumedgreen (both files unlinked post-install), no-plaintext green. Run output attached to installer: TOLLGATE_ADMIN_PASSWORD / TOLLGATE_PRIVATE_WIFI_PASSWORD never reach the uci-defaults script underapk addon 25.12 — the documented install-time credential UX is broken #888.Fixes #888 (file channel restores the documented install-time choice; the env channel's apk loss stays documented in the issue as an apk-tools behavior).