a2ae74d582
- Backend: auth refresh reuse, schedule/retry/sync/agent/files fixes - Frontend: push WS, files ETag browse, vite build assets - Docs: audit/changelog, production deploy gate, bug scan registry B7-77 - Deploy: deploy-production.sh, prune assets, gate logs
1.3 KiB
1.3 KiB
2026-06-04 — 预览页去 CDN + install.py B904
摘要
- 将
web/app/preview*.html的 Tailwind 从 jsDelivr CDN 改为本地/app/vendor/tailwindcss-browser.js,与业务页一致,满足离线/内网与安全策略。 server/api/install.py锁定安装前校验管理员时,503 异常改为raise ... from e,消除 ruff B904。
动机
tests/test_security_unit.py::test_html_pages_do_not_load_external_cdn因 4 个预览 HTML 仍引 CDN 失败。ruff check server/在install.py:659报 B904(raise未链式原异常)。
涉及文件
| 文件 | 变更 |
|---|---|
web/app/preview.html |
CDN → vendor |
web/app/preview-v3.html |
同上 |
web/app/preview-v4.html |
同上 |
web/app/preview-v5.html |
同上 |
server/api/install.py |
HTTPException 503 from e |
迁移 / 重启
- 无需 DB 迁移;改静态 HTML 与 API 一处,重启 uvicorn 即可(仅 install 路径需 reload)。
验证
ruff check server/api/install.py # All checks passed
pytest tests/test_security_unit.py::test_html_pages_do_not_load_external_cdn
pytest tests/ -q # 136 passed
rg 'cdn.jsdelivr|unpkg.com' web/app/*.html # 无匹配
进度
☑实现 ☑WSL验证 ☐审计8步 ☐部署 ☐健康检查 ☐浏览器验证 ☑changelog