diag: probe candidate addresses

This commit is contained in:
diag
2026-09-30 00:15:54 +08:00
parent 13a10d2df1
commit 689bf2744a
+9 -12
View File
@@ -5,19 +5,16 @@ jobs:
diag:
runs-on: ubuntu-latest
steps:
- name: env and dns probe
- name: candidate addresses probe
shell: bash
run: |
echo "RESULTS_URL=${ACTIONS_RESULTS_URL:-<unset>}"
echo "RUNTIME_URL=${ACTIONS_RUNTIME_URL:-<unset>}"
echo "CACHE_URL=${ACTIONS_CACHE_URL:-<unset>}"
echo "RUNNER_VERSION=${GITEA_ACTIONS_RUNNER_VERSION:-<unset>}"
echo "HTTP_PROXY=${HTTP_PROXY:-} HTTPS_PROXY=${HTTPS_PROXY:-} NO_PROXY=${NO_PROXY:-}"
echo "---- /etc/hosts"; cat /etc/hosts
echo "---- /etc/resolv.conf"; cat /etc/resolv.conf
for u in "$ACTIONS_RESULTS_URL" "$ACTIONS_RUNTIME_URL"; do
echo "== resolv.conf"; cat /etc/resolv.conf
for u in https://gitea.naeeo.com/ http://10.0.0.250:39630/ http://gitea:3000/; do
h=$(echo "$u" | sed -E 's#^[a-zA-Z]+://##; s#[/:].*$##')
echo "==== probe host: $h (from $u)"
getent hosts "$h" || echo "getent FAILED"
curl -sS -m 8 -o /dev/null -w "http_code=%{http_code} time=%{time_total}\n" "$u" || echo "curl FAILED rc=$?"
echo "==== $u (host=$h)"
getent hosts "$h" || echo "DNS FAIL"
curl -sS -m 10 -o /dev/null -w " http_code=%{http_code} time=%{time_total} remote=%{remote_ip}\n" "$u" || echo " CURL FAIL rc=$?"
done
echo "==== api checks"
curl -sS -m 10 -o /dev/null -w "public api: %{http_code}\n" https://gitea.naeeo.com/api/v1/version
curl -sS -m 10 -o /dev/null -w "lan api: %{http_code}\n" http://10.0.0.250:39630/api/v1/version