SearXNG is a free internet metasearch engine which aggregates results from various search services and databases. Users are neither tracked nor profiled.
Python bingbravedegoogleduckduckgogooglemetasearchprivacypythonqwantsearchsearch-enginesearxsearxngstartpageyahoo
[mod] enable calculator and allow plugin on public instances
Markus Heiserb774ee04ba09
diff --git a/searx/plugins/calculator.py b/searx/plugins/calculator.pyindex aef10c559..d963aa304 100644--- a/searx/plugins/calculator.py+++ b/searx/plugins/calculator.py@@ -7,13 +7,12 @@ import operatorfrom multiprocessing import Process, Queuefrom flask_babel import gettext-from searx import settingsfrom searx.plugins import loggername = "Basic Calculator"description = gettext("Calculate mathematical expressions via the search bar")-default_on = False+default_on = Truepreference_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 pageif 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']diff --git a/searx/settings.yml b/searx/settings.ymlindex a1701d009..8f5a4430e 100644--- a/searx/settings.yml+++ b/searx/settings.yml@@ -219,13 +219,13 @@ outgoing:## enabled_plugins:# # these plugins are enabled if nothing is configured ..+# - 'Basic Calculator'# - 'Hash plugin'# - 'Self Information'# - 'Tracker URL remover'# - 'Ahmia blacklist' # activation depends on outgoing.using_tor_proxy# # these plugins are disabled if nothing is configured ..# - 'Hostnames plugin' # see 'hostnames' configuration below-# - 'Basic Calculator'# - 'Open Access DOI rewrite'# - 'Tor check plugin'# # Read the docs before activate: auto-detection of the language could bediff --git a/searx/templates/simple/preferences.html b/searx/templates/simple/preferences.htmlindex 0145dcd0f..9dab84fd1 100644--- a/searx/templates/simple/preferences.html+++ b/searx/templates/simple/preferences.html@@ -38,7 +38,7 @@{%- macro plugin_preferences(section) -%}{%- for plugin in plugins -%}-{%- if plugin.preference_section == section and (plugin.is_allowed() if plugin.is_allowed else True) -%}+{%- if plugin.preference_section == section -%}<fieldset>{{- '' -}}<legend>{{ _(plugin.name) }}</legend>{{- '' -}}<div class="value">