summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAadniz <8147434+Aadniz@users.noreply.github.com>2025-04-22 17:28:51 +0200
committerMarkus Heiser <markus.heiser@darmarIT.de>2025-04-23 07:29:26 +0200
commit07a94d4d2e7219eda74c34caaf5424cd8b9c3e97 (patch)
treeb320d34fee4b1a994ba6bd570167d67e96714a9e
parente9157b3c1a502a5898d370c0e98cc3e5ef8ef3f0 (diff)
[mod] include SEARXNG_METHOD environment variable
-rw-r--r--docs/admin/settings/settings_server.rst6
-rw-r--r--searx/settings.yml3
-rw-r--r--searx/settings_defaults.py2
3 files changed, 9 insertions, 2 deletions
diff --git a/docs/admin/settings/settings_server.rst b/docs/admin/settings/settings_server.rst
index df5986764..6238286a6 100644
--- a/docs/admin/settings/settings_server.rst
+++ b/docs/admin/settings/settings_server.rst
@@ -14,6 +14,7 @@
limiter: false
public_instance: false
image_proxy: false
+ method: "POST"
default_http_headers:
X-Content-Type-Options : nosniff
X-Download-Options : noopen
@@ -50,6 +51,11 @@
``image_proxy`` : ``$SEARXNG_IMAGE_PROXY``
Allow your instance of SearXNG of being able to proxy images. Uses memory space.
+.. _method:
+
+``method`` : ``$SEARXNG_METHOD``
+ Whether to use ``GET`` or ``POST`` HTTP method when searching.
+
.. _HTTP headers: https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers
``default_http_headers`` :
diff --git a/searx/settings.yml b/searx/settings.yml
index e3201e8ca..65afb086f 100644
--- a/searx/settings.yml
+++ b/searx/settings.yml
@@ -101,7 +101,8 @@ server:
# 1.0 and 1.1 are supported
http_protocol_version: "1.0"
# POST queries are more secure as they don't show up in history but may cause
- # problems when using Firefox containers
+ # problems when using Firefox containers.
+ # Is overwritten by ${SEARXNG_METHOD}
method: "POST"
default_http_headers:
X-Content-Type-Options: nosniff
diff --git a/searx/settings_defaults.py b/searx/settings_defaults.py
index 30434aea1..b91657ff6 100644
--- a/searx/settings_defaults.py
+++ b/searx/settings_defaults.py
@@ -182,7 +182,7 @@ SCHEMA = {
'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'),
+ 'method': SettingsValue(('POST', 'GET'), 'POST', 'SEARXNG_METHOD'),
'default_http_headers': SettingsValue(dict, {}),
},
'redis': {