fix(deploy): autodeploy works under systemctl --user + ignores untracked runtime files - #190
Merged
Merged
Conversation
…racked runtime files Two bugs found while installing the unit on a live rootless host: 1. The service's hardening block (ProtectKernelModules, RestrictSUIDSGID, etc.), copied from the system-level hermes-gateway.service, is not permitted under `systemctl --user` and fails the unit at start with status=218/CAPABILITIES. Reduce the always-on set to the user-safe subset (NoNewPrivileges, PrivateTmp) and leave the privileged directives commented for system-level installs. 2. The dirty-tree guard used `git status --porcelain`, which counts untracked files. A live gateway writes runtime state inside the checkout (cron/executions.db), so the guard would refuse to deploy forever on any real host. Restrict it to modified tracked files (--untracked-files=no); untracked files never block a fast-forward. Verified on the target host (no-op + deploy paths) and against a scratch repo (untracked runtime file no longer blocks; modified tracked file still does). Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01MW1vwtetBTLSMJcBYp9r1C
dizhaky
marked this pull request as ready for review
August 13, 2026 15:48
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
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.
What does this PR do?
Fixes two bugs in the autodeploy unit from #189, both found by actually installing it on a live rootless host (mfc1):
218/CAPABILITIESundersystemctl --user. The service's hardening block (ProtectKernelModules,ProtectKernelTunables,ProtectControlGroups,RestrictSUIDSGID) was copied from the system-levelhermes-gateway.service. Those directives require a privileged (root) service manager and fail the unit at start under a rootless user manager — the exact path the unit's own header documents. Reduced the always-on hardening to the user-safe subset (NoNewPrivileges,PrivateTmp) and left the privileged directives commented, to be uncommented for a dedicated-host system install.Dirty-tree guard refused forever on live hosts. The guard used
git status --porcelain, which includes untracked files. A running gateway writes runtime state inside the checkout (cron/executions.db), so the guard would block every deploy on any real host. Restricted it to modified tracked files (--untracked-files=no); untracked files don't block a fast-forward, and git errors on its own in the rare case an incoming commit would overwrite one.Related Issue
Follow-up to #189 (DAN-2730).
Type of Change
Changes Made
deploy/hermes-agent-autodeploy.service— user-safe hardening subset; privileged directives commented with an explanatory note.deploy/hermes-agent-autodeploy.sh— dirty-tree guard uses--untracked-files=no; comment explains why untracked runtime files are ignored.How to Test
Result=successundersystemctl --user(previously218/CAPABILITIES), hits the no-op path when current, and does not trip on the untrackedcron/executions.db.bash -nclean.Checklist
fix(deploy): ...)cli-config.yaml.example/AGENTS.md— N/A🤖 Generated with Claude Code
https://claude.ai/code/session_01MW1vwtetBTLSMJcBYp9r1C
Generated by Claude Code