mirror of
https://github.com/MODSetter/SurfSense.git
synced 2026-04-25 00:36:31 +02:00
feat: add internal backend URL configuration and enhance server URL handling in SurfSense settings
This commit is contained in:
parent
1f524660e1
commit
1abbc6021f
4 changed files with 20 additions and 3 deletions
|
|
@ -71,6 +71,7 @@ EMBEDDING_MODEL=sentence-transformers/all-MiniLM-L6-v2
|
|||
# BACKEND_URL=https://api.yourdomain.com
|
||||
# NEXT_PUBLIC_FASTAPI_BACKEND_URL=https://api.yourdomain.com
|
||||
# NEXT_PUBLIC_ZERO_CACHE_URL=https://zero.yourdomain.com
|
||||
# FASTAPI_BACKEND_INTERNAL_URL=http://backend:8000
|
||||
|
||||
# ------------------------------------------------------------------------------
|
||||
# Zero-cache (real-time sync)
|
||||
|
|
|
|||
|
|
@ -198,6 +198,7 @@ services:
|
|||
NEXT_PUBLIC_FASTAPI_BACKEND_AUTH_TYPE: ${AUTH_TYPE:-LOCAL}
|
||||
NEXT_PUBLIC_ETL_SERVICE: ${ETL_SERVICE:-DOCLING}
|
||||
NEXT_PUBLIC_DEPLOYMENT_MODE: ${DEPLOYMENT_MODE:-self-hosted}
|
||||
FASTAPI_BACKEND_INTERNAL_URL: ${FASTAPI_BACKEND_INTERNAL_URL:-http://backend:8000}
|
||||
labels:
|
||||
- "com.centurylinklabs.watchtower.enable=true"
|
||||
depends_on:
|
||||
|
|
|
|||
|
|
@ -41,7 +41,13 @@ export class SurfSenseSettingTab extends PluginSettingTab {
|
|||
.setPlaceholder("https://surfsense.com")
|
||||
.setValue(settings.serverUrl)
|
||||
.onChange(async (value) => {
|
||||
this.plugin.settings.serverUrl = value.trim();
|
||||
const next = value.trim();
|
||||
const previous = this.plugin.settings.serverUrl;
|
||||
if (previous !== "" && next !== previous) {
|
||||
this.plugin.settings.searchSpaceId = null;
|
||||
this.plugin.settings.connectorId = null;
|
||||
}
|
||||
this.plugin.settings.serverUrl = next;
|
||||
await this.plugin.saveSettings();
|
||||
}),
|
||||
);
|
||||
|
|
@ -59,7 +65,13 @@ export class SurfSenseSettingTab extends PluginSettingTab {
|
|||
.setPlaceholder("Paste token")
|
||||
.setValue(settings.apiToken)
|
||||
.onChange(async (value) => {
|
||||
this.plugin.settings.apiToken = value.trim();
|
||||
const next = value.trim();
|
||||
const previous = this.plugin.settings.apiToken;
|
||||
if (previous !== "" && next !== previous) {
|
||||
this.plugin.settings.searchSpaceId = null;
|
||||
this.plugin.settings.connectorId = null;
|
||||
}
|
||||
this.plugin.settings.apiToken = next;
|
||||
await this.plugin.saveSettings();
|
||||
});
|
||||
})
|
||||
|
|
|
|||
|
|
@ -5,7 +5,10 @@ import type { Context } from "@/types/zero";
|
|||
import { queries } from "@/zero/queries";
|
||||
import { schema } from "@/zero/schema";
|
||||
|
||||
const backendURL = process.env.NEXT_PUBLIC_FASTAPI_BACKEND_URL || "http://localhost:8000";
|
||||
const backendURL =
|
||||
process.env.FASTAPI_BACKEND_INTERNAL_URL ||
|
||||
process.env.NEXT_PUBLIC_FASTAPI_BACKEND_URL ||
|
||||
"http://localhost:8000";
|
||||
|
||||
async function authenticateRequest(
|
||||
request: Request
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue