diff options
author | Noémi Ványi <sitbackandwait@gmail.com> | 2020-10-09 15:49:48 +0200 |
---|---|---|
committer | Noémi Ványi <sitbackandwait@gmail.com> | 2020-10-09 18:31:42 +0200 |
commit | 116f7a6daaa2d29db30bc0765427d011fa99ce9c (patch) | |
tree | 1955d26682bf8b974e1336d67d404c0b60b7a022 /searx/__init__.py | |
parent | e158eeee4bf69b973659f68a799d5c005aa1c0ae (diff) | |
download | searxng-116f7a6daaa2d29db30bc0765427d011fa99ce9c.tar.gz searxng-116f7a6daaa2d29db30bc0765427d011fa99ce9c.zip |
Force admins to set secret_key if debug mode is disabled
This commit also enables debug mode for unit tests.
Diffstat (limited to 'searx/__init__.py')
-rw-r--r-- | searx/__init__.py | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/searx/__init__.py b/searx/__init__.py index b90cf5358..887ef806d 100644 --- a/searx/__init__.py +++ b/searx/__init__.py @@ -85,3 +85,7 @@ if 'SEARX_SECRET' in environ: settings['server']['secret_key'] = environ['SEARX_SECRET'] if 'SEARX_BIND_ADDRESS' in environ: settings['server']['bind_address'] = environ['SEARX_BIND_ADDRESS'] + +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) |