Author SHA1 Message Date
Jacky e200d850f9 fix: trust system CA in production smoke test
CI / test (pull_request) Successful in 6m38s
PR合并自动部署 / release-check (pull_request) Successful in 3s
PR合并自动部署 / deploy (pull_request) Successful in 19s
2026-09-29 01:41:35 +08:00
Jacky c90858f45c fix: smoke test Hulumath over public TLS (#45) 2026-09-29 01:39:55 +08:00
Jacky 92c456c7d1 fix: smoke test Hulumath over public TLS
CI / test (pull_request) Successful in 6m7s
PR合并自动部署 / release-check (pull_request) Successful in 3s
PR合并自动部署 / deploy (pull_request) Failing after 19s
2026-09-29 01:29:55 +08:00
Jacky 9a5ce6e4af Merge pull request 'fix: decouple edge HSTS from backend health' (#44) from fix/edge-hsts-header-probe into main 2026-09-29 01:13:59 +08:00
Jacky 8825f6c639 fix: decouple edge HSTS from backend health
CI / test (pull_request) Successful in 6m47s
PR合并自动部署 / release-check (pull_request) Successful in 4s
PR合并自动部署 / deploy (pull_request) Failing after 21s
2026-09-29 01:05:24 +08:00
3 changed files with 13 additions and 8 deletions
+4 -7
View File
@@ -100,13 +100,14 @@ jobs:
chmod +x scripts/deploy_production.sh chmod +x scripts/deploy_production.sh
SSL_CERT_FILE=/etc/ssl/certs/ca-certificates.crt \
DJANGO_HSTS_AT_EDGE=true \ DJANGO_HSTS_AT_EDGE=true \
PROJECT_DIR="$PROJECT" \ PROJECT_DIR="$PROJECT" \
PYTHON_BIN="$PYTHON_BIN" \ PYTHON_BIN="$PYTHON_BIN" \
PREVIOUS_REVISION="$PREVIOUS_REVISION" \ PREVIOUS_REVISION="$PREVIOUS_REVISION" \
DEPLOY_HEALTH_HOST="math.jacky0987.xyz" \ DEPLOY_HEALTH_HOST="math.jacky0987.xyz" \
DEPLOY_SMOKE_BASE_URL="http://127.0.0.1:4321" \ DEPLOY_SMOKE_BASE_URL="https://math.jacky0987.xyz" \
DEPLOY_SMOKE_WS_URL="ws://127.0.0.1:4321/ws/health/" \ DEPLOY_SMOKE_WS_URL="wss://math.jacky0987.xyz/ws/health/" \
bash scripts/deploy_production.sh bash scripts/deploy_production.sh
echo "========================================" echo "========================================"
@@ -116,13 +117,9 @@ jobs:
EOF EOF
- name: 从 Runner 验证 Nginx 健康状态 - name: 从 Runner 验证 Nginx 健康状态
env:
DEPLOY_HOST: ${{ secrets.DEPLOY_HOST }}
DEPLOY_PUBLIC_HOST: 117.72.28.96
run: | run: |
curl --fail --silent --show-error \ curl --fail --silent --show-error \
--retry 5 \ --retry 5 \
--retry-delay 2 \ --retry-delay 2 \
--header "Host: $DEPLOY_PUBLIC_HOST" \ "https://math.jacky0987.xyz/health/" \
"http://$DEPLOY_HOST:4321/health/" \
| grep -q '"status": "ok"' | grep -q '"status": "ok"'
@@ -12,6 +12,14 @@ def test_edge_hsts_ownership_is_explicit_and_verified():
assert 'os.getenv("DJANGO_HSTS_AT_EDGE", "false")' in settings assert 'os.getenv("DJANGO_HSTS_AT_EDGE", "false")' in settings
assert '["security.W004"]' in settings assert '["security.W004"]' in settings
assert "DJANGO_HSTS_AT_EDGE=true" in workflow assert "DJANGO_HSTS_AT_EDGE=true" in workflow
assert "SSL_CERT_FILE=/etc/ssl/certs/ca-certificates.crt" in workflow
assert 'DEPLOY_HEALTH_HOST="math.jacky0987.xyz"' in workflow assert 'DEPLOY_HEALTH_HOST="math.jacky0987.xyz"' in workflow
assert 'DEPLOY_SMOKE_BASE_URL="https://math.jacky0987.xyz"' in workflow
assert 'DEPLOY_SMOKE_WS_URL="wss://math.jacky0987.xyz/ws/health/"' in workflow
assert '"https://math.jacky0987.xyz/health/"' in workflow
assert "127.0.0.1:4321" not in workflow
assert "curl --silent --show-error --head" in deploy
assert "curl --fail --silent --show-error --head" not in deploy
assert "strict-transport-security:.*max-age=[1-9][0-9]*" in deploy assert "strict-transport-security:.*max-age=[1-9][0-9]*" in deploy
assert "unverified" not in deploy.lower()
assert "DJANGO_HSTS_AT_EDGE=false" in example assert "DJANGO_HSTS_AT_EDGE=false" in example
+1 -1
View File
@@ -235,7 +235,7 @@ fi
cd "$PROJECT_DIR/backend" cd "$PROJECT_DIR/backend"
if [ "${DJANGO_USE_HTTPS:-true}" = "true" ]; then if [ "${DJANGO_USE_HTTPS:-true}" = "true" ]; then
if [ "${DJANGO_HSTS_AT_EDGE:-false}" = "true" ]; then if [ "${DJANGO_HSTS_AT_EDGE:-false}" = "true" ]; then
curl --fail --silent --show-error --head \ curl --silent --show-error --head \
--noproxy '*' \ --noproxy '*' \
--resolve "${HEALTH_HOST}:443:127.0.0.1" \ --resolve "${HEALTH_HOST}:443:127.0.0.1" \
--max-time 10 \ --max-time 10 \