1
0
mirror of https://github.com/searxng/searxng.git synced 2024-11-15 01:00:12 +01:00
searxng/searx
Markus Heiser 2039060b64 [mod] revision of the settings_loader
The intention of this PR is to modernize the settings_loader implementations.
The concept is old (remember, this is partly from 2014), back then we only had
one config file, meanwhile we have had a folder with config files for a very
long time.  Callers can now load a YAML configuration from this folder as
follows ::

    settings_loader.get_yaml_cfg('my-config.yml')

- BTW this is a fix of #3557.

- Further the `existing_filename_or_none` construct dates back to times when
  there was not yet a `pathlib.Path` in all Python versions we supported in the
  past.

- Typehints have been added wherever appropriate

At the same time, this patch should also be downward compatible and not
introduce a new environment variable. The localization of the folder with the
configurations is further based on:

    SEARXNG_SETTINGS_PATH (wich defaults to /etc/searxng/settings.yml)

Which means, the default config folder is `/etc/searxng/`.

ATTENTION: intended functional changes!

 If SEARXNG_SETTINGS_PATH was set and pointed to a not existing file, the
 previous implementation silently loaded the default configuration.  This
 behavior has been changed: if the file or folder does not exist, an
 EnvironmentError exception will be thrown in future.

Closes: https://github.com/searxng/searxng/issues/3557
Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
2024-07-14 18:10:06 +02:00
..
answerers [fix] setup.py - packaging for 'answerers' to build a valid package 2024-06-17 15:07:07 +02:00
botdetection Drop pytomlpp dependency for Python >= 3.11 2024-05-05 17:35:29 +02:00
data [data] update searx.data - update_wikidata_units.py 2024-06-29 07:20:59 +02:00
enginelib [mod] pylint all files with one profile / drop PYLINT_SEARXNG_DISABLE_OPTION 2024-03-11 14:55:38 +01:00
engines [feat] engine: implementation of alpine linux packages 2024-07-14 17:57:58 +02:00
infopage [fix] issues reported by pylint-3.2.2 2024-05-28 18:10:04 +02:00
metrics [mod] pylint all files with one profile / drop PYLINT_SEARXNG_DISABLE_OPTION 2024-03-11 14:55:38 +01:00
network [mod] remove py 3.6 leftovers 2024-07-13 17:20:50 +02:00
plugins [mod] revision of the settings_loader 2024-07-14 18:10:06 +02:00
search [mod] pylint all files with one profile / drop PYLINT_SEARXNG_DISABLE_OPTION 2024-03-11 14:55:38 +01:00
static [build] /static 2024-07-13 17:19:59 +02:00
templates/simple [mod] UX: flush flag icon to right in language select option values 2024-07-14 16:39:50 +02:00
translations [l10n] update translations from Weblate 2024-07-13 17:18:16 +02:00
__init__.py [mod] pylint all files with one profile / drop PYLINT_SEARXNG_DISABLE_OPTION 2024-03-11 14:55:38 +01:00
autocomplete.py [fix] html.unescape stract autocomplete suggestions 2024-07-02 18:16:46 +02:00
babel_extract.py [mod] pylint all files with one profile / drop PYLINT_SEARXNG_DISABLE_OPTION 2024-03-11 14:55:38 +01:00
exceptions.py [mod] pylint all files with one profile / drop PYLINT_SEARXNG_DISABLE_OPTION 2024-03-11 14:55:38 +01:00
external_bang.py [mod] pylint all files with one profile / drop PYLINT_SEARXNG_DISABLE_OPTION 2024-03-11 14:55:38 +01:00
external_urls.py [mod] pylint all files with one profile / drop PYLINT_SEARXNG_DISABLE_OPTION 2024-03-11 14:55:38 +01:00
flaskfix.py [mod] pylint all files with one profile / drop PYLINT_SEARXNG_DISABLE_OPTION 2024-03-11 14:55:38 +01:00
limiter.py [fix] even if limiter not activated, botdetection must be activated 2024-04-08 07:53:04 +02:00
limiter.toml [mod] isolation of botdetection from the limiter 2023-11-01 06:44:56 +01:00
locales.py [mod] pylint all files with one profile / drop PYLINT_SEARXNG_DISABLE_OPTION 2024-03-11 14:55:38 +01:00
preferences.py [mod] pylint all files with one profile / drop PYLINT_SEARXNG_DISABLE_OPTION 2024-03-11 14:55:38 +01:00
query.py [mod] pylint all files with one profile / drop PYLINT_SEARXNG_DISABLE_OPTION 2024-03-11 14:55:38 +01:00
redisdb.py [mod] pylint all files with one profile / drop PYLINT_SEARXNG_DISABLE_OPTION 2024-03-11 14:55:38 +01:00
redislib.py [mod] pylint all files with one profile / drop PYLINT_SEARXNG_DISABLE_OPTION 2024-03-11 14:55:38 +01:00
results.py [feat] hostname replace plugin: possibility to prioritize certain websites 2024-06-07 14:42:52 +02:00
searxng.msg [enh] Add engine for discourse forums 2024-06-07 10:16:09 +02:00
settings_defaults.py [feat] docker: add env vars for common public instance settings 2024-06-14 14:58:02 +02:00
settings_loader.py [mod] revision of the settings_loader 2024-07-14 18:10:06 +02:00
settings.yml [feat] engine: implementation of alpine linux packages 2024-07-14 17:57:58 +02:00
sxng_locales.py [data] update searx.data - update_engine_traits.py 2024-06-25 15:20:51 +02:00
unixthreadname.py [mod] pylint all files with one profile / drop PYLINT_SEARXNG_DISABLE_OPTION 2024-03-11 14:55:38 +01:00
utils.py [perf] torrents.html, files.html: don't parse and re-format filesize 2024-06-15 15:42:29 +02:00
version.py [mod] pylint all files with one profile / drop PYLINT_SEARXNG_DISABLE_OPTION 2024-03-11 14:55:38 +01:00
webadapter.py [mod] pylint all files with one profile / drop PYLINT_SEARXNG_DISABLE_OPTION 2024-03-11 14:55:38 +01:00
webapp.py [mod] revision of the settings_loader 2024-07-14 18:10:06 +02:00
webutils.py [mod] pylint all files with one profile / drop PYLINT_SEARXNG_DISABLE_OPTION 2024-03-11 14:55:38 +01:00