Files
userbase/deploy/diag_deep.sh
T

25 lines
1.0 KiB
Bash

set -u
echo "===== 1. In-container view of /etc/caddy/Caddyfile: userbase count ====="
docker exec caddy grep -c "userbase" /etc/caddy/Caddyfile
echo
echo "===== 2. Container start command ====="
docker inspect caddy --format 'CMD={{.Config.Cmd}} ENTRY={{.Config.Entrypoint}}'
echo
echo "===== 3. Admin API reachable? top-level keys ====="
docker exec caddy curl -s localhost:2019/
echo
echo "===== 4. Running HTTP servers + route matchers in config ====="
docker exec caddy curl -s localhost:2019/config/ > /tmp/running.json
echo "bytes: $(wc -c < /tmp/running.json)"
echo "occurrences:"
for s in "userbase" "Welcome to Base Platform" "handle_path" "reverse_proxy" "www.yunhaixingtong.com"; do
echo " $s : $(grep -o "$s" /tmp/running.json | wc -l)"
done
echo
echo "===== 5. Do a manual POST /load from inside container and show result ====="
docker exec caddy caddy reload --config /etc/caddy/Caddyfile --adapter caddyfile 2>&1
echo "exit=$?"
sleep 1
echo "--- after reload, recount ---"
docker exec caddy curl -s localhost:2019/config/ | grep -c "userbase"