SearXNG is a free internet metasearch engine which aggregates results from various search services and databases. Users are neither tracked nor profiled.
Python bingbravedegoogleduckduckgogooglemetasearchprivacypythonqwantsearchsearch-enginesearxsearxngstartpageyahoo
[mod] defaults: GET method and ddg autocomplete
vojkovic1c3bb1e88f87
diff --git a/docs/admin/settings/settings_search.rst b/docs/admin/settings/settings_search.rstindex 2aaa4795d..5e11fc810 100644--- a/docs/admin/settings/settings_search.rst+++ b/docs/admin/settings/settings_search.rst@@ -8,7 +8,7 @@search:safe_search: 0- autocomplete: ""+ autocomplete: "duckduckgo"favicon_resolver: ""default_lang: ""ban_time_on_fail: 5@@ -32,7 +32,7 @@- ``2``: Strict``autocomplete``:- Existing autocomplete backends, leave blank to turn it off.+ Existing autocomplete backends, set blank to turn it off.- ``360search``- ``baidu``diff --git a/docs/admin/settings/settings_server.rst b/docs/admin/settings/settings_server.rstindex dabfc259c..7b677d695 100644--- a/docs/admin/settings/settings_server.rst+++ b/docs/admin/settings/settings_server.rst@@ -14,7 +14,7 @@limiter: falsepublic_instance: falseimage_proxy: false- method: "POST"+ method: "GET"default_http_headers:X-Content-Type-Options : nosniffX-Download-Options : noopen@@ -58,8 +58,8 @@``method`` : ``GET`` | ``POST``- HTTP method. By defaults ``POST`` is used / The ``POST`` method has the- advantage with some WEB browsers that the history is not easy to read, but+ HTTP method. By default, ``GET`` is used / The ``POST`` method has the+ advantage with some browsers that the history is not saved, butthere are also various disadvantages that sometimes **severely restrict theease of use for the end user** (e.g. back button to jump back to the previoussearch page and drag & drop of search term to new tabs do not work asdiff --git a/searx/settings.yml b/searx/settings.ymlindex 1650a484d..7acb40bc2 100644--- a/searx/settings.yml+++ b/searx/settings.yml@@ -41,9 +41,9 @@ search:# Filter results. 0: None, 1: Moderate, 2: Strictsafe_search: 0# Existing autocomplete backends: "360search", "baidu", "bing", "brave", "dbpedia", "duckduckgo", "google",- # "kagi", "yandex", "privacywall", "mwmbl", "naver", "seznam", "sogou", "startpage", "swisscows", "quark",- # "qwant", "wikipedia" - leave blank to turn it off by default.- autocomplete: ""+ # "yandex", "privacywall", "mwmbl", "naver", "seznam", "sogou", "startpage", "swisscows", "quark", "qwant",+ # "wikipedia" - set blank to turn it off by default.+ autocomplete: "duckduckgo"# minimun characters to type before autocompleter startsautocomplete_min: 4# backend for the favicon near URL in search results.@@ -107,11 +107,10 @@ server:image_proxy: false# 1.0 and 1.1 are supportedhttp_protocol_version: "1.0"- # POST queries are "more secure!" but are also the source of hard-to-locate- # annoyances, which is why GET may be better for end users and their browsers.+ # POST keeps search queries out of the browsers history, but causes UX issues.# see https://github.com/searxng/searxng/pull/3619# Is overwritten by ${SEARXNG_METHOD}- method: "POST"+ method: "GET"default_http_headers:X-Content-Type-Options: nosniffX-Download-Options: noopendiff --git a/searx/settings_defaults.py b/searx/settings_defaults.pyindex c23ebd956..5fed08b68 100644--- a/searx/settings_defaults.py+++ b/searx/settings_defaults.py@@ -192,7 +192,7 @@ SCHEMA: dict[str, t.Any] = {'brand': SettingsBrand,'search': {'safe_search': SettingsValue((0, 1, 2), 0),- 'autocomplete': SettingsValue(str, ''),+ 'autocomplete': SettingsValue(str, 'duckduckgo'),'autocomplete_min': SettingsValue(int, 4),'favicon_resolver': SettingsValue(str, ''),'default_lang': SettingsValue(tuple(SXNG_LOCALE_TAGS + ['']), ''),@@ -219,7 +219,7 @@ SCHEMA: dict[str, t.Any] = {'base_url': SettingsValue((False, str), False, 'SEARXNG_BASE_URL'),'image_proxy': SettingsValue(bool, False, 'SEARXNG_IMAGE_PROXY'),'http_protocol_version': SettingsValue(('1.0', '1.1'), '1.0'),- 'method': SettingsValue(('POST', 'GET'), 'POST', 'SEARXNG_METHOD'),+ 'method': SettingsValue(('POST', 'GET'), 'GET', 'SEARXNG_METHOD'),'default_http_headers': SettingsValue(dict, {}),},# redis is deprecated ..diff --git a/searx/templates/simple/elements/apis.html b/searx/templates/simple/elements/apis.htmlindex d1d5ec60d..d09fa758d 100644--- a/searx/templates/simple/elements/apis.html+++ b/searx/templates/simple/elements/apis.html@@ -4,7 +4,7 @@<div class="wrapper">{%- for output_type in search_formats -%}<div class="left">- <form method="{{ method or 'POST' }}" action="{{ url_for('search') }}">+ <form method="{{ method }}" action="{{ url_for('search') }}"><input type="hidden" name="q" value="{{ q|e }}">{%- for category in selected_categories -%}<input type="hidden" name="category_{{ category }}" value="1">diff --git a/searx/templates/simple/elements/corrections.html b/searx/templates/simple/elements/corrections.htmlindex 57556b43f..570fb76e1 100644--- a/searx/templates/simple/elements/corrections.html+++ b/searx/templates/simple/elements/corrections.html@@ -2,7 +2,7 @@<h4 id="corrections-title">{{ _('Try searching for:') }}</h4>{% for correction in corrections %}<div class="left">- <form method="{{ method or 'POST' }}" action="{{ url_for('search') }}" role="navigation">+ <form method="{{ method }}" action="{{ url_for('search') }}" role="navigation">{% for category in selected_categories %}<input type="hidden" name="category_{{ category }}" value="1">{% endfor %}diff --git a/searx/templates/simple/elements/infobox.html b/searx/templates/simple/elements/infobox.htmlindex 4d75ad802..f8e02ad9d 100644--- a/searx/templates/simple/elements/infobox.html+++ b/searx/templates/simple/elements/infobox.html@@ -31,7 +31,7 @@<div><h3><bdi>{{ topic.name }}</bdi></h3>{%- for suggestion in topic.suggestions -%}- <form method="{{ method or 'POST' }}" action="{{ url_for('search') }}">+ <form method="{{ method }}" action="{{ url_for('search') }}"><input type="hidden" name="q" value="{{ suggestion }}"><input type="hidden" name="time_range" value="{{ time_range }}"><input type="hidden" name="language" value="{{ current_language }}">diff --git a/searx/templates/simple/elements/suggestions.html b/searx/templates/simple/elements/suggestions.htmlindex e847578d7..7ad6f7061 100644--- a/searx/templates/simple/elements/suggestions.html+++ b/searx/templates/simple/elements/suggestions.html@@ -3,7 +3,7 @@<summary class="title" id="suggestions-title">{{ _('Suggestions') }}</summary><ul class="wrapper">{%- for suggestion in suggestions -%}- <li><form method="{{ method or 'POST' }}" action="{{ url_for('search') }}">+ <li><form method="{{ method }}" action="{{ url_for('search') }}"><input type="hidden" name="q" value="{{ suggestion.url }}">{%- for category in selected_categories -%}<input type="hidden" name="category_{{ category }}" value="1">diff --git a/searx/templates/simple/results.html b/searx/templates/simple/results.htmlindex 18a6c6bfa..d40b69bfb 100644--- a/searx/templates/simple/results.html+++ b/searx/templates/simple/results.html@@ -75,7 +75,7 @@{% if paging %}<nav id="pagination" role="navigation">{% if pageno > 1 %}- <form method="{{ method or 'POST' }}" action="{{ url_for('search') }}" class="previous_page">+ <form method="{{ method }}" action="{{ url_for('search') }}" class="previous_page"><div class="{% if rtl %}right{% else %}left{% endif %}"><input type="hidden" name="q" value="{{ q|e }}" >{% for category in selected_categories %}@@ -93,7 +93,7 @@</form>{% endif %}{%- if results | count > 0 -%}- <form method="{{ method or 'POST' }}" action="{{ url_for('search') }}" class="next_page">+ <form method="{{ method }}" action="{{ url_for('search') }}" class="next_page"><div class="{% if rtl %}left{% else %}right{% endif %}"><input type="hidden" name="q" value="{{ q|e }}" >{% for category in selected_categories %}@@ -119,7 +119,7 @@<div class="numbered_pagination">{% for x in range(pstart, pend) %}- <form method="{{ method or 'POST' }}" action="{{ url_for('search') }}" class="page_number">+ <form method="{{ method }}" action="{{ url_for('search') }}" class="page_number"><input type="hidden" name="q" value="{{ q|e }}" >{% for category in selected_categories %}<input type="hidden" name="category_{{ category }}" value="1" >diff --git a/searx/templates/simple/search.html b/searx/templates/simple/search.htmlindex 180c56160..a91a0a54b 100644--- a/searx/templates/simple/search.html+++ b/searx/templates/simple/search.html@@ -1,4 +1,4 @@-<form id="search" method="{{ method or 'POST' }}" action="{{ url_for('search') }}" role="search">+<form id="search" method="{{ method }}" action="{{ url_for('search') }}" role="search"><div id="search_header"><a id="search_logo" href="{{ url_for('index') }}" tabindex="0" title="{{ _('Display the front page') }}"><span hidden>SearXNG</span>diff --git a/searx/templates/simple/simple_search.html b/searx/templates/simple/simple_search.htmlindex af533e6e0..0d95daa28 100644--- a/searx/templates/simple/simple_search.html+++ b/searx/templates/simple/simple_search.html@@ -1,4 +1,4 @@-<form id="search" method="{{ method or 'POST' }}" action="{{ url_for('search') }}" role="search">+<form id="search" method="{{ method }}" action="{{ url_for('search') }}" role="search"><div id="search_header"><div id="search_view"><div class="search_box">diff --git a/searx/webapp.py b/searx/webapp.pyindex 07ef06078..3be042ba5 100755--- a/searx/webapp.py+++ b/searx/webapp.py@@ -1195,7 +1195,7 @@ def opensearch():method = 'GET'if method not in ('POST', 'GET'):- method = 'POST'+ method = 'GET'ret = render('opensearch.xml', opensearch_method=method, autocomplete=autocomplete)resp = Response(response=ret, status=200, mimetype="application/opensearchdescription+xml")