Skip to content

Conversation

@jaycollett
Copy link

Summary

This PR adds SearXNG as a search provider option with user-configurable instance URL support.

SearXNG is a privacy-respecting, self-hosted metasearch engine. Unlike Google/Bing/DuckDuckGo which have fixed URLs, SearXNG instances are self-hosted with user-specific URLs. This implementation:

  • Adds SearXNG to the search providers list
  • Adds a new "SearXNG Instance URL" setting in Miscellaneous settings
  • Dynamically injects the user's configured URL when performing searches
  • Supports autocomplete via SearXNG's x-suggestions format

Changes

File Change
storage/app/searchproviders.yaml Add SearXNG provider entry
database/seeders/SettingsSeeder.php Add searx_url setting (ID 15), add to provider options
app/Search.php Modify providerDetails() to inject user's configured URL
lang/en/app.php Add translation strings for new setting and provider

User Workflow

  1. Settings → Homepage Search = Yes
  2. Settings → SearXNG Instance URL = https://your-searx-instance.com
  3. Settings → Default Search Provider = SearXNG
  4. Search queries redirect to https://your-searx-instance.com/search?q=query

Testing

  • Tested locally with Docker using linuxserver/heimdall image
  • Verified search redirects correctly to configured SearXNG instance
  • Verified autocomplete functionality works with SearXNG's x-suggestions endpoint

- Add SearXNG entry to searchproviders.yaml
- Add searx_url setting for user-configurable instance URL
- Modify Search::providerDetails() to inject user's SearXNG URL
- Add English translations for new setting and provider

SearXNG is a self-hosted metasearch engine, so unlike other providers
the URL cannot be hardcoded. This implementation allows users to
configure their instance URL in settings, which is then dynamically
injected when performing searches.
@jaycollett
Copy link
Author

Closing this PR in favor of implementing SearXNG as a proper search provider app in the Heimdall-Apps repo, following the standard SearchInterface pattern.

@jaycollett jaycollett closed this Feb 2, 2026
@LinuxServer-CI LinuxServer-CI moved this from PRs to Done in Issue & PR Tracker Feb 2, 2026
@jaycollett jaycollett reopened this Feb 2, 2026
@jaycollett
Copy link
Author

jaycollett commented Feb 2, 2026

Reopening this PR after investigating the alternative approach of implementing SearXNG as a SearchInterface app in Heimdall-Apps.

Why the Heimdall-Apps approach doesn't work:

The Item::isSearchProvider() method in app/Item.php uses class_exists($class, false) which disables PHP autoloading. This means app-based search providers (like Whoogle, Searx, NZBHydra) don't appear in the search dropdown unless the class has already been loaded by some other means.

Why this PR's approach is appropriate:

Since SearXNG requires a user-configurable URL (unlike fixed providers like Google/Bing), adding it to searchproviders.yaml with special handling in Search.php is a reasonable solution that:

  1. Makes SearXNG immediately available in the dropdown
  2. Allows users to configure their instance URL in settings
  3. Works around the autoloading bug in isSearchProvider()

A separate fix for the class_exists($class, false) issue is probably warrented?

@LinuxServer-CI LinuxServer-CI moved this from Done to PRs in Issue & PR Tracker Feb 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Development

Successfully merging this pull request may close these issues.

1 participant