chore(master): run the master as a non-root user (#25) #27

Merged
shcizo merged 2 commits from chore/master-non-root-25 into main 2026-10-13 07:33:47 +00:00
Owner

Summary

  • The example master stack runs the master as nobody (user: "65534:65534"); it has no Docker socket and needs no root. The Dockerfile is unchanged, because the agent uses the same image and needs root for the socket.
  • The master logs config_json_readable on registry_credentials, and a registry_credentials_unreadable warning when config.json exists but cannot be opened.
  • Docs: keep the mounted registry credentials private (chown -R 65534:65534, 0700/0600), never world-readable.

Closes #25

Test plan

  • go vet ./..., go test ./... (new cmd/master/main_test.go), build
  • Image starts updater-master as 65534:65534 up to config validation
  • On the server: stack deploys, listening logged, id in the container shows uid 65534
  • With DOCKER_CONFIG mounted and chowned: config_json_readable: true, polling of a private image works
## Summary - The example master stack runs the master as nobody (`user: "65534:65534"`); it has no Docker socket and needs no root. The Dockerfile is unchanged, because the agent uses the same image and needs root for the socket. - The master logs `config_json_readable` on `registry_credentials`, and a `registry_credentials_unreadable` warning when `config.json` exists but cannot be opened. - Docs: keep the mounted registry credentials private (`chown -R 65534:65534`, `0700`/`0600`), never world-readable. Closes #25 ## Test plan - [x] `go vet ./...`, `go test ./...` (new `cmd/master/main_test.go`), build - [x] Image starts `updater-master` as 65534:65534 up to config validation - [ ] On the server: stack deploys, `listening` logged, `id` in the container shows uid 65534 - [ ] With `DOCKER_CONFIG` mounted and chowned: `config_json_readable: true`, polling of a private image works
shcizo added 2 commits 2026-10-13 07:33:38 +00:00
shcizo merged commit 307e46e4c7 into main 2026-10-13 07:33:47 +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#27