不用 GitHub:从签名发布一键更新(粘一把钥匙就行) #2

Merged
saki merged 9 commits from duet/release-bundle-update into main 2026-11-29 00:15:39 +00:00
Member

Duet 写了第一版,saki 让 Claude 直接接着改完(b3bd2e0)。

现在怎么用

没有 GitHub 仓库的部署:/admin 右上角点「设置更新」→ 点「去 Cloudflare 拿钥匙」(只勾了 Workers Scripts 和 D1 的 Edit)→ 粘回来 → 以后点「更新」,就会装上 git.dan9.si 上最新的签名发布。记忆、设置、Secret 都不动。

相对 Duet 第一版改了什么

  • 只签一个小说明文件:aelios-worker.json 约 65KB,写着 D1 迁移、Worker 配置和每个模块的 SHA-256。模块是单独的发布文件,下载后靠哈希核对。免费档的 Worker 只有 10ms CPU,原来要在一次请求里解析和验证整个 1.9MB 的包,现在不用了。
  • 只要粘一把钥匙:新加了 version_metadata 绑定(CF_VERSION)。拿钥匙在账号里找"线上正在跑的就是这一版"的那个 Worker,不用填账户 ID 和 Worker 名,也不会误改别的 Worker。
  • 保留脚本设置:wrangler 每次上传都会带 observability、cache_options 等设置,原来的更新漏了,装完会把日志和缓存设置冲掉。现在照 wrangler 一样带上。
  • 公钥:和 Aelios-resident 共用同一把,默认私钥路径也一样。
  • 不是正常版本号的标签不再当成"更新"。
  • 删掉 docs/deploy-without-github.md。README 里两句话说清楚,docs/releasing.md 只写给维护的人。

测过的

  • npm run typecheck 干净,npm test 724 个全过,lint 和 main 一样是 48 条。
  • 真实 Cloudflare 端到端:在 saki 的账号里临时建了 Worker、D1、Vectorize、Queue,名字都换成测试用的,从源码部署后,把这一版打成签名的 v0.0.1,发到一个临时公开仓库。
    1. 先在 D1 里回退一条迁移(0037)。
    2. 在 /admin 只粘一把钥匙,它认出了自己。
    3. 点更新后:版本变成 v0.0.1,0037 被重新应用(真实 D1 API 一次执行多条语句可以用),D1、Vectorize、Queue 都继承下来,Secret 和自定义变量都在,observability 和缓存设置没变,定时任务按新版本改了,/health 返回 200。
    4. 测完全删,正式的 companion-memory-proxy 和它的资源没碰。

🤖 Generated with Claude Code

Duet 写了第一版,saki 让 Claude 直接接着改完(b3bd2e0)。 ## 现在怎么用 没有 GitHub 仓库的部署:`/admin` 右上角点「设置更新」→ 点「去 Cloudflare 拿钥匙」(只勾了 Workers Scripts 和 D1 的 Edit)→ 粘回来 → 以后点「更新」,就会装上 git.dan9.si 上最新的签名发布。记忆、设置、Secret 都不动。 ## 相对 Duet 第一版改了什么 - **只签一个小说明文件**:`aelios-worker.json` 约 65KB,写着 D1 迁移、Worker 配置和每个模块的 SHA-256。模块是单独的发布文件,下载后靠哈希核对。免费档的 Worker 只有 10ms CPU,原来要在一次请求里解析和验证整个 1.9MB 的包,现在不用了。 - **只要粘一把钥匙**:新加了 `version_metadata` 绑定(`CF_VERSION`)。拿钥匙在账号里找"线上正在跑的就是这一版"的那个 Worker,不用填账户 ID 和 Worker 名,也不会误改别的 Worker。 - **保留脚本设置**:wrangler 每次上传都会带 observability、cache_options 等设置,原来的更新漏了,装完会把日志和缓存设置冲掉。现在照 wrangler 一样带上。 - **公钥**:和 Aelios-resident 共用同一把,默认私钥路径也一样。 - 不是正常版本号的标签不再当成"更新"。 - 删掉 `docs/deploy-without-github.md`。README 里两句话说清楚,`docs/releasing.md` 只写给维护的人。 ## 测过的 - `npm run typecheck` 干净,`npm test` 724 个全过,lint 和 main 一样是 48 条。 - **真实 Cloudflare 端到端**:在 saki 的账号里临时建了 Worker、D1、Vectorize、Queue,名字都换成测试用的,从源码部署后,把这一版打成签名的 v0.0.1,发到一个临时公开仓库。 1. 先在 D1 里回退一条迁移(0037)。 2. 在 /admin 只粘一把钥匙,它认出了自己。 3. 点更新后:版本变成 v0.0.1,0037 被重新应用(真实 D1 API 一次执行多条语句可以用),D1、Vectorize、Queue 都继承下来,Secret 和自定义变量都在,observability 和缓存设置没变,定时任务按新版本改了,`/health` 返回 200。 4. 测完全删,正式的 `companion-memory-proxy` 和它的资源没碰。 🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
src/release holds what an installer page can reuse: finding the latest
release, checking its Ed25519 signature against the public keys in the
code, and installing it through the Cloudflare API. /admin's update only
adds where the account, Worker and sealed token live, the lock, and the
proof that the Worker named is this one.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
release:keygen makes the key pair, keeps the private key outside the
repository and adds the public key to src/release/publicKey.ts.
release:bundle signs aelios-worker.json with it and refuses a key whose
public half is not committed. The .sha256 file is replaced by .sig.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
duet-bot changed target branch from duet/update-from-dan9 to main 2026-11-28 23:41:39 +00:00
- Sign only a small manifest that lists each module's SHA-256 and size; modules
  are release files of their own, checked by hashing. Nothing large is parsed,
  so an update fits a free-plan Worker's 10 ms of CPU.
- Setup is one pasted token. A new version_metadata binding (CF_VERSION) tells
  the running version; the token's accounts are searched for the Worker whose
  live deployment is that version, so it never picks another Worker. The token
  page link opens Cloudflare with Workers Scripts and D1 (Edit) ticked.
- Send the script settings wrangler sends with every upload (observability,
  cache_options, limits, placement, logpush, tail_consumers) and the
  version_metadata binding; before, an update could reset logs and caching.
- Trust the release key shared with Aelios-resident, default to its path.
- A tag that is not a plain version is never "newer".
- Drop docs/deploy-without-github.md; README says it in two lines and
  docs/releasing.md is for the maintainer.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
saki changed title from 不用 GitHub:从签名发布包一键更新 Worker to 不用 GitHub:从签名发布一键更新(粘一把钥匙就行) 2026-11-29 00:13:38 +00:00
saki merged commit 6d6c7bb514 into main 2026-11-29 00:15:39 +00:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Aelios-project/Aelios!2
No description provided.