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: add default initial login credentials
yomafff1ab7c5cda
diff --git a/.env.local.example b/.env.local.exampleindex f79b3016..cd8e7ee7 100644--- a/.env.local.example+++ b/.env.local.example@@ -64,9 +64,8 @@ EDGE_EVER_R2_PREVIEW_BUCKET_NAME=edgeever-resources-preview# Login username.EDGE_EVER_AUTH_USERNAME=admin-# Login password. Store it as a Cloudflare Secret.-# Example: EDGE_EVER_AUTH_PASSWORD=Admin123-EDGE_EVER_AUTH_PASSWORD=+# Login password.+EDGE_EVER_AUTH_PASSWORD=admin123# Web session lifetime in days. The server limits it to 1-400 days.EDGE_EVER_SESSION_TTL_DAYS=400diff --git a/README.md b/README.mdindex f104f79d..1ba755cd 100644--- a/README.md+++ b/README.md@@ -68,7 +68,7 @@ After the first deployment, see [Cloudflare Workers Builds](docs/cloudflare-workPlease refer to the [Cloudflare Manual Deployment Guide](docs/manual-deploy.md) for first-time manual installation, Cloudflare resource setup, and emergency recovery. After the first deployment, connect Workers Builds; future updates arrive through GitHub **Sync fork** or pushes to `main`.-The automated helper commands are recommended. If you create the Cloudflare resources manually, finish configuring `.env.local`—including the D1 ID, R2 bucket, login password Secret, and the 400-day session limit—before running `bun run deploy`. Existing installations that use `EDGE_EVER_AUTH_PASSWORD_HASH` remain supported. Use that command only for first installation and emergency recovery; Workers Builds handles routine updates.+The automated helper commands are recommended. The template uses `admin` / `admin123` for the initial login, and the password can be changed later in Personal Settings. If you create the Cloudflare resources manually, finish configuring `.env.local`—including the D1 ID, R2 bucket, and the 400-day session limit—before running `bun run deploy`. Existing installations that use `EDGE_EVER_AUTH_PASSWORD_HASH` remain supported. Use that command only for first installation and emergency recovery; Workers Builds handles routine updates.## PWA Installationdiff --git a/docs/agent-deploy-cloudflare.md b/docs/agent-deploy-cloudflare.mdindex da250953..f976e562 100644--- a/docs/agent-deploy-cloudflare.md+++ b/docs/agent-deploy-cloudflare.md@@ -24,7 +24,7 @@ Chinese version:- Do not hard-code a personal Worker name, D1 database ID, R2 bucket name, account ID, API token, or domain in source files.- Use `.env.local` for local/private deployment values. It is git-ignored.- If the Cloudflare MCP or Cloudflare plugin is available, it may be used to inspect or create resources. If not, use Wrangler through the scripts in this repo.-- Ask the user only for values that cannot be inferred or generated safely, such as Cloudflare authorization, the first login password, or custom domain ownership.+- Ask the user only for values that cannot be inferred or generated safely, such as Cloudflare authorization or custom domain ownership. The default first-login credentials are `admin` / `admin123`, so a custom password is optional.## Required Tools@@ -57,26 +57,30 @@ Chinese version:4. Prepare deployment resources and `.env.local`.- `EDGE_EVER_PASSWORD` must contain the **plaintext password that the user will type when first logging in to EdgeEver**. It is not an encrypted password or a password hash. If the user gave this first login password, run:+ By default, run:++ ```sh+ bun run deploy:setup+ ```++ This uses the template credentials `admin` / `admin123`. If the user explicitly provides a custom first-login password, pass that plaintext password through `EDGE_EVER_PASSWORD`; it is not an encrypted password or a password hash:```sh# Plaintext first-login password; do not put a hash here.EDGE_EVER_PASSWORD='<first-login-password>' bun run deploy:setup```- If no password was provided, ask for one or ask permission to generate a random password. Then rerun the command with `EDGE_EVER_PASSWORD`.-`deploy:setup` will:- copy `.env.local.example` to `.env.local` when needed- reuse or create the D1 database- create the R2 buckets when needed- - save the plaintext `EDGE_EVER_PASSWORD` as `EDGE_EVER_AUTH_PASSWORD` in the private, git-ignored `.env.local`; deployment uploads it as a Cloudflare Worker Secret, not a regular plaintext build variable+ - keep the template password or save the optional plaintext `EDGE_EVER_PASSWORD` override as `EDGE_EVER_AUTH_PASSWORD` in the private, git-ignored `.env.local`; deployment uploads it as a Cloudflare Worker Secret, not a regular plaintext build variablePassword variable meanings:- - `EDGE_EVER_PASSWORD`: plaintext first-login password passed temporarily to `deploy:setup`- - `EDGE_EVER_AUTH_PASSWORD`: the same plaintext login password stored only in private `.env.local` and uploaded as a Cloudflare Worker Secret+ - `EDGE_EVER_PASSWORD`: optional plaintext override passed temporarily to `deploy:setup`+ - `EDGE_EVER_AUTH_PASSWORD`: login password stored in private `.env.local` and uploaded as a Cloudflare Worker Secret; defaults to `admin123`- `EDGE_EVER_AUTH_PASSWORD_HASH`: a PBKDF2 password hash supported only for legacy or advanced configurations; never pass this hash through `EDGE_EVER_PASSWORD`5. Check the deployment inputs.@@ -104,7 +108,7 @@ Chinese version:curl https://<worker-url>/api/openapi.json```- Open the site, log in with `EDGE_EVER_AUTH_USERNAME` and the first login password, then create an MCP token from the in-app MCP settings.+ Open the site and log in with the configured credentials. Unless overridden, use `admin` / `admin123`. The password can be changed later in Personal Settings. Then create an MCP token from the in-app MCP settings.8. Connect Cloudflare Workers Builds.@@ -128,7 +132,7 @@ EDGE_EVER_D1_DATABASE_NAME=edgeeverEDGE_EVER_R2_BUCKET_NAME=edgeever-resourcesEDGE_EVER_R2_PREVIEW_BUCKET_NAME=edgeever-resources-previewEDGE_EVER_AUTH_USERNAME=admin-EDGE_EVER_AUTH_PASSWORD=<login-password>+EDGE_EVER_AUTH_PASSWORD=admin123EDGE_EVER_SESSION_TTL_DAYS=400EDGE_EVER_CUSTOM_DOMAIN=notes.example.com```@@ -139,7 +143,7 @@ For multiple instances, set `EDGE_EVER_INSTANCE=<name>` and use scoped variablesEDGE_EVER_PROD_WORKER_NAME=edgeever-prodEDGE_EVER_PROD_D1_DATABASE_ID=<database-id>EDGE_EVER_PROD_R2_BUCKET_NAME=edgeever-prod-resources-EDGE_EVER_PROD_AUTH_PASSWORD=<login-password>+EDGE_EVER_PROD_AUTH_PASSWORD=admin123```Legacy or advanced installations may use `EDGE_EVER_<INSTANCE>_AUTH_PASSWORD_HASH` instead. Never place either password value in a committed file or a non-secret Cloudflare variable.@@ -149,7 +153,6 @@ Legacy or advanced installations may use `EDGE_EVER_<INSTANCE>_AUTH_PASSWORD_HASStop and ask the user only when:- Cloudflare authentication is missing and the agent cannot open or complete login.-- The user must choose or provide the first login password.- The requested custom domain is not available in the Cloudflare account.- Resource creation fails because of account limits, permissions, billing, or conflicting names that cannot be resolved by choosing a new name.@@ -159,7 +162,7 @@ After deployment, report:- deployed URL- login username-- whether the password was user-provided or generated+- whether the default password or a user-provided override was used- where to create the EdgeEver MCP token in the app- confirmation that Workers Builds is connected and that future `main` pushes automatically migrate and deploy- any custom domain or Cloudflare DNS step that remainsdiff --git a/docs/cloudflare-workers-builds.md b/docs/cloudflare-workers-builds.mdindex 05c12202..26588224 100644--- a/docs/cloudflare-workers-builds.md+++ b/docs/cloudflare-workers-builds.md@@ -83,6 +83,8 @@ EDGE_EVER_ROUTE_PATTERN # optionalExisting installations that already use `EDGE_EVER_AUTH_PASSWORD_HASH` may keep it instead of `EDGE_EVER_AUTH_PASSWORD`. If both are present, the hash takes precedence for backward compatibility.+New installations default to `admin` / `admin123`. The password remains a Build Secret and can be changed later in Personal Settings.+For a multi-instance configuration, set `EDGE_EVER_INSTANCE` and the matching scoped variables such as `EDGE_EVER_PROD_D1_DATABASE_ID` instead. The same resolution rules apply in local deployment and Workers Builds.Workers Builds needs an API token that can deploy Workers, update R2 bindings, and apply D1 migrations. If the automatically created Builds token does not have D1 edit permission, select or create a token with that permission before enabling automated deployments.diff --git a/docs/cloudflare-workers-builds.zh-CN.md b/docs/cloudflare-workers-builds.zh-CN.mdindex 3e2d0d20..a8c557d5 100644--- a/docs/cloudflare-workers-builds.zh-CN.md+++ b/docs/cloudflare-workers-builds.zh-CN.md@@ -84,6 +84,8 @@ EDGE_EVER_ROUTE_PATTERN # 可选已经使用 `EDGE_EVER_AUTH_PASSWORD_HASH` 的旧实例可以继续保留该变量,无需改成 `EDGE_EVER_AUTH_PASSWORD`。为兼容已有实例,两个变量同时存在时哈希优先。+新实例默认使用 `admin` / `admin123`。密码仍应保存为 Build Secret,部署后可以在个人中心修改。+多实例场景则设置 `EDGE_EVER_INSTANCE`,并使用 `EDGE_EVER_PROD_D1_DATABASE_ID` 之类的带实例前缀变量。本地部署和 Workers Builds 使用相同的变量解析规则。Workers Builds 使用的 API Token 必须拥有 Worker 发布、R2 binding 更新和 D1 migration 所需权限。如果 Cloudflare 自动创建的 Builds token 没有 D1 编辑权限,请选择或新建一个具备该权限的 token。diff --git a/docs/manual-deploy.md b/docs/manual-deploy.mdindex a1ecfc65..5beb1cb1 100644--- a/docs/manual-deploy.md+++ b/docs/manual-deploy.md@@ -23,8 +23,8 @@ If you are comfortable with Cloudflare and the command line, or prefer customize# Install dependenciesbun install- # Initialize deployment resources and set the first login password- EDGE_EVER_PASSWORD='<your password>' bun run deploy:setup+ # Initialize deployment resources with the default admin / admin123 login+ bun run deploy:setup# Check the deployment environment and configurationsbun run deploy:doctor@@ -33,6 +33,8 @@ If you are comfortable with Cloudflare and the command line, or prefer customizebun run deploy```+ To use a custom first-login password, run `EDGE_EVER_PASSWORD='<your password>' bun run deploy:setup` instead. You can also change the password later in Personal Settings.+### Creating Cloudflare Resources ManuallyIf you prefer not to use the automated `deploy:setup` helper, you can create the resources manually using Cloudflare CLI (Wrangler):@@ -48,10 +50,10 @@ bunx wrangler d1 create edgeever# Create the R2 bucketbunx wrangler r2 bucket create edgeever-resources-# Edit .env.local and fill in at least the generated resource and password values+# Edit .env.local and fill in at least the generated resource values# EDGE_EVER_D1_DATABASE_ID=<database_id returned by the D1 command># EDGE_EVER_R2_BUCKET_NAME=edgeever-resources-# EDGE_EVER_AUTH_PASSWORD=<your login password>+# EDGE_EVER_AUTH_PASSWORD=admin123# EDGE_EVER_SESSION_TTL_DAYS=400# Validate the completed configuration before deploying@@ -59,7 +61,7 @@ bun run deploy:doctorbun run deploy```-Before running `bun run deploy`, copy the D1 `database_id`, R2 bucket name, and login password into your local `.env.local` file. Keep the session lifetime at the template default of `400` days; the server also caps larger values at 400 days.+Before running `bun run deploy`, copy the D1 `database_id` and R2 bucket name into your local `.env.local` file. The template uses `admin` / `admin123` for the initial login; edit `EDGE_EVER_AUTH_PASSWORD` if you prefer another initial password. Keep the session lifetime at the template default of `400` days; the server also caps larger values at 400 days.`bun run deploy` builds the web app, applies remote D1 migrations, deploys the Worker, and uploads `EDGE_EVER_AUTH_PASSWORD` as a Worker Secret. After the first successful login, EdgeEver stores a salted PBKDF2-SHA256 hash in D1. Existing installations may continue to use `EDGE_EVER_AUTH_PASSWORD_HASH`; when both Secrets are set, the hash takes precedence. Verify the deployment by signing in with `EDGE_EVER_AUTH_USERNAME` and the configured password.diff --git a/docs/manual-deploy.zh-CN.md b/docs/manual-deploy.zh-CN.mdindex 7e89accb..411dedc7 100644--- a/docs/manual-deploy.zh-CN.md+++ b/docs/manual-deploy.zh-CN.md@@ -23,8 +23,8 @@# 安装依赖bun install- # 执行部署初始化,并设置首次登录密码- EDGE_EVER_PASSWORD='<你的密码>' bun run deploy:setup+ # 执行部署初始化,默认登录账号密码为 admin / admin123+ bun run deploy:setup# 诊断部署环境与配置bun run deploy:doctor@@ -33,6 +33,8 @@bun run deploy```+ 如果希望首次登录就使用自定义密码,可改为执行 `EDGE_EVER_PASSWORD='<你的密码>' bun run deploy:setup`。部署成功后也可以在个人中心修改密码。+### 完全手动创建 Cloudflare 资源如果你不想使用 `deploy:setup` 自动化脚本,也可以完全手动使用 Cloudflare CLI (Wrangler) 创建资源:@@ -48,10 +50,10 @@ bunx wrangler d1 create edgeever# 手动创建 R2 存储桶bunx wrangler r2 bucket create edgeever-resources-# 编辑 .env.local,至少填入刚创建的资源和密码配置+# 编辑 .env.local,至少填入刚创建的资源配置# EDGE_EVER_D1_DATABASE_ID=<D1 创建命令返回的 database_id># EDGE_EVER_R2_BUCKET_NAME=edgeever-resources-# EDGE_EVER_AUTH_PASSWORD=<你的登录密码>+# EDGE_EVER_AUTH_PASSWORD=admin123# EDGE_EVER_SESSION_TTL_DAYS=400# 确认配置完整后再部署@@ -59,7 +61,7 @@ bun run deploy:doctorbun run deploy```-必须在执行 `bun run deploy` **之前**,将 D1 创建命令返回的 `database_id`、R2 bucket 名称和登录密码写入本机 `.env.local`。会话有效期建议保留模板中的 `400` 天;服务端也会把更大的值限制为 400 天。+必须在执行 `bun run deploy` **之前**,将 D1 创建命令返回的 `database_id` 和 R2 bucket 名称写入本机 `.env.local`。模板的初始登录账号密码为 `admin` / `admin123`;如需使用其他初始密码,可修改 `EDGE_EVER_AUTH_PASSWORD`。会话有效期建议保留模板中的 `400` 天;服务端也会把更大的值限制为 400 天。`bun run deploy` 会构建 Web 应用、执行远程 D1 migration、部署 Worker,并将 `EDGE_EVER_AUTH_PASSWORD` 作为 Worker Secret 上传。首次登录成功后,EdgeEver 会将加盐的 PBKDF2-SHA256 哈希写入 D1。已有实例可以继续使用 `EDGE_EVER_AUTH_PASSWORD_HASH`;两个 Secret 同时存在时优先使用哈希。部署完成后,请使用 `.env.local` 中的 `EDGE_EVER_AUTH_USERNAME` 和配置的密码登录验证。diff --git a/scripts/cloudflare-deploy.mjs b/scripts/cloudflare-deploy.mjsindex 00a0823d..8f7922e1 100644--- a/scripts/cloudflare-deploy.mjs+++ b/scripts/cloudflare-deploy.mjs@@ -209,23 +209,21 @@ const ensureAuthPassword = (values) => {return check("auth password hash", valid, valid ? "configured" : "invalid");}- const currentPassword = envValue("AUTH_PASSWORD", values);- if (currentPassword) {- return check("auth password", true, "configured as a secret");- }-const password = process.env.EDGE_EVER_PASSWORD?.trim();- if (!password) {- return check(- "auth password",- false,- "set EDGE_EVER_PASSWORD and rerun setup, or set EDGE_EVER_AUTH_PASSWORD",- );+ if (password) {+ upsertEnv(targetKey("AUTH_PASSWORD", values), password);+ console.log("[ok] configured auth password secret");+ return true;}- upsertEnv(targetKey("AUTH_PASSWORD", values), password);- console.log("[ok] configured auth password secret");- return true;+ const currentPassword = envValue("AUTH_PASSWORD", values);+ return currentPassword+ ? check("auth password", true, "configured as a secret")+ : check(+ "auth password",+ false,+ "set EDGE_EVER_PASSWORD and rerun setup, or set EDGE_EVER_AUTH_PASSWORD",+ );};const doctor = () => {