diff options
| author | Markus Heiser <markus.heiser@darmarit.de> | 2024-05-30 14:03:25 +0200 |
|---|---|---|
| committer | Markus Heiser <markus.heiser@darmarIT.de> | 2024-09-03 18:36:28 +0200 |
| commit | b774ee04ba097cf7327cac072704360a37353e4d (patch) | |
| tree | f4197e979f2f4b6d7907412f365d1a3ce2454701 /searx/plugins | |
| parent | 3a3ff8f02092491c159a76e76dd50f1b6fcadc70 (diff) | |
[mod] enable calculator and allow plugin on public instances
Remove quirks that prevented the Calculator from being used on public instances.
Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
Diffstat (limited to 'searx/plugins')
| -rw-r--r-- | searx/plugins/calculator.py | 10 |
1 files changed, 1 insertions, 9 deletions
diff --git a/searx/plugins/calculator.py b/searx/plugins/calculator.py index aef10c559..d963aa304 100644 --- a/searx/plugins/calculator.py +++ b/searx/plugins/calculator.py @@ -7,13 +7,12 @@ import operator from multiprocessing import Process, Queue from flask_babel import gettext -from searx import settings from searx.plugins import logger name = "Basic Calculator" description = gettext("Calculate mathematical expressions via the search bar") -default_on = False +default_on = True preference_section = 'general' plugin_id = 'calculator' @@ -81,9 +80,6 @@ def timeout_func(timeout, func, *args, **kwargs): def post_search(_request, search): - # don't run on public instances due to possible attack surfaces - if settings['server']['public_instance']: - return True # only show the result of the expression on the first page if search.search_query.pageno > 1: @@ -113,7 +109,3 @@ def post_search(_request, search): if result != query: search.result_container.answers['calculate'] = {'answer': f"{query} = {result}"} return True - - -def is_allowed(): - return not settings['server']['public_instance'] |