summaryrefslogtreecommitdiff
path: root/searx/webapp.py
diff options
context:
space:
mode:
authorMarkus Heiser <markus.heiser@darmarit.de>2022-01-23 20:55:14 +0100
committerMarkus Heiser <markus.heiser@darmarit.de>2022-01-23 20:55:14 +0100
commite0b284e427187d42d63c7cfc0761cdd01f509ee9 (patch)
treef2ff4bebe206c061b219982ee2c1b615eb7dd7bf /searx/webapp.py
parent1a210e653c80d33dfebaafc7d6697d7ee58655e1 (diff)
downloadsearxng-e0b284e427187d42d63c7cfc0761cdd01f509ee9.tar.gz
searxng-e0b284e427187d42d63c7cfc0761cdd01f509ee9.zip
[mod] configuration to overwrite engine description
Engine description can be configured, this is needed e.g. by custom search engines. Here is an example of a command engine with a description in the about section:: - name: locate engine: command command: ['locate', '{{QUERY}}'] disabled: true categories: files about: description: local files website: 'https://www.man7.org/linux/man-pages/man1/locate.1.html' delimiter: chars: ' ' keys: ['line'] Closes: https://github.com/searxng/searxng/issues/788 Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
Diffstat (limited to 'searx/webapp.py')
-rwxr-xr-xsearx/webapp.py7
1 files changed, 7 insertions, 0 deletions
diff --git a/searx/webapp.py b/searx/webapp.py
index 099a42996..7e351bfaa 100755
--- a/searx/webapp.py
+++ b/searx/webapp.py
@@ -1170,6 +1170,13 @@ def engine_descriptions():
if isinstance(description, str):
description = [description, 'wikipedia']
result[engine] = description
+
+ # overwrite by about:description (from settings)
+ for engine_name, engine_mod in engines.items():
+ descr = getattr(engine_mod, 'about', {}).get('description', None)
+ if descr is not None:
+ result[engine_name] = [descr, "SearXNG config"]
+
return jsonify(result)