fix(enroll): tenth audit — nix build PIPESTATUS, nginx HEALTHY, harmonia diag, preflight host dir, sed post-verify#182
Merged
Conversation
…nia diag, preflight host dir, sed post-verify
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
CLOSURE=$(nix build ... | head -1): withset -euo pipefail, a failed build firesset -ebefore thediewith BUILD_LOG path runs. Fixed withset +e/PIPESTATUS[0]/set -e, matching the nixos-rebuild steps pattern.elsebranch meantHEALTHYstayed 1 and the entire minisig verification block silently skipped. AddedelsewithHEALTHY=0and diagnostic commands.KATELLO_PG_PASSWORDsed was not post-verified (onlyFOREMAN_ADMIN_PASSWORDwas). Added matchinggrep -qguard.journalctlandsystemctl starthints.else, leading to misleading "minisig not yet at..." message. Added explicitelsewithHEALTHY=0.CURRENT_GENempty from failedreadlink: both divergence branches silently skipped. Added explicit empty-string warn branch.hosts/${HOST}/exists. A badSOURCEOS_HOSToverride now fails at step 0 with available-hosts list, not a cryptic Nix eval error in step 2.Test plan
bash -n scripts/enroll.sh— syntax cleanSOURCEOS_HOST=bogus→ preflight dies with available hosts listednix buildfailure → die shows exit code and BUILD_LOG pathHEALTHY=0, minisig block skipped, clear diagnosticHEALTHY=0, journalctl hint shownKATELLO_PG_PASSWORDguard fires