From 92c456c7d1571e62599c300b82d0b1be8ff4d6f6 Mon Sep 17 00:00:00 2001 From: Jacky Date: Tue, 29 Sep 2026 01:29:55 +0800 Subject: [PATCH] fix: smoke test Hulumath over public TLS --- .gitea/workflows/deploy.yml | 10 +++------- backend/common/test_deployment_security.py | 4 ++++ 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/.gitea/workflows/deploy.yml b/.gitea/workflows/deploy.yml index 34d7a66..60c01a0 100644 --- a/.gitea/workflows/deploy.yml +++ b/.gitea/workflows/deploy.yml @@ -105,8 +105,8 @@ jobs: PYTHON_BIN="$PYTHON_BIN" \ PREVIOUS_REVISION="$PREVIOUS_REVISION" \ DEPLOY_HEALTH_HOST="math.jacky0987.xyz" \ - DEPLOY_SMOKE_BASE_URL="http://127.0.0.1:4321" \ - DEPLOY_SMOKE_WS_URL="ws://127.0.0.1:4321/ws/health/" \ + DEPLOY_SMOKE_BASE_URL="https://math.jacky0987.xyz" \ + DEPLOY_SMOKE_WS_URL="wss://math.jacky0987.xyz/ws/health/" \ bash scripts/deploy_production.sh echo "========================================" @@ -116,13 +116,9 @@ jobs: EOF - name: 从 Runner 验证 Nginx 健康状态 - env: - DEPLOY_HOST: ${{ secrets.DEPLOY_HOST }} - DEPLOY_PUBLIC_HOST: 117.72.28.96 run: | curl --fail --silent --show-error \ --retry 5 \ --retry-delay 2 \ - --header "Host: $DEPLOY_PUBLIC_HOST" \ - "http://$DEPLOY_HOST:4321/health/" \ + "https://math.jacky0987.xyz/health/" \ | grep -q '"status": "ok"' diff --git a/backend/common/test_deployment_security.py b/backend/common/test_deployment_security.py index 3f2a87f..e3fbbc0 100644 --- a/backend/common/test_deployment_security.py +++ b/backend/common/test_deployment_security.py @@ -13,6 +13,10 @@ def test_edge_hsts_ownership_is_explicit_and_verified(): assert '["security.W004"]' in settings assert "DJANGO_HSTS_AT_EDGE=true" 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 -- 2.54.0