Skip to content

docs(deployment): phase 2 batch 1 — deployment side 4 docs (#167)#177

Merged
g1331 merged 1 commit into
masterfrom
docs/phase2-deployment-batch
May 23, 2026
Merged

docs(deployment): phase 2 batch 1 — deployment side 4 docs (#167)#177
g1331 merged 1 commit into
masterfrom
docs/phase2-deployment-batch

Conversation

@g1331
Copy link
Copy Markdown
Owner

@g1331 g1331 commented May 23, 2026

Summary

Phase 2 起跑:撰写 issue #167 第一批 10 篇中的部署侧 4 篇正文,严格以仓库源码为依据。

文档 路径 主要内容
部署形态总览 docs/guide/deployment/overview.md 源码 + docker compose vs CI + 远端 SSH 两条主路径,何时引入 docker-compose.cliproxy.yml,「容器服务名 vs localhost」陷阱
快速开始 docs/guide/deployment/quickstart.md 从克隆到登录管理后台的端到端命令链,含 ENCRYPTION_KEY / ADMIN_TOKEN 生成、POSTGRES_PASSWORDDATABASE_URL 一致性、healthcheck 行为
CI 部署后追加 CLIProxyAPI sidecar docs/guide/deployment/cliproxy-sidecar.md deploy-personal.yml 完成后在服务器上手工补 sidecar 资料的完整步骤:curl 拉叠加文件、追加 .env、双 -f up -d、登记实例、升级与回滚
环境变量参考 docs/guide/deployment/env-reference.md .env.example 每个字段一一展开:代码默认 vs docker-compose 默认、必填情况、修改后重启行为、运行时配置覆盖关系;含录制功能两套默认差异的明确标注

事实依据

逐条以仓库当前源码为根:

  • docker-compose.yml / docker-compose.cliproxy.yml:服务定义、网络、卷、healthcheck、${VAR:-default} 默认值
  • .env.example:字段清单与代码注释
  • .github/workflows/deploy-personal.ymlworkflow_dispatch 输入、secrets 列表、自动生成 .env 的规则、smoke test 行为
  • .github/workflows/release.yml:tag 规则、镜像构建与推送、git-cliff release notes
  • cliproxy/config.yaml.template / cliproxy/docker-entrypoint.sh:模板字段、入口脚本必填校验
  • src/lib/utils/config.ts:代码默认值、必填校验、生产 fail-fast 行为
  • src/lib/services/traffic-recording-service.ts 与对应测试:录制相关字段的代码默认与运行时覆盖关系
  • src/app/api/health/route.ts:健康端点响应 schema

无法在源码中验证的具体值(例如 v0.1.0 这种示例 release tag)均以「`<RELEASE_TAG>` 替换为实际部署的 release tag」形式标注,避免给出假数据。

不在本 PR 范围

  • 使用侧 4 篇与架构侧 2 篇(Phase 2 后续两个 PR)
  • README 减负
  • UI helper text
  • 4 篇之外的其他占位文档

Test plan

  • pnpm format:check 全绿(prettier 自动对齐了 markdown 表格列宽)
  • pnpm docs:build 3.15 s 构建成功
  • 占位文档现有 cross-link 与新正文 cross-link 均使用相对路径,构建未报 dead link
  • CI 的 Docs workflow build job 通过
  • 合并后 Pages 站点四篇文档可访问,sidebar 入口正常

Write the first four deployment-side documents from issue #167 phase 2
in source-grounded form. Every command, env var name, default value,
secret list, healthcheck interval and CI flow detail is verified
against docker-compose.yml, docker-compose.cliproxy.yml, .env.example,
.github/workflows/deploy-personal.yml, .github/workflows/release.yml,
cliproxy/config.yaml.template, cliproxy/docker-entrypoint.sh and
src/lib/utils/config.ts as of the current tree.

Documents:
- guide/deployment/overview.md: two main paths (source + compose vs CI
  + remote SSH), the optional CLIProxyAPI sidecar overlay, and the
  service-name vs localhost pitfall.
- guide/deployment/quickstart.md: end-to-end command chain from clone
  to admin login, including ENCRYPTION_KEY / ADMIN_TOKEN generation
  and the POSTGRES_PASSWORD vs DATABASE_URL consistency requirement.
- guide/deployment/cliproxy-sidecar.md: how to retroactively attach
  the CLIProxyAPI sidecar after a deploy-personal.yml deployment,
  including pulling overlay files via raw.githubusercontent.com,
  appending CLIPROXY_* to .env, double -f startup, and rollback.
- guide/deployment/env-reference.md: every .env.example field with
  code default vs docker-compose default, restart behavior, and the
  CLIProxyAPI three-place consistency note.

Out of scope: usage / architecture batches, README slimming, and any
UI helper-text changes. Cross-links use relative paths so they keep
working under the VitePress base /AutoRouter/.
@codecov
Copy link
Copy Markdown

codecov Bot commented May 23, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 74.13%. Comparing base (1bc779c) to head (2395275).
⚠️ Report is 3 commits behind head on master.
✅ All tests successful. No failed tests found.

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #177      +/-   ##
==========================================
- Coverage   78.67%   74.13%   -4.55%     
==========================================
  Files         145      145              
  Lines       11528    11043     -485     
  Branches     3995     3832     -163     
==========================================
- Hits         9070     8187     -883     
- Misses       1625     1657      +32     
- Partials      833     1199     +366     
Flag Coverage Δ
typescript ?
verify 74.13% <ø> (ø)
🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@g1331 g1331 merged commit db6de46 into master May 23, 2026
19 of 21 checks passed
@g1331 g1331 deleted the docs/phase2-deployment-batch branch May 23, 2026 09:46
g1331 added a commit that referenced this pull request May 23, 2026
docs(deployment): fix two review findings on PR #177 (#167)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant