e730b3f831
同源於 2026-08-08 的 apiBase 事故:部署腳本把 apiBase/profile 印在 終端機上,卻沒有寫進推上去的產物 ⇒ 印對的、推錯的。 根因比想像深:deploy.targets.json 原本靠 build.mjs 在 build 期把 profile/apiBase 烤進產物,但 t160(e744ad1)清世代債時把 build.mjs 整支刪掉改成直接託管 public/,沒有人接手「把宣告值寫進產物」這件事 ⇒ 前兩次事故的解等於被還原,只剩下「印出來給人看」。 本次落地: - targets.mjs:宣告值的唯一讀取點,把「一個目標展開成期望的產物長相」 定死成函式,供部署/驗證共用同一個答案,杜絕三邊各自解讀而漂移。 缺 apiBase/accountId/verifyUrls/未定義的 profile 一律拒絕部署。 - verify-live.mjs:獨立可跑,驗「線上網址真的在用的組態」=「宣告值」。 - deploy.targets.json:補 _profiles(profile → views/home)與 verifyUrls。 WIP:deploy.mjs 尚未改接 targets.mjs,public/config.js 尚未退役。 Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
79 lines
4.2 KiB
JSON
79 lines
4.2 KiB
JSON
{
|
||
"_readme": [
|
||
"部署目標定義檔(leo 2026-07-22 立)。一個目標=一組『帳號+profile+apiBase+專案名+對外網址』。",
|
||
"",
|
||
"為什麼要這個檔:5a16484 把 UI 搬 CF Pages 後,這些值從 worker 環境變數變成部署期參數。",
|
||
"誰部署誰要記得帶 → 帶漏了就退回預設,而預設值對兩邊都不對。實際踩過的:",
|
||
" · demo 站漏 CONSOLE_PROFILE=rag → 顯示個人版 7 頁駕駛艙(leo 看到『Mira 介面』的真因)",
|
||
" · 兩站都漏 ARCRUN_API_BASE → apiBase 空字串 → 前端打自己回 405 → 登不進去",
|
||
" · 兩個帳號有同名 arcrun-console-ui 專案,wrangler 又登入在 uncle6",
|
||
" → 不指定帳號直接 deploy 會部到 demo 站上(差點蓋掉)",
|
||
"",
|
||
"🔴 第四次(2026-08-08 發現,同一種病換了形式):",
|
||
" 上面三次的『解』是 deploy.targets.json + build.mjs 在 build 時把 profile/apiBase",
|
||
" 烤進產物。但 t160(e744ad1)為了清世代債把 build.mjs 整支刪掉、改成直接託管 public/,",
|
||
" **沒有人把『把宣告值寫進產物』這件事接手過去** ⇒ deploy.mjs 照樣在終端機印",
|
||
" 『profile:full / apiBase:…leo21c…』,推上去的卻是 public/config.js 裡凍住的",
|
||
" cypher.arcrun.dev + 凍在 4 頁的 VIEWS。也就是說:",
|
||
" **`npm run deploy:personal` 會把個人站的 API 打到企業 demo 的後端、頁面砍成 4 頁**,",
|
||
" 而終端機從頭到尾顯示『成功』。(第三次的 accountId 是靠 env 傳的,倖存;前兩次的解等於被還原。)",
|
||
"",
|
||
" → 現在的規矩:**產物由 deploy.mjs 依本檔即時產生(staging 目錄),",
|
||
" 推之前驗產物、推之後驗線上網址**。public/ 裡不再放任何跟目標有關的值。",
|
||
" · public/config.js 已刪除——它是產物不是原始碼(自架站的 /config.js 由",
|
||
" arcrun-rag 的 build-ui-bundle 動態產生,不吃這個檔)",
|
||
" · public/console/index.html 的 VIEWS/HOME 只是本機 preview 的預設值,",
|
||
" 部署時一律被 _profiles 覆寫,覆寫沒命中就中止部署",
|
||
"",
|
||
"版本差異(leo 2026-07-22 定調):頁面都存在,由 profile 決定顯示哪些。",
|
||
" personal(full) 個人版:7 頁全開,落地駕駛艙",
|
||
" enterprise(rag) 企業版:只留 搜尋/工作流/設定/card,落地搜尋頁",
|
||
" 未來擴充:個人版新用戶上限 1、知識庫權限不可用 → 加在對應目標的欄位裡,別再散進部署指令。",
|
||
"",
|
||
"用法:npm run deploy:personal / npm run deploy:enterprise",
|
||
" npm run deploy:personal -- --dry-run (只產出並驗產物,不推)",
|
||
" npm run verify (不部署,只驗線上各站現況=宣告值)"
|
||
],
|
||
|
||
"_profiles": {
|
||
"full": {
|
||
"description": "個人版:7 頁全開,落地駕駛艙",
|
||
"views": ["cockpit", "search", "card", "workflows", "creds", "inbox", "settings"],
|
||
"home": "cockpit"
|
||
},
|
||
"rag": {
|
||
"description": "企業版:搜尋/card/工作流/設定,落地搜尋頁",
|
||
"views": ["search", "card", "workflows", "settings"],
|
||
"home": "search"
|
||
}
|
||
},
|
||
|
||
"personal": {
|
||
"description": "leo 私人實例(原 Mira)。入口 mira.uncle6.me → leo21c worker。",
|
||
"accountId": "51a01bfa2665bd7bc3fd080dc40cf3e1",
|
||
"projectName": "arcrun-console-ui",
|
||
"profile": "full",
|
||
"brand": "Arcrun",
|
||
"apiBase": "https://arcrun-cypher-executor.leo21c.workers.dev",
|
||
"verifyUrls": ["https://mira.uncle6.me", "https://arcrun-console-ui.pages.dev"],
|
||
"limits": {
|
||
"maxUsers": 1,
|
||
"libraryPermissions": false
|
||
}
|
||
},
|
||
|
||
"enterprise": {
|
||
"description": "企業版 demo 站。rag-demo.arcrun.dev → uncle6 帳號 cypher。",
|
||
"accountId": "58309bb90fd93ad6d0fe0aae99170e9d",
|
||
"projectName": "arcrun-console-ui",
|
||
"profile": "rag",
|
||
"brand": "Arcrun",
|
||
"apiBase": "https://cypher.arcrun.dev",
|
||
"verifyUrls": ["https://rag-demo.arcrun.dev"],
|
||
"limits": {
|
||
"maxUsers": null,
|
||
"libraryPermissions": true
|
||
}
|
||
}
|
||
}
|