Skip to content

fix(setup): staged secret files carry install-time credentials through apk (#888) - #894

Closed
Amperstrand wants to merge 3 commits into
mainfrom
fix/installer-credential-channel
Closed

Amperstrand wants to merge 3 commits into
mainfrom
fix/installer-credential-channel

Conversation

@Amperstrand

Copy link
Copy Markdown
Collaborator

What

99-tollgate-setup gains the apk-reliable delivery channel for the operator-chosen credentials: when the environment is absent (which, per #888, is ALWAYS the case under apk add on 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:

printf '%s' 'my-password' > /tmp/tollgate-admin-password
printf '%s' 'my-wifi-key'   > /tmp/tollgate-wifi-key
chmod 600 /tmp/tollgate-admin-password /tmp/tollgate-wifi-key
apk add --allow-untrusted /tmp/tollgate-wrt.apk

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 under sh -x in #888's evidence).

Verification

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).

…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.
Amperstrand pushed a commit that referenced this pull request Oct 11, 2026
…add credentials-consumed check; env mode kept as #888's living demonstration
wave2a-trial added 2 commits October 11, 2026 19:19
@Amperstrand

Copy link
Copy Markdown
Collaborator Author

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+.

@Amperstrand

Copy link
Copy Markdown
Collaborator Author

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 find -perm mode gate — the busybox-stat refusal bug this PR found and fixed did not ship), and #902+#907 then removed the package's credential-setting entirely ('the package never sets a credential') in favor of the preinst refusing passwordless installs. The end-to-end evidence trail this PR built (vlab lane runs, the apk-tools env-loss proof, the stat-applet finding) stands in #888 and carries into the lane's rc3 semantics (#892). Nothing unique remains unlanded.

Amperstrand pushed a commit that referenced this pull request Oct 12, 2026
…add credentials-consumed check; env mode kept as #888's living demonstration
@Amperstrand
Amperstrand deleted the fix/installer-credential-channel branch October 17, 2026 18:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

1 participant