Files
knowledge-governance/.gitignore
T
姚章浩 90db243a68
build / build (push) Successful in 56s
fix(web): 旧 index.html 的哈希资源回退到「上一版构建」,页面不再空白/裸奔
现象(主人反馈:页面**偶尔**变成"只有文字没样式"):旧入口 index.html 引用的是上一版的
`index-CddbQIqQ.js` / `index-DLg1Y9tN.css`,而新镜像里只剩当次构建的两个文件
⇒ JS 404 白屏、CSS 404 只有文字没样式。触发条件是"短时间内多次重建 web + CDN/浏览器还拿着旧入口"。

修复(三层,各管一段):

1. **入口不缓存**(上一笔已做):`index.html` → `no-cache, must-revalidate`,CDN/浏览器每次回源校验;
2. **旧哈希资源仍可取**(本笔):`/assets/` 未命中时先回退到只读挂载的
   `deploy/legacy-assets/assets`(**上一版构建**的资源),再 404 ⇒ 还持有旧入口的客户端
   不会因为一个文件 404 而白屏/裸奔;该目录由 `scripts/deploy-api-web.sh` 在**每次重建前**
   从"正在运行的那个镜像"里落盘(`LEGACY_ASSETS=` 会打在部署日志里),并加进 .gitignore;
3. **未命中不再回退成 HTML**:避免浏览器把 index.html 当 JS 执行报一堆语法错误。

验证:旧入口的两个引用 `assets/index-CddbQIqQ.js`、`assets/index-DLg1Y9tN.css` 现在都是 200
(旧客户端可用);当前入口的 `assets/index-Dbnd-DW-.js`、`assets/index-Bgkt4A1i.css` 也是 200;
不存在的文件名仍明确 404;`nginx -t` 通过;本机 8088 与公网入口 kg.zheromiku.top 一致;make verify 15/15。
2026-10-14 10:58:01 +08:00

48 lines
912 B
Plaintext

# Go
/bin/
/coverage.out
# Web
/web/node_modules/
/web/dist/
/web/tsconfig.tsbuildinfo
# Local runtime
.env
.env.*
!.env.example
/tmp/
/data/
/secrets/*
!/secrets/*.example
# Editors and OS
.idea/
.vscode/
.DS_Store
# 门禁产物(每次运行重写;不是证据,证据是运行日志与 Gitea 的 run)
/ci-report.json
/.ci-manifests.json
# Local artifacts (binaries, staging scripts, backups)
/release-diag
/worker
/apply_s5_patch.py
/tmp_*
.style-backup-*/
.hermes/
__pycache__/
/dist/
config/release.wiki-e2e.json
backups/
# 运行期灌库产物(xlsx/pdf/docx 原件,百兆级),只在本机 spool 里流转,绝不入库
/spool/ingestion/
# 门禁/检出在 CI 工作区里落的中间文件(不是产物)
.ci-remote-tags
.ci-commits-count
.ci-preview-url
# 上一版构建的静态资源(部署脚本落盘、只读挂载的运行时目录,不进 git)
deploy/legacy-assets/