Files
felhom.eu/documentation/audits/d63-2026-10-29/walk_release.sh
T

17 lines
1.4 KiB
Bash

#!/usr/bin/env bash
# walk_release.sh <ssh-host> <vmid> <domain> <since RFC3339> — the release box walk, read-only, from inside the guest:
# the controller's image and health; every container up and not unhealthy; the controller log since the switch (refusals,
# errors); the dashboard login page and the file manager through the box's own proxy (GET only).
H=$1; V=$2; D=$3; SINCE=$4
ssh -o BatchMode=yes -o ConnectTimeout=15 "$H" "pct exec $V -- bash -s" <<EOF
echo "controller: \$(docker ps --filter name=^/felhom-controller\$ --format '{{.Image}} {{.Status}}')"
echo "containers: \$(docker ps -a --format '{{.Names}}|{{.Status}}' | wc -l) total"
bad=\$(docker ps -a --format '{{.Names}}|{{.Status}}' | grep -E 'unhealthy|Restarting|Exited|Dead|Created' || true)
echo "not running/unhealthy: \${bad:-none}"
echo "refusals since \$(echo $SINCE): \$(docker logs --since $SINCE felhom-controller 2>&1 | grep -ciE 'REFUSED a catalog definition|app_definition_refused|definition refused')"
echo "ERROR lines since: \$(docker logs --since $SINCE felhom-controller 2>&1 | grep -c '\[ERROR\]')"
docker logs --since $SINCE felhom-controller 2>&1 | grep '\[ERROR\]' | cut -c1-220 | tail -5
echo "login page: \$(curl -sk -o /dev/null -w '%{http_code}' -H 'Host: felhom.$D' https://127.0.0.1/login)"
echo "file manager: \$(curl -sk -o /dev/null -w '%{http_code}' -H 'Host: files.$D' https://127.0.0.1/)"
EOF