- 2026-10-05 深夜复测:mwmbl 稳定(133/120 条,unresponsive 为空);bing 静默返空;sogou 报 CAPTCHA(此前可用,属上游限流) - 保留 bing/sogou(会随冷却恢复)但**不是主力**;文档里注明「本机只有 mwmbl 稳定 ⇒ 兜底定位是有总比没有好」 - 端口文档从 8888 修正为实际的 38471(避免照抄撞端口)
78 lines
3.3 KiB
YAML
78 lines
3.3 KiB
YAML
# SearXNG 配置(Cyrene v2「网络搜索」的兜底后端)
|
||
#
|
||
# 用途:给 plugins/tools/io 的 web-search 工具提供一个**本机可达**的搜索端点,
|
||
# 不依赖任何第三方 API key。它不是 Cyrene 自己的监听端口(不碰「单端口」红线),
|
||
# 而是像 docker `cyrene-pg` 一样的**外部服务**。
|
||
#
|
||
# 起法(宿主机可达,必须发布端口;后端跑在宿主机上而不是 compose 内网):
|
||
# ⚠️ 宿主端口用 **38471**(不常见,避免与其它项目撞车);容器内部仍是 8080,宿主机看不到它。
|
||
# docker rm -f cyrene-searxng 2>/dev/null
|
||
# docker run -d --name cyrene-searxng --restart unless-stopped \
|
||
# -p 38471:8080 \
|
||
# -v "D:/Project/Code/Uni/Cyrene_v2/scripts/searxng/settings.yml:/etc/searxng/settings.yml:ro" \
|
||
# searxng/searxng:latest
|
||
# 自检(必须能拿到非空 results 且 unresponsive_engines 为空,否则 web-search 工具等于没接):
|
||
# curl -s "http://127.0.0.1:38471/search?q=test&format=json" | head -c 200
|
||
# curl -s "http://127.0.0.1:38471/search?q=%E6%B5%8B%E8%AF%95&format=json" | python -c "import sys,json;d=json.load(sys.stdin);print(len(d['results']), d['unresponsive_engines'])"
|
||
#
|
||
# ⚠️ 三处关键(少任何一处都会「能返回 JSON 但结果是空的」):
|
||
# 1) search.formats 必须含 json —— 默认只给 html;
|
||
# 2) server.limiter: false —— 限流器会以「请求过频/非浏览器」为由拒掉 API 调用;
|
||
# 3) **引擎必须按本机网络可达性裁剪**:默认引擎集(google/duckduckgo/brave/qwant/
|
||
# startpage/wikipedia…)在**这台机器的网络下全部超时**(2026-10-05 实测),
|
||
# 既不产出结果、还每次白等 3 秒超时 ⇒ 关掉它们、只留国内可达的
|
||
# (baidu / bing / sogou / 360search / quark)。
|
||
use_default_settings: true
|
||
|
||
server:
|
||
secret_key: "cyrene-v2-searxng-local-fallback-6f3a9c1d"
|
||
limiter: false
|
||
image_proxy: false
|
||
|
||
search:
|
||
formats:
|
||
- html
|
||
- json
|
||
# 中文为主:让 SearXNG 按查询自动选语言(默认 auto,这里显式写清意图)
|
||
default_lang: auto
|
||
# 只跑可达引擎后,2 秒足够;留一点余量避免偶发慢请求被判超时
|
||
max_page: 1
|
||
|
||
outgoing:
|
||
request_timeout: 6.0
|
||
max_request_timeout: 10.0
|
||
|
||
engines:
|
||
# ---- 本机可达且真在产出:------
|
||
# 2026-10-05 深夜复测:bing 静默返空、sogou 报 CAPTCHA(此前实测可用,属上游限流,
|
||
# 会随冷却恢复)⇒ 补一个稳定的开源引擎 mwmbl(实测 123 条)当主力。
|
||
- name: mwmbl
|
||
disabled: false
|
||
- name: bing
|
||
disabled: false
|
||
- name: sogou
|
||
disabled: false
|
||
# ---- 实测不可用:一律关掉(留着只会每次白等 3–6 秒,还让 unresponsive_engines 充满噪音)----
|
||
# 360search → timeout;baidu → Suspended: CAPTCHA;quark → CAPTCHA
|
||
# google/duckduckgo/brave/qwant/startpage/wikipedia/wikidata → ConnectTimeout(本机网络不可达)
|
||
- name: baidu
|
||
disabled: true
|
||
- name: 360search
|
||
disabled: true
|
||
- name: quark
|
||
disabled: true
|
||
- name: google
|
||
disabled: true
|
||
- name: duckduckgo
|
||
disabled: true
|
||
- name: brave
|
||
disabled: true
|
||
- name: qwant
|
||
disabled: true
|
||
- name: startpage
|
||
disabled: true
|
||
- name: wikipedia
|
||
disabled: true
|
||
- name: wikidata
|
||
disabled: true
|