Commit Graph

57 Commits

Author SHA1 Message Date
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
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
b4d3f4de24 fix: 凭证解密优先用 node crypto-helper.js (BWENC1 格式)
secrets.enc 由 crypto-helper.js 加密(BWENC1 格式),
openssl 命令行无法解密(报 bad magic number)。
三个脚本统一修复: 优先 node crypto-helper.js, 回退 openssl。

影响: auto-setup.ps1 / Bookworm-Setup.sh / Bookworm-OneClick-Mac.sh

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-06 15:04:02 +08:00
bookworm
67412b871b feat: 全自动一键安装器 (auto-setup.ps1 + AutoSetup.bat)
7 阶段全自动化:
1. 环境检测 + winget 自动安装 (Node.js/Git/Claude Code)
2. 网络诊断 (代理检测 + API/Gitea/中转站连通性测试)
3. 仓库克隆 (GUI 弹窗输入 Gitea 凭证)
4. 凭证解密 (GUI 密码框 + Credential Manager 缓存)
5. 配置渲染 (settings.json 模板替换)
6. MCP 验证 + 自动安装 (Playwright 等)
7. 完整性校验 + 桌面快捷方式 + 启动

目标: 全新电脑双击一个文件即可完成全部配置

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