Commit Graph

8 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
51525d3c1f fix: 修复授权码认证的 2 个 BLOCKER + 3 个 WARNING
BLOCKER:
- Bookworm-Setup.sh: ${var,,} → tr 兼容 macOS bash 3.2
- Bookworm-Setup.sh: while 循环加 total_attempts<10 防死循环

WARNING:
- install.ps1: 重写 Decrypt-Secrets 为 while 双计数器,
  格式/过期错误不消耗有效次数,清理残留"主密码"文案
- install.ps1 + auto-setup.ps1: 格式示例去掉误导性空格
  (XXXXXXXX → XXXXXXXXXXXXXXXXXXXXXXXX)

其他:
- 新增 .gitignore,排除 secrets.txt 防止明文密钥误提交

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-06 22:57:47 +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
bookworm
d11b36f815 fix: DPAPI凭证加密 + pwsh7路径凭证注入 + PS5.1双调用优化 + assets追踪
- install.ps1: Save-SecretsToCache 改用真正 DPAPI 加密 (System.Security.ProtectedData)
  增加 GEMINI_API_KEY 到缓存键列表
- install.ps1: Get-CachedSecrets DPAPI 解密 + 旧版明文缓存向后兼容
- 启动Bookworm.bat: pwsh7路径启动 claude 前从注册表加载 DPAPI 加密凭证
- 更新并启动Bookworm.bat: 同上 + PS5.1 回退路径从2次调用精简为1次
- assets/: 纳入版本管理 (favicon-32.png / logo-200x200.png / logo-dark.svg)
- HTML: 同步 download/guide-mac/guide-unified/guide 页面更新

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-06 21:49:50 +08:00
bookworm
2d4dea242b fix: 去掉 Start-Process, bat 负责窗口/ps1 负责执行
根因: Start-Process pwsh 开新窗口但 claude 找不到 PATH,
同时 OneClick.bat 重复调用 install.ps1 导致双启动。

- install.ps1: 新增 -SkipLaunch 参数, step9 改为同步 & claude
- auto-setup.ps1: Phase7 去掉 Start-Process, 同步 & claude
- OneClick.bat: step7 加 -SkipLaunch, 最终块 start pwsh -Command claude
- 启动/更新.bat: 直接 start pwsh -Command claude (不经 install.ps1)

架构: bat 决定窗口类型, ps1 只管同步执行

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-06 20:34:00 +08:00
bookworm
c4c09992f6 feat: 默认启动 --dangerously-skip-permissions 模式
所有6处 claude 启动点统一添加 --dangerously-skip-permissions,
确保 Portable 用户无需手动确认即可执行 Bash 等工具操作。

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-06 20:18:30 +08:00
bookworm
dee7742a12 feat: pwsh7默认终端 + Phase1依赖增强 + Phase6 MCP预安装
- Phase 1: +PowerShell 7/Python 3.12/uv, pwsh升为核心依赖
- Phase 4: 修复缓存命中后仍弹密码框的逻辑缺陷
- Phase 5: 新增 {{PWSH_PATH}} 占位符渲染
- Phase 6: npm cache add + uv tool install 预缓存(超时保护)
- Phase 7: Start-Process pwsh 独立窗口启动Claude
- install.ps1: Render函数添加 {{PWSH_PATH}} + Start-Process启动
- OneClick.bat: 新增步骤4/8安装PowerShell 7
- 所有.bat: start pwsh新窗口模式 + CRLF修复

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-06 19:48:48 +08:00
bookworm
5e0ff18aa1 feat: Bookworm Portable v1.5 — 8 fixes (P0 NDA + P1 banners + P2 perf)
- P1: Banner v1.3→v1.5, Hooks 29→34
- P1: 卸载脚本补删 更新Bookworm.lnk
- P1: git stash pop 安全检查
- P2: Playwright 检测改用 npm list
- P2: 代理端口扫描 500ms async 超时

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-05 23:34:27 +08:00