Diagnose site endpoint scheme #1
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Diagnose site endpoint scheme | |
| on: | |
| workflow_dispatch: | |
| jobs: | |
| diagnose: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Inspect endpoint value shape | |
| env: | |
| ENDPOINT: ${{ secrets.HOMEPAGE_BUNNY_S3_ENDPOINT }} | |
| SHARE_ENDPOINT: ${{ secrets.BUNNY_S3_ENDPOINT }} | |
| run: | | |
| echo "site has https://: $( [[ "$ENDPOINT" == https://* ]] && echo YES || echo NO )" | |
| echo "site has http://: $( [[ "$ENDPOINT" == http://* ]] && echo YES || echo NO )" | |
| echo "site length: ${#ENDPOINT}" | |
| echo "share has https://: $( [[ "$SHARE_ENDPOINT" == https://* ]] && echo YES || echo NO )" | |
| echo "share has http://: $( [[ "$SHARE_ENDPOINT" == http://* ]] && echo YES || echo NO )" | |
| echo "share length: ${#SHARE_ENDPOINT}" | |
| - name: Test explicit https to site host | |
| env: | |
| ENDPOINT: ${{ secrets.HOMEPAGE_BUNNY_S3_ENDPOINT }} | |
| run: | | |
| HOST=$(echo "$ENDPOINT" | sed -E 's#^https?://##; s#[/:].*##') | |
| echo "testing https://${HOST}/ ..." | |
| 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" | |
| echo "---" | |
| echo "testing http://${HOST}/ ..." | |
| 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" |