1
0
mirror of https://github.com/searxng/searxng.git synced 2024-11-22 20:17:45 +01:00
searxng/docs/admin/settings
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
..
index.rst [mod] revision of the settings_loader 2024-07-14 18:10:06 +02:00
settings_brand.rst [doc] rearranges Settings & Engines docs for better readability 2023-07-01 22:45:19 +02:00
settings_categories_as_tabs.rst [doc] rearranges Settings & Engines docs for better readability 2023-07-01 22:45:19 +02:00
settings_engine.rst Change 'his/her' to 'them' 2024-06-13 10:23:01 +02:00
settings_general.rst [fix] typo in docs/admin/settings/settings_general.rst (doc) 2023-08-11 11:07:38 +02:00
settings_outgoing.rst [doc] rearranges Settings & Engines docs for better readability 2023-07-01 22:45:19 +02:00
settings_redis.rst [fix] typos in documentation & messages 2023-08-13 08:50:29 +02:00
settings_search.rst [mod] autocomplete.py: add support for mwmbl completions 2023-08-27 17:25:26 +02:00
settings_server.rst [feat] docker: add env vars for common public instance settings 2024-06-14 14:58:02 +02:00
settings_ui.rst [feat] docker: add env vars for common public instance settings 2024-06-14 14:58:02 +02:00
settings.rst [doc] rearranges Settings & Engines docs for better readability 2023-07-01 22:45:19 +02:00