Commit Graph

2 Commits

Author SHA1 Message Date
bookworm
5141b7882b feat: 多用户独立 relay Key 支持 (方案B)
gen-authcode.js:
  - 新增 --relay-key/-k 参数,替换 ANTHROPIC_API_KEY 为中转站限额子 Key
  - 新增 --user/-u 参数(仅显示标识)
  - 多用户模式输出 secrets-{token前8位}.enc,单用户仍输出 secrets.enc

install.ps1:
  - 新增 Resolve-SecretsFile: 优先找 secrets-XXXXXXXX.enc,回退 secrets.enc
  - Decrypt-Secrets 按 token 前8位定位加密文件

auto-setup.ps1:
  - Phase 4 同步 Resolve-SecretsFile 逻辑(GUI 路径)
  - 文件未找到时弹窗提示拉取对应文件

Bookworm-Setup.sh:
  - 新增 resolve_secrets_file() bash 函数
  - 解密循环按 token 前8位定位 .enc 文件

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-06 23:39:17 +08:00
bookworm
b83c508c22 feat: replace master password auth with time-limited authorization codes
Auth codes use format BW-YYYYMMDD-TOKEN (24-hex, 96-bit entropy).
Token doubles as the AES-256-CBC decryption key for secrets.enc.
Expiry is enforced client-side; format/expiry errors don't consume
the 3 valid-attempt quota.

- gen-authcode.js: new admin tool — generates BW auth code + re-encrypts secrets.enc
- install.ps1: Parse-AuthCode validates format/expiry, Decrypt-Secrets uses token as key
- auto-setup.ps1: Show-AuthCodeDialog WinForms input + Parse-AuthCode-GUI loop
- Bookworm-Setup.sh: parse_authcode() bash function + while-loop with format/expiry handling

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-06 22:47:04 +08:00