Repository navigation
Close the snapshot-signing follow-ups from #24 - #25
Merged
Merged
Conversation
The installer's missing-flag warning read only a preserved base unit, so a drop-in that supplied the flag got a false "will not start" warning, and a drop-in that overrode ExecStart without it went unnoticed, even on a freshly installed unit. It now checks the last ExecStart across the unit and its drop-ins, for both units on every install. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…ow key-command errors Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
The drop-in check took an ExecStart from any section, sorted drop-ins by the caller's locale, and joined continued lines without the space systemd inserts, so each could hide a missing flag. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…tation Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
9 tasks done
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
This closes the follow-ups parked in #24, the snapshot-signing PR, plus two more problems the final review of this branch found.
Changes
Installer drop-in check. The missing-flag warning now reads the ExecStart systemd actually runs. That is the last
ExecStart=in[Service]across the unit and<unit>.d/*.conf, with:=allowedBoth units are checked on every install, not only when a customized unit is kept.
/run, vendor,service.d/and prefix drop-ins are not read; ashortcut:comment says so.mecfeed-serve.
current,snapshot.jsonandsnapshot.sigopen withO_NOFOLLOW | O_NONBLOCK, and then must be regular files, checked on the open fd. A FIFO no longer hangs a blocking thread, and the symlink check-then-open race is gone.libcwas already in the lockfile and is now a direct dependency.Installer root writes.
/etc/mecfeedmcpmust not be group- or other-writable, and in a live install it must be root-owned. This is checked (shared with/etc/mecfeed-serve) before root writesfeed.json.exampleor fixesaudit-hmac.key.tokens.jsonis now created by the service user, because root'sinstallchmods by name inside the service-owned state dir.Installer errors. It no longer discards stderr from
--print-snapshot-signing-public-key, so a bad key shows its reason. The key id line now appears in normal output.CI. The re-init check passes only if init fails with
already existsand the key's hash is unchanged.Docs.
docs/operations.mdgains "Rotation (Docker)". It recreates serve rather than restarting it, re-passes--listenand every--allow-cidr, and installs the new key as 65532 with mode 0600.Verification
New tests fail on the old code.
2>/dev/nullrestored, the key-id assertion and the malformed-key assertion fail.mawk. I ran the ExecStart parser under mawk (Debian's awk) on the disposable test LXC.
Live upgrade on the disposable test LXC, as real root:
/etc/mecfeedmcpisroot:mecfeedmcp 0750,tokens.jsonismecfeedmcp 0600, and the.pubisroot 06440600, also under a private 0700TMPDIRThe live probe caught a bug in an earlier version that no staged test could. That version used
runuser install /dev/stdin, and the service user cannot reopen a pipe root created.Each commit had a task review and a Codex gate (
codex exec review --commit), and the branch had a whole-branch review.Checklist
cargo fmt --all -- --checkpassescargo clippy --workspace --all-targets --all-features --locked -- -D warningspassescargo build --workspace --lockedandcargo test --workspace --lockedpasscargo audit --deny warningsandcargo deny check licenses bans sourcesare cleanmecfeed-servesnapshot serving. The reader now refuses non-regular files, including FIFOs and devices, and symlinks atomically. It fails closed with the same 503, and nothing on the publish side changes.Anything you're unsure about
/run, vendor,service.d/and prefix drop-ins, the upgrade path issystemctl show -P ExecStart.install.shreads only the base unit forIPAddressDeny, so a drop-in that clears it still reports ENFORCED. This predates this branch and is not fixed here, so it needs a follow-up.currentlogs the OS error. It now logsToo many levels of symbolic linksinstead ofcurrent is a symlink. This is cosmetic.load.verify-packagingallowsCommand::new("mkfifo")only in*_test.rs, andunsafeis forbidden.🤖 Generated with Claude Code