Skip to content

Commit 0bd596b

Browse files
committed
ci: diagnose site endpoint scheme (https/http)
1 parent 20573fc commit 0bd596b

1 file changed

Lines changed: 31 additions & 0 deletions

File tree

.github/workflows/diag-scheme.yml

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
name: Diagnose site endpoint scheme
2+
3+
on:
4+
workflow_dispatch:
5+
6+
jobs:
7+
diagnose:
8+
runs-on: ubuntu-latest
9+
steps:
10+
- name: Inspect endpoint value shape
11+
env:
12+
ENDPOINT: ${{ secrets.HOMEPAGE_BUNNY_S3_ENDPOINT }}
13+
SHARE_ENDPOINT: ${{ secrets.BUNNY_S3_ENDPOINT }}
14+
run: |
15+
echo "site has https://: $( [[ "$ENDPOINT" == https://* ]] && echo YES || echo NO )"
16+
echo "site has http://: $( [[ "$ENDPOINT" == http://* ]] && echo YES || echo NO )"
17+
echo "site length: ${#ENDPOINT}"
18+
echo "share has https://: $( [[ "$SHARE_ENDPOINT" == https://* ]] && echo YES || echo NO )"
19+
echo "share has http://: $( [[ "$SHARE_ENDPOINT" == http://* ]] && echo YES || echo NO )"
20+
echo "share length: ${#SHARE_ENDPOINT}"
21+
22+
- name: Test explicit https to site host
23+
env:
24+
ENDPOINT: ${{ secrets.HOMEPAGE_BUNNY_S3_ENDPOINT }}
25+
run: |
26+
HOST=$(echo "$ENDPOINT" | sed -E 's#^https?://##; s#[/:].*##')
27+
echo "testing https://${HOST}/ ..."
28+
timeout 30 curl -sv --max-time 25 "https://${HOST}/" 2>&1 | grep -E "Connected to|SSL connection|subjectAltName|verify result|HTTP/|error|could not|Failed" || echo "curl https FAILED"
29+
echo "---"
30+
echo "testing http://${HOST}/ ..."
31+
timeout 30 curl -sv --max-time 25 "http://${HOST}/" 2>&1 | grep -E "Connected to|HTTP/|Location:|error|could not|Failed" || echo "curl http FAILED"

0 commit comments

Comments
 (0)