homelab-codex-ws/services/control-plane
Oskar Kapala 00fc36df3a fix(deploy): skip sudo chown/chmod when /opt/homelab ownership is already correct
deploy-local.sh previously ran `sudo chown -R 1000:1000` and
`sudo chmod -R 775` unconditionally on every deploy, which blocked
non-TTY execution (CC/CI) on VPS where /opt/homelab is already 1000:1000.

Both steps are now conditional using `find ... -print -quit`:
- chown: runs only if any file/dir is NOT uid/gid 1000
- chmod: runs only if any directory is missing -775 permission bits

When everything is correct (steady state on VPS), both steps log
"already correct, skipping" and never invoke sudo.  If a new directory
was created by root (e.g. a manual mkdir, volume mount, or restart artefact),
the remediation path triggers automatically — the self-heal property is preserved.

Smoke-tested in Docker (ubuntu:22.04):
  Case 1 (1000:1000 + 775):  chown skipped, chmod skipped ✓
  Case 2 (root-owned subdir): chown triggered ✓
  Case 3 (700 dir perms):     chmod triggered ✓

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-03 15:44:44 +02:00
..
src fix(observer): robust incident lifecycle + orphan auto-resolve 2026-06-03 14:29:12 +02:00
tests fix(observer): robust incident lifecycle + orphan auto-resolve 2026-06-03 14:29:12 +02:00
deploy-local.sh fix(deploy): skip sudo chown/chmod when /opt/homelab ownership is already correct 2026-06-03 15:44:44 +02:00
docker-compose.yml Add control plane deploy script and fix UI healthcheck 2026-05-18 21:34:57 +02:00
Dockerfile Add heartbeat updates and improve health checks in control-plane components 2026-05-12 20:59:46 +02:00
pyproject.toml feat(control-plane): route ha-diag-agent events through supervisor 2026-05-29 15:59:23 +02:00