platform: interrupted install ignores a replacement runtime token and never updates deployed Workers

未關閉
#666 0 則留言 0 個 reaction 已指派 0 人 在 GitHub 檢視

維護者通常 1 天內回覆

還沒有人認領這個 Issue。

評估

難度
4/5
預估耗時
3-5 天
新手友好度
35/100
Issue 類型
缺陷
描述清晰度
基本清楚
活躍度
活躍
技術堆疊
typescript
領域
cli, cloud

研究方向

Start in packages/void/src/cli/platform-lifecycle.ts, where configured() prefers the checkpoint token over the environment variable and the rejected-token recovery runs only for drafts on a TTY. Then read platform-installer-secrets.ts and platform-install-workers.ts to see how workerSecretUpdates is built and why existing Workers receive no CF_API_TOKEN update. Done means a resumed install uses an explicit replacement token and pushes it to existing API and proxy Workers, with tests covering both paths; the maintainer has not yet chosen the behaviour.

由索引模型根據 Issue 內容生成。

描述

Summary

Suppose void platform install stops after it has created resources or deployed the API and proxy Workers, and the operator then has to replace the runtime token, for example because the original was revoked or rotated. Resuming with VOID_PLATFORM_RUNTIME_CLOUDFLARE_API_TOKEN=<replacement> void platform install --resume --name <id> has two problems:

  1. The CLI keeps using the runtime token saved in the checkpoint and ignores the replacement in the environment.
  2. Even when the replacement is used, Workers that are already deployed keep their old CF_API_TOKEN secret.
Where this happens (v1.5.0)

The saved token wins once the install is past the draft stage.

Existing Workers never receive the new token.

So if the old token still verifies, the API and proxy Workers already deployed in the interrupted run keep running with it. Revoking it later breaks app deploys from the platform. Today, only the installed-platform maintenance path passes updateExistingWorkers: true: https://github.com/voidzero-dev/void/blob/afeeff6a4d72682f6cfb6c947e9a2c29393c00a6/packages/void/src/cli/platform-management.ts#L575-L585

#569 made interrupted credential updates resumable on that maintenance path. The install-resume path does not appear to feed a replacement runtime token into the same mechanism.

Synthetic repro
  1. Run void platform install --workers-dev and interrupt it after the API and proxy Workers are deployed but before it finishes, for example by stopping at a later failing step.
  2. Revoke the runtime token in Cloudflare and create a replacement with the same permissions.
  3. Run VOID_PLATFORM_RUNTIME_CLOUDFLARE_API_TOKEN=<replacement> void platform install --resume --name <id>.
  4. Runtime token verification uses the saved (revoked) token and fails.
  5. Variant: if step 2 does not revoke the old token, the resume completes, but the API and proxy Workers still hold the old token.
Questions
  1. On a non-draft resume, should an explicit VOID_PLATFORM_RUNTIME_CLOUDFLARE_API_TOKEN win over the saved checkpoint value, as it already does for drafts?
  2. When the resolved runtime token differs from the saved one, should resume push CF_API_TOKEN to the existing API and proxy Workers through the existing workerSecretUpdates and intent mechanism? Or would you prefer that resume refuses and points to a separate command?

I'm happy to open a PR for whichever behaviour you prefer.

Prepared with Claude Code on behalf of @iPLAYCAFE-dev; reviewed by the maintainer of this account.

主要語言
TypeScript
星號
627
分支
66
平均合併
14 小時 56 分鐘
30 天內合併 PR
170

環境準備

這個專案沒有提供開發容器、Dockerfile 或貢獻指南,環境需要你自己搭建:先看它的 README,通用步驟見我們的新手貢獻指南。

從這裡開始

  1. 先讀完整個 Issue,再讀專案的貢獻指南。
  2. 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
  3. Fork 儲存庫,在一個分支上完成修改。
  4. 送出 Pull Request,並在描述裡引用這個 Issue 編號。

voidzero-dev/void 的其他 Issue

查看 voidzero-dev/void 的全部 Issue

相似的 Issue

更多 TypeScript Issue

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。