From 5c78f7ebb895b8bf3b77257fd0bbcd331d2f9629 Mon Sep 17 00:00:00 2001 From: Codex Agent Date: Sun, 11 Oct 2026 18:32:14 +0300 Subject: [PATCH] =?UTF-8?q?=D0=A3=D1=81=D0=B8=D0=BB=D0=B8=D1=82=D1=8C=20re?= =?UTF-8?q?ad-only=20drift-=D0=BF=D1=80=D0=BE=D0=B2=D0=B5=D1=80=D0=BA?= =?UTF-8?q?=D1=83=20VPS?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- infra/bootstrap/verify.sh | 38 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) diff --git a/infra/bootstrap/verify.sh b/infra/bootstrap/verify.sh index e80f960..c5c476f 100755 --- a/infra/bootstrap/verify.sh +++ b/infra/bootstrap/verify.sh @@ -33,6 +33,18 @@ else echo 'FAIL Docker Compose unavailable' failed=1 fi +if python3 -c 'import json; d=json.load(open("/etc/docker/daemon.json")); assert d.get("log-driver") == "local" and d.get("log-opts",{}).get("max-size") == "10m" and d.get("log-opts",{}).get("max-file") == "3"' 2>/dev/null; then + echo 'PASS Docker log rotation configuration' +else + echo 'FAIL Docker log rotation configuration differs from repository target' + failed=1 +fi +if id -nG codex | tr ' ' '\n' | grep -Eq '^(sudo|docker)$'; then + echo 'FAIL codex has sudo or Docker group access' + failed=1 +else + echo 'PASS codex is outside sudo and docker groups' +fi for path in /opt/akyldash /etc/akyldash /var/lib/akyldash/data /var/backups/akyldash; do if [[ -d $path ]]; then @@ -50,6 +62,32 @@ for path in /etc/akyldash /var/backups/akyldash; do failed=1 fi done +for path in /etc/akyldash/production.env /etc/akyldash/review_secret; do + if [[ -f $path && $(stat -c %U:%a "$path") == root:600 ]]; then + printf 'PASS protected file %s mode 0600\n' "$path" + elif [[ -e $path ]]; then + printf 'FAIL protected file %s must be root-owned mode 0600\n' "$path" + failed=1 + else + printf 'FAIL protected file %s missing\n' "$path" + failed=1 + fi +done + +checkout=/opt/akyldash/current +compose_file=$checkout/deploy/production/compose.yaml +if git -C "$checkout" diff --quiet HEAD -- deploy/production/compose.yaml deploy/production/Dockerfile.backend deploy/production/Dockerfile.opensearch; then + echo 'PASS production Compose and Dockerfiles match the checked-out Git revision' +else + echo 'FAIL production Compose or Dockerfile has local drift' + failed=1 +fi +if docker compose --env-file /etc/akyldash/production.env -f "$compose_file" config --quiet >/dev/null 2>&1; then + echo 'PASS rendered production Compose configuration' +else + echo 'FAIL production Compose configuration cannot be rendered' + failed=1 +fi if ufw status | grep -q '^Status: active$'; then echo 'PASS UFW active'