#!/usr/bin/env bash # walk_release.sh — the release box walk, read-only, from inside the guest: # the controller's image and health; Traefik's image and digest; 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); # every app route the box serves, through Traefik with its own Host (the public name is asked apart, from outside). H=$1; V=$2; D=$3; SINCE=$4 ssh -o BatchMode=yes -o ConnectTimeout=15 "$H" "pct exec $V -- bash -s" <&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/)" for c in \$(docker ps --format '{{.Names}}'); do docker inspect \$c --format '{{json .Config.Labels}}' | grep -o 'Host(\`[^\`]*\`)' | sed 's/Host(\`//; s/\`)//' | sort -u | while read -r h; do echo "route \$h [\$c]: \$(curl -sk -m 20 -o /dev/null -w '%{http_code}' -H "Host: \$h" https://127.0.0.1/)" done done EOF