Skip to content

fix(deploy): 部署 workflow 加上守門,網頁加 meta CSP - #128

Merged
frobel0520 merged 1 commit into
mainfrom
fix/20261101-deploy-guard-csp
Nov 1, 2026
Merged

frobel0520 merged 1 commit into
mainfrom
fix/20261101-deploy-guard-csp

Conversation

@frobel0520

Copy link
Copy Markdown
Owner

依 Harbor 部署手冊 2.2、2.4 調整。

修改

  • checkout 加 persist-credentials: false;緊急手動發布流程(deploy-pages.yml)發布前檢查 owner 與 main。
  • harbor-release.yml 由 Harbor App 觸發、執行者不是 owner,維持原本的輸入驗證與 environment,不加 owner 檢查。
  • CI 加入 npm audit --audit-level=high。
  • frontend/index.html 加 meta CSP,只允許本站、Harbor 維護腳本與 Google Fonts。

驗證

  • npm audit --audit-level=high 通過。
  • VITE_BASE=/software-engineering-workshop/ npm run build:pages 後用 Chromium 開首頁與 4 個分頁:CSP 違規 0 筆;模擬 Harbor 維護中與正常兩種回應都正常。
  • 本機 test:e2e 有 3 個 navigation 測試失敗;拿掉這次修改在 main 上也同樣失敗(沙箱環境因素),以這個 PR 的 CI 結果為準。

Rollback

revert 這個 PR。


Generated by Claude Code

- 部署手冊 2.4:checkout 加 persist-credentials: false;緊急手動發布流程發布前檢查 owner 與 main。harbor-release 由 Harbor App 觸發,執行者不是 owner,維持原本的輸入驗證與 environment,不加 owner 檢查。
- CI 加入 npm audit,high/critical 或稽核失敗都讓 CI 失敗。
- 部署手冊 2.2:index.html 加 meta CSP,只允許本站、Harbor 維護腳本與 Google Fonts。

驗證:npm audit --audit-level=high 通過;VITE_BASE=/software-engineering-workshop/ npm run build:pages 後用 Chromium 開首頁與 4 個分頁,CSP 違規 0 筆;模擬 Harbor 維護中與正常兩種回應都正常。本機 test:e2e 有 3 個 navigation 測試失敗,拿掉這次修改在 main 上也同樣失敗(沙箱環境因素),以 CI 結果為準。
@frobel0520
frobel0520 merged commit a6a2285 into main Nov 1, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant