Bookworm Portable Setup �����ֿ� (history-cleansed 2026-04-21)
茶师兄 Win11 机器真实报障驱动 4 Bug 闭环:
B1: 移除 change-key.js 优先验证分支 (硬编码 haiku → sonnet-only 套餐必 403)
统一走 Test-ApiKey (多模型 fallback + 三值错误分类).
B2: 默认 ANTHROPIC_MODEL 兜底 opus-4-7 → sonnet-4-6 (基础套餐覆盖面最广).
Test-ApiKey 成功时记录 $script:LastValidatedModel → Phase 4 末尾覆盖为真·可用模型.
B4: stderr 不再 2>&1 | Out-Null. PASS/AUTH_FAIL/NETWORK_ACCEPT 三态记录到
$env:TEMP\bw-phase4-validate.log 并附失败模型列表便于报障.
B3 在 bookworm-portable-config.git c46f0b6 解决 (fingerprint.js wmic→CIM).
Test-ApiKey 候选顺序: sonnet-4-6 > opus-4-7 > opus-4-6 > thinking 变体.
401/403 不再立即 return false, 改累积到 $authFailModels, 全候选失败才判 false.
|
||
|---|---|---|
| assets | ||
| patches | ||
| 拓展 | ||
| .gitignore | ||
| admin-authcode-gui.ps1 | ||
| admin-authcode.ico | ||
| auto-setup.ps1 | ||
| bookworm-desktop.ico | ||
| Bookworm-OneClick-Mac.sh | ||
| Bookworm-OneClick.bat | ||
| Bookworm-Setup.sh | ||
| bookworm.ico | ||
| build.ps1 | ||
| crypto-helper.js | ||
| deploy-gitea.sh | ||
| diagnose-tooluse.js | ||
| gen-authcode.js | ||
| generate-integrity.ps1 | ||
| guide-unified.html | ||
| inject-mcp.js | ||
| install-mac.sh | ||
| install.ps1 | ||
| prepare-repo.ps1 | ||
| quick-reference.txt | ||
| quick-start.html | ||
| README.txt | ||
| secure-firewall.sh | ||
| settings.local.template.json | ||
| setup-all.js | ||
| setup-https.sh | ||
| stop.ps1 | ||
| sync-version.js | ||
| uninstall-mac.sh | ||
| 卸载Bookworm.bat | ||
| 启动Bookworm.bat | ||
| 更新并启动Bookworm.bat | ||
Bookworm Portable v1.4 - 纯云端便携部署工具包
================================================
=== 文件说明 ===
deploy-gitea.sh ECS Gitea 部署 (服务端,执行一次)
prepare-repo.ps1 仓库准备 (本机执行一次)
encrypt-secrets.ps1 凭证加密 (本机执行一次)
settings.local.template.json settings.local.json 模板 (权限白名单)
(settings.template.json 已由 build-portable.js 管理,存于 config 仓库)
install.ps1 安装/启动 (目标机执行)
stop.ps1 清理/卸载 (目标机执行)
=== 一次性部署 ===
步骤 1: 部署 Gitea (ECS)
> scp deploy-gitea.sh root@8.138.11.105:/tmp/
> ssh root@8.138.11.105 "GITEA_ADMIN_PASS='你的密码' bash /tmp/deploy-gitea.sh"
> 登录 http://8.138.11.105:3000 创建两个私有仓库:
- bookworm-config (系统文件)
- bookworm-boot (引导脚本+加密凭证)
步骤 2: 推送 Bookworm 配置
> .\prepare-repo.ps1 -GitUrl "http://8.138.11.105:3000/bookworm/bookworm-config.git"
步骤 3: 加密凭证
> .\encrypt-secrets.ps1
> (输入中转站 API Key + MCP 凭证 + 设置主密码,至少 12 位)
步骤 4: 推送 boot 仓库
> 将 install.ps1, stop.ps1, secrets.enc 推送到 bookworm-boot 仓库
=== 目标机使用 ===
安装: .\install.ps1
清理: .\stop.ps1
恢复: .\stop.ps1 -Restore
深度: .\stop.ps1 -Deep
=== 目标机要求 ===
[必须] Claude Code, Node.js >= 18, Git
[可选] Python 3.x, openssl (Git for Windows 自带)
=== 安全规格 ===
加密: AES-256-CBC + PBKDF2 (600000 迭代, OWASP 2023)
凭证: 仅进程级环境变量,不写磁盘/注册表
Gitea: INSTALL_LOCK=true, 注册关闭, 管理员 CLI 创建
密码: openssl stdin 管道传入,不暴露在进程列表
校验: Gitea 二进制 SHA256 完整性校验