fix: update server URL in README and settings for SurfSense plugin

This commit is contained in:
Anish Sarkar 2026-04-21 10:53:55 +05:30
parent 20ce687b6d
commit 1f524660e1
6 changed files with 26 additions and 6 deletions

View file

@ -50,7 +50,7 @@ Open **Settings → SurfSense** in Obsidian and fill in:
| Setting | Value | | 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 | | API token | Copy from the *Connectors → Obsidian* dialog in the SurfSense web app |
| Search space | Pick the search space this vault should sync into | | 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 | | Vault name | Defaults to your Obsidian vault name; rename if you have multiple vaults |

View file

@ -34,11 +34,11 @@ export class SurfSenseSettingTab extends PluginSettingTab {
new Setting(containerEl) new Setting(containerEl)
.setName("Server URL") .setName("Server URL")
.setDesc( .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) => .addText((text) =>
text text
.setPlaceholder("https://api.surfsense.com") .setPlaceholder("https://surfsense.com")
.setValue(settings.serverUrl) .setValue(settings.serverUrl)
.onChange(async (value) => { .onChange(async (value) => {
this.plugin.settings.serverUrl = value.trim(); this.plugin.settings.serverUrl = value.trim();
@ -189,7 +189,7 @@ export class SurfSenseSettingTab extends PluginSettingTab {
new Setting(containerEl) new Setting(containerEl)
.setName("Include attachments") .setName("Include attachments")
.setDesc( .setDesc(
"Sync non-Markdown files (images, PDFs, …). Off by default — Markdown only.", "Also sync non-Markdown files such as images and PDFs.",
) )
.addToggle((toggle) => .addToggle((toggle) =>
toggle toggle

View file

@ -23,7 +23,7 @@ export interface SurfsensePluginSettings {
} }
export const DEFAULT_SETTINGS: SurfsensePluginSettings = { export const DEFAULT_SETTINGS: SurfsensePluginSettings = {
serverUrl: "https://api.surfsense.com", serverUrl: "https://surfsense.com",
apiToken: "", apiToken: "",
searchSpaceId: null, searchSpaceId: null,
connectorId: null, connectorId: null,

View file

@ -1,4 +1,9 @@
NEXT_PUBLIC_FASTAPI_BACKEND_URL=http://localhost:8000 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_FASTAPI_BACKEND_AUTH_TYPE=LOCAL or GOOGLE
NEXT_PUBLIC_ETL_SERVICE=UNSTRUCTURED or LLAMACLOUD or DOCLING NEXT_PUBLIC_ETL_SERVICE=UNSTRUCTURED or LLAMACLOUD or DOCLING
NEXT_PUBLIC_ZERO_CACHE_URL=http://localhost:4848 NEXT_PUBLIC_ZERO_CACHE_URL=http://localhost:4848

View file

@ -14,7 +14,7 @@ const PLUGIN_RELEASES_URL =
"https://github.com/MODSetter/SurfSense/releases?q=obsidian&expanded=true"; "https://github.com/MODSetter/SurfSense/releases?q=obsidian&expanded=true";
const BACKEND_URL = 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. * Obsidian connect form for the plugin-only architecture.

View file

@ -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) // Configure webpack (SVGR)
webpack: (config) => { webpack: (config) => {
// SVGR: import *.svg as React components // SVGR: import *.svg as React components