Preface

In the development practice of DeepSeek Harness (DSH), web_search is a common interface for agents to retrieve external information. By default, this typically points to a third-party search API. When you need to self-host a search instance to control data privacy, reduce API call costs, or handle network environment restrictions, switching the backend of web_search to a self-hosted SearXNG is a common requirement. The biyuhao/dsh-web-searxng plugin provides this capability for DSH by registering SearXNG as a provider for web_search.

Plugin Introduction

This plugin provides a self-hosted search backend through SearXNG and supports the provider id searxng. The owner is biyuhao, and the license is MIT. The plugin includes server-side (host) and client-side (client) code, so queries do not need to be sent directly to third-party search engines.

Installation and Dependencies

Before installation, please ensure the runtime environment meets the following requirements:
* Node.js version >= 20
* The currently active DSH profile is the web profile

Use the official command to install:

dsh plugin --profile web add dsh-web-searxng

After installation is complete, restart the dsh web process to make the configuration take effect.

Core Features

The plugin provides the following features:

  1. Settings Page Configuration: Provides a complete configuration card, supporting settings for instance URL, BasicAuth authentication, search categories, language, safe search level, and outbound proxy (supports http/https/socks5h).
  2. Connection Test: Supports one-click connection testing, returning availability status, latency, and number of results. If the test fails, the reason is clearly displayed (such as 403 JSON not enabled, 429 rate limited, etc.).
  3. Community Instance Selection: Integrates searx.space community instances and provides a selector feature. Supports automatic speed testing, and stops fetching when the number of available instances reaches 10.
  4. List Management: Provides one-click refresh of the community instance list, with fetching and caching based on the currently configured proxy.
  5. Chinese/English Bilingual Support: The interface supports switching between Chinese and English.

Configuration Description

The configuration priority is: Settings page > composition entry > environment variables. The main configuration items are as follows:

Field Description Default Value
baseURL SearXNG instance URL. If left blank, it is not configured and the provider is unavailable. ""
username / password BasicAuth authentication credentials. For public instances, leaving them blank means authentication headers are not sent. ""
categories / language SearXNG search parameters. general / zh-CN
safesearch Safe search level. 0 is off, 1 is moderate, 2 is strict. 1
proxyUrl Outbound proxy URL. If left blank, a direct connection is used. Required in environments with restricted outbound access. ""
proxyEnabled Proxy switch. If disabled, a direct connection is used, but the proxy URL is retained in the configuration. true

Typical Usage

When multiple search providers exist in DSH, if no default provider is specified, it may report the error WEB_PROVIDER_AMBIGUOUS. Use the patch command to point the default provider to searxng:

# 创建一个临时 patch 文件,内容如下:
# - id: web
#   config:
#     searchProvider: searxng
#     fetchProvider: http

dsh --profile web --patch ./pin-searxng.patch.yml

Or directly modify the profile configuration file ~/.dsh/profiles/web/cordis.patch.yml, and set searchProvider and fetchProvider to searxng and http.

Verify Functionality

After configuration is complete, you can call web_search in the DSH console to verify:

web_search({queries: ["searxng format=json"]})

Security and Deployment Notes

  1. Password Storage: The plugin stores passwords in plaintext in the local settings document. This has the same security sensitivity as using environment variables (SEARXNG_USERNAME / SEARXNG_PASSWORD).
  2. Community Instance Risks: When using community instances, query content is transmitted in plaintext, and server behavior cannot be verified. Do not search sensitive content on community instances.
  3. Engine Selection: Do not add the Google engine to a self-hosted instance, because VPS IPs easily trigger CAPTCHA verification, causing search failures.
  4. Self-Hosted Deployment: The project’s deploy/ directory provides a Docker Compose-based deployment solution, including Caddy reverse proxy configuration. A single-core 1GB memory VPS can run it stably.

Ecosystem Background

The DSH philosophy is “everything is a plugin”. This plugin is hosted on GitHub, and the community directory provides a plugin index.