From adc39d10622d1235ba309ee36707aeaa44fc1da1 Mon Sep 17 00:00:00 2001 From: CREDO23 Date: Wed, 1 Jul 2026 17:08:58 +0200 Subject: [PATCH] feat(config): add env keys for discover search providers --- surfsense_backend/.env.example | 7 +++++++ surfsense_backend/app/config/__init__.py | 6 +++++- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/surfsense_backend/.env.example b/surfsense_backend/.env.example index c08a696a3..435782159 100644 --- a/surfsense_backend/.env.example +++ b/surfsense_backend/.env.example @@ -60,6 +60,13 @@ WHATSAPP_BRIDGE_URL=http://whatsapp-bridge:9929 # Only uncomment if running the backend outside Docker (e.g. uvicorn on host). # SEARXNG_DEFAULT_HOST=http://localhost:8888 +# web.discover fallback providers (env-keyed). SearXNG above is preferred; these +# are used when it is not configured. web.discover self-disables if none are set. +# LINKUP_API_KEY= +# BAIDU_API_KEY= +# BAIDU_MODEL=ernie-3.5-8k +# BAIDU_SEARCH_SOURCE=baidu_search_v2 + # Periodic task interval # # Run every minute (default) # SCHEDULE_CHECKER_INTERVAL=1m diff --git a/surfsense_backend/app/config/__init__.py b/surfsense_backend/app/config/__init__.py index 0065faa9a..bacfc3c38 100644 --- a/surfsense_backend/app/config/__init__.py +++ b/surfsense_backend/app/config/__init__.py @@ -554,8 +554,12 @@ class Config: os.getenv("SURFSENSE_CONNECTOR_DISCOVERY_TTL_SECONDS", "30") ) - # Platform web search (SearXNG) + # Platform web search providers for the web.discover capability (env-keyed). SEARXNG_DEFAULT_HOST = os.getenv("SEARXNG_DEFAULT_HOST") + LINKUP_API_KEY = os.getenv("LINKUP_API_KEY") + BAIDU_API_KEY = os.getenv("BAIDU_API_KEY") + BAIDU_MODEL = os.getenv("BAIDU_MODEL", "ernie-3.5-8k") + BAIDU_SEARCH_SOURCE = os.getenv("BAIDU_SEARCH_SOURCE", "baidu_search_v2") SURFSENSE_PUBLIC_URL = os.getenv("SURFSENSE_PUBLIC_URL") NEXT_FRONTEND_URL = os.getenv("NEXT_FRONTEND_URL") or SURFSENSE_PUBLIC_URL