From a05c660e3036ad8d02072fc6731af54c2ed6151c Mon Sep 17 00:00:00 2001 From: Adam Tauber Date: Fri, 9 Oct 2020 14:11:19 +0200 Subject: [PATCH] [enh] add ability to set enabled plugins from settings - closes #1613 #778 --- searx/plugins/__init__.py | 7 +++++++ searx/settings.yml | 6 ++++++ 2 files changed, 13 insertions(+) diff --git a/searx/plugins/__init__.py b/searx/plugins/__init__.py index 51f6981a2..2f02e224f 100644 --- a/searx/plugins/__init__.py +++ b/searx/plugins/__init__.py @@ -172,3 +172,10 @@ plugins.register(vim_hotkeys) # load external plugins if 'plugins' in settings: plugins.register(*settings['plugins'], external=True) + +if 'enabled_plugins' in settings: + for plugin in plugins: + if plugin.name in settings['enabled_plugins']: + plugin.default_on = True + else: + plugin.default_on = False diff --git a/searx/settings.yml b/searx/settings.yml index aad632513..aa5f35256 100644 --- a/searx/settings.yml +++ b/searx/settings.yml @@ -67,6 +67,12 @@ outgoing: # communication with search engines # - plugin2 # - ... +# uncomment below section if you want to configure which plugin is enabled by default +# +# enabled_plugins: +# - "HTTPS rewrite" +# - ... + engines: - name: apk mirror engine: apkmirror