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
feat: configure online admin username
tianma-if2fa59702a36d
diff --git a/README.md b/README.mdindex 12fb1c60..8754ce33 100644--- a/README.md+++ b/README.md@@ -64,7 +64,7 @@ Copy this prompt into an AI Agent configured with GitHub and Cloudflare MCP servDeploy EdgeEver online:1. Fork https://github.com/tianma-if/edgeever.2. Import the Fork into Cloudflare Workers & Pages.-3. Configure D1, R2, the `EDGE_EVER_AUTH_PASSWORD` Worker Secret, and the production `main` build.+3. Configure D1, R2, `EDGE_EVER_AUTH_USERNAME` (prefilled as `admin`, customizable), the `EDGE_EVER_AUTH_PASSWORD` Worker Secret, and the production `main` build.4. Start the first build and verify `/api/health`, `/api/openapi.json`, and login.5. Enable and run `Update deployed EdgeEver` once.```@@ -77,7 +77,7 @@ Complete setup in 4 simple web steps:1. **Fork the Repository**: Click **Fork** at the top right of GitHub to fork EdgeEver into your personal account.2. **Import into Cloudflare**: Log into the Cloudflare Dashboard, navigate to **Workers & Pages**, and choose to import your Fork repository.-3. **Bind Resources & Password**: Bind the D1 database (`DB`), R2 bucket (`RESOURCES`), and set the Worker Secret `EDGE_EVER_AUTH_PASSWORD` as your admin password.+3. **Bind Resources & Credentials**: Bind the D1 database (`DB`), R2 bucket (`RESOURCES`), set `EDGE_EVER_AUTH_USERNAME` (default `admin`, customizable), and set the Worker Secret `EDGE_EVER_AUTH_PASSWORD` as your admin password.4. **Build & Verify**: Start the first build with default settings. Once complete, visit `/api/health` to verify a `200` response before logging in.> 📖 For full step-by-step instructions and configuration details, see the [Online Deployment Guide](docs/deploy-cloudflare-button.md).diff --git a/docs/agent-deploy-cloudflare.md b/docs/agent-deploy-cloudflare.mdindex dfccf3a0..a77b7f7b 100644--- a/docs/agent-deploy-cloudflare.md+++ b/docs/agent-deploy-cloudflare.md@@ -21,6 +21,7 @@ This document defines the standard operating specifications and conventions for4. **Resource Bindings & Secrets**- **D1 Database Binding**: Binding name `DB`, associated with database `edgeever`.- **R2 Bucket Binding**: Binding name `RESOURCES`, associated with a globally unique R2 Bucket.+ - **Admin username**: Configure `EDGE_EVER_AUTH_USERNAME`; it defaults to `admin` and can be replaced with a custom username.- **Worker Secret**: Add secret `EDGE_EVER_AUTH_PASSWORD` for initial admin password.5. **Configure Workers Builds Commands**@@ -35,7 +36,7 @@ This document defines the standard operating specifications and conventions for- Trigger the initial build. 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` loads the OpenAPI schema properly.- - Verify login API using the configured `EDGE_EVER_AUTH_PASSWORD`.+ - Verify login API using the configured `EDGE_EVER_AUTH_USERNAME` (default `admin`) and `EDGE_EVER_AUTH_PASSWORD`.7. **Verify Upstream Update Channel**- Manually trigger **Update deployed EdgeEver** once in the Fork's **Actions** tab to confirm upstream synchronization and automated builds work properly.diff --git a/docs/agent-deploy-cloudflare.zh-CN.md b/docs/agent-deploy-cloudflare.zh-CN.mdindex 97ae8852..6cd44e94 100644--- a/docs/agent-deploy-cloudflare.zh-CN.md+++ b/docs/agent-deploy-cloudflare.zh-CN.md@@ -21,6 +21,7 @@4. **绑定资源与凭据 (Bindings & Secrets)**- **D1 数据库绑定**:Binding 名称填 `DB`,关联数据库名称为 `edgeever`。- **R2 存储桶绑定**:Binding 名称填 `RESOURCES`,关联全局唯一的 R2 Bucket。+ - **管理员用户名**:配置 `EDGE_EVER_AUTH_USERNAME`,默认值为 `admin`;如需自定义,可替换为其他用户名。- **Worker Secret**:添加密钥 `EDGE_EVER_AUTH_PASSWORD`,值为初始管理员登录密码。5. **配置 Workers Builds 命令**@@ -35,7 +36,7 @@- 触发启动首次构建,待构建部署完成后,进行如下自动化验证:- 检查 `https://<你的 Worker 域名>/api/health` 返回 `200` 状态码且 JSON 内容为 `{"ok": true}`。- 检查 `https://<你的 Worker 域名>/api/openapi.json` 能够正常加载 OpenAPI 规范。- - 使用之前配置的 `EDGE_EVER_AUTH_PASSWORD` 验证登录 API 是否可用。+ - 使用之前配置的 `EDGE_EVER_AUTH_USERNAME`(默认 `admin`)和 `EDGE_EVER_AUTH_PASSWORD` 验证登录 API 是否可用。7. **验证上游更新通道**- 在 Fork 的 **Actions** 中手动运行一次 **Update deployed EdgeEver**,确认上游同步与构建更新流程畅通。diff --git a/docs/deploy-cloudflare-button.md b/docs/deploy-cloudflare-button.mdindex 7015d1a7..acda1903 100644--- a/docs/deploy-cloudflare-button.md+++ b/docs/deploy-cloudflare-button.md@@ -49,8 +49,11 @@ Log into your [Cloudflare Dashboard](https://dash.cloudflare.com/):| :--- | :--- | :--- | :--- || **D1 Database Binding** | `DB` | Select `edgeever` database | Stores notes & structured data || **R2 Bucket Binding** | `RESOURCES` | Select your created R2 bucket | Stores images & file attachments |+| **Environment Variable** | `EDGE_EVER_AUTH_USERNAME` | `admin` (customizable) | Admin login username || **Environment Variable (Secret)** | `EDGE_EVER_AUTH_PASSWORD` | Set your admin password | Initial login credential |+> `EDGE_EVER_AUTH_USERNAME` is prefilled with `admin`. Most users can keep this value. Advanced users can replace it with a custom administrator username; the configured username is required at login.+---### Step 4: Set Build Commands & Start Build@@ -73,7 +76,7 @@ Click **Save and Deploy** to trigger the initial build.```json{ "ok": true }```-3. Open the homepage, log in with your configured `EDGE_EVER_AUTH_PASSWORD`, and start using EdgeEver!+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 manually trigger **Update deployed EdgeEver** once to ensure upstream updates will sync properly in the future.---diff --git a/docs/deploy-cloudflare-button.zh-CN.md b/docs/deploy-cloudflare-button.zh-CN.mdindex 12fda192..4431045b 100644--- a/docs/deploy-cloudflare-button.zh-CN.md+++ b/docs/deploy-cloudflare-button.zh-CN.md@@ -49,8 +49,11 @@| :--- | :--- | :--- | :--- || **D1 Database Binding** | `DB` | 选择 `edgeever` 数据库 | 存放笔记与结构化数据 || **R2 Bucket Binding** | `RESOURCES` | 选择您创建的 R2 Bucket | 存放图片与图片附件 |+| **Environment Variable** | `EDGE_EVER_AUTH_USERNAME` | `admin`(可改为自定义用户名) | 管理员登录用户名 || **Environment Variable (Secret)** | `EDGE_EVER_AUTH_PASSWORD` | 设置您的管理员登录密码 | 初始登录凭据 |+> `EDGE_EVER_AUTH_USERNAME` 默认预填为 `admin`。普通用户可以直接使用这个值;如果希望使用其他管理员用户名,可在这里修改。请记住部署时填写的用户名,登录时需要同时输入用户名和密码。+---### 步骤 4:设置构建命令并启动构建@@ -73,7 +76,7 @@ Deploy command: bun run deploy:cloudflare-builds```json{ "ok": true }```-3. 打开主站首页,输入您配置的密码(`EDGE_EVER_AUTH_PASSWORD`)测试登录并开始使用。+3. 打开主站首页,输入您配置的管理员用户名(默认是 `admin`)和密码(`EDGE_EVER_AUTH_PASSWORD`)测试登录并开始使用。4. 返回 Fork 的 GitHub 仓库 **Actions** 页面,手动触发运行一次 **Update deployed EdgeEver** 工作流,确保未来可自动跟进上游更新。---diff --git a/package.json b/package.jsonindex 51599c4c..77f67563 100644--- a/package.json+++ b/package.json@@ -65,6 +65,9 @@},"EDGE_EVER_AUTH_PASSWORD": {"description": "首次登录密码,必填。请设置一个仅用于此实例的强密码;部署后可在个人设置中修改。"+ },+ "EDGE_EVER_AUTH_USERNAME": {+ "description": "管理员登录用户名,默认值为 admin;高级用户可以改成自定义用户名。"}}},diff --git a/scripts/cloudflare-workers-builds.mjs b/scripts/cloudflare-workers-builds.mjsindex c1f6c454..0cee60c5 100644--- a/scripts/cloudflare-workers-builds.mjs+++ b/scripts/cloudflare-workers-builds.mjs@@ -114,7 +114,7 @@ const buildVariables = () => {for (const name of runtimeNames) {const scoped = instanceKey ? `EDGE_EVER_${instanceKey}_${name}` : "";const key = scoped && merged.get(scoped)?.trim() ? scoped : `EDGE_EVER_${name}`;- const current = merged.get(key)?.trim();+ const current = merged.get(key)?.trim() || (name === "AUTH_USERNAME" ? "admin" : "");if (current) entries.push([key, current]);}diff --git a/scripts/run-wrangler.mjs b/scripts/run-wrangler.mjsindex 9a104205..8a141191 100644--- a/scripts/run-wrangler.mjs+++ b/scripts/run-wrangler.mjs@@ -185,7 +185,9 @@ config = replaceTomlValue();const runtimeVars = {- EDGE_EVER_AUTH_USERNAME: envValue("AUTH_USERNAME"),+ // Keep the login identifier explicit in generated online deployments so+ // users can discover and override the default without changing code.+ EDGE_EVER_AUTH_USERNAME: envValue("AUTH_USERNAME") || "admin",EDGE_EVER_SESSION_TTL_DAYS: envValue("SESSION_TTL_DAYS"),EDGE_EVER_AUTH_LOGIN_WINDOW_SECONDS: envValue("AUTH_LOGIN_WINDOW_SECONDS"),EDGE_EVER_AUTH_LOGIN_USERNAME_MAX_ATTEMPTS: envValue("AUTH_LOGIN_USERNAME_MAX_ATTEMPTS"),