前言¶
在 DSH 的插件化思路下,web 搜索可以通过 ctx.web 能力缝接入外部后端。dsh-searxng 提供一条基于 SearXNG 的路径:使用免费、自托管、无需 API key 的 metasearch 实例,给 agent 提供 web_search。社区目录是独立站点,不等同于官方应用商店。下面介绍它的定位、安装方式和常用操作。
这是什么¶
dsh-searxng 是 rogerdigital 维护的 DSH 插件,许可证为 MIT,版本为 0.2.1。它注册一个 SearXNG-backed search provider 到 DSH 的 web capability seam(ctx.web),让 agent 通过 SearXNG 执行 web 搜索。
它面向需要在 DSH 中启用 web 搜索,但希望使用自托管 SearXNG 实例的开发者。dsh 本身处于 developer preview,后续可能出现破坏性变更。
核心功能¶
- 向
ctx.web注册 SearXNG-backed search provider。 setup创建 loopback-only、pinned 的 SearXNG Docker 部署;在 JSON API 和搜索检查通过后才激活 profile。- 支持通过
--url使用已有 local、remote、authenticated 或 independently managed SearXNG 实例;外部模式不启动 Docker。 - 支持在 setup 命令中选择 profile 和 port。
- 提供
status、doctor、remove操作,并支持--service与--purge-data选项。 - 支持提供者配置键:
baseURL、language、engines、categories、authHeader。 - 多个搜索提供者可用时,可用
DSH_WEB_SEARCH_PROVIDER=searxng或对应的searchProviderDSH web 配置选择它。 - 要求 Node.js 20 或更新版本。
- managed Docker path 需要 Docker Engine 或 Docker Desktop,以及 Docker Compose v2;不支持 Podman 和 Podman Compose。
安装与启用¶
先确认环境:Node.js 20 或更新版本;如果使用 managed Docker path,还需要 Docker Engine 或 Docker Desktop,以及 Docker Compose v2。
使用 setup 快速接入¶
先执行 setup,让插件完成部署和检查;再通过对应 profile 使用 DSH。
npx dsh-searxng setup
dsh --profile web
setup 会创建 loopback-only、pinned 的 SearXNG Docker 部署,等待 JSON API,并在 SearXNG 和最终 DSH 提供者配置下执行搜索检查;通过后才激活 profile。
经过上面的步骤,可以在 web profile 中使用该搜索提供者。
如果需要使用另一个 profile 或端口:
npx dsh-searxng setup --profile research --port 9080
dsh --profile research
使用现有 SearXNG 实例¶
如果已经有一个本地、远程、需要认证或独立管理的 SearXNG 实例,可以直接指定 endpoint:
npx dsh-searxng setup --profile web --url https://search.example.com
外部 endpoint 需要满足:HTTP(S)、不包含 credentials、不包含 query、不包含 fragment,并且启用 JSON search。外部模式不会调用 Docker。
只安装插件包¶
如果你自行管理 DSH profile 配置,不想让 setup 自动附着配置,可以只安装插件包:
dsh plugin add dsh-searxng
命名 profile 下使用:
dsh plugin --profile <name> add dsh-searxng
典型用法¶
检查状态¶
状态检查:
npx dsh-searxng status --profile web
更完整的检查:
npx dsh-searxng doctor --profile web
移除插件¶
基础移除:
npx dsh-searxng remove --profile web
如果需要同步处理受管 service,使用:
npx dsh-searxng remove --profile web --service
如果需要永久删除受管数据,使用:
npx dsh-searxng remove --profile web --service --purge-data
永久删除在交互式终端会提示确认;自动化需要加 --yes。Destructive Docker operations 只在 container、network、volume labels 匹配当前 DSH home 后执行;同名的外来资源会被拒绝。
提供者配置¶
setup 会管理 DSH profile 中的 web-search-searxng row。可以在该行添加这些可选值:
| Key | 含义 |
|---|---|
baseURL |
SearXNG base URL。 |
language |
SearXNG language。 |
engines |
SearXNG engines。 |
categories |
SearXNG categories。 |
authHeader |
外部实例认证 header。 |
如果存在多个 DSH 搜索提供者,选择该提供者:
DSH_WEB_SEARCH_PROVIDER=searxng
或使用对应的 searchProvider DSH web 配置。
适用场景与注意¶
它适合以下情况:
- 想给 DSH agent 提供 web 搜索,但希望使用 SearXNG 这类 metasearch。
- 希望自托管、免费、无 key。
- 已有 SearXNG 实例,不想让插件管理 Docker。
- 需要按 profile 和 port 区分多个搜索环境。
使用前注意:
- Node.js 20 或更新版本是必需的。
- managed Docker path 需要 Docker Engine 或 Docker Desktop,以及 Docker Compose v2;不支持 Podman 和 Podman Compose。
- Docker Desktop on macOS and Windows is supported but has not completed formal release certification.
dsh处于 developer preview,破坏性变更可能出现在上游。- 插件会在当前 DSH 环境中运行,并使用当前 DSH 进程的权限访问 Docker、文件与网络。安装前应检查源码、命令行为和 MIT 许可证。
--purge-data是破坏性操作,只用于确认受管资源属于当前 DSH home 的场景。
结尾¶
dsh-searxng 的价值在于给 DSH 的 ctx.web 提供一条基于 SearXNG 的搜索路径:既能由插件创建受管 Docker 实例,也能复用现有 SearXNG endpoint。如果你正在为 agent 配置 web 搜索,可以从 setup 开始,再用 status 和 doctor 检查最终状态。
相关链接:
- GitHub:https://github.com/rogerdigital/dsh-searxng
- 插件线索给出的社区目录页(供参考):https://www.skillhub.cn/plugins/rogerdigital/dsh-searxng