AI-native knowledge base & Evernote/Obsidian alternative with instant sync & native MCP. Free on Cloudflare or self-hosted via Docker.
HTML ai-agentcloudflarecloudflare-d1cloudflare-r2cloudflare-workersdockerelectronevernoteevernote-alternativeknowledge-basemcpnote-takingobsidian-alternativeoffline-firstpersonal-knowledge-basepwaself-hostedsqlitetiptapweb-clipper
docs(deploy): configure Cloudflare auth before connecting the fork
tianma-if6557bf47bbb9
diff --git a/README.ja.md b/README.ja.mdindex 4a938f3e..16e07701 100644--- a/README.ja.md+++ b/README.ja.md@@ -106,17 +106,17 @@ Cloudflare のオンライン導入は、次のいずれかです。GitHub と Cloudflare のオンライン操作だけで EdgeEver を導入してください:1. Fork https://github.com/tianma-if/edgeever。2. Cloudflare で D1 `edgeever` と R2 `edgeever-resources` を作成します。-3. Workers & Pages で Fork の `main` ブランチから `edgeever` という名前の Worker を作成します。- リポジトリのルートを使い、Cloudflare Workers Builds の既定のデプロイコマンドを維持します。- その API トークンに D1 の読み取り・編集権限があることを確認して Save and Deploy を選択します。-4. Worker の作成後、ユーザーが指定したパスワードを実行時 Secret- `EDGE_EVER_AUTH_PASSWORD` に設定します- (32 文字以上を推奨)。管理者ユーザー名の既定値は `admin` です。別の名前を指定された場合は、- 次のビルド前に Workers Builds 変数 `EDGE_EVER_AUTH_USERNAME` を設定します。-5. 再度ビルドし、`/api/health` と `/api/openapi.json` を確認してから、- その管理者ユーザー名とパスワードでログインできることを確認します。-6. GitHub Actions の `Update deployed EdgeEver` を有効にし、一度手動実行して、- Fork が今後の安定版と修正を自動で受け取れるようにします。+3. Workers & Pages で「Start with Hello World!」を選び、`edgeever` という名前の Worker を作成します。+4. Worker の Settings → Variables and Secrets で、指定されたログインパスワードを+ 実行時 Secret `EDGE_EVER_AUTH_PASSWORD` として追加し、Deploy を選択します+ (32 文字以上を推奨)。管理者ユーザー名の既定値は `admin` です。+5. Secret のデプロイ後、同じ Worker の Settings → Builds → Connect で Fork の+ `main` ブランチに接続します。+6. Settings → Builds → API token でデプロイ用の Cloudflare API トークンを選択または作成し、対象アカウントの D1 読み取り・編集権限を確認します。+7. Fork の GitHub リポジトリで Actions → Update deployed EdgeEver を開き、必要に応じて有効化して、+ `main` ブランチで Run workflow を選択します。Cloudflare で対応するビルドの成功とデプロイの完了を確認してから、`/api/health` と+ `/api/openapi.json` を確認し、管理者ユーザー名とパスワードでログインを検証します。+ 以後、このワークフローが安定版と修正を自動で同期します。```> 詳細な要件: [AI Agent Cloudflare Deployment](docs/agent-deploy-cloudflare.md)。@@ -124,16 +124,17 @@ GitHub と Cloudflare のオンライン操作だけで EdgeEver を導入して### 方法 B: 手動のオンライン導入<details>-<summary>📖 クリックして展開:Web で行う 6 ステップの手動導入手順</summary>+<summary>📖 クリックして展開:Web で行う 7 ステップの手動導入手順</summary>-ウェブ上の 6 手順で完了します。+以下の 7 手順を、必ず記載の順番どおりにウェブ上で実行してください。1. **リポジトリを Fork**:GitHub 右上の **Fork** で、EdgeEver を自分のアカウントへ Fork します。2. **Cloudflare リソースを作成**:D1 `edgeever` と R2 `edgeever-resources` を作ります。-3. **プロジェクトを取り込み、設定**:Cloudflare **Workers & Pages** で Fork の `main` ブランチから `edgeever` という名前の Worker を作成します。リポジトリのルートと、Cloudflare 上で実行される Workers Builds の既定のデプロイコマンドを使い、API トークンの D1 読み取り・編集権限を確認します。binding はデプロイコマンドが作るため、Fork 内のファイルは編集しないでください。-4. **管理者パスワードを準備**:管理者ログイン用パスワードを用意します。32 文字以上を推奨します。Worker 作成後、実行時 Secret `EDGE_EVER_AUTH_PASSWORD` に保存します。-5. **ビルドと確認**:Save and Deploy で Worker が作成され、ビルドが始まります。初回のビルドは Worker インスタンスを初期化するためのものであり、管理者 Secret 未設定によるエラーは想定内の動作です。手順 4 の実行時 Secret `EDGE_EVER_AUTH_PASSWORD` を追加した後に再試行ボタンを押せばビルドが通過します。管理者ユーザー名の既定値は `admin` です。別の名前を使う場合は、再試行前に Workers Builds 変数 `EDGE_EVER_AUTH_USERNAME` を設定します。導入後に `/api/health` が `200` を返すことを確認し、設定した管理者ユーザー名とパスワードでログインします。-6. **自動更新を有効化**:Fork の **Actions** タブで **I understand my workflows, go ahead and enable them** を押し、**Update deployed EdgeEver** を一度手動実行して、今後の安定版と修正を自動で受け取れるようにします。+3. **Worker を作成**:Cloudflare Workers & Pages で Create application → Start with Hello World! を選び、`edgeever` という名前でデプロイします。これは仮のサービスで、EdgeEver は手順 7 でデプロイします。+4. **管理者パスワードを設定**:Worker の Settings → Variables and Secrets で Secret 型の `EDGE_EVER_AUTH_PASSWORD` を追加し、Deploy を選択します。値はログインパスワードで、32 文字以上を推奨します。完了後に Fork へ接続します。+5. **Fork に接続**:既存 Worker の Settings → Builds → Connect で Fork と本番ブランチ `main` を選びます。+6. **デプロイ権限を設定**:Settings → Builds → API token でデプロイ用の Cloudflare API トークンを選択または作成し、対象アカウントの D1 読み取り・編集権限を確認します。+7. **ビルドと確認**:Fork の GitHub リポジトリで Actions → Update deployed EdgeEver を開き、必要に応じて有効化して、 `main` ブランチで Run workflow を選択します。Cloudflare で対応するビルドの成功とデプロイの完了を確認してから、 `/api/health` が `200` を返すこととログインを確認します。以後、このワークフローが安定版と修正を自動で同期します。> 📖 手順と設定の詳細は [Online Deployment Guide](docs/deploy-cloudflare-button.md) を見てください。diff --git a/README.md b/README.mdindex c3f1054c..a22f7319 100644--- a/README.md+++ b/README.md@@ -106,18 +106,16 @@ Copy the prompt below directly into an AI Agent (such as Codex, Claude, Cursor,Deploy EdgeEver entirely through GitHub and Cloudflare:1. Fork https://github.com/tianma-if/edgeever.2. Create D1 `edgeever` and R2 `edgeever-resources` in Cloudflare.-3. In Workers & Pages, create a Worker named `edgeever` from the Fork's `main` branch.- Use the repository root, keep Cloudflare's default Workers Builds deploy command,- and ensure its API token can read and edit D1. Select Save and Deploy.-4. After the Worker is created, add the user's chosen password as the runtime Secret- `EDGE_EVER_AUTH_PASSWORD` (preferably at least 32 characters).- The username defaults to `admin`.- If the user specifies another, set `EDGE_EVER_AUTH_USERNAME` as a Workers Builds- variable before the next build.-5. Run the build again, verify `/api/health` and `/api/openapi.json`, then log in- with that administrator username and password.-6. Enable and manually run the GitHub Actions workflow named `Update deployed EdgeEver`- once so the Fork can automatically receive future stable releases and fixes.+3. In Workers & Pages, select "Start with Hello World!" and create a Worker named `edgeever`.+4. Add the user's chosen password as the runtime Secret `EDGE_EVER_AUTH_PASSWORD`+ under Settings → Variables and Secrets, and deploy the Secret (preferably at least+ 32 characters). The username defaults to `admin`.+5. Only after the Secret is deployed, open this Worker's Settings → Builds → Connect+ and connect the Fork's `main` branch.+6. In Settings → Builds → API token, select or create the Cloudflare API token used for deployment, with D1 read/edit permission for the target account.+7. In the Fork's GitHub repository, open Actions → Update deployed EdgeEver, enable the workflow if prompted, and select Run workflow on `main`. After confirming in Cloudflare that the corresponding build succeeded and deployment completed, verify `/api/health` and `/api/openapi.json`, then log in with the administrator+ username and password.+ This workflow will automatically sync future stable releases and fixes.```> Detailed requirements: [AI Agent Cloudflare Deployment](docs/agent-deploy-cloudflare.md).@@ -125,16 +123,17 @@ Deploy EdgeEver entirely through GitHub and Cloudflare:### Option B: Manual Online Deployment<details>-<summary>📖 Click to expand: 6-Step Web Manual Deployment Guide</summary>+<summary>📖 Click to expand: 7-Step Web Manual Deployment Guide</summary>-Complete setup in 6 web steps:+Complete the following 7 web steps strictly in order:1. **Fork the Repository**: Click **Fork** at the top right of GitHub to fork EdgeEver into your personal account.2. **Create Cloudflare Resources**: Create D1 `edgeever` and R2 `edgeever-resources`.-3. **Import & Configure the Project**: Create a Worker named `edgeever` from the Fork's `main` branch in Cloudflare **Workers & Pages**. Use the repository root and keep Cloudflare's default Workers Builds deploy command, which runs in Cloudflare. Ensure its API token can read and edit D1. The deploy command creates the bindings; do not edit Fork files.-4. **Choose the Administrator Password**: Choose an administrator password, preferably at least 32 characters. Once the Worker is created, save it as the runtime Secret `EDGE_EVER_AUTH_PASSWORD`.-5. **Build & Verify**: Save and Deploy creates the Worker and starts a build. The initial build primarily initializes the Worker instance; if it fails due to missing administrator Secret, this is expected behavior. Simply add the runtime Secret `EDGE_EVER_AUTH_PASSWORD` from Step 4 and click retry. The username defaults to `admin`; to use another, set `EDGE_EVER_AUTH_USERNAME` as a Workers Builds variable before retrying. Once deployed, confirm `/api/health` returns `200`, then log in with the configured username and password.-6. **Enable Automatic Updates**: Open the Fork's **Actions** tab, click **I understand my workflows, go ahead and enable them**, then manually run **Update deployed EdgeEver** once so the Fork can automatically receive future stable releases and fixes.+3. **Create the Worker**: In Cloudflare Workers & Pages, select Create application → Start with Hello World!, name the Worker `edgeever`, and deploy it. This creates a placeholder; EdgeEver is deployed in Step 7.+4. **Set the Administrator Password**: Under the Worker’s Settings → Variables and Secrets, add `EDGE_EVER_AUTH_PASSWORD` as type Secret and click Deploy. Its value is your chosen login password, preferably at least 32 characters. Complete this before connecting the Fork.+5. **Connect the Fork**: In the existing Worker’s Settings → Builds → Connect, select the Fork and production branch `main`.+6. **Configure Deployment Permissions**: In Settings → Builds → API token, select or create the Cloudflare API token used for deployment, with D1 read/edit permission for the target account.+7. **Build & Verify**: In the Fork's GitHub repository, open Actions → Update deployed EdgeEver, enable the workflow if prompted, and select Run workflow on `main`. After confirming in Cloudflare that the corresponding build succeeded and deployment completed, confirm `/api/health` returns `200` and verify login. This workflow will automatically sync future stable releases and fixes.> 📖 For full step-by-step instructions and configuration details, see the [Online Deployment Guide](docs/deploy-cloudflare-button.md).diff --git a/README.pl-PL.md b/README.pl-PL.mdindex 949479c2..e499d537 100644--- a/README.pl-PL.md+++ b/README.pl-PL.md@@ -106,18 +106,17 @@ Skopiuj poniższe polecenie do agenta AI, na przykład Codex, Claude, Cursor, WoWdróż EdgeEver przez GitHub i Cloudflare:1. Utwórz Fork repozytorium https://github.com/tianma-if/edgeever.2. Utwórz bazę D1 `edgeever` i zasobnik R2 `edgeever-resources` w Cloudflare.-3. W Workers & Pages utwórz Worker o nazwie `edgeever` z gałęzi `main` Forka.- Użyj katalogu głównego repozytorium, zachowaj domyślne polecenie wdrożenia- Workers Builds i upewnij się, że token API może odczytywać i modyfikować D1.- Wybierz Save and Deploy.-4. Po utworzeniu Workera zapisz wybrane hasło jako sekret środowiska- uruchomieniowego `EDGE_EVER_AUTH_PASSWORD` (najlepiej co najmniej 32 znaki).- Domyślna nazwa użytkownika to `admin`. Aby ją zmienić, ustaw zmienną- Workers Builds `EDGE_EVER_AUTH_USERNAME` przed kolejnym buildem.-5. Ponów build, sprawdź `/api/health` i `/api/openapi.json`, a następnie- zaloguj się nazwą administratora i hasłem.-6. Włącz i ręcznie uruchom raz workflow GitHub Actions `Update deployed EdgeEver`,- aby Fork automatycznie otrzymywał przyszłe stabilne wersje i poprawki.+3. W Workers & Pages wybierz „Start with Hello World!” i utwórz Worker o nazwie `edgeever`.+4. W Settings → Variables and Secrets dodaj wybrane hasło jako sekret środowiska+ uruchomieniowego `EDGE_EVER_AUTH_PASSWORD` i kliknij Deploy (zalecane co najmniej+ 32 znaki). Domyślna nazwa użytkownika to `admin`.+5. Po wdrożeniu sekretu otwórz Settings → Builds → Connect tego Workera i podłącz+ gałąź `main` Forka.+6. W Settings → Builds → API token wybierz lub utwórz token API Cloudflare do wdrażania, z uprawnieniami do odczytu i edycji D1 na koncie docelowym.+7. W repozytorium Forka na GitHubie otwórz Actions → Update deployed EdgeEver, włącz workflow, jeśli pojawi się monit,+ i wybierz Run workflow dla gałęzi `main`. Po potwierdzeniu w Cloudflare, że odpowiedni build zakończył się sukcesem, a wdrożenie zostało ukończone, sprawdź `/api/health` i `/api/openapi.json`, a następnie+ zweryfikuj logowanie nazwą administratora i hasłem.+ Ten workflow będzie automatycznie synchronizować kolejne stabilne wersje i poprawki.```> Szczegółowe wymagania: [wdrożenie Cloudflare z agentem AI](docs/agent-deploy-cloudflare.md).@@ -125,16 +124,17 @@ Wdróż EdgeEver przez GitHub i Cloudflare:### Opcja B: Ręczne wdrożenie online<details>-<summary>📖 Rozwiń: 6 kroków konfiguracji ręcznej w przeglądarce</summary>+<summary>📖 Rozwiń: 7 kroków konfiguracji ręcznej w przeglądarce</summary>-Konfiguracja obejmuje sześć kroków w interfejsie przeglądarkowym:+Wykonaj poniższe siedem kroków w przeglądarce ściśle w podanej kolejności:1. **Utwórz Fork repozytorium**: Kliknij **Fork** w prawym górnym rogu strony GitHub, aby utworzyć kopię EdgeEver na swoim koncie.2. **Utwórz zasoby Cloudflare**: Utwórz bazę D1 `edgeever` i zasobnik R2 `edgeever-resources`.-3. **Zaimportuj i skonfiguruj projekt**: W Cloudflare **Workers & Pages** utwórz Worker `edgeever` z gałęzi `main` swojego Forka. Użyj katalogu głównego repozytorium i zachowaj domyślne polecenie wdrożenia Workers Builds. Token API musi mieć prawo do odczytu i modyfikacji D1. Polecenie wdrożenia utworzy powiązania zasobów; nie edytuj plików Forka.-4. **Wybierz hasło administratora**: Ustaw hasło, najlepiej o długości co najmniej 32 znaków. Po utworzeniu Workera zapisz je jako sekret środowiska uruchomieniowego `EDGE_EVER_AUTH_PASSWORD`.-5. **Zbuduj i sprawdź aplikację**: Kliknij **Save and Deploy**, aby utworzyć Workera i uruchomić build (niepowodzenie pierwszego buildu z powodu braku sekretu administratora jest zjawiskiem normalnym; dodaj sekret z kroku 4 i ponów próbę). Domyślna nazwa użytkownika to `admin`; aby ją zmienić, ustaw zmienną Workers Builds `EDGE_EVER_AUTH_USERNAME` przed ponownym buildem. Po wdrożeniu sprawdź, czy `/api/health` zwraca `200`, i zaloguj się.-6. **Włącz automatyczne aktualizacje**: W zakładce **Actions** Forka kliknij **I understand my workflows, go ahead and enable them**, a następnie ręcznie uruchom raz workflow **Update deployed EdgeEver**.+3. **Utwórz Workera**: W Cloudflare Workers & Pages wybierz Create application → Start with Hello World!, nazwij Workera `edgeever` i wdróż go. To usługa tymczasowa; EdgeEver zostanie wdrożony w kroku 7.+4. **Ustaw hasło administratora**: W Settings → Variables and Secrets Workera dodaj `EDGE_EVER_AUTH_PASSWORD` jako typ Secret i kliknij Deploy. Wartością jest wybrane hasło logowania, najlepiej co najmniej 32 znaki. Zrób to przed podłączeniem Forka.+5. **Podłącz Fork**: W Settings → Builds → Connect istniejącego Workera wybierz Fork i gałąź produkcyjną `main`.+6. **Skonfiguruj uprawnienia wdrożenia**: W Settings → Builds → API token wybierz lub utwórz token API Cloudflare do wdrażania, z uprawnieniami do odczytu i edycji D1 na koncie docelowym.+7. **Zbuduj i sprawdź**: W repozytorium Forka na GitHubie otwórz Actions → Update deployed EdgeEver, włącz workflow, jeśli pojawi się monit, i wybierz Run workflow dla gałęzi `main`. Po potwierdzeniu w Cloudflare, że odpowiedni build zakończył się sukcesem, a wdrożenie zostało ukończone, sprawdź, czy `/api/health` zwraca `200`, i zweryfikuj logowanie. Ten workflow będzie automatycznie synchronizować kolejne stabilne wersje i poprawki.> Pełne instrukcje i konfigurację znajdziesz w [przewodniku wdrożenia online](docs/deploy-cloudflare-button.md).diff --git a/README.zh-CN.md b/README.zh-CN.mdindex 60a26239..9d7594ca 100644--- a/README.zh-CN.md+++ b/README.zh-CN.md@@ -106,16 +106,18 @@ Cloudflare 在线部署可以选择以下两种方式之一:请全程通过 GitHub 和 Cloudflare 在线部署 EdgeEver:1. Fork https://github.com/tianma-if/edgeever。2. 在 Cloudflare 中创建 D1 `edgeever` 与 R2 `edgeever-resources`。-3. 在 Workers & Pages 中从 Fork 的 `main` 分支创建名为 `edgeever` 的 Worker。- 使用仓库根目录,保留 Cloudflare Workers Builds 的默认部署命令,确认其 API Token- 具备 D1 读取和编辑权限,然后保存并部署。-4. Worker 创建后,设置运行时 Secret `EDGE_EVER_AUTH_PASSWORD`,值为用户指定的密码- (建议至少 32 个字符)。管理员用户名默认为 `admin`;如需自定义,请在再次构建前- 设置 Workers Builds 构建变量 `EDGE_EVER_AUTH_USERNAME`。-5. 再次构建,验证 `/api/health` 和 `/api/openapi.json`,再用该管理员- 用户名和密码验证登录。-6. 启用并手动运行一次名为 `Update deployed EdgeEver` 的 GitHub Actions 工作流,- 以便后续自动同步正式版本,持续获得 EdgeEver 的功能更新和问题修复。+3. 在 Workers & Pages 中选择「Start with Hello World!」,创建名为 `edgeever` 的 Worker。+4. 在该 Worker 的 Settings → Variables and Secrets 中添加运行时 Secret+ `EDGE_EVER_AUTH_PASSWORD`,值为用户指定的登录密码(建议至少 32 个字符),并点击 Deploy。+ 管理员用户名默认为 `admin`。+5. 确认 Secret 已部署后,在该 Worker 的 Settings → Builds → Connect 中连接 Fork 的+ `main` 分支。+6. 在 Settings → Builds → API token 中选择或创建用于部署的+ Cloudflare API Token,并确保它具备目标账户的 D1 读取和编辑权限。+7. 在 Fork 的 GitHub 仓库中进入 Actions → Update deployed EdgeEver,按提示启用工作流,+ 选择 `main` 分支并点击 Run workflow。在 Cloudflare 确认对应构建成功、部署完成后,验证 `/api/health` 和 `/api/openapi.json`,+ 再用管理员用户名和密码验证登录。+ 后续由该工作流自动同步正式版本,持续获得功能更新和问题修复。```> 详细约定与要求请查看:[AI Agent 在线部署约定](docs/agent-deploy-cloudflare.zh-CN.md)。@@ -123,16 +125,17 @@ Cloudflare 在线部署可以选择以下两种方式之一:### 方案二:手动在线部署<details>-<summary>📖 展开查看:网页端 6 步手动部署流程</summary>+<summary>📖 展开查看:网页端 7 步手动部署流程</summary>-仅需在网页端完成 6 步配置:+请严格按以下顺序,在网页端完成 7 步配置:1. **Fork 仓库**:在 GitHub 点击右上角 **Fork**,将项目 Fork 到您的个人账户下。2. **创建 Cloudflare 资源**:创建 D1 `edgeever` 与 R2 `edgeever-resources`。-3. **导入并配置项目**:在 Cloudflare **Workers & Pages** 中从 Fork 的 `main` 分支创建名为 `edgeever` 的 Worker。使用仓库根目录,保留由 Cloudflare 在线执行的 Workers Builds 默认部署命令,并确认其 API Token 具备 D1 读取和编辑权限。binding 由部署命令生成,不要修改 Fork 中的文件。-4. **准备管理员密码**:准备管理员登录密码,建议至少 32 个字符。Worker 创建后,将它保存为运行时 Secret `EDGE_EVER_AUTH_PASSWORD`。-5. **首次构建与验证**:保存并部署会创建 Worker 并启动构建。首次构建主要用于初始化 Worker 实例,若因尚未配置管理员 Secret 而报错属于预期行为,只需在第 4 步添加运行时 Secret `EDGE_EVER_AUTH_PASSWORD` 后点击重试构建即可通过。管理员用户名默认为 `admin`;如需使用其他用户名,请在重试构建前设置 Workers Builds 构建变量 `EDGE_EVER_AUTH_USERNAME`。部署完成后访问 `/api/health`,确认返回 `200`,再用配置的管理员用户名和密码登录。-6. **启用自动更新**:进入 Fork 的 **Actions** 标签页,点击 **I understand my workflows, go ahead and enable them**,然后手动运行一次 **Update deployed EdgeEver**,确保后续能够自动获得正式版本的功能更新与修复。+3. **创建 Worker**:在 Cloudflare Workers & Pages 中选择 Create application → Start with Hello World!,命名为 `edgeever` 并部署。此时是占位服务,第 7 步才部署 EdgeEver。+4. **设置管理员密码**:在该 Worker 的 Settings → Variables and Secrets 中,选择 Secret 类型,添加 `EDGE_EVER_AUTH_PASSWORD` 并点击 Deploy。值为您指定的登录密码,建议至少 32 个字符。完成后再连接 Fork。+5. **连接 Fork**:在已有 Worker 的 Settings → Builds → Connect 中选择 Fork 和生产分支 `main`。+6. **配置部署权限**:在 Settings → Builds → API token 中选择或创建用于部署的 Cloudflare API Token,并确保它具备目标账户的 D1 读取和编辑权限。+7. **构建并验证**:在 Fork 的 GitHub 仓库中进入 Actions → Update deployed EdgeEver,按提示启用工作流, 选择 `main` 分支并点击 Run workflow。在 Cloudflare 确认对应构建成功、部署完成后,确认 `/api/health` 返回 `200`,并验证登录。后续由该工作流自动同步正式版本,持续获得功能更新和问题修复。> 📖 包含具体参数与构建命令的详细步骤,请查看 [在线部署完整文档](docs/deploy-cloudflare-button.zh-CN.md)。diff --git a/README.zh-TW.md b/README.zh-TW.mdindex 20b39c42..3f78d8ba 100644--- a/README.zh-TW.md+++ b/README.zh-TW.md@@ -106,16 +106,18 @@ Cloudflare 線上部署可以選擇以下兩種方式之一:請全程透過 GitHub 和 Cloudflare 線上部署 EdgeEver:1. Fork https://github.com/tianma-if/edgeever。2. 在 Cloudflare 中建立 D1 `edgeever` 與 R2 `edgeever-resources`。-3. 在 Workers & Pages 中從 Fork 的 `main` 分支建立名為 `edgeever` 的 Worker。- 使用儲存庫根目錄,保留 Cloudflare Workers Builds 的預設部署指令,確認其 API Token- 具備 D1 讀取及編輯權限,然後儲存並部署。-4. Worker 建立後,設定執行時 Secret `EDGE_EVER_AUTH_PASSWORD`,值為使用者指定的密碼- (建議至少 32 個字元)。管理員使用者名稱預設為 `admin`;如需自訂,請在再次建置前- 設定 Workers Builds 建置變數 `EDGE_EVER_AUTH_USERNAME`。-5. 再次建置,驗證 `/api/health` 和 `/api/openapi.json`,再用該管理員- 使用者名稱和密碼驗證登入。-6. 啟用並手動執行一次名為 `Update deployed EdgeEver` 的 GitHub Actions 工作流程,- 以便後續自動同步正式版本,持續獲得 EdgeEver 的功能更新與問題修復。+3. 在 Workers & Pages 中選擇「Start with Hello World!」,建立名為 `edgeever` 的 Worker。+4. 在該 Worker 的 Settings → Variables and Secrets 中新增執行時 Secret+ `EDGE_EVER_AUTH_PASSWORD`,值為使用者指定的登入密碼(建議至少 32 個字元),並點選 Deploy。+ 管理員使用者名稱預設為 `admin`。+5. 確認 Secret 已部署後,在該 Worker 的 Settings → Builds → Connect 中連接 Fork 的+ `main` 分支。+6. 在 Settings → Builds → API token 中選擇或建立用於部署的+ Cloudflare API Token,並確認它具備目標帳戶的 D1 讀取及編輯權限。+7. 在 Fork 的 GitHub 儲存庫中進入 Actions → Update deployed EdgeEver,依提示啟用工作流程,+ 選擇 `main` 分支並點選 Run workflow。在 Cloudflare 確認對應建置成功、部署完成後,驗證 `/api/health` 和 `/api/openapi.json`,+ 再用管理員使用者名稱和密碼驗證登入。+ 後續由該工作流程自動同步正式版本,持續獲得功能更新與問題修復。```> 詳細約定與要求請查看:[AI Agent 線上部署約定](docs/agent-deploy-cloudflare.zh-CN.md)。@@ -123,16 +125,17 @@ Cloudflare 線上部署可以選擇以下兩種方式之一:### 方案二:手動線上部署<details>-<summary>📖 展開查看:網頁端 6 步手動部署流程</summary>+<summary>📖 展開查看:網頁端 7 步手動部署流程</summary>-只需在網頁端完成 6 步設定:+請嚴格依照以下順序,在網頁端完成 7 步設定:1. **Fork 儲存庫**:在 GitHub 點選右上角 **Fork**,將專案 Fork 到您的個人帳戶下。2. **建立 Cloudflare 資源**:建立 D1 `edgeever` 與 R2 `edgeever-resources`。-3. **匯入並設定專案**:在 Cloudflare **Workers & Pages** 中從 Fork 的 `main` 分支建立名為 `edgeever` 的 Worker。使用儲存庫根目錄,保留由 Cloudflare 線上執行的 Workers Builds 預設部署指令,並確認其 API Token 具備 D1 讀取及編輯權限。binding 由部署指令產生,不要修改 Fork 中的檔案。-4. **準備管理員密碼**:準備管理員登入密碼,建議至少 32 個字元。Worker 建立後,將它儲存為執行時 Secret `EDGE_EVER_AUTH_PASSWORD`。-5. **首次建置與驗證**:儲存並部署會建立 Worker 並啟動建置。首次建置主要用於初始化實例,若因尚未配置管理員 Secret 而報錯屬於預期行為,只需在第 4 步新增執行時 Secret `EDGE_EVER_AUTH_PASSWORD` 後點擊重試建置即可通過。管理員使用者名稱預設為 `admin`;如需使用其他名稱,請在重試建置前設定 Workers Builds 建置變數 `EDGE_EVER_AUTH_USERNAME`。部署完成後造訪 `/api/health`,確認回傳 `200`,再用設定的管理員使用者名稱和密碼登入。-6. **啟用自動更新**:進入 Fork 的 **Actions** 分頁,點選 **I understand my workflows, go ahead and enable them**,然後手動執行一次 **Update deployed EdgeEver**,確保後續能夠自動獲得正式版本的功能更新與修復。+3. **建立 Worker**:在 Cloudflare Workers & Pages 中選擇 Create application → Start with Hello World!,命名為 `edgeever` 並部署。此時是預留服務,第 7 步才部署 EdgeEver。+4. **設定管理員密碼**:在該 Worker 的 Settings → Variables and Secrets 中,選擇 Secret 類型,新增 `EDGE_EVER_AUTH_PASSWORD` 並點選 Deploy。值為您指定的登入密碼,建議至少 32 個字元。完成後再連接 Fork。+5. **連接 Fork**:在既有 Worker 的 Settings → Builds → Connect 中選擇 Fork 和正式環境分支 `main`。+6. **設定部署權限**:在 Settings → Builds → API token 中選擇或建立用於部署的 Cloudflare API Token,並確認它具備目標帳戶的 D1 讀取及編輯權限。+7. **建置並驗證**:在 Fork 的 GitHub 儲存庫中進入 Actions → Update deployed EdgeEver,依提示啟用工作流程, 選擇 `main` 分支並點選 Run workflow。在 Cloudflare 確認對應建置成功、部署完成後,確認 `/api/health` 回傳 `200`,並驗證登入。後續由該工作流程自動同步正式版本,持續獲得功能更新與問題修復。> 📖 包含具體參數與建置指令的詳細步驟,請查看 [線上部署完整文件](docs/deploy-cloudflare-button.zh-CN.md)。diff --git a/apps/site/src/deployment-prompts.ts b/apps/site/src/deployment-prompts.tsindex c3436570..89c8efad 100644--- a/apps/site/src/deployment-prompts.ts+++ b/apps/site/src/deployment-prompts.ts@@ -2,90 +2,98 @@ export const deploymentPrompts = {"en-US": `Deploy EdgeEver entirely through GitHub and Cloudflare:1. Fork https://github.com/tianma-if/edgeever.2. Create D1 \`edgeever\` and R2 \`edgeever-resources\` in Cloudflare.-3. In Workers & Pages, create a Worker named \`edgeever\` from the Fork's \`main\` branch.- Use the repository root, keep Cloudflare's default Workers Builds deploy command,- and ensure its API token can read and edit D1. Select Save and Deploy.-4. After the Worker is created, add the user's chosen password as the runtime Secret- \`EDGE_EVER_AUTH_PASSWORD\` (preferably at least 32 characters).- The username defaults to \`admin\`.- If the user specifies another, set \`EDGE_EVER_AUTH_USERNAME\` as a Workers Builds- variable before the next build.-5. Run the build again, verify \`/api/health\` and \`/api/openapi.json\`, then log in- with that administrator username and password.-6. Enable and manually run the GitHub Actions workflow named \`Update deployed EdgeEver\`- once so the Fork can automatically receive future stable releases and fixes.`,+3. In Workers & Pages, select "Start with Hello World!" and create a Worker named \`edgeever\`.+4. Add the user's chosen password as the runtime Secret \`EDGE_EVER_AUTH_PASSWORD\`+ under Settings → Variables and Secrets, and deploy the Secret (preferably at least+ 32 characters). The username defaults to \`admin\`.+5. Only after the Secret is deployed, open this Worker's Settings → Builds → Connect+ and connect the Fork's \`main\` branch.+6. In Settings → Builds → API token, select or create the Cloudflare API token used for deployment, with D1 read/edit permission for the target account.+7. In the Fork's GitHub repository, open Actions → Update deployed EdgeEver, enable the workflow if prompted, and select Run workflow on \`main\`. After confirming in Cloudflare that the corresponding build succeeded and deployment completed, verify \`/api/health\` and \`/api/openapi.json\`, then log in with the administrator+ username and password.+ This workflow will automatically sync future stable releases and fixes.`,"zh-CN": `请全程通过 GitHub 和 Cloudflare 在线部署 EdgeEver:1. Fork https://github.com/tianma-if/edgeever。2. 在 Cloudflare 中创建 D1 \`edgeever\` 与 R2 \`edgeever-resources\`。-3. 在 Workers & Pages 中从 Fork 的 \`main\` 分支创建名为 \`edgeever\` 的 Worker。- 使用仓库根目录,保留 Cloudflare Workers Builds 的默认部署命令,确认其 API Token- 具备 D1 读取和编辑权限,然后保存并部署。-4. Worker 创建后,设置运行时 Secret \`EDGE_EVER_AUTH_PASSWORD\`,值为用户指定的密码- (建议至少 32 个字符)。管理员用户名默认为 \`admin\`;如需自定义,请在再次构建前- 设置 Workers Builds 构建变量 \`EDGE_EVER_AUTH_USERNAME\`。-5. 再次构建,验证 \`/api/health\` 和 \`/api/openapi.json\`,再用该管理员- 用户名和密码验证登录。-6. 启用并手动运行一次名为 \`Update deployed EdgeEver\` 的 GitHub Actions 工作流,- 以便后续自动同步正式版本,持续获得 EdgeEver 的功能更新和问题修复。`,+3. 在 Workers & Pages 中选择「Start with Hello World!」,创建名为 \`edgeever\` 的 Worker。+4. 在该 Worker 的 Settings → Variables and Secrets 中添加运行时 Secret+ \`EDGE_EVER_AUTH_PASSWORD\`,值为用户指定的登录密码(建议至少 32 个字符),并点击 Deploy。+ 管理员用户名默认为 \`admin\`。+5. 确认 Secret 已部署后,在该 Worker 的 Settings → Builds → Connect 中连接 Fork 的+ \`main\` 分支。+6. 在 Settings → Builds → API token 中选择或创建用于部署的+ Cloudflare API Token,并确保它具备目标账户的 D1 读取和编辑权限。+7. 在 Fork 的 GitHub 仓库中进入 Actions → Update deployed EdgeEver,按提示启用工作流,+ 选择 \`main\` 分支并点击 Run workflow。在 Cloudflare 确认对应构建成功、部署完成后,验证 \`/api/health\` 和 \`/api/openapi.json\`,+ 再用管理员用户名和密码验证登录。+ 后续由该工作流自动同步正式版本,持续获得功能更新和问题修复。`,} as const;export const manualDeploymentCopy = {"en-US": {- intro: "Complete setup in 6 web steps:",- steps: [+ "intro": "Complete the following 7 web steps strictly in order:",+ "steps": [{- title: "Fork the Repository",- body: "Click Fork at the top right of GitHub to fork EdgeEver into your personal account.",+ "title": "Fork the Repository",+ "body": "Click Fork at the top right of GitHub to fork EdgeEver into your personal account."},{- title: "Create Cloudflare Resources",- body: "Create D1 edgeever and R2 edgeever-resources.",+ "title": "Create Cloudflare Resources",+ "body": "Create D1 edgeever and R2 edgeever-resources."},{- title: "Import & Configure the Project",- body: "Create a Worker named edgeever from the Fork's main branch in Cloudflare Workers & Pages. Use the repository root and keep Cloudflare's default Workers Builds deploy command, which runs in Cloudflare. Ensure its API token can read and edit D1. The deploy command creates the bindings; do not edit Fork files.",+ "title": "Create the Worker",+ "body": "In Cloudflare Workers & Pages, select Create application → Start with Hello World!, name the Worker edgeever, and deploy it. This creates a placeholder; EdgeEver is deployed in Step 7."},{- title: "Choose the Administrator Password",- body: "Choose an administrator password, preferably at least 32 characters. Once the Worker is created, save it as the runtime Secret EDGE_EVER_AUTH_PASSWORD.",+ "title": "Set the Administrator Password",+ "body": "Under the Worker’s Settings → Variables and Secrets, add EDGE_EVER_AUTH_PASSWORD as type Secret and click Deploy. Its value is your chosen login password, preferably at least 32 characters. Complete this before connecting the Fork."},{- title: "Build & Verify",- body: "Save and Deploy creates the Worker and starts a build. The initial build primarily initializes the Worker instance; if it fails due to missing administrator Secret, this is expected behavior. Simply add the runtime Secret EDGE_EVER_AUTH_PASSWORD from Step 4 and click retry. The username defaults to admin; to use another, set EDGE_EVER_AUTH_USERNAME as a Workers Builds variable before retrying. Once deployed, confirm /api/health returns 200, then log in with the configured username and password.",+ "title": "Connect the Fork",+ "body": "In the existing Worker’s Settings → Builds → Connect, select the Fork and production branch main."},{- title: "Enable Automatic Updates",- body: "Open the Fork's Actions tab, click I understand my workflows, go ahead and enable them, then manually run Update deployed EdgeEver once so the Fork can automatically receive future stable releases and fixes.",+ "title": "Configure Deployment Permissions",+ "body": "In Settings → Builds → API token, select or create the Cloudflare API token used for deployment, with D1 read/edit permission for the target account."},- ],+ {+ "title": "Build & Verify",+ "body": "In the Fork's GitHub repository, open Actions → Update deployed EdgeEver, enable the workflow if prompted, and select Run workflow on main. After confirming in Cloudflare that the corresponding build succeeded and deployment completed, confirm /api/health returns 200 and verify login. This workflow will automatically sync future stable releases and fixes."+ }+ ]},"zh-CN": {- intro: "仅需在网页端完成 6 步配置:",- steps: [+ "intro": "请严格按以下顺序,在网页端完成 7 步配置:",+ "steps": [{- title: "Fork 仓库",- body: "在 GitHub 点击右上角 Fork,将项目 Fork 到您的个人账户下。",+ "title": "Fork 仓库",+ "body": "在 GitHub 点击右上角 Fork,将项目 Fork 到您的个人账户下。"},{- title: "创建 Cloudflare 资源",- body: "创建 D1 edgeever 与 R2 edgeever-resources。",+ "title": "创建 Cloudflare 资源",+ "body": "创建 D1 edgeever 与 R2 edgeever-resources。"},{- title: "导入并配置项目",- body: "在 Cloudflare Workers & Pages 中从 Fork 的 main 分支创建名为 edgeever 的 Worker。使用仓库根目录,保留由 Cloudflare 在线执行的 Workers Builds 默认部署命令,并确认其 API Token 具备 D1 读取和编辑权限。binding 由部署命令生成,不要修改 Fork 中的文件。",+ "title": "创建 Worker",+ "body": "在 Cloudflare Workers & Pages 中选择 Create application → Start with Hello World!,命名为 edgeever 并部署。此时是占位服务,第 7 步才部署 EdgeEver。"},{- title: "准备管理员密码",- body: "准备管理员登录密码,建议至少 32 个字符。Worker 创建后,将它保存为运行时 Secret EDGE_EVER_AUTH_PASSWORD。",+ "title": "设置管理员密码",+ "body": "在该 Worker 的 Settings → Variables and Secrets 中,选择 Secret 类型,添加 EDGE_EVER_AUTH_PASSWORD 并点击 Deploy。值为您指定的登录密码,建议至少 32 个字符。完成后再连接 Fork。"},{- title: "首次构建与验证",- body: "保存并部署会创建 Worker 并启动构建。首次构建主要用于初始化 Worker 实例,若因尚未配置管理员 Secret 而报错属于预期行为,只需在第 4 步添加运行时 Secret EDGE_EVER_AUTH_PASSWORD 后点击重试构建即可通过。管理员用户名默认为 admin;如需使用其他用户名,请在重试构建前设置 Workers Builds 构建变量 EDGE_EVER_AUTH_USERNAME。部署完成后访问 /api/health,确认返回 200,再用配置的管理员用户名和密码登录。",+ "title": "连接 Fork",+ "body": "在已有 Worker 的 Settings → Builds → Connect 中选择 Fork 和生产分支 main。"},{- title: "启用自动更新",- body: "进入 Fork 的 Actions 标签页,点击 I understand my workflows, go ahead and enable them,然后手动运行一次 Update deployed EdgeEver,确保后续能够自动获得正式版本的功能更新与修复。",+ "title": "配置部署权限",+ "body": "在 Settings → Builds → API token 中选择或创建用于部署的 Cloudflare API Token,并确保它具备目标账户的 D1 读取和编辑权限。"},- ],- },+ {+ "title": "构建并验证",+ "body": "在 Fork 的 GitHub 仓库中进入 Actions → Update deployed EdgeEver,按提示启用工作流, 选择 main 分支并点击 Run workflow。在 Cloudflare 确认对应构建成功、部署完成后,确认 /api/health 返回 200,并验证登录。后续由该工作流自动同步正式版本,持续获得功能更新和问题修复。"+ }+ ]+ }} as const;diff --git a/docs/agent-deploy-cloudflare.md b/docs/agent-deploy-cloudflare.mdindex 2c19a100..2ac578a7 100644--- a/docs/agent-deploy-cloudflare.md+++ b/docs/agent-deploy-cloudflare.md@@ -15,38 +15,39 @@ This document defines the standard operating specifications and conventions for- Create a D1 database named exactly `edgeever`.- Create an R2 bucket named exactly `edgeever-resources`.-3. **Cloudflare Project Import**- - In Cloudflare **Workers & Pages**, create a Worker named `edgeever` by importing the Fork repository. Select the repository root and production branch `main`.- - Keep the default Deploy command `npx wrangler deploy` in Cloudflare's Workers Builds settings. Cloudflare runs it in its build environment; the user does not run it on their computer. The repository routes it through EdgeEver's validated deployment pipeline. Do not create a Pages project for the application.- - Select **Save and Deploy** to create the Worker. The initial build may fail because the administrator Secret has not been added yet; configure it in the next step, then retry.--4. **Configure Login Credentials & Instance Settings**- - **Worker Secret**: After the Worker exists, add the runtime Secret `EDGE_EVER_AUTH_PASSWORD` for the initial administrator password. Prefer a strong password of at least 32 characters.- - Keep this password only as a Worker runtime Secret; do not copy it into Workers Builds variables. The standard deploy entrypoint reuses and verifies the existing Secret.- - Do not edit `wrangler.toml` or add duplicate bindings in the Dashboard. The deployment command generates the `DB` and `RESOURCES` bindings from these standard resource names.- - For an existing Worker deployed from older instructions, do not ask the user to rename or reconfigure a custom R2 bucket. With no explicit override, deployment automatically preserves the live `RESOURCES` binding and administrator username.--5. **Check Workers Builds Settings**- - Keep the repository root, `main` branch, and default Deploy command `npx wrangler deploy` in Cloudflare's build settings. Existing deployments that already use the explicit `bun run build:cloudflare` and `bun run deploy:cloudflare-builds` commands there may keep them.- - The deployment pipeline automatically resolves the D1 UUID from the `edgeever` database name and writes instance settings only to a temporary generated Wrangler configuration. The tracked `wrangler.toml` must remain unchanged; deployment rejects instance-specific values committed there so a Fork cannot diverge on infrastructure configuration.- - Ensure the Workers Builds API token can read and edit D1. Advanced non-secret customization belongs in `EDGE_EVER_*` Workers Builds variables. For a differently named database, set `EDGE_EVER_D1_DATABASE_NAME`; set `EDGE_EVER_D1_DATABASE_ID` only if automatic UUID discovery is unavailable. Passwords remain runtime Secrets.--6. **Start Initial Build & Verify Service**- - Retry the build after adding the runtime Secret and any requested username override. Once deployed, run the following automated verifications:- - Check `https://<your-worker-domain>/api/health` returns HTTP `200` with JSON `{"ok": true}`.- - Check `https://<your-worker-domain>/api/openapi.json` is reachable and returns JSON `{"ok": true}`.- - Verify login API using the configured administrator username (default: `admin`) and `EDGE_EVER_AUTH_PASSWORD`.--7. **Verify Upstream Update Channel**- - In the Fork's **Actions** tab, enable **Update deployed EdgeEver** (required on public forks: scheduled workflows are disabled by default).+3. **Create the Worker**+ - In **Workers & Pages** → **Create application** → **Start with Hello World!**, create and deploy a Worker named exactly `edgeever`.+ - This is a placeholder service, not a completed EdgeEver deployment. For an existing EdgeEver instance, reuse its Worker and authentication Secret; do not replace its application with Hello World or reset its password.++4. **Configure the Runtime Secret Before Connecting the Fork**+ - Under the Worker's **Settings** → **Variables and Secrets**, add `EDGE_EVER_AUTH_PASSWORD` as type **Secret**, using the initial administrator login password (preferably at least 32 characters), and select **Deploy**.+ - Confirm the Secret name appears in the list before connecting the repository. Keep the password only as a Worker runtime Secret, never in Workers Builds variables or Fork files.++5. **Connect the Fork**+ - Open this existing Worker's **Settings** → **Builds** → **Connect**, authorize GitHub access, and select the Fork's `main` branch. Follow [Cloudflare's existing-Worker instructions](https://developers.cloudflare.com/workers/ci-cd/builds/#connect-an-existing-worker). Do not use the Deploy to Cloudflare template entrypoint or create a Pages application.+ - Use the repository root and default deploy command `npx wrangler deploy`; Cloudflare runs it online through EdgeEver's validated deployment pipeline. Existing deployments may keep explicit `bun run build:cloudflare` and `bun run deploy:cloudflare-builds` commands.+ - Do not edit `wrangler.toml` or add duplicate bindings. Deployment automatically resolves the D1 UUID from `edgeever` and generates temporary `DB` and `RESOURCES` bindings. For a different database name, set `EDGE_EVER_D1_DATABASE_NAME`; use `EDGE_EVER_D1_DATABASE_ID` only if UUID discovery is unavailable. Non-secret instance settings belong in Workers Builds variables.+ - Existing deployments retain their live `RESOURCES` binding and administrator username unless explicitly overridden; do not ask users to rename or reconfigure a custom R2 bucket. Keep tracked configuration unchanged so the Fork remains a deployment mirror.++6. **Configure Deployment Permissions**+ - In **Settings → Builds → API token**, select or create the Cloudflare API token used by Workers Builds to deploy the application. **Create new token** generates a token automatically; its defaults may lack D1. Add D1 read/edit permission for the target account under [My Profile → API Tokens](https://dash.cloudflare.com/profile/api-tokens), retaining its existing deployment permissions. Select this token in the Worker’s **Settings → Builds → API token** and save the build settings. Subsequent Cloudflare Workers Builds runs use it for database migrations and Worker deployment.++7. **Start the First Build and Verify the Service**+ - Use `admin` unless the user requests another username; configure `EDGE_EVER_AUTH_USERNAME` before starting the first build if requested.+ - In the Fork's GitHub repository, open **Actions → Update deployed EdgeEver**, enable the workflow if prompted, select `main`, and click **Run workflow**. This republishes the selected upstream version even when the Fork is already aligned. Return to Cloudflare **Deployments** to monitor the corresponding build.+ - Missing authentication configuration is a deployment error to correct, not an expected first-build failure. Keep all authentication and deployment checks enabled.+ - After confirming in Cloudflare that the corresponding build succeeded and deployment completed, verify `/api/health` returns HTTP `200` with `{"ok": true}`, `/api/openapi.json` is reachable with JSON containing `"ok": true`, and the login API accepts the configured administrator username and password. A Hello World response does not pass verification.++ - This workflow will automatically sync future stable releases and fixes.++## Upstream Update Channel- An ordinary Fork is a deployment mirror by default. No update variable is required: the workflow applies the selected upstream Release's product snapshot to `main` before triggering Cloudflare.- The updater preserves the Fork's complete `.github/workflows/**` directory and its two updater helper scripts as a stable local bootstrap layer. Official packaging, signing, testing, and Release workflows remain guarded to `tianma-if/edgeever` and are never rewritten by downstream product updates.- Only a Fork that intentionally maintains application-code changes should create the Actions repository variable `EDGE_EVER_PRESERVE_FORK_CHANGES=true`. This opts into merges and requires the owner to resolve future conflicts; it is not needed for normal deployments.- - Manually trigger **Update deployed EdgeEver** once in the Fork's **Actions** tab. A manual run republishes the selected version even when the Fork is already aligned, ensuring Cloudflare receives a fresh build event.- Open the job **Summary** and confirm it reports Fork mode `mirror`, the upstream target (stable Release or edge `main`), and either an update publish or an explicit *already aligned* result.- Confirm Cloudflare **Deployments** builds the published `main` commit when a push occurred.- Do not edit deployment files or rely on GitHub **Sync fork** for routine upgrades; the workflow is the only synchronization path needed by a normal deployment Fork. Use **Sync fork** once only when an old Fork must receive a newer updater workflow itself, then return to **Update deployed EdgeEver**.## Optional: Customize the Initial Administrator Username-Ordinary deployments use the default username `admin`; do not proactively ask the user whether to change it. Only when the user explicitly requests a custom administrator username, set `EDGE_EVER_AUTH_USERNAME` in Workers Builds variables before retrying the initial build and use that username during login verification. Changing only this variable after the administrator account exists does not rename that account.+Ordinary deployments use the default username `admin`; do not proactively ask the user whether to change it. Only when the user explicitly requests a custom administrator username, set `EDGE_EVER_AUTH_USERNAME` in Workers Builds variables before starting the first build and use that username during login verification. Changing only this variable after the administrator account exists does not rename that account.diff --git a/docs/agent-deploy-cloudflare.zh-CN.md b/docs/agent-deploy-cloudflare.zh-CN.mdindex 92d9d8e1..2ead3041 100644--- a/docs/agent-deploy-cloudflare.zh-CN.md+++ b/docs/agent-deploy-cloudflare.zh-CN.md@@ -15,38 +15,39 @@- 创建名称严格为 `edgeever` 的 D1 数据库。- 创建名称严格为 `edgeever-resources` 的 R2 存储桶。-3. **Cloudflare 项目导入**- - 在 Cloudflare **Workers & Pages** 中导入 Fork 仓库,创建名为 `edgeever` 的 Worker。选择仓库根目录和生产分支 `main`。- - 在 Cloudflare Workers Builds 设置中保留默认部署命令 `npx wrangler deploy`。该命令由 Cloudflare 的构建环境执行,用户无需在本机运行;仓库会将其接入 EdgeEver 的受验证部署流程。应用不要创建为 Pages 项目。- - 点击 **Save and Deploy** 创建 Worker。首次构建可能因为尚未添加管理员 Secret 而失败;完成下一步配置后重试。--4. **配置登录凭据与实例参数**- - **Worker Secret**:Worker 创建后,添加运行时密钥 `EDGE_EVER_AUTH_PASSWORD`,值为初始管理员登录密码;建议使用至少 32 个字符的强密码。- - 该密码只配置为 Worker 运行时 Secret,不要复制到 Workers Builds 构建变量;标准部署入口会复用并验证已存在的 Secret。- - 不要修改 `wrangler.toml`,也不要在控制台重复添加 binding。部署命令会根据标准资源名称生成 `DB` 与 `RESOURCES` binding。- - 对按旧版文档部署的已有 Worker,不要要求用户重命名或重新配置自定义 R2 存储桶。没有显式覆盖时,部署会自动保留线上 `RESOURCES` binding 与管理员用户名。--5. **检查 Workers Builds 配置**- - 在 Cloudflare 的构建设置中保持仓库根目录、`main` 分支和默认部署命令 `npx wrangler deploy`。已有部署若在构建设置中使用显式的 `bun run build:cloudflare` 与 `bun run deploy:cloudflare-builds` 命令,可继续沿用。- - 部署流程会根据 `edgeever` 数据库名称自动查询 D1 UUID,并把所有实例参数仅写入临时生成的 Wrangler 配置。受版本控制的 `wrangler.toml` 必须保持不变;若把实例专属配置提交到该文件,部署会直接拒绝,避免 Fork 因基础设施配置产生分叉。- - 请确保 Workers Builds API Token 具有 D1 读取和编辑权限。高级非敏感自定义参数应放在 `EDGE_EVER_*` Workers Builds 构建变量中。如使用其他数据库名称,设置 `EDGE_EVER_D1_DATABASE_NAME`;仅在无法自动查询 UUID 时设置 `EDGE_EVER_D1_DATABASE_ID`。密码始终属于运行时 Secret。--6. **启动首次构建与服务验证**- - 添加运行时 Secret 及用户要求的用户名覆盖后,重试构建。部署完成后进行如下自动化验证:- - 检查 `https://<你的 Worker 域名>/api/health` 返回 `200` 状态码且 JSON 内容为 `{"ok": true}`。- - 检查 `https://<你的 Worker 域名>/api/openapi.json` 可以访问,且 JSON 含 `"ok": true`。- - 使用配置的管理员用户名(默认 `admin`)和 `EDGE_EVER_AUTH_PASSWORD` 验证登录 API。--7. **验证上游更新通道**- - 在 Fork 仓库的 **Actions** 标签页中启用 **Update deployed EdgeEver**(公共 Fork 上定时任务默认关闭,必须手动启用)。+3. **创建 Worker**+ - 在 **Workers & Pages** → **Create application** → **Start with Hello World!** 中创建并部署名称严格为 `edgeever` 的 Worker。+ - 此时只是占位服务,不代表 EdgeEver 已部署。已有 EdgeEver 实例应复用其 Worker 和认证 Secret,不得替换为 Hello World 或重置密码。++4. **连接 Fork 前配置运行时 Secret**+ - 在该 Worker 的 **Settings** → **Variables and Secrets** 中添加 **Secret** 类型的 `EDGE_EVER_AUTH_PASSWORD`,值为初始管理员登录密码(建议至少 32 个字符),并点击 **Deploy**。+ - 确认 Secret 名称已出现在列表中,再连接仓库。密码只保存为 Worker 运行时 Secret,不得写入 Workers Builds 构建变量或 Fork 文件。++5. **连接 Fork**+ - 在这个已有 Worker 的 **Settings** → **Builds** → **Connect** 中授权 GitHub 访问并选择 Fork 的 `main` 分支。参考 [Cloudflare 连接已有 Worker 的步骤](https://developers.cloudflare.com/workers/ci-cd/builds/#connect-an-existing-worker)。不要使用 Deploy to Cloudflare 模板入口,也不要创建 Pages 应用。+ - 使用仓库根目录与默认部署命令 `npx wrangler deploy`,由 Cloudflare 在线执行并接入 EdgeEver 的受验证部署流程。已有部署可保留显式的 `bun run build:cloudflare` 与 `bun run deploy:cloudflare-builds` 命令。+ - 不要修改 `wrangler.toml` 或重复添加 binding。部署根据 `edgeever` 自动查询 D1 UUID,并生成临时 `DB` 与 `RESOURCES` binding。其他数据库名称通过 `EDGE_EVER_D1_DATABASE_NAME` 设置;仅无法查询 UUID 时使用 `EDGE_EVER_D1_DATABASE_ID`。非敏感实例参数放入 Workers Builds 构建变量。+ - 已有部署默认沿用线上 `RESOURCES` binding 与管理员用户名,不要求用户重命名或重新配置自定义 R2 存储桶。受版本控制的配置保持不变,确保 Fork 默认作为部署镜像。++6. **配置部署权限**+ - 在 **Settings → Builds → API token** 中选择或创建 Workers Builds 部署应用使用的 Cloudflare API Token。选择 **Create new token** 会自动生成 Token,但默认权限可能不含 D1;到[个人资料 → API Tokens](https://dash.cloudflare.com/profile/api-tokens) 为其补充目标账户的 D1 读取和编辑权限,并保留原有部署权限。在该 Worker 的 **Settings → Builds → API token** 中选用该 Token 并保存构建设置。后续 Cloudflare Workers Builds 会使用它执行数据库迁移和 Worker 部署。++7. **启动首次构建与服务验证**+ - 用户名默认使用 `admin`;仅用户要求自定义时,在启动首次构建前设置 `EDGE_EVER_AUTH_USERNAME`。+ - 在 Fork 的 GitHub 仓库中进入 **Actions → Update deployed EdgeEver**,按提示启用工作流,选择 `main` 分支并点击 **Run workflow**。该工作流会重新发布所选上游版本,即使 Fork 已对齐也会触发新的部署事件。返回 Cloudflare 的 **Deployments** 查看对应构建。+ - 缺少认证配置是需要修正的部署错误,不是预期的首次构建失败。保持认证与部署校验开启。+ - 在 Cloudflare 确认对应构建成功、部署完成后,验证 `/api/health` 返回 HTTP `200` 及 `{"ok": true}`,`/api/openapi.json` 可访问且 JSON 含 `"ok": true`,并使用管理员用户名及密码验证登录 API。Hello World 响应不能通过验收。++ - 后续由该工作流自动同步正式版本,持续获得功能更新和问题修复。++## 上游更新通道说明- 普通 Fork 默认作为部署镜像,无需配置任何更新变量:工作流会把所选上游 Release 的产品代码快照应用到 `main`,再触发 Cloudflare。- 更新器会把 Fork 自己的完整 `.github/workflows/**` 目录及两个更新辅助脚本作为稳定的本地引导层保留。官方打包、签名、测试与 Release 工作流继续通过 `tianma-if/edgeever` 仓库门禁限制执行,也不会被下游产品更新改写。- 只有明确维护了应用代码修改的 Fork,才应创建 Actions 仓库变量 `EDGE_EVER_PRESERVE_FORK_CHANGES=true`。启用后改为 merge,并由仓库所有者处理未来冲突;普通部署无需设置。- - 在 Fork 的 **Actions** 中手动运行一次 **Update deployed EdgeEver**。即使 Fork 已对齐,手动运行也会重新发布所选版本,确保 Cloudflare 收到新的构建事件。- 打开 Job **Summary**,确认 Fork mode 为 `mirror`,并显示上游目标(stable Release 或 edge `main`),以及「已发布更新」或明确的「已对齐」结果。- 若发生了 push,确认 Cloudflare **Deployments** 构建的是对应的 `main` commit。- 普通部署 Fork 不应修改部署文件,日常升级也不要依赖 GitHub **Sync fork**;本工作流就是唯一需要的同步路径。只有旧 Fork 必须取得新版更新工作流本身时,才使用一次 **Sync fork**,之后继续使用 **Update deployed EdgeEver**。## 可选:自定义初始管理员用户名-普通部署直接使用默认用户名 `admin`,不要主动询问用户是否需要修改。仅当用户明确要求自定义管理员用户名时,才在重试首次构建前通过 Workers Builds 构建变量设置 `EDGE_EVER_AUTH_USERNAME`,并在登录验证时使用该用户名。管理员账号已创建后,仅修改该变量不会重命名现有账号。+普通部署直接使用默认用户名 `admin`,不要主动询问用户是否需要修改。仅当用户明确要求自定义管理员用户名时,才在启动首次构建前通过 Workers Builds 构建变量设置 `EDGE_EVER_AUTH_USERNAME`,并在登录验证时使用该用户名。管理员账号已创建后,仅修改该变量不会重命名现有账号。diff --git a/docs/cloudflare-workers-builds.md b/docs/cloudflare-workers-builds.mdindex f356bf32..035b7f41 100644--- a/docs/cloudflare-workers-builds.md+++ b/docs/cloudflare-workers-builds.md@@ -2,13 +2,13 @@## Setup-For a manual import, follow the [online deployment guide](deploy-cloudflare-button.md), use the repository root and `main` branch, and keep the default `npx wrangler deploy` command. Existing projects can keep their explicit build and `bun run deploy:cloudflare-builds` commands.+For first-time setup, create the `edgeever` Worker with **Start with Hello World!**, deploy `EDGE_EVER_AUTH_PASSWORD` as a runtime Secret, then connect the Fork through the existing Worker’s **Settings → Builds → Connect**. Follow the [online deployment guide](deploy-cloudflare-button.md), use the repository root and `main` branch, and keep the default `npx wrangler deploy` command. Existing projects can keep their explicit build and `bun run deploy:cloudflare-builds` commands.Authorization:1. Approve the **Cloudflare Workers & Pages** GitHub App for the deployment repository.2. If the Agent integration needs a Cloudflare API token, use a User API Token limited to the target account.-3. Configure the deployment API token in Cloudflare under **Worker -> Settings -> Build -> API token**. The automatically generated token may lack D1 permissions; confirm it has D1 read and edit permissions for the target account before deploying.+3. Configure the deployment API token in Cloudflare under **Worker -> Settings -> Build -> API token**. The automatically generated token may lack D1 permissions; confirm it has D1 read and edit permissions for the target account before deploying. Select this token in the Worker’s **Settings → Builds → API token** and save the build settings. Subsequent Cloudflare Workers Builds runs use it for database migrations and Worker deployment.Set `EDGE_EVER_AUTH_PASSWORD` as a runtime Secret under the Worker's **Settings → Variables and Secrets**, not as a Builds variable.diff --git a/docs/cloudflare-workers-builds.zh-CN.md b/docs/cloudflare-workers-builds.zh-CN.mdindex 038493d6..3149ec3d 100644--- a/docs/cloudflare-workers-builds.zh-CN.md+++ b/docs/cloudflare-workers-builds.zh-CN.md@@ -2,13 +2,13 @@## 配置-手动导入仓库时,按[在线部署文档](deploy-cloudflare-button.zh-CN.md)选择仓库根目录和 `main` 分支,保留默认部署命令 `npx wrangler deploy`。已有项目可继续使用原来的显式构建命令和 `bun run deploy:cloudflare-builds`。+首次部署时,先通过 **Start with Hello World!** 创建 `edgeever` Worker,添加并部署运行时 Secret `EDGE_EVER_AUTH_PASSWORD`,再从已有 Worker 的 **Settings → Builds → Connect** 连接 Fork。按[在线部署文档](deploy-cloudflare-button.zh-CN.md)选择仓库根目录和 `main` 分支,保留默认部署命令 `npx wrangler deploy`。已有项目可继续使用原来的显式构建命令和 `bun run deploy:cloudflare-builds`。授权:1. 为部署仓库授权 **Cloudflare Workers & Pages** GitHub App。2. 如果 Agent 集成需要 Cloudflare API Token,使用限制到目标账号的 User API Token。-3. 部署 API Token 在 Cloudflare **Worker -> Settings -> Build -> API token** 中配置。默认自动生成的 token 可能没有 D1 权限;部署前应确认其具备目标账户的 D1 读取与编辑权限。+3. 部署 API Token 在 Cloudflare **Worker -> Settings -> Build -> API token** 中配置。默认自动生成的 token 可能没有 D1 权限;部署前应确认其具备目标账户的 D1 读取与编辑权限。在该 Worker 的 **Settings → Builds → API token** 中选用该 Token 并保存构建设置。后续 Cloudflare Workers Builds 会使用它执行数据库迁移和 Worker 部署。在 Worker 的 **Settings → Variables and Secrets** 中设置运行时 Secret `EDGE_EVER_AUTH_PASSWORD`,不要放入 Builds 构建变量。diff --git a/docs/deploy-cloudflare-button.md b/docs/deploy-cloudflare-button.mdindex 156f01d2..ce5ac7f6 100644--- a/docs/deploy-cloudflare-button.md+++ b/docs/deploy-cloudflare-button.md@@ -13,6 +13,8 @@ Deploy EdgeEver through GitHub and Cloudflare in your browser, without installin## First Deployment+Complete the following steps strictly in order.+### Step 1: Fork the Repository1. Visit the official EdgeEver repository: `https://github.com/tianma-if/edgeever`.@@ -33,24 +35,15 @@ Log into your [Cloudflare Dashboard](https://dash.cloudflare.com/). If an entry----### Step 3: Import the Project--1. Open **Workers & Pages**, click **Create application**, then **Get started** next to **Import a repository**. If the entry moves, see [Cloudflare's instructions](https://developers.cloudflare.com/workers/ci-cd/builds/#connect-a-new-worker).-2. Follow the prompts to connect your GitHub account, authorize access to your Fork, and select the Forked `edgeever` repository.-3. Project settings:- - **Worker name**: `edgeever`, matching the `name` in the root `wrangler.toml`- - **Git branch** (or **Production branch**): `main`- - **Root directory**: Leave blank to use the repository root- - Deploy command: npx wrangler deploy (keep Cloudflare's default; Workers Builds runs it online, not on your computer)- - **API token**: The automatically generated token may lack D1 permissions. Select or create a User API Token scoped to the target account with D1 read and edit permissions; if permissions are insufficient, correct them based on the build log and retry.+### Step 3: Create the Worker-The deployment command creates the `DB` and `RESOURCES` bindings and looks up the D1 UUID. Do not edit `wrangler.toml` or add duplicate bindings in the Dashboard.+1. Open **Workers & Pages** → **Create application** → **Start with Hello World!**. Name the Worker exactly `edgeever` and click **Deploy**.----### Step 4: Create the Project and Set the Administrator Password+### Step 4: Set the Administrator Password-Click **Save and Deploy** to create the Worker. The first build fails verification because the administrator Secret is missing; do not use the site URL yet. Under the Worker's **Settings** → **Variables and Secrets**, click **Add**, add this runtime Secret, and click **Deploy**:+1. Open this Worker's **Settings** → **Variables and Secrets**, click **Add**, add the runtime Secret below, and click **Deploy**:| Type | Name | Value | Purpose || :--- | :--- | :--- | :--- |@@ -58,11 +51,33 @@ Click **Save and Deploy** to create the Worker. The first build fails verificati`EDGE_EVER_AUTH_PASSWORD` is the variable name; its value is the administrator login password. It is a Worker runtime Secret, not a Workers Builds variable.-Return to the build history and retry. Confirm the build and live health check succeed.+Confirm the Secret name appears in the list before continuing. The Worker currently serves a Hello World placeholder; EdgeEver will replace it after the repository build. Do not enter your password on the placeholder page.++---++### Step 5: Connect the Fork++1. In the **existing** `edgeever` Worker, open **Settings** → **Builds** → **Connect**. Authorize GitHub access to your Fork and select that repository. Follow [Cloudflare's existing-Worker instructions](https://developers.cloudflare.com/workers/ci-cd/builds/#connect-an-existing-worker) if the entry moves.+2. Configure Workers Builds:+ - **Production branch**: `main`+ - **Root directory**: Leave blank to use the repository root+ - Deploy command: npx wrangler deploy (keep the default; Cloudflare runs it online)++The Worker name must match `edgeever` in the repository's `wrangler.toml`. The deployment command creates the `DB` and `RESOURCES` bindings and looks up the D1 UUID. Do not edit Fork files or add duplicate bindings in the Dashboard.----### Step 5: Verify Deployment, Login & Automatic Updates+### Step 6: Configure Deployment Permissions++**API token**: Select or create a User API Token scoped to the target account with D1 read and edit permissions; selecting **Create new token** lets Cloudflare generate a deployment token, but its default permissions may lack D1. Edit that token under [My Profile → API Tokens](https://dash.cloudflare.com/profile/api-tokens) to add D1 permission for the target account, then select it in the Worker’s **Settings → Builds → API token**. Keep its existing deployment permissions. Select this token in the Worker’s **Settings → Builds → API token** and save the build settings. Subsequent Cloudflare Workers Builds runs use it for database migrations and Worker deployment.++---++### Step 7: Build and Verify Login++The administrator username defaults to `admin`. If you need a custom username, configure the Workers Builds variable `EDGE_EVER_AUTH_USERNAME` before starting the first build.++In the Fork's GitHub repository, open **Actions → Update deployed EdgeEver**, enable the workflow if prompted, select `main`, and click **Run workflow**. This republishes the selected upstream version even when the Fork is already aligned. Return to Cloudflare **Deployments** to monitor the corresponding build. Confirm that the build succeeded and deployment completed before performing the following checks:1. After deployment completes, Cloudflare will assign a default domain (e.g., `https://edgeever.your-subdomain.workers.dev`). You can also attach your own custom domain in the Worker settings under **Settings → Domains & Routes**.2. Visit the health check endpoint in your browser: `https://<your-domain>/api/health`, and confirm it returns HTTP `200` with:@@ -70,8 +85,9 @@ Return to the build history and retry. Confirm the build and live health check s{ "ok": true }```3. Open the homepage, log in with your configured administrator username (default: `admin`) and `EDGE_EVER_AUTH_PASSWORD`, and start using EdgeEver!-4. Go back to your Fork's **Actions** tab on GitHub and click **I understand my workflows, go ahead and enable them**.-5. Manually run **Update deployed EdgeEver** once to ensure future upstream updates can sync, and confirm Cloudflare receives the resulting build event.+++This workflow will automatically sync future stable releases and fixes.---@@ -100,7 +116,7 @@ To customize an instance, add non-secret values under the Worker's **Settings| `EDGE_EVER_WORKERS_DEV` | Enable or disable the `workers.dev` route || `EDGE_EVER_CUSTOM_DOMAIN` / `EDGE_EVER_ROUTE_PATTERN` | Custom routing |-Set a custom administrator username before retrying the initial build; changing the variable after the account exists does not rename it.+Set a custom administrator username before starting the first build; changing the variable after the account exists does not rename it.Older deployments need not migrate a custom R2 bucket; upgrades reuse the live `RESOURCES` binding unless overridden. Existing explicit build commands remain supported; see [Workers Builds configuration](cloudflare-workers-builds.md).@@ -108,6 +124,8 @@ Older deployments need not migrate a custom R2 bucket; upgrades reuse the live `## Troubleshooting+- **Missing administrator Secret**: Add and deploy the runtime Secret from Step 4 on the same Worker connected to the Fork, then retry the failed build. Missing configuration is not a required first-deployment step.+- **Still seeing Hello World**: Creating the Worker or deploying its Secret does not deploy EdgeEver. Complete Step 7 and confirm the successful production build uses the Fork’s `main` commit.- **Initial build failed**: Check the Worker **Deployments** log for “routing it through EdgeEver's validated deployment pipeline”. Verify that the standard resources are named exactly `edgeever` and `edgeever-resources`, and that the Workers Builds API token has D1 read/edit permission. For an intentionally different D1 database, set `EDGE_EVER_D1_DATABASE_NAME`; add `EDGE_EVER_D1_DATABASE_ID` only if automatic UUID discovery is unavailable.- **Updates not syncing**:1. On the Fork **Actions** tab, enable **Update deployed EdgeEver** (scheduled workflows are off by default on public forks).diff --git a/docs/deploy-cloudflare-button.zh-CN.md b/docs/deploy-cloudflare-button.zh-CN.mdindex 4e8d1582..3fe0dac6 100644--- a/docs/deploy-cloudflare-button.zh-CN.md+++ b/docs/deploy-cloudflare-button.zh-CN.md@@ -13,6 +13,8 @@## 首次部署+请严格按以下步骤顺序操作。+### 步骤 1:Fork 仓库1. 访问 EdgeEver 官方仓库:`https://github.com/tianma-if/edgeever`。@@ -33,24 +35,15 @@----### 步骤 3:导入项目--1. 打开 **Workers & Pages**,点击 **Create application** → **Import a repository** 旁的 **Get started**。入口变化时参考 [Cloudflare 官方步骤](https://developers.cloudflare.com/workers/ci-cd/builds/#connect-a-new-worker)。-2. 按提示连接 GitHub 账户,授权 Cloudflare 访问该 Fork,并选中您刚才 Fork 的 `edgeever` 仓库。-3. 在项目设置中:- - **Worker 名称**:`edgeever`,与根目录 `wrangler.toml` 中的 `name` 一致- - **Git branch**(或 **Production branch**):选择 `main`- - **Root directory**:保持留空,使用仓库根目录- - Deploy command: npx wrangler deploy(保留 Cloudflare 默认值,由 Workers Builds 在线执行,无需在本机运行)- - **API token**:自动生成的 token 可能没有 D1 权限。选择或创建限定到目标账户、具备 D1 读取与编辑权限的 User API Token;权限不足时按构建日志调整后重试。+### 步骤 3:创建 Worker-部署命令会自动生成 `DB` 与 `RESOURCES` binding,并查询 D1 UUID。不要修改 `wrangler.toml` 或在控制台重复添加 binding。+1. 打开 **Workers & Pages** → **Create application** → **Start with Hello World!**,将 Worker 名称严格设为 `edgeever` 并点击 **Deploy**。----### 步骤 4:创建项目并设置管理员密码+### 步骤 4:设置管理员密码-点击 **Save and Deploy** 创建 Worker。首次构建会因缺少管理员 Secret 而校验失败;先不要使用站点地址。在 Worker 的 **Settings** → **Variables and Secrets** 中点击 **Add**,添加运行时 Secret 并点击 **Deploy**:+1. 进入该 Worker 的 **Settings** → **Variables and Secrets**,点击 **Add**,添加下列运行时 Secret,再点击 **Deploy**:| 类型 (Type) | 名称 (Name) | 值 (Value) | 说明 || :--- | :--- | :--- | :--- |@@ -58,20 +51,43 @@`EDGE_EVER_AUTH_PASSWORD` 是变量名,值是管理员登录密码。它属于 Worker 运行时 Secret,不是 Workers Builds 构建变量。-返回构建记录并重试,确认构建及线上健康检查成功。+确认 Secret 名称已出现在列表中,再继续下一步。此时 Worker 显示 Hello World 占位页面,仓库构建完成后才会替换为 EdgeEver;不要在占位页面输入密码。++---++### 步骤 5:连接 Fork++1. 在**已有的** `edgeever` Worker 中打开 **Settings** → **Builds** → **Connect**,授权 GitHub 访问您的 Fork,并选中该仓库。入口变化时参考 [Cloudflare 连接已有 Worker 的步骤](https://developers.cloudflare.com/workers/ci-cd/builds/#connect-an-existing-worker)。+2. 配置 Workers Builds:+ - **Production branch**:`main`+ - **Root directory**:保持留空,使用仓库根目录+ - Deploy command: npx wrangler deploy(保留默认值,由 Cloudflare 在线执行)++Worker 名称必须与仓库 `wrangler.toml` 中的 `edgeever` 一致。部署命令会自动生成 `DB` 与 `RESOURCES` binding,并查询 D1 UUID。不要修改 Fork 中的文件,也不要在控制台重复添加 binding。----### 步骤 5:验证部署、登录与自动更新+### 步骤 6:配置部署权限-1. 构建完成后,Cloudflare 会为您生成一个二级域名(如 `https://edgeever.your-subdomain.workers.dev`)。您也可以在 Worker 的 **Settings → Domains & Routes** 中绑定自己的自定义域名(强烈建议绑定自定义域名以保障国内直连稳定性并提升访问速度)。+**API token**:选择或创建限定到目标账户、具备 D1 读取与编辑权限的 User API Token;选择 **Create new token** 时,Cloudflare 会自动生成部署 Token,但默认权限可能不含 D1。可到[个人资料 → API Tokens](https://dash.cloudflare.com/profile/api-tokens) 编辑该 Token,为目标账户补充 D1 权限,再在 Worker 的 **Settings → Builds → API token** 中选用;保留其原有部署权限。在该 Worker 的 **Settings → Builds → API token** 中选用该 Token 并保存构建设置。后续 Cloudflare Workers Builds 会使用它执行数据库迁移和 Worker 部署。++---++### 步骤 7:构建并验证登录++管理员用户名默认为 `admin`。如需自定义,请在启动首次构建前设置 Workers Builds 构建变量 `EDGE_EVER_AUTH_USERNAME`。++在 Fork 的 GitHub 仓库中进入 **Actions → Update deployed EdgeEver**,按提示启用工作流,选择 `main` 分支并点击 **Run workflow**。该工作流会重新发布所选上游版本,即使 Fork 已对齐也会触发新的部署事件。返回 Cloudflare 的 **Deployments** 查看对应构建。确认构建成功、部署完成后,再进行以下验证:++1. 打开 Cloudflare 为该 Worker 分配的二级域名(如 `https://edgeever.your-subdomain.workers.dev`)。您也可以在 Worker 的 **Settings → Domains & Routes** 中绑定自己的自定义域名(强烈建议绑定自定义域名以保障国内直连稳定性并提升访问速度)。2. 在浏览器打开该域名下的健康检查接口:`https://你的域名/api/health`,确认返回 `200` 及 JSON:```json{ "ok": true }```3. 打开主站首页,输入您配置的管理员用户名(默认是 `admin`)和密码(`EDGE_EVER_AUTH_PASSWORD`)测试登录并开始使用。-4. 返回 Fork 的 GitHub 仓库 **Actions** 页面,点击 **I understand my workflows, go ahead and enable them** 启用工作流。-5. 手动运行一次 **Update deployed EdgeEver**,确保未来可自动跟进上游更新,并确认 Cloudflare 收到这次构建事件。+++后续由该工作流自动同步正式版本,持续获得功能更新和问题修复。---@@ -100,7 +116,7 @@ EDGE_EVER_UPDATE_CHANNEL=edge| `EDGE_EVER_WORKERS_DEV` | 启用或禁用 `workers.dev` 路由 || `EDGE_EVER_CUSTOM_DOMAIN` / `EDGE_EVER_ROUTE_PATTERN` | 自定义路由 |-自定义管理员用户名须在重试首次构建前设置;账号创建后修改该变量不会重命名账号。+自定义管理员用户名须在启动首次构建前设置;账号创建后修改该变量不会重命名账号。旧部署的自定义 R2 存储桶无需迁移;不设置覆盖变量时,升级会沿用线上 `RESOURCES` binding。已有项目的显式构建命令也可继续使用,详见 [Workers Builds 配置](cloudflare-workers-builds.zh-CN.md)。@@ -108,6 +124,8 @@ EDGE_EVER_UPDATE_CHANNEL=edge## 常见问题与排错+- **缺少管理员 Secret**:在连接 Fork 的同一个 Worker 中,按步骤 4 添加并部署运行时 Secret,再重试失败的构建;缺少配置不是首次部署的必经步骤。+- **仍显示 Hello World**:创建 Worker、部署 Secret 都不代表 EdgeEver 已部署。请完成步骤 7,并确认成功的生产构建对应 Fork 的 `main` commit。- **首次构建失败**:请检查 Cloudflare 控制台中 Worker 的 **Deployments** 构建日志,确认日志包含“routing it through EdgeEver's validated deployment pipeline”,标准资源名称严格为 `edgeever` 与 `edgeever-resources`,并确认 Workers Builds API Token 具有 D1 读取和编辑权限。如有意使用其他 D1 数据库,请设置 `EDGE_EVER_D1_DATABASE_NAME`;仅在自动查询 UUID 不可用时再添加 `EDGE_EVER_D1_DATABASE_ID`。- **无法同步上游更新**:1. 打开 Fork 的 **Actions**,启用 **Update deployed EdgeEver**(公共 Fork 上定时任务默认关闭)。