diff --git a/surfsense_obsidian/README.md b/surfsense_obsidian/README.md index d2757118a..71cb8566e 100644 --- a/surfsense_obsidian/README.md +++ b/surfsense_obsidian/README.md @@ -50,7 +50,7 @@ Open **Settings → SurfSense** in Obsidian and fill in: | Setting | Value | | --- | --- | -| Server URL | `https://api.surfsense.com` for SurfSense Cloud, or your self-hosted URL | +| Server URL | `https://surfsense.com` for SurfSense Cloud, or your self-hosted URL | | API token | Copy from the *Connectors → Obsidian* dialog in the SurfSense web app | | Search space | Pick the search space this vault should sync into | | Vault name | Defaults to your Obsidian vault name; rename if you have multiple vaults | diff --git a/surfsense_obsidian/src/settings.ts b/surfsense_obsidian/src/settings.ts index 8cd8c1edb..ffa590cce 100644 --- a/surfsense_obsidian/src/settings.ts +++ b/surfsense_obsidian/src/settings.ts @@ -34,11 +34,11 @@ export class SurfSenseSettingTab extends PluginSettingTab { new Setting(containerEl) .setName("Server URL") .setDesc( - "https://api.surfsense.com for SurfSense Cloud, or your self-hosted URL.", + "https://surfsense.com for SurfSense Cloud, or your self-hosted URL.", ) .addText((text) => text - .setPlaceholder("https://api.surfsense.com") + .setPlaceholder("https://surfsense.com") .setValue(settings.serverUrl) .onChange(async (value) => { this.plugin.settings.serverUrl = value.trim(); @@ -189,7 +189,7 @@ export class SurfSenseSettingTab extends PluginSettingTab { new Setting(containerEl) .setName("Include attachments") .setDesc( - "Sync non-Markdown files (images, PDFs, …). Off by default — Markdown only.", + "Also sync non-Markdown files such as images and PDFs.", ) .addToggle((toggle) => toggle diff --git a/surfsense_obsidian/src/types.ts b/surfsense_obsidian/src/types.ts index 9c0e49600..97ddcdbdf 100644 --- a/surfsense_obsidian/src/types.ts +++ b/surfsense_obsidian/src/types.ts @@ -23,7 +23,7 @@ export interface SurfsensePluginSettings { } export const DEFAULT_SETTINGS: SurfsensePluginSettings = { - serverUrl: "https://api.surfsense.com", + serverUrl: "https://surfsense.com", apiToken: "", searchSpaceId: null, connectorId: null, diff --git a/surfsense_web/.env.example b/surfsense_web/.env.example index 417181ccc..05d27f2b4 100644 --- a/surfsense_web/.env.example +++ b/surfsense_web/.env.example @@ -1,4 +1,9 @@ NEXT_PUBLIC_FASTAPI_BACKEND_URL=http://localhost:8000 + +# Server-only. Backend URL behind the /api/v1/* proxy in next.config.ts. +# Falls back to NEXT_PUBLIC_FASTAPI_BACKEND_URL when unset. +BACKEND_PROXY_TARGET=https://your-internal-backend.example.com + NEXT_PUBLIC_FASTAPI_BACKEND_AUTH_TYPE=LOCAL or GOOGLE NEXT_PUBLIC_ETL_SERVICE=UNSTRUCTURED or LLAMACLOUD or DOCLING NEXT_PUBLIC_ZERO_CACHE_URL=http://localhost:4848 diff --git a/surfsense_web/components/assistant-ui/connector-popup/connect-forms/components/obsidian-connect-form.tsx b/surfsense_web/components/assistant-ui/connector-popup/connect-forms/components/obsidian-connect-form.tsx index b4bd76e8f..49c68ba39 100644 --- a/surfsense_web/components/assistant-ui/connector-popup/connect-forms/components/obsidian-connect-form.tsx +++ b/surfsense_web/components/assistant-ui/connector-popup/connect-forms/components/obsidian-connect-form.tsx @@ -14,7 +14,7 @@ const PLUGIN_RELEASES_URL = "https://github.com/MODSetter/SurfSense/releases?q=obsidian&expanded=true"; const BACKEND_URL = - process.env.NEXT_PUBLIC_FASTAPI_BACKEND_URL ?? "https://api.surfsense.com"; + process.env.NEXT_PUBLIC_FASTAPI_BACKEND_URL ?? "https://surfsense.com"; /** * Obsidian connect form for the plugin-only architecture. diff --git a/surfsense_web/next.config.ts b/surfsense_web/next.config.ts index 5414d548d..e291c4102 100644 --- a/surfsense_web/next.config.ts +++ b/surfsense_web/next.config.ts @@ -44,6 +44,21 @@ const nextConfig: NextConfig = { }, }, + // Proxy /api/v1/* to the FastAPI backend. Keeps the real backend host + // out of the client bundle. BACKEND_PROXY_TARGET is server-only. + async rewrites() { + const target = + process.env.BACKEND_PROXY_TARGET || + process.env.NEXT_PUBLIC_FASTAPI_BACKEND_URL || + "http://localhost:8000"; + return [ + { + source: "/api/v1/:path*", + destination: `${target.replace(/\/+$/, "")}/api/v1/:path*`, + }, + ]; + }, + // Configure webpack (SVGR) webpack: (config) => { // SVGR: import *.svg as React components