From e0b284e427187d42d63c7cfc0761cdd01f509ee9 Mon Sep 17 00:00:00 2001 From: Markus Heiser Date: Sun, 23 Jan 2022 20:55:14 +0100 Subject: [PATCH] [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 --- searx/webapp.py | 7 +++++++ 1 file changed, 7 insertions(+) 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)