fix: guard static asset deploy permissions
Some checks failed
CD Pipeline / deploy (push) Failing after 1m9s

This commit is contained in:
ogt
2026-06-26 07:30:56 +08:00
parent fec7b5c778
commit bd7cbcae62
4 changed files with 25 additions and 1 deletions

View File

@@ -777,3 +777,4 @@ POSTGRES_HOST=momo-db
| 2026-06-25 | 治理與匯入頁也不得外露模型/權杖/欄位口徑 | V10.698 起缺貨匯入、供應商窗口、AI 歷史、預算、AI 流量、AI 分工與主機健康頁統一改用「必要資料、用量、建議引擎、建議路徑、雲端備援、AI 建議服務」等前台可讀詞,避免使用者在營運頁看到 raw model、token、欄位或模型品牌。 |
| 2026-06-25 | 工具頁與簡報頁也必須使用作戰語言Google Drive token 必須固定到持久化掛載 | V10.699 起簡報預覽、品牌素材、比價、匯入、缺貨與觀測台操作提示移除英文/內部流程字,改成可直接理解的狀態與下一步;正式容器明確指定 `/app/config/google_token.json``/app/config/google_credentials.json`,背景匯入不得因主機重啟或工作目錄變動而改找瀏覽器授權。 |
| 2026-06-26 | 邊角治理頁不得把 raw caller、模型資料或推版代碼當主訊息 | V10.700 起 AI 流量、主機健康、通知模板與缺貨匯入提示再收斂為「使用情境、建議路徑、服務資料、更新摘要、先選擇供應商缺貨檔」等營運語言,避免低頻治理頁回流 `原始`、模型品牌、commit/pipeline 欄位或泛用檔案提示。 |
| 2026-06-26 | 靜態資源部署必須保持容器可讀 | V10.701 起部署 SOP 改用 Git 物件打包差異檔,並以測試檢查 `web/static` 檔案可被容器讀取,避免 macOS / iCloud 工作目錄權限造成正式 `/static/*` 500讓全站 CSS/JS 不再因檔案模式回歸而失效。 |

View File

@@ -19,6 +19,19 @@ scp -o ProxyJump=wooo@192.168.0.110 app.py ollama@192.168.0.188:/home/ollama/mom
scp -o ProxyJump=wooo@192.168.0.110 -r services/ ollama@192.168.0.188:/home/ollama/momo-pro/
```
若使用 tar 打包差異檔,必須用 Git 物件建立部署包,避免 macOS / iCloud 工作目錄的 `600` 權限或 extended attributes 被帶到正式機,造成 `/static/*` 500
```bash
BASE=<上一個已部署 commit>
HEAD=$(git rev-parse HEAD)
git diff --name-only "$BASE..$HEAD" > /tmp/momo-deploy-filelist.txt
git archive --format=tar.gz -o /tmp/momo-deploy-files.tar.gz "$HEAD" $(cat /tmp/momo-deploy-filelist.txt)
```
部署前本地必跑靜態檔可讀檢查:
```bash
.venv/bin/python -m pytest tests/test_frontend_v2_assets.py
```
若部署時在 110 → 188 的內層 `scp` 遇到 `Host key verification failed`,先在 110 修正 `known_hosts`,不要用 `StrictHostKeyChecking=no` 硬跳過:
```bash
ssh wooo@192.168.0.110 \