feat/hostname-helper-and-selfcheck #94

Merged
clawdie merged 2 commits from feat/hostname-helper-and-selfcheck into main 2026-11-21 19:14:04 +01:00
Owner
No description provided.
feat(live): add hostname derivation/rename helpers and honest hostname selfcheck (PR A)
All checks were successful
format-check / gates (pull_request) Successful in 2m34s
525e2db169
Implements PR A of the Eva/Helix ask-once, derive-defaults, store-separately
naming model (Option 4: keep ZFS pool foundations clawdielive/clawdie/existing
and identify pools by GUID on recovery):

- live/operator-session/clawdie-name-derive: shared accent-folding slug and
  RFC-1123 hostname helper deriving <slug>-usb.clawdie.home.arpa (USB) and
  <slug>.clawdie.home.arpa (installed disk) with POSIX fallback.
- live/operator-session/clawdie-set-hostname: root-owned, RFC-1123-validated
  hostname updater (zero eval, no --root CLI flag, refuses symlinks, writes
  /etc/rc.conf and /etc/hosts loopback atomically, updates live hostname(1),
  never touches /etc/machine-id), paired with narrow 'as root' doas.conf
  grants in both build.sh and firstboot/shell-system.sh.
- build.sh: installs clawdie-name-derive and clawdie-set-hostname and seeds
  managed loopback entries (usb.clawdie.home.arpa usb clawdie-live) in /etc/hosts.
- firstboot/retarget-be.sh: validates TARGET_HOSTNAME (RFC-1123) and syncs
  /etc/hosts loopback while stripping stale USB live aliases (respecting DRY_RUN).
- live/operator-session/clawdie-live-selfcheck: replaces the hardcoded
  usb.clawdie.home.arpa check with saved rc.conf RFC-1123 validation, /etc/hosts
  127.0.0.1 + ::1 loopback verification, and live kernel hostname parity.
- Added tests/clawdie-hostname-helper-test.sh (wired into scripts/ci-checks.sh),
  extended selfcheck/retarget/doas tests, and verified doas -C live on
  FreeBSD 15.1-RELEASE-p7 (81/81 pass).
- F1/F5/F8 (clawdie-name-derive): removed lossy/locale-dependent shell fallback
  (fails closed when python3 is absent), pinned domain to clawdie.home.arpa
  matching clawdie-set-hostname, and updated header comment.
- F2 (retarget-be.sh): hoisted TARGET_HOSTNAME RFC-1123 (LC_ALL=C) and hosts
  symlink validation before step 1 so invalid hostnames fail closed with zero
  partial BE mutation.
- F3 (clawdie-hostname-helper-test.sh): replaced set -e bare assertions with
  set -u + explicit if/ok/bad helpers so failures always print diagnostics and
  RESULT summary; added Straße/Črt and python3-absent fail-closed checks.
- F4 (clawdie-live-selfcheck + validate-live-image.sh): added --only hostname
  subcheck and wired it into validate-live-image.sh (plus staged helper checks)
  so broken loopback/hostname contracts fail at build time, not at boot.
- F6 (clawdie-set-hostname): documented CLAWDIE_SET_HOSTNAME_KEEP_LIVE_ALIAS
  in usage().
- F7 (doas-policy-test.sh): added explicit guard forbidding keepenv in doas.conf
  so env-only test hooks remain stripped under doas.
clawdie deleted branch feat/hostname-helper-and-selfcheck 2026-11-21 19:14:04 +01:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
clawdie/clawdie-iso!94
No description provided.