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
fix: make App Review demo instance URL unambiguous
tianma-if4a73502f1694
diff --git a/apps/ios/EdgeEver/Features/Auth/LoginView.swift b/apps/ios/EdgeEver/Features/Auth/LoginView.swiftindex 53afea05..5ea3a29d 100644--- a/apps/ios/EdgeEver/Features/Auth/LoginView.swift+++ b/apps/ios/EdgeEver/Features/Auth/LoginView.swift@@ -65,11 +65,28 @@ struct LoginView: View {field(env.preferences.t("实例地址", en: "Instance URL"),- placeholder: "https://notes.example.com",+ placeholder: EdgeEverPublicDemo.instanceURLString,text: $baseUrl,keyboard: .URL,secure: false)+ Text(env.preferences.t(+ "请填写完整 HTTPS 地址,不要只输入 demo。",+ en: "Enter the full HTTPS URL, not just “demo”."+ ))+ .font(.system(size: 12, weight: .medium))+ .foregroundStyle(AppTheme.secondary)+ .padding(.top, 8)+ Button {+ baseUrl = EdgeEverPublicDemo.instanceURLString+ } label: {+ Text(env.preferences.t("填入公开演示实例", en: "Use public demo instance"))+ .font(.system(size: 13, weight: .semibold))+ .foregroundStyle(AppTheme.accent)+ }+ .buttonStyle(.plain)+ .accessibilityLabel(env.preferences.t("填入公开演示实例", en: "Use public demo instance"))+ .padding(.top, 6).padding(.bottom, 14)field(diff --git a/apps/ios/EdgeEver/Supporting/URL+Normalize.swift b/apps/ios/EdgeEver/Supporting/URL+Normalize.swiftindex 5eda6609..d7262859 100644--- a/apps/ios/EdgeEver/Supporting/URL+Normalize.swift+++ b/apps/ios/EdgeEver/Supporting/URL+Normalize.swift@@ -11,6 +11,10 @@ extension URL {}}+enum EdgeEverPublicDemo {+ static let instanceURLString = "https://demo.edgeever.org"+}+enum EdgeEverURLNormalizer {static func normalizeInstanceURL(_ raw: String) throws -> URL {var trimmed = raw.trimmingCharacters(in: .whitespacesAndNewlines)@@ -23,6 +27,10 @@ enum EdgeEverURLNormalizer {guard var components = URLComponents(string: trimmed), let host = components.host, !host.isEmpty else {throw EdgeEverURLError.invalid}+ if host.lowercased() == "demo" {+ components.scheme = "https"+ components.host = "demo.edgeever.org"+ }components.fragment = nilcomponents.query = nilguard let url = components.url else {diff --git a/apps/ios/Tests/EdgeEverTests/URLNormalizeTests.swift b/apps/ios/Tests/EdgeEverTests/URLNormalizeTests.swiftindex f585deda..dd7ec5de 100644--- a/apps/ios/Tests/EdgeEverTests/URLNormalizeTests.swift+++ b/apps/ios/Tests/EdgeEverTests/URLNormalizeTests.swift@@ -15,4 +15,19 @@ final class URLNormalizeTests: XCTestCase {func testRejectsEmpty() {XCTAssertThrowsError(try EdgeEverURLNormalizer.normalizeInstanceURL(" "))}++ func testMapsBareDemoAliasToPublicInstance() throws {+ XCTAssertEqual(+ try EdgeEverURLNormalizer.normalizeInstanceURL("demo").absoluteString,+ EdgeEverPublicDemo.instanceURLString+ )+ XCTAssertEqual(+ try EdgeEverURLNormalizer.normalizeInstanceURL("https://demo").absoluteString,+ EdgeEverPublicDemo.instanceURLString+ )+ XCTAssertEqual(+ try EdgeEverURLNormalizer.normalizeInstanceURL("DEMO/").absoluteString,+ EdgeEverPublicDemo.instanceURLString+ )+ }}diff --git a/apps/mobile/src/lib/session.tsx b/apps/mobile/src/lib/session.tsxindex 692c7e9a..f1f7ee54 100644--- a/apps/mobile/src/lib/session.tsx+++ b/apps/mobile/src/lib/session.tsx@@ -1,5 +1,5 @@import { createEdgeEverClient } from "@edgeever/client";-import type { AuthUser } from "@edgeever/shared";+import { resolveInstanceUrlInput, type AuthUser } from "@edgeever/shared";import { useQueryClient } from "@tanstack/react-query";import { fetch as expoFetch } from "expo/fetch";import * as SecureStore from "expo-secure-store";@@ -79,7 +79,7 @@ export const SessionProvider = ({ children }: { children: ReactNode }) => {}, [queryClient, session]);const signIn = useCallback(async (input: { baseUrl: string; username: string; password: string }) => {- const baseUrl = normalizeInstanceUrl(input.baseUrl);+ const baseUrl = normalizeInstanceUrl(resolveInstanceUrlInput(input.baseUrl));const deviceId = await getOrCreateDeviceId();const loginClient = createEdgeEverClient({ baseUrl });const authSession = await loginClient.login({diff --git a/apps/mobile/src/screens/LoginScreen.tsx b/apps/mobile/src/screens/LoginScreen.tsxindex b362855b..6a44fd3a 100644--- a/apps/mobile/src/screens/LoginScreen.tsx+++ b/apps/mobile/src/screens/LoginScreen.tsx@@ -7,6 +7,7 @@ import {StyleSheet,View,} from "react-native";+import { PUBLIC_DEMO_INSTANCE_URL } from "@edgeever/shared";import { SafeAreaView } from "react-native-safe-area-context";import { ActivityIndicator, ExternalLink, LockKeyhole } from "../components/icons";import { Pressable, Text, TextInput } from "../components/LocalizedText";@@ -72,11 +73,19 @@ export const LoginScreen = () => {autoCorrect={false}keyboardType="url"onChangeText={setBaseUrl}- placeholder="https://notes.example.com"+ placeholder={PUBLIC_DEMO_INSTANCE_URL}placeholderTextColor="#94a3b8"style={styles.input}value={baseUrl}/>+ <Text style={styles.hint}>请填写完整 HTTPS 地址,不要只输入 demo。</Text>+ <Pressable+ accessibilityLabel="填入公开演示实例"+ accessibilityRole="button"+ onPress={() => setBaseUrl(PUBLIC_DEMO_INSTANCE_URL)}+ >+ <Text style={styles.demoLink}>填入公开演示实例</Text>+ </Pressable></View><View style={styles.field}>@@ -208,6 +217,16 @@ const baseLoginStyles = StyleSheet.create({minHeight: 48,paddingHorizontal: 14,},+ hint: {+ color: "#64748b",+ fontSize: 12,+ lineHeight: 16,+ },+ demoLink: {+ color: "#059669",+ fontSize: 13,+ fontWeight: "700",+ },error: {color: "#dc2626",fontSize: 13,diff --git a/apps/mobile/store-assets/app-store/metadata.en-US.md b/apps/mobile/store-assets/app-store/metadata.en-US.mdindex 304a8648..d6f76c46 100644--- a/apps/mobile/store-assets/app-store/metadata.en-US.md+++ b/apps/mobile/store-assets/app-store/metadata.en-US.md@@ -61,7 +61,25 @@ notes,notebook,self-hosted,markdown,writing,knowledge,Cloudflare,open source,syn### Review notes-EdgeEver is a client for a self-hosted notes service. On the sign-in screen, enter the demo instance URL, username, and password listed above. The public demo resets every day at 3:00 AM China Standard Time; please do not store sensitive review content in it.+APP REVIEW LOGIN — paste these values into the sign-in form.++Demo Instance URL (type this exact HTTPS URL into Instance URL; do not type "demo"):+https://demo.edgeever.org++Username: ee-demo+Password: demo#dZ6Q29Zjfor%++How to sign in:+1. Launch EdgeEver.+2. In Instance URL, enter https://demo.edgeever.org+3. Enter the username and password above.+4. Tap Sign in. You should land in a notes workspace with sample content.++Do not enter "demo" alone, and do not use any example.com placeholder.++EdgeEver is a self-hosted personal knowledge base. Users connect the app to their own instance URL; there is no shared SaaS backend. The public demo is for App Review and resets daily around 03:00 China Standard Time (19:00 UTC). Please do not store private data there.++HTTPS is required for the public demo. HTTP is only for local/LAN self-hosting and shows an explicit warning.The app does not create accounts. Production accounts are created and controlled by the administrator of the self-hosted EdgeEver instance. Notes, attachments, credentials, and sync traffic travel directly between the device and the instance selected by the user; the app developer operates no relay or centralized storage service. Account and server-side data deletion is handled by that instance administrator. Users can sign out to remove the local session and can remove local app data through iOS Settings.diff --git a/apps/mobile/store-assets/app-store/metadata.zh-CN.md b/apps/mobile/store-assets/app-store/metadata.zh-CN.mdindex a5c8f8ae..be14b814 100644--- a/apps/mobile/store-assets/app-store/metadata.zh-CN.md+++ b/apps/mobile/store-assets/app-store/metadata.zh-CN.md@@ -61,7 +61,25 @@ EdgeEver 是独立项目,与 Evernote Corporation 及其关联公司无隶属### 审核备注-EdgeEver 是自托管笔记服务的客户端。请在登录页输入上方提供的演示实例网址、用户名和密码。公开演示环境会在每天北京时间凌晨 3:00 重置,请勿在其中保存敏感审核内容。+请先按下面的值登录,不要只输入 demo。++演示实例网址(请完整填入「实例地址」,必须是 HTTPS):+https://demo.edgeever.org++用户名:ee-demo+密码:demo#dZ6Q29Zjfor%++登录步骤:+1. 打开 EdgeEver。+2. 在「实例地址」中输入 https://demo.edgeever.org+3. 输入上方用户名和密码。+4. 点击登录,应进入带有示例内容的笔记工作区。++请不要只输入 demo,也不要使用任何 example.com 占位符。++EdgeEver 是自托管个人知识库。用户将 App 连接到自己的实例地址,不存在共享 SaaS 后端。公开演示实例供 App 审核使用,每天北京时间约 03:00(19:00 UTC)重置,请勿在其中保存私人数据。++公开演示必须使用 HTTPS。HTTP 仅用于本机/局域网自托管,并会显示明确警告。App 不负责创建账号。正式账号由用户所连接的自托管 EdgeEver 实例管理员创建和管理。笔记、附件、凭据与同步流量直接在设备和用户选择的实例之间传输,App 开发者不运营中转或集中存储服务。账号及服务端数据删除由实例管理员处理;用户可以退出登录以移除本地会话,并通过 iOS 设置删除本地 App 数据。diff --git a/apps/web/src/components/LoginScreen.tsx b/apps/web/src/components/LoginScreen.tsxindex 777d5abe..be481962 100644--- a/apps/web/src/components/LoginScreen.tsx+++ b/apps/web/src/components/LoginScreen.tsx@@ -1,6 +1,7 @@import { useState, type FormEvent } from "react";import { LockKeyhole } from "lucide-react";import { useTranslation } from "react-i18next";+import { PUBLIC_DEMO_INSTANCE_URL, resolveInstanceUrlInput } from "@edgeever/shared";import { Button } from "@/components/ui/button";import { GitHubRepositoryLink } from "@/components/GitHubRepositoryLink";import { Input } from "@/components/ui/input";@@ -38,7 +39,7 @@ export const LoginScreen = ({ error, instanceUrl: initialInstanceUrl, isSubmitti}onSubmit({- ...(initialInstanceUrl !== undefined ? { instanceUrl: instanceUrl.trim() } : {}),+ ...(initialInstanceUrl !== undefined ? { instanceUrl: resolveInstanceUrlInput(instanceUrl) } : {}),username: username.trim(),password,});@@ -85,12 +86,20 @@ export const LoginScreen = ({ error, instanceUrl: initialInstanceUrl, isSubmitti<InputautoComplete="url"className="h-11 rounded-lg bg-slate-50/50 px-3.5 focus-visible:bg-white focus-visible:ring-4 focus-visible:ring-emerald-500/10"- placeholder="https://notes.example.com"+ placeholder={t("login.instanceUrlPlaceholder")}requiredtype="url"value={instanceUrl}onChange={(event) => setInstanceUrl(event.target.value)}/>+ <p className="mt-2 text-xs font-medium text-slate-500">{t("login.instanceUrlHint")}</p>+ <button+ className="mt-1.5 text-sm font-semibold text-emerald-700 transition hover:text-emerald-800 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-emerald-500/70"+ type="button"+ onClick={() => setInstanceUrl(PUBLIC_DEMO_INSTANCE_URL)}+ >+ {t("login.usePublicDemo")}+ </button></label>) : null}diff --git a/apps/web/src/lib/api.test.mjs b/apps/web/src/lib/api.test.mjsindex 037b2607..cddaf614 100644--- a/apps/web/src/lib/api.test.mjs+++ b/apps/web/src/lib/api.test.mjs@@ -91,6 +91,15 @@ describe("desktop instance setup", () => {expect(storage.get(DESKTOP_API_BASE_URL_STORAGE_KEY)).toBe("https://notes.example.com");});+ test("maps the App Review demo alias to the public instance", async () => {+ calls.length = 0;+ const saving = saveDesktopApiBaseUrl("demo");+ await Promise.resolve();+ expect(calls).toEqual([["bridge:start", "https://demo.edgeever.org"]]);+ completeSave();+ await expect(saving).resolves.toBe("https://demo.edgeever.org");+ });+test("clears the cached session when the login form changes instances", async () => {calls.length = 0;window.edgeeverDesktop.apiBaseUrl = "https://notes.example.com";diff --git a/apps/web/src/lib/api.ts b/apps/web/src/lib/api.tsindex a2c7b84b..a68e13a2 100644--- a/apps/web/src/lib/api.ts+++ b/apps/web/src/lib/api.ts@@ -35,6 +35,7 @@ import type {SyncBootstrapResponse,SyncChangesResponse,} from "@edgeever/shared";+import { resolveInstanceUrlInput } from "@edgeever/shared";import type { MemoFilterMode, MemoSortMode } from "./app-helpers";type ListNotebooksResponse = {@@ -192,7 +193,7 @@ export class DesktopInstanceUrlError extends Error {}export const saveDesktopApiBaseUrl = async (value: string) => {- const normalized = value.trim().replace(/\/$/, "");+ const normalized = resolveInstanceUrlInput(value).replace(/\/$/, "");let parsed: URL;try {parsed = new URL(normalized);diff --git a/packages/shared/src/i18n/en-US.ts b/packages/shared/src/i18n/en-US.tsindex 4b2fe7b9..3dc07d63 100644--- a/packages/shared/src/i18n/en-US.ts+++ b/packages/shared/src/i18n/en-US.ts@@ -73,6 +73,9 @@ export const enUS = {desktopInstanceContinue: "Continue",desktopChangeInstance: "Change instance URL",desktopInstanceUrlInvalid: "Enter a valid instance URL beginning with http:// or https://.",+ instanceUrlPlaceholder: "https://demo.edgeever.org",+ instanceUrlHint: "Enter the full HTTPS URL, not just “demo”.",+ usePublicDemo: "Use public demo instance",},nav: {mobileMain: "Mobile primary navigation",diff --git a/packages/shared/src/i18n/zh-CN.ts b/packages/shared/src/i18n/zh-CN.tsindex f3a176fd..985f6987 100644--- a/packages/shared/src/i18n/zh-CN.ts+++ b/packages/shared/src/i18n/zh-CN.ts@@ -73,6 +73,9 @@ export const zhCN = {desktopInstanceContinue: "继续",desktopChangeInstance: "更换实例地址",desktopInstanceUrlInvalid: "请输入以 http:// 或 https:// 开头的有效实例地址。",+ instanceUrlPlaceholder: "https://demo.edgeever.org",+ instanceUrlHint: "请填写完整 HTTPS 地址,不要只输入 demo。",+ usePublicDemo: "填入公开演示实例",},nav: {mobileMain: "移动端主导航",diff --git a/packages/shared/src/index.ts b/packages/shared/src/index.tsindex edbea12e..06dd2aa1 100644--- a/packages/shared/src/index.ts+++ b/packages/shared/src/index.ts@@ -1,4 +1,5 @@export * from "./content";+export * from "./public-demo";export * from "./ai-assistant";export * from "./ai-prompt-seeds";export * from "./ai-selection";diff --git a/packages/shared/src/public-demo.test.mjs b/packages/shared/src/public-demo.test.mjsnew file mode 100644index 00000000..0a881bec--- /dev/null+++ b/packages/shared/src/public-demo.test.mjs@@ -0,0 +1,19 @@+import { describe, expect, test } from "bun:test";+import { PUBLIC_DEMO_INSTANCE_URL, resolveInstanceUrlInput } from "./public-demo.ts";++describe("public demo instance URL", () => {+ test("maps the App Review 'demo' alias to the public instance", () => {+ expect(PUBLIC_DEMO_INSTANCE_URL).toBe("https://demo.edgeever.org");+ expect(resolveInstanceUrlInput("demo")).toBe(PUBLIC_DEMO_INSTANCE_URL);+ expect(resolveInstanceUrlInput("DEMO")).toBe(PUBLIC_DEMO_INSTANCE_URL);+ expect(resolveInstanceUrlInput(" https://demo/ ")).toBe(PUBLIC_DEMO_INSTANCE_URL);+ expect(resolveInstanceUrlInput("http://demo")).toBe(PUBLIC_DEMO_INSTANCE_URL);+ });++ test("leaves real hosts unchanged", () => {+ expect(resolveInstanceUrlInput("https://demo.edgeever.org")).toBe("https://demo.edgeever.org");+ expect(resolveInstanceUrlInput("https://notes.example.com")).toBe("https://notes.example.com");+ expect(resolveInstanceUrlInput("demo.example.com")).toBe("demo.example.com");+ expect(resolveInstanceUrlInput("")).toBe("");+ });+});diff --git a/packages/shared/src/public-demo.ts b/packages/shared/src/public-demo.tsnew file mode 100644index 00000000..099b018c--- /dev/null+++ b/packages/shared/src/public-demo.ts@@ -0,0 +1,18 @@+/** Public App Review / marketing demo. Never use a fake example host as the login placeholder. */+export const PUBLIC_DEMO_INSTANCE_URL = "https://demo.edgeever.org";++const publicDemoAliasHost = (value: string) =>+ value+ .trim()+ .replace(/\/+$/, "")+ .replace(/^https?:\/\//i, "")+ .toLowerCase();++/** Map the App Review typo "demo" (and https://demo) to the real public instance. */+export const resolveInstanceUrlInput = (value: string) => {+ const trimmed = value.trim();+ if (!trimmed) {+ return trimmed;+ }+ return publicDemoAliasHost(trimmed) === "demo" ? PUBLIC_DEMO_INSTANCE_URL : trimmed;+};diff --git a/tests/app-review-login.test.ts b/tests/app-review-login.test.tsnew file mode 100644index 00000000..156c9c45--- /dev/null+++ b/tests/app-review-login.test.ts@@ -0,0 +1,43 @@+import { describe, expect, test } from "bun:test";+import { readFileSync } from "node:fs";++const read = (relativePath: string) =>+ readFileSync(new URL(`../${relativePath}`, import.meta.url), "utf8");++const loginSurfaces = [+ "apps/ios/EdgeEver/Features/Auth/LoginView.swift",+ "apps/mobile/src/screens/LoginScreen.tsx",+ "apps/web/src/components/LoginScreen.tsx",+];++const reviewNotes = [+ "apps/mobile/store-assets/app-store/metadata.en-US.md",+ "apps/mobile/store-assets/app-store/metadata.zh-CN.md",+];++describe("App Review login", () => {+ test("does not offer a fake example.com host as the instance placeholder", () => {+ for (const path of [...loginSurfaces, ...reviewNotes]) {+ expect(read(path), path).not.toContain("notes.example.com");+ }+ });++ test("wires login screens to the public demo instance", () => {+ expect(read("packages/shared/src/public-demo.ts")).toContain('export const PUBLIC_DEMO_INSTANCE_URL = "https://demo.edgeever.org"');+ expect(read("apps/ios/EdgeEver/Supporting/URL+Normalize.swift")).toContain('static let instanceURLString = "https://demo.edgeever.org"');+ expect(read("apps/ios/EdgeEver/Features/Auth/LoginView.swift")).toContain("EdgeEverPublicDemo.instanceURLString");+ expect(read("apps/ios/EdgeEver/Features/Auth/LoginView.swift")).toContain("Use public demo instance");+ expect(read("apps/mobile/src/screens/LoginScreen.tsx")).toContain("PUBLIC_DEMO_INSTANCE_URL");+ expect(read("apps/mobile/src/screens/LoginScreen.tsx")).toContain("填入公开演示实例");+ expect(read("apps/web/src/components/LoginScreen.tsx")).toContain("PUBLIC_DEMO_INSTANCE_URL");+ expect(read("apps/web/src/components/LoginScreen.tsx")).toContain("login.usePublicDemo");+ });++ test("puts the public demo URL and credentials in App Review notes", () => {+ for (const path of reviewNotes) {+ expect(read(path), path).toContain("https://demo.edgeever.org");+ }+ expect(read("apps/mobile/store-assets/app-store/metadata.en-US.md")).toContain("Username: ee-demo");+ expect(read("apps/mobile/store-assets/app-store/metadata.zh-CN.md")).toContain("用户名:ee-demo");+ });+});