diff options
author | Alexandre Flament <alex@al-f.net> | 2021-05-18 17:23:21 +0200 |
---|---|---|
committer | Alexandre Flament <alex@al-f.net> | 2021-05-18 17:23:21 +0200 |
commit | d1cffc55cb5421c6c56f54124ded202a3332a676 (patch) | |
tree | 74e831edd53602aecfea89e42f3544b89dc465fb /searx/settings_loader.py | |
parent | d255e5637b45a05d7a3b01d261affdcfc120b653 (diff) | |
download | searxng-d1cffc55cb5421c6c56f54124ded202a3332a676.tar.gz searxng-d1cffc55cb5421c6c56f54124ded202a3332a676.zip |
[fix] unit test: don't load /etc/searx/settings.yml
Add a new environment variable SEARX_DISABLE_ETC_SETTINGS
to disable loading of /etc/searx/settings.yml
unit tests:
* set SEARX_DISABLE_ETC_SETTINGS to 1
* remove SEARX_SETTINGS_PATH if it exists
Diffstat (limited to 'searx/settings_loader.py')
-rw-r--r-- | searx/settings_loader.py | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/searx/settings_loader.py b/searx/settings_loader.py index cfdeb4d91..6beab59a1 100644 --- a/searx/settings_loader.py +++ b/searx/settings_loader.py @@ -40,6 +40,9 @@ def get_user_settings_path(): # enviroment variable SEARX_SETTINGS_PATH return check_settings_yml(environ['SEARX_SETTINGS_PATH']) + if environ.get('SEARX_DISABLE_ETC_SETTINGS', '').lower() in ('1', 'true'): + return None + # if not, get it from searx code base or last solution from /etc/searx return check_settings_yml('/etc/searx/settings.yml') |