diff --git a/apps/site/src/components/agent-install-tabs.astro b/apps/site/src/components/agent-install-tabs.astro new file mode 100644 index 00000000..45125da7 --- /dev/null +++ b/apps/site/src/components/agent-install-tabs.astro @@ -0,0 +1,112 @@ +--- +import { Icon } from "astro-icon/components"; + +const promptText = + "请先 Fork EdgeEver 仓库:https://github.com/msh01/edgeever\n\nFork 完成后,请使用 Fork 后的仓库把 EdgeEver 安装部署到 Cloudflare 上。"; +--- + +
+
+ + +
+ +
+
+
+

提示词

+
{promptText}
+
+ +
+ +
+
+ + +
+
+ + + + diff --git a/apps/site/src/components/hero.astro b/apps/site/src/components/hero.astro index 92cde902..e5ad53c0 100644 --- a/apps/site/src/components/hero.astro +++ b/apps/site/src/components/hero.astro @@ -47,7 +47,7 @@ const heroSlogan = "基于 Cloudflare 全家桶自托管的开源『印象笔记 class="flex gap-2 items-center justify-center px-6 py-3 bg-white/50 backdrop-blur-sm border border-slate-200 hover:border-slate-300 rounded-xl text-slate-600 hover:text-brand-text transition-all text-sm font-medium hover:-translate-y-0.5" > - AI 辅助部署 + 通过AI Agent安装 diff --git a/apps/site/src/components/navbar/navbar.astro b/apps/site/src/components/navbar/navbar.astro index 6edf44ce..9dba8914 100644 --- a/apps/site/src/components/navbar/navbar.astro +++ b/apps/site/src/components/navbar/navbar.astro @@ -10,8 +10,8 @@ const menuitems = [ path: "/#features", }, { - title: "部署成本", - path: "/pricing", + title: "博客", + path: "/blog", }, { title: "关于项目", diff --git a/apps/site/src/components/pricing.astro b/apps/site/src/components/pricing.astro deleted file mode 100644 index 56e61a17..00000000 --- a/apps/site/src/components/pricing.astro +++ /dev/null @@ -1,54 +0,0 @@ ---- -import { Tick } from "@/components/ui/icons"; -import Link from "@/components/ui/link.astro"; - -const { plan } = Astro.props; ---- - -
-
- - {plan.popular && ( -
- 推荐方案 -
- )} - -
-
-

{plan.name}

-

- { - plan.price && typeof plan.price === "object" - ? plan.price.monthly - : plan.price - } -

-
- -
    - { - plan.features.map((item) => ( -
  • - - - - {item} -
  • - )) - } -
-
- -
- - {plan.button.text || "Get Started"} - -
-
-
diff --git a/apps/site/src/content/blog/ai-agent-deploy-cloudflare.md b/apps/site/src/content/blog/ai-agent-deploy-cloudflare.md index 967c98a8..3717f142 100644 --- a/apps/site/src/content/blog/ai-agent-deploy-cloudflare.md +++ b/apps/site/src/content/blog/ai-agent-deploy-cloudflare.md @@ -11,120 +11,3 @@ category: "Deployment" author: "EdgeEver Team" tags: [cloudflare, deploy, ai-agent, serverless] --- - -如果您习惯使用 AI 编程助手或 Agent(例如 Codex、Claude Code、Antigravity 等),可以让 Agent 按核心仓库的部署协议自动完成 EdgeEver 的 Cloudflare 部署。 - -这篇文章同步自 `edgeever/docs/agent-deploy-cloudflare.md` 的当前流程。推荐先 Fork 官方仓库到自己的 GitHub 账号,再把 Fork 仓库链接交给 Agent。 - ---- - -### 一键部署指令 - -您可以直接把下面这句话发送给 AI 助手: - -```text -这个是我的 EdgeEver Fork 仓库链接:<你的 Fork 仓库 URL>。请把这个项目安装部署到 Cloudflare 上。 -``` - ---- - -### Agent 应遵守的规则 - -- 先读取 `AGENTS.md`、`README.md`、`.env.local.example` 和 `docs/agent-deploy-cloudflare.md`。 -- 不创建新分支,部署工作在 `main` 上执行。 -- 优先使用 `bun run deploy:setup`、`bun run deploy:doctor` 和 `bun run deploy`。 -- 不把个人 Worker 名称、D1 database ID、R2 bucket 名称、account ID、API token 或域名硬编码进源码。 -- 本地和私有部署值写入 `.env.local`,该文件已被 git ignore。 -- 只有 Cloudflare 授权、首次登录密码、自定义域名归属等无法安全推断的信息,才需要询问用户。 - ---- - -### 标准部署流程 - -1. Clone 仓库并进入目录: - - ```sh - git clone - cd edgeever - ``` - -2. 安装依赖: - - ```sh - bun install - ``` - -3. 确认 Cloudflare 授权: - - ```sh - bunx wrangler whoami - ``` - - 如果失败,Agent 应先协助完成 Cloudflare 登录或要求提供合适的 API Token。 - -4. 准备 Cloudflare 资源和 `.env.local`: - - ```sh - EDGE_EVER_PASSWORD='' bun run deploy:setup - ``` - - `deploy:setup` 会在需要时复制 `.env.local.example`,复用或创建 D1 数据库,创建 R2 bucket,并根据首次登录密码生成 `EDGE_EVER_AUTH_PASSWORD_HASH`。 - -5. 检查部署输入: - - ```sh - bun run deploy:doctor - ``` - - 所有 `fail` 结果都应修复后再继续。 - -6. 部署: - - ```sh - bun run deploy - ``` - - 该命令会构建 Web 应用、应用远端 D1 migrations,并部署 Cloudflare Worker。部署过程中,脚本会把 `EDGE_EVER_AUTH_PASSWORD_HASH` 作为 Worker secret 上传。 - -7. 验证结果: - - ```sh - curl -I https:/// - curl https:///api/openapi.json - ``` - - 然后打开站点,用 `EDGE_EVER_AUTH_USERNAME` 和首次登录密码登录,再在应用内 MCP 设置创建 Token。 - -### 高级自定义变量与多实例部署 - -可以在执行 `deploy:setup` 或 `deploy` 前向 `.env.local` 写入自定义变量: - -```sh -EDGE_EVER_WORKER_NAME=edgeever -EDGE_EVER_D1_DATABASE_NAME=edgeever -EDGE_EVER_R2_BUCKET_NAME=edgeever-resources -EDGE_EVER_R2_PREVIEW_BUCKET_NAME=edgeever-resources-preview -EDGE_EVER_AUTH_USERNAME=admin -EDGE_EVER_CUSTOM_DOMAIN=notes.example.com -``` - -多实例可以设置 `EDGE_EVER_INSTANCE=`,并使用作用域变量: - -```sh -EDGE_EVER_INSTANCE=PROD -EDGE_EVER_PROD_WORKER_NAME=edgeever-prod -EDGE_EVER_PROD_D1_DATABASE_ID=<特定的数据库-ID> -EDGE_EVER_PROD_R2_BUCKET_NAME=edgeever-prod-resources -EDGE_EVER_PROD_AUTH_PASSWORD_HASH=<特定的密码-HASH> -``` - -### Agent 何时应该停下来询问 - -只有以下情况应阻塞并询问用户: - -- Cloudflare 授权缺失,且 Agent 无法打开或完成登录。 -- 用户必须选择或提供首次登录密码。 -- 自定义域名不在当前 Cloudflare 账号中。 -- 资源创建因账号限制、权限、计费或命名冲突失败,且无法通过选择新名称解决。 - -部署完成后,Agent 应报告部署 URL、登录用户名、密码是用户提供还是生成的、在应用哪里创建 EdgeEver MCP Token,以及是否还存在自定义域名或 DNS 步骤。 diff --git a/apps/site/src/pages/blog/[slug].astro b/apps/site/src/pages/blog/[slug].astro index fccae93c..49454ce1 100644 --- a/apps/site/src/pages/blog/[slug].astro +++ b/apps/site/src/pages/blog/[slug].astro @@ -1,5 +1,6 @@ --- import { getCollection, render } from "astro:content"; +import AgentInstallTabs from "@/components/agent-install-tabs.astro"; import BlogLayout from "@/layouts/BlogLayout.astro"; export async function getStaticPaths() { @@ -15,5 +16,6 @@ const { Content } = await render(entry); --- + {entry.slug === "ai-agent-deploy-cloudflare" && } diff --git a/apps/site/src/pages/pricing.astro b/apps/site/src/pages/pricing.astro deleted file mode 100644 index 0ae2fa4d..00000000 --- a/apps/site/src/pages/pricing.astro +++ /dev/null @@ -1,59 +0,0 @@ ---- -import Layout from "@/layouts/Layout.astro"; -import Container from "@/components/container.astro"; -import Sectionhead from "@/components/sectionhead.astro"; -import PricingCard from "@/components/pricing.astro"; - -const pricing = [ - { - name: "个人自托管", - price: "接近 $0", - popular: true, - features: [ - "基于 Cloudflare Workers、D1 和 R2", - "README 估算:短笔记可达 10 万条量级", - "README 估算:200KB 图片约可存放 5 万张", - "Web 端图片压缩可减少 R2 资源占用", - "REST API、OpenAPI、CLI 与 Remote MCP 均可使用", - "适合个人笔记、迁移旧资料和 AI Agent 读取整理" - ], - button: { - text: "查看部署仓库", - link: "https://github.com/msh01/edgeever", - }, - }, - { - name: "超出免费额度后", - price: "按 Cloudflare 计费", - popular: false, - features: [ - "费用由你的 Cloudflare 账号计划和用量决定", - "大量图片、附件或高频 API 调用会增加资源消耗", - "多实例可通过 EDGE_EVER_INSTANCE 和作用域变量隔离", - "自定义域名可通过 EDGE_EVER_CUSTOM_DOMAIN 配置", - "部署前可运行 bun run deploy:doctor 检查配置", - "具体单价请以 Cloudflare 官方定价页为准" - ], - button: { - text: "查看 Cloudflare 定价", - link: "https://www.cloudflare.com/zh-cn/developer-platform/products/", - }, - }, -]; ---- - - - - - 极低的使用与托管成本 - - EdgeEver 本身是开源项目。官网不替 Cloudflare 承诺价格,以下只同步核心仓库 README 对个人使用规模的说明;实际账单以您的 Cloudflare 账号计划、资源用量和官方定价为准。 - - - -
- {pricing.map((item) => )} -
-
-