Skip to main content

SearXNG

The optional SearXNG plugin finds new proxy-list pages for you. On a schedule, it sends your search queries to a SearXNG instance you run, picks result pages that can contain proxy lists, and subscribes one workspace to them as scrape sources. The scraper then fetches them like any other source, and the checker tests what they contain. Sources that stop producing proxies are removed again.

The plugin only adds sources. It does not check proxies, change checker settings, or touch sources you added yourself.

Run a SearXNG instance​

The plugin needs a SearXNG instance with the JSON output format turned on. Public SearXNG instances usually turn JSON off, so run your own.

With the bundled Compose service​

The Maglane Compose file includes an optional SearXNG service. It is off unless you turn on its profile:

  1. Add COMPOSE_PROFILES=searxng to the .env file next to docker-compose.yml.
  2. Run docker compose up -d. Compose starts searxng-config, which writes the SearXNG settings and exits, and then searxng.
  3. Use http://searxng:8080 as the plugin's SearXNG URL.

The service publishes no host port. Only containers on the Compose network, such as the backend, can reach it. The generated settings turn on JSON output, turn off the rate limiter and image proxy, and pick a new secret key on each start. They are rewritten every time the stack starts, so edits made inside the container do not last. To customize SearXNG, run your own instance instead.

The update helpers pull the SearXNG image together with Maglane's while the profile is set. Pin a release with SEARXNG_TAG if you prefer; SearXNG publishes date-based tags. Resource limits use the SEARXNG prefix described in environment variables.

With your own instance​

Add json to search.formats in the instance's settings.yml and restart it:

search:
formats:
- html
- json

The URL can point at a private or loopback address, such as a container on the same host. Link-local, cloud metadata, multicast, and unspecified addresses are rejected. The URL must not redirect, carry credentials, or appear on the website blacklist.

Choose a target workspace​

Discovered sources go into one workspace whose members are all instance administrators. Workspaces with a member or a pending invitation for a non-admin account do not qualify. This keeps sources that strangers' search results suggested away from regular users.

Create a dedicated workspace for discovery, for example Discovery, and invite only administrators. The plugin checks the workspace when its settings change and again before every run. If a non-admin later joins, runs stop with an error until you choose another workspace or remove that member.

Changing the target workspace leaves sources already added to the old workspace where they are.

Configure the plugin​

  1. As an instance administrator, open Plugins → SearXNG.
  2. Enter the SearXNG URL and choose the Target workspace.
  3. Optionally choose Tags for new sources. They become the automatic tags of every source the plugin adds, so proxies scraped from those sources carry them. See automatic tags.
  4. Review the queries and limits, turn the plugin on, and save.

The first run starts shortly after you turn the plugin on. Later runs follow the interval. Run now starts a run immediately with the saved settings; the status figures update when it finishes.

SettingDefaultRangeMeaning
QueriesFive proxy-list queries1–20, up to 256 characters eachSearches sent on every run, in SearXNG syntax.
EnginesInstance defaultsUp to 20 namesComma-separated SearXNG engine names.
Result ageAny timeAny time, day, week, month, yearSearXNG time range.
Result pages21–5Result pages requested per query.
Check robots.txtOnOn / OffCheck each candidate's robots.txt before subscribing it. Scheduled scrapes still follow the global scraper setting.
Request timeout15 s1–60 sTimeout for each SearXNG request.
GitHub tokenEmptyOptional, up to 512 charactersOptional personal access token sent only to api.github.com to raise repo, folder, and Gist expansion from 60 to 5,000 requests/hour. Falls back to SEARXNG_GITHUB_TOKEN / GITHUB_TOKEN when blank.
Run every360 min15–10,080 minTime between scheduled runs.
Source limit1001–1,000Discovered sources kept at once.
New sources per run201–200Sources added by one run at most.
Empty or failed scrapes31–50Consecutive empty or failed scrapes before removal.
Dead proxy grace period48 h1–720 hAge after which a source whose proxies are all dead is removed.
Cooldown168 h1–2,160 hTime a removed or rejected URL is skipped before it can be tried again.

Which results become sources​

Each result URL is expanded, cleaned up, and probed before it is subscribed:

  • GitHub and GitLab repository roots, folder trees, and multi-file Gists are expanded into direct raw proxy-list file URLs (skipping metadata, badges, and per-country subdirectories). Unexpandable repository and profile pages are skipped. Configure an optional GitHub token in Plugins → SearXNG (or set the SEARXNG_GITHUB_TOKEN / GITHUB_TOKEN backend environment variable as a fallback) to raise the GitHub API rate limit from 60 to 5,000 requests/hour; when rate-limited, expansion falls back to raw links in the repository's README.md.
  • GitHub blob/raw pages, Gist pages (with commit hashes unpinned so updates are followed), GitLab blob pages, and Pastebin paste pages are rewritten to their raw text URLs.
  • Media, binary, markdown, and source-code files, social and video sites, documentation/API-doc sites and paths, and GitHub issue or discussion pages are skipped.
  • Private, loopback, and reserved addresses are skipped, even when ALLOW_PRIVATE_NETWORK_EGRESS is on.
  • URLs on the website blacklist, already subscribed by the workspace, or in cooldown are skipped.
  • Remaining candidates are probed over strict-public HTTP (checking robots.txt when Check robots.txt is on) and must produce at least three distinct valid public IPv4 proxies. Candidates that fail probing enter cooldown without taking up active source slots.

A run adds at most New sources per run, and never more than the free room under the Source limit. When the limit is reached, the run only prunes and the status reads At source limit.

How discovered sources are fetched​

Discovered sources are fetched in HTTP mode with stricter network rules than sources you add yourself:

  • Fetches, redirects, and robots.txt requests go to public addresses only, even when ALLOW_PRIVATE_NETWORK_EGRESS is on.
  • Proxies on private, loopback, or reserved addresses found on these pages are dropped before they reach the checker.
  • Pre-subscription probing follows the plugin's Check robots.txt setting; scheduled scrapes follow the global scraper robots.txt setting and the website blacklist as usual.

If you also add the same URL by hand in a workspace, all workspaces share one fetch, so the stricter rules apply to it everywhere.

Pruning​

Each run first reviews the sources the plugin added and removes the workspace's subscription when:

  • the last Empty or failed scrapes scrapes in a row found no proxies or failed;
  • the source is older than the Dead proxy grace period, has been scraped, and every proxy it produced is dead, with none still unchecked;
  • its URL was added to the website blacklist.

If someone in the workspace removed a discovered source, the plugin stops tracking it. Removed URLs stay in cooldown and are not added again until it ends.

Sources you add yourself are never removed, even when the same URL was also discovered. A URL the plugin added stays plugin-managed if you later add it again by hand in the same workspace; remove it and add it back to make it yours.

Status​

The status card shows the discovered sources against the source limit, the last and next run, and how many sources the last run added and removed. It refreshes every minute while the page is open.

StateMeaning
RunningThe last run succeeded, or no run has happened yet.
At source limitThe last run found no free room and only pruned.
Some searches failedSome queries failed; results from the others were used.
Last run failedThe run stopped. The message explains why.

HTTP 403 or 406 from SearXNG, or an HTML response, means JSON output is off. A redirect means the URL is not the instance's final address.

Deployment and load​

Upgrade the frontend and all backend replicas together, run the normal database migration, and only then turn the plugin on. Backends from before the plugin do not apply the stricter fetch rules to discovered sources. The migration creates searxng_states and searxng_discovered_sources and adds managed_by to workspace source subscriptions. No backend environment variables are required.

One elected backend runs discovery at a time across replicas. While the plugin is off, it makes no database, Redis, or network requests. A run reads its tracked sources with a few database queries and sends one SearXNG request per query and result page.

The plugin adds no work to the proxy checker loop. For sources you add yourself, scraping is unchanged: the scraper already reads the subscription row that carries managed_by.