summaryrefslogtreecommitdiff
path: root/searx/webapp.py
diff options
context:
space:
mode:
authorAlexandre Flament <alex@al-f.net>2020-12-21 10:21:10 +0100
committerAlexandre Flament <alex@al-f.net>2020-12-27 10:30:20 +0100
commit568b9465e9480bf408a00982ce0b8ec7462f830c (patch)
treea9e22d77a7591e5f5713e9516122c13d6aa38036 /searx/webapp.py
parenteb1b5289d5da742473dd412e83abe35406da5fa5 (diff)
downloadsearxng-568b9465e9480bf408a00982ce0b8ec7462f830c.tar.gz
searxng-568b9465e9480bf408a00982ce0b8ec7462f830c.zip
[mod] check secret_key when searx.webapp is imported
Without this commit the module searx checks the secret_key value. With this commit, make docs, utils/standalone_searx.py, utils/fetch_firefox_version.py works without SEARX_DEBUG=1 For reference see https://github.com/searx/searx/pull/2386
Diffstat (limited to 'searx/webapp.py')
-rwxr-xr-xsearx/webapp.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/searx/webapp.py b/searx/webapp.py
index 5076355d0..49750d210 100755
--- a/searx/webapp.py
+++ b/searx/webapp.py
@@ -86,6 +86,11 @@ from searx.metrology.error_recorder import errors_per_engines
from werkzeug.serving import WSGIRequestHandler
WSGIRequestHandler.protocol_version = "HTTP/{}".format(settings['server'].get('http_protocol_version', '1.0'))
+# check secret_key
+if not searx_debug and settings['server']['secret_key'] == 'ultrasecretkey':
+ logger.error('server.secret_key is not changed. Please use something else instead of ultrasecretkey.')
+ exit(1)
+
# about static
static_path = get_resources_directory(searx_dir, 'static', settings['ui']['static_path'])
logger.debug('static directory is %s', static_path)