Files
felhom.eu/documentation/audits/rulings-2026-10-01/tools/b_9202.py
T
2026-10-01 08:40:04 +02:00

14 lines
1.2 KiB
Python

#!/usr/bin/env python3
"""Part B on 9202 (self-update is off here — no hub): the standard bootstrap deploy of the release, then the
decision-56 pass 3 minutes after the new controller starts. 9202 has no swap record → the version-order fallback."""
import time, sys
import walk as w
V = sys.argv[1]
IMG = "docker image ls -a --format '{{.Repository}}:{{.Tag}} {{.ID}} {{.Size}}' | grep felhom-controller | sort -V; echo count=$(docker image ls -a --format '{{.Repository}}' | grep -c felhom-controller); docker system df | sed -n 1,2p; df -h /var/lib/docker | tail -1"
print("## before", flush=True); print(w.guest(IMG), flush=True)
print(w.guest(f"docker pull -q gitea.dooplex.hu/admin/felhom-controller:{V} && echo gitea.dooplex.hu/admin/felhom-controller:{V} > /etc/felhom-controller-image && systemctl restart felhom-controller-bootstrap.service; sleep 20; docker inspect felhom-controller --format '{{{{.Config.Image}}}} {{{{.State.StartedAt}}}}'"), flush=True)
time.sleep(210)
print("## the passes (positive observable: one line per pass)", flush=True)
print(w.guest("docker logs --since 5m felhom-controller 2>&1 | grep -E 'image retention' | cut -c1-280"), flush=True)
print("## after", flush=True); print(w.guest(IMG), flush=True)