Merge f47f8350e01e69f305604d88b239d3d17aaa103c into 7861ae1512fa540fc43a7bf595de9e7f39852a8a

This commit is contained in:
Jay Collett 2026-02-02 10:32:31 -05:00 committed by GitHub
commit 64ca4c2fbf
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 40 additions and 1 deletions

View File

@ -33,7 +33,20 @@ abstract class Search
return false;
}
return (object) $providers[$provider] ?? false;
$details = (object) $providers[$provider] ?? false;
// For SearXNG, use user-configured URL
if ($provider === 'searx') {
$searxUrl = Setting::fetch('searx_url');
if (!empty($searxUrl)) {
// Ensure URL doesn't have trailing slash
$searxUrl = rtrim($searxUrl, '/');
$details->url = $searxUrl . '/search';
$details->autocomplete = $searxUrl . '/autocompleter?format=x-suggestions&q={query}';
}
}
return $details;
}
/**

View File

@ -145,6 +145,7 @@ class SettingsSeeder extends Seeder
'qwant' => 'app.options.qwant',
'bing' => 'app.options.bing',
'startpage' => 'app.options.startpage',
'searx' => 'app.options.searx',
]);
if (! $setting = Setting::find(4)) {
@ -349,5 +350,19 @@ class SettingsSeeder extends Seeder
$setting->label = 'app.settings.treat_tags_as';
$setting->save();
}
if (! $setting = Setting::find(15)) {
$setting = new Setting;
$setting->id = 15;
$setting->group_id = 3;
$setting->key = 'searx_url';
$setting->type = 'text';
$setting->label = 'app.settings.searx_url';
$setting->value = '';
$setting->save();
} else {
$setting->label = 'app.settings.searx_url';
$setting->save();
}
}
}

View File

@ -17,6 +17,7 @@ return array (
'settings.window_target.new' => 'Open in a new tab',
'settings.homepage_search' => 'Homepage Search',
'settings.search_provider' => 'Default Search Provider',
'settings.searx_url' => 'SearXNG Instance URL',
'settings.language' => 'Language',
'settings.reset' => 'Reset back to default',
'settings.remove' => 'Remove',
@ -38,6 +39,7 @@ return array (
'options.bing' => 'Bing',
'options.qwant' => 'Qwant',
'options.startpage' => 'StartPage',
'options.searx' => 'SearXNG',
'options.yes' => 'Yes',
'options.no' => 'No',
'options.nzbhydra' => 'NZBHydra',

View File

@ -45,3 +45,12 @@ startpage:
method: get
target: _blank
query: query
searx:
id: searx
url: https://searx.example.com/search
name: SearXNG
method: get
target: _blank
query: q
autocomplete: https://searx.example.com/autocompleter?format=x-suggestions&q={query}