跳转至

访问域名

在线私有文档建议使用:

https://docs.megworks.ai/avenue-agent/

第一版可以用 Cloudflare Pages 托管静态站点,并通过 Cloudflare Zero Trust Access 控制访问。离线交付包继续包含 docs/site/,保证隔离网络也能打开文档。

推荐架构

%%{init: {"theme":"base","themeVariables":{"fontFamily":"Inter, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif","background":"#FAF9F5","primaryColor":"#F4F1EA","primaryTextColor":"#141413","primaryBorderColor":"#D8CBB8","lineColor":"#6F6B63","secondaryColor":"#FFFFFF","tertiaryColor":"#EAF1F7","clusterBkg":"#FAF9F5","clusterBorder":"#E8E6DC"},"flowchart":{"curve":"basis","padding":14,"nodeSpacing":34,"rankSpacing":44,"htmlLabels":true,"useMaxWidth":false}}}%%
flowchart LR
  A([GitHub 仓库]):::start --> B[Cloudflare Pages]:::system
  B --> C[文档域名]:::step
  C --> D[Zero Trust]:::decision
  D --> E([授权用户]):::done
  A --> F[离线站点包]:::module


  classDef start fill:#141413,color:#ffffff,stroke:#141413,stroke-width:1px;
  classDef step fill:#F4F1EA,color:#141413,stroke:#D8CBB8,stroke-width:1px;
  classDef system fill:#EAF1F7,color:#141413,stroke:#6A9BCC,stroke-width:1px;
  classDef decision fill:#EFE7DA,color:#141413,stroke:#C58B5A,stroke-width:1px;
  classDef action fill:#F7E4DC,color:#141413,stroke:#D97757,stroke-width:1px;
  classDef done fill:#EDF1E7,color:#141413,stroke:#788C5D,stroke-width:1px;
  classDef module fill:#FFFFFF,color:#141413,stroke:#E8E6DC,stroke-width:1px;

域名策略

场景 建议地址 访问控制
项目在线访问 docs.megworks.ai/avenue-agent/ Zero Trust Access 邮箱或身份组
项目专属上线空间 docs.megworks.ai/<project>/avenue-agent/ 单独 Access policy
完全离线交付 docs/site/index.html 本地文件或内网静态服务

Zero Trust 第一版配置

  1. 创建 Cloudflare Pages 项目 megworks-docs
  2. 在 GitHub 仓库配置 CLOUDFLARE_API_TOKEN secret。
  3. GitHub Actions 使用 scripts/build-cloudflare-pages.sh 生成 Pages 产物:
scripts/build-cloudflare-pages.sh
  1. 输出目录使用:
_pages
  1. 绑定自定义域名:
docs.megworks.ai
  1. 在 Cloudflare Zero Trust 创建 Access Application,保护 docs.megworks.aidocs.megworks.ai/avenue-agent/*
  2. Access policy 先使用实施团队邮箱域和项目用户邮箱 allowlist。

租户隔离边界

/avenue-agent/ 自动部署通道只发布共享文档,不承载项目专属内容。项目专属上线空间使用独立路径或独立 Pages 项目,并绑定单独的 Cloudflare Access policy。

推荐规则:

类型 路径 部署边界
共享文档 docs.megworks.ai/avenue-agent/ megworks-docs 项目的公共构建产物
项目专属文档 docs.megworks.ai/<project>/avenue-agent/ 单独构建产物和 Access policy
高隔离项目 <project>-docs.megworks.ai/avenue-agent/ 单独 Pages 项目和域名

保留离线版本

发布交付包时,仍然复制构建产物:

avenue-agent-install-package/
  docs/
    site/
      index.html
      assets/
      install/
      release/
      ops/

这样在线访问和离线交付使用同一份源码、同一次 mkdocs build --strict 输出。