Skip to content

Commit 20573fc

Browse files
committed
ci: diagnose site zone endpoint host/DNS/cert
1 parent 3511b6e commit 20573fc

1 file changed

Lines changed: 36 additions & 0 deletions

File tree

.github/workflows/diag-site.yml

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
name: Diagnose site zone endpoint
2+
3+
on:
4+
workflow_dispatch:
5+
6+
jobs:
7+
diagnose:
8+
runs-on: ubuntu-latest
9+
steps:
10+
- name: Identify site endpoint host + DNS
11+
env:
12+
ENDPOINT: ${{ secrets.HOMEPAGE_BUNNY_S3_ENDPOINT }}
13+
run: |
14+
HOST=$(echo "$ENDPOINT" | sed -E 's#^https?://##; s#[/:].*##')
15+
echo "Host visible: ${HOST} (length: ${#HOST})"
16+
echo "--- getent attempts ---"
17+
for attempt in 1 2 3 4 5; do
18+
IP=$(getent ahostsv4 "$HOST" 2>/dev/null | awk '{print $1}' | sort -u | head -1)
19+
echo "attempt $attempt: ${IP:-FAILED}"
20+
[ -n "$IP" ] && break
21+
sleep 2
22+
done
23+
echo "--- curl -v to endpoint ---"
24+
timeout 30 curl -sv --max-time 25 "$ENDPOINT/" 2>&1 | grep -E "Connected|subjectAltName|expire date|Host:|HTTP/" || echo "curl FAILED"
25+
- name: Compare with share zone endpoint
26+
env:
27+
SHARE_ENDPOINT: ${{ secrets.BUNNY_S3_ENDPOINT }}
28+
run: |
29+
SHOST=$(echo "$SHARE_ENDPOINT" | sed -E 's#^https?://##; s#[/:].*##')
30+
echo "Share host: ${SHOST}"
31+
for attempt in 1 2 3; do
32+
IP=$(getent ahostsv4 "$SHOST" 2>/dev/null | awk '{print $1}' | sort -u | head -1)
33+
echo "share attempt $attempt: ${IP:-FAILED}"
34+
[ -n "$IP" ] && break
35+
sleep 1
36+
done

0 commit comments

Comments
 (0)