docs(fleet-conventions): git checkouts under root:docker need safe.directory for the deploy user
The 2026-09-14 normalization (826a63b) moved /opt/docker/compose/<stack>
dirs to root:docker 2775. git refuses a worktree whose top-level dir has a
different owner, so yt-voice-clipper's webhook auto-deploy on irv-ml1
(git fetch/reset as lkraven) failed with 'dubious ownership' from then on.
Found 2026-09-24 when v0.3.13 did not land.
The fix keeps the convention: one safe.directory entry per repo for the
deploy user. Applied on irv-ml1 and the deploy re-run: main 2af9b3a,
/diagnostics reports 0.3.13. A sweep of the other normalized hosts found no
other checkout deployed by a non-root user.
This commit is contained in:
@@ -155,6 +155,19 @@ The setgid bit on directories is load-bearing: it makes every file created
|
|||||||
afterwards inherit the `docker` group, so the scheme does not decay back into
|
afterwards inherit the `docker` group, so the scheme does not decay back into
|
||||||
whoever-touched-it-last ownership.
|
whoever-touched-it-last ownership.
|
||||||
|
|
||||||
|
⚠ **A stack dir that is a git checkout needs `safe.directory` for its deploy
|
||||||
|
user.** git (>= 2.35.2) refuses to operate in a worktree whose top-level dir is
|
||||||
|
owned by someone else, so moving a checkout to `root:docker` breaks any deploy
|
||||||
|
that runs `git fetch`/`reset` as a normal user, with `fatal: detected dubious
|
||||||
|
ownership`. That's what stalled yt-voice-clipper's webhook auto-deploy on irv-ml1
|
||||||
|
after the 2026-09-14 normalization, found 2026-09-24 when v0.3.13 would not
|
||||||
|
land. The fix keeps the convention: as the deploy user,
|
||||||
|
`git config --global --add safe.directory /opt/docker/compose/<stack>` (one
|
||||||
|
entry per repo; the `/*` wildcard form needs git >= 2.46, and irv-ml1 has
|
||||||
|
2.39). Swept 2026-09-24: that was the only checkout under a normalized
|
||||||
|
`/opt/docker/compose` deployed by a non-root user. esh-docker-vm's
|
||||||
|
`/opt/docker/conf/esphome/` is a checkout but is `root:root` throughout.
|
||||||
|
|
||||||
⚠ **A stack lives under `/opt/docker/compose/<stack>/` or it is invisible.**
|
⚠ **A stack lives under `/opt/docker/compose/<stack>/` or it is invisible.**
|
||||||
Every piece of fleet automation walks that path. `talk` sat at `~/talk` until
|
Every piece of fleet automation walks that path. `talk` sat at `~/talk` until
|
||||||
2026-09-14 and was silently skipped by the docker-ce upgrade's restart loop for
|
2026-09-14 and was silently skipped by the docker-ce upgrade's restart loop for
|
||||||
|
|||||||
Reference in New Issue
Block a user