fix(cli): acr update/deploy 下載源改指 Gitea archive(Arcrun#4) #26
Reference in New Issue
Block a user
Delete Branch "fix/acr-update-gitea-source"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Arcrun#4:
acr update/ 部署下載源 GitHub codeload → Gitea archive為什麼
acr update綁死codeload.github.com→ 沒有乾淨的重裝路徑。init與update共用downloadAndDeploy,其內容指紋 manifest 天然「新裝零件補上、內容未變者略過」(冪等)。所以修 update ≈ 把下載源重指 Gitea,用戶跑acr update就會把 init 之後新增的零件(如 code)補上、已裝的略過。改了什麼(只碰 CLI 下載邏輯)
cli/src/lib/deploy.tsARCRUN_REPO預設uncle6me-web/Arcrun→Leo/Arcrun(Gitea 路徑)。ARCRUN_GITEA_BASE(預設https://git.uncle6.me)供 fork/自架站台覆蓋。giteaToken():ARCRUN_GITEA_TOKEN>GITEA_TOKEN,不寫死;public repo 可不設。buildArchiveUrl()/buildDownloadHeaders()(好離線測),走 Gitea archive API:GET {base}/api/v1/repos/{owner}/{repo}/archive/{ref}.tar.gz。保留 #13 P2 的 cache-buster query +no-cacheheader 防 stale;private repo 帶Authorization: token <TOKEN>。downloadRepoTarball改用上述;401/403 給「設 GITEA_TOKEN」可行動提示。cli/src/commands/update.ts:docstring 對齊(GitHub release → Gitea archive),標註 install≈update 由共用downloadAndDeploy保證。cli/tests/deploy-url.test.ts(新):Node 內建 test runner(node --test,零新依賴),8 顆全綠。為什麼選 Gitea archive API
arcrun/,既有 generic 頂層目錄偵測自然吃)。Authorization: token),與既有GITEA_TOKENenv 機制一致,private repo 直接可用。驗證(離線 + 唯讀)
npm test(cli)8/8 綠:URL 組裝、repo/base覆蓋、token→header、public 無 token、env 優先序。tsc --noEmit綠。200 application/octet-stream ~9.3MB;tarball 含全部 tier1(.component-builds/*)+ tier2(cypher-executor/kbdb/mcp/registry)worker 目錄。leo 要做什麼才能真正
acr updateGITEA_TOKEN(或ARCRUN_GITEA_TOKEN)env,且該 token 對Leo/Arcrun有讀取權限(若 repo 為 private)。probe 顯示帶 token 可 200。registry/components/code/),.component-builds/code/component.wasm尚未 build/commit;tier1 gate 要求component.wasm才部署。故本 PR 讓下載源可用,但 code 零件要真正被acr update裝上,仍需先 build 其 wasm 並 commit 進.component-builds/code/(與 claude_api/km_writer 等同類情況)。草稿 PR,不 merge、不部署、未碰 README(README 由 #22 負責)。
[總管] 審查 ✅ 可 merge。
ARCRUN_REPO預設改Leo/Arcrun、ARCRUN_GITEA_BASE/token env 覆蓋、token 走 header 不寫死、純函式抽出可離線測、保留 cache-buster。npm test8/8 綠、tsc --noEmit過。