fix(agent): give compose.override.yaml the owner of the stack (#24) #26

Merged
shcizo merged 2 commits from fix/override-file-owner-24 into main 2026-10-13 07:27:44 +00:00
Owner

Summary

  • The agent gives compose.override.yaml the owner of the existing override, or of the stack's first compose file when there is none or the existing one is root-owned (files written by earlier agent versions are fixed on the next job).
  • The owner is set on the temp file through its open handle before the rename, so a path swapped for a symlink cannot redirect the chown.
  • A failure to read or set the owner is a warning: line in the job output; the job still succeeds. No Warn log line: the Compose executor has no logger, and the job output is stored on the master.

Closes #24

Test plan

  • go test ./..., go test -race ./internal/agent/..., GOOS=linux go vet ./internal/agent/...
  • On the server: a stack with a root-owned override gets the compose file's uid:gid after one Update, with no warning
  • A manually chowned (non-root) override keeps its owner after another Update
## Summary - The agent gives `compose.override.yaml` the owner of the existing override, or of the stack's first compose file when there is none or the existing one is root-owned (files written by earlier agent versions are fixed on the next job). - The owner is set on the temp file through its open handle before the rename, so a path swapped for a symlink cannot redirect the chown. - A failure to read or set the owner is a `warning:` line in the job output; the job still succeeds. No Warn log line: the Compose executor has no logger, and the job output is stored on the master. Closes #24 ## Test plan - [x] `go test ./...`, `go test -race ./internal/agent/...`, `GOOS=linux go vet ./internal/agent/...` - [ ] On the server: a stack with a root-owned override gets the compose file's uid:gid after one Update, with no warning - [ ] A manually chowned (non-root) override keeps its owner after another Update
shcizo added 2 commits 2026-10-13 07:27:33 +00:00
shcizo merged commit f95e5319a8 into main 2026-10-13 07:27:44 +00:00
Sign in to join this conversation.
No Reviewers
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: shcizo/package-updater#26