Files

20 lines
1.0 KiB
Bash

set -u
echo "===== 1. Main app JS chunk from SPA ====="
html=$(curl -s -H "Host: www.yunhaixingtong.com" http://127.0.0.1/userbase/)
appjs=$(echo "$html" | grep -oE '/static/js/[A-Za-z0-9_./-]+\.js' | head -1)
echo "app js: $appjs"
curl -s -o /dev/null -w " /userbase${appjs} -> %{http_code}\n" -H "Host: www.yunhaixingtong.com" "http://127.0.0.1/userbase${appjs}"
echo
echo "===== 2. Ensure other sites not regressed (sso / b) ====="
curl -s -o /dev/null -w " sso host / -> %{http_code}\n" -H "Host: sso.yunhaixingtong.com" http://127.0.0.1/
curl -s -o /dev/null -w " b host / -> %{http_code}\n" -H "Host: www.yunhaixingtong.com" http://127.0.0.1/b/
echo
echo "===== 3. Caddy listening ports on host ====="
ss -ltnp 2>/dev/null | grep -E ':80 |:443 ' | head
echo
echo "===== 4. Containers status ====="
docker ps --format '{{.Names}} {{.Status}}' | grep -E 'caddy|userbase'
echo
echo "===== 5. userbase-front health (serve index directly) ====="
docker exec userbase-front wget -qO- http://localhost/ 2>/dev/null | head -c 60; echo