feat(web-search): add SearXNG provider (#1166)
支持对接自建/公共 SearXNG 实例作为网络搜索引擎,缓解免费搜索引擎在国内 网络环境下访问受限的问题。 - types: 新增 WebSearchProviderTypeSearxng 与 BaseURL 参数字段; 类型元数据新增 RequiresBaseURL,前端可动态渲染 Instance URL 表单。 - infrastructure/web_search/searxng.go: 调用 /search?format=json,强制 utils.ValidateURLForSSRF 校验 base_url,可选 api_key 透传给反代鉴权。 - service: isValidProviderType 与参数校验接入 searxng。 - container: 注册 NewSearxngProvider 工厂。 - frontend: WebSearchSettings 表单根据 requires_base_url 渲染 Instance URL 输入框;编辑回填、free 判定同步更新。 - docker: 新增可选 searxng 服务(profile=searxng/full),附带最小化 settings.yml(启用 JSON 格式、关闭 limiter、关闭遥测), docker-compose 默认 SSRF_WHITELIST 包含 searxng 容器名。 - .env.example: 补充 SEARXNG_PORT / SEARXNG_SECRET 说明。 Closes #1166
This commit is contained in:
@@ -0,0 +1,49 @@
|
||||
use_default_settings: true
|
||||
|
||||
general:
|
||||
instance_name: "WeKnora SearXNG"
|
||||
privacypolicy_url: false
|
||||
donation_url: false
|
||||
contact_url: false
|
||||
enable_metrics: false
|
||||
|
||||
server:
|
||||
# Override via env SEARXNG_SECRET; the entrypoint script substitutes ultrasecretkey.
|
||||
secret_key: "ultrasecretkey"
|
||||
base_url: false
|
||||
image_proxy: true
|
||||
http_protocol_version: "1.0"
|
||||
method: "GET"
|
||||
# Disabled so WeKnora's backend can call /search without IP-based throttling.
|
||||
# Re-enable and add WeKnora's egress IP to a limiter allowlist if you expose
|
||||
# this instance to the public internet.
|
||||
limiter: false
|
||||
public_instance: false
|
||||
|
||||
ui:
|
||||
static_use_hash: true
|
||||
default_locale: ""
|
||||
query_in_title: false
|
||||
infinite_scroll: false
|
||||
center_alignment: false
|
||||
theme_args:
|
||||
simple_style: auto
|
||||
search_on_category_select: true
|
||||
hotkeys: default
|
||||
|
||||
search:
|
||||
safe_search: 0
|
||||
autocomplete: ""
|
||||
default_lang: "auto"
|
||||
ban_time_on_fail: 5
|
||||
max_ban_time_on_fail: 120
|
||||
formats:
|
||||
- html
|
||||
- json
|
||||
|
||||
outgoing:
|
||||
request_timeout: 6.0
|
||||
max_request_timeout: 10.0
|
||||
pool_connections: 100
|
||||
pool_maxsize: 20
|
||||
enable_http2: true
|
||||
Reference in New Issue
Block a user