deploy(gw-04): run the timer as a dedicated clawmates user under /opt
ci / gates (push) Successful in 6s
ci / frontend (push) Successful in 37s
ci / rust (push) Successful in 2m57s
ci / e2e (push) Failing after 15s
ci / publish (push) Successful in 21s

Move the running stack off root ownership. The systemd service now runs
as User=clawmates:clawmates with WorkingDirectory=/opt/clawmates, and the
script's COMPOSE_DIR default follows. This closes the "rootful compose
stack" ask from the original ship-readiness audit — deploys no longer
require any part of the pipeline to run as root beyond docker access
(the clawmates user gets that via the docker group).

Docker-managed volumes (pgdata, broker_run, broker_key, brains, filedata)
stay put; the compose project name is unchanged so docker resolves them
to the same physical volumes. The old /root/clawmates directory stays in
place as an emergency rollback for a week, then gets removed as follow-up.
This commit is contained in:
Omar Sobh
2026-07-05 19:39:08 -07:00
parent 39a6424d72
commit 8f29cf8e44
2 changed files with 4 additions and 1 deletions
+3
View File
@@ -5,6 +5,9 @@ After=docker.service network-online.target
[Service] [Service]
Type=oneshot Type=oneshot
User=clawmates
Group=clawmates
WorkingDirectory=/opt/clawmates
ExecStart=/usr/local/bin/clawmates-deploy.sh ExecStart=/usr/local/bin/clawmates-deploy.sh
StandardOutput=journal StandardOutput=journal
StandardError=journal StandardError=journal
+1 -1
View File
@@ -25,7 +25,7 @@ set -euo pipefail
REGISTRY="${REGISTRY:-100.94.185.103:5000}" REGISTRY="${REGISTRY:-100.94.185.103:5000}"
NAMESPACE="${NAMESPACE:-clawmates}" NAMESPACE="${NAMESPACE:-clawmates}"
COMPOSE_DIR="${COMPOSE_DIR:-/root/clawmates}" COMPOSE_DIR="${COMPOSE_DIR:-/opt/clawmates}"
LOG="${LOG:-/var/log/clawmates-deploy.log}" LOG="${LOG:-/var/log/clawmates-deploy.log}"
SERVICES=(broker server frontend) SERVICES=(broker server frontend)