<feed xmlns='http://www.w3.org/2005/Atom'>
<title>searxng/docs/src/searx.settings.rst, branch custom</title>
<subtitle>Free internet metasearch engine which aggregates results from various search services and databases</subtitle>
<id>https://git.ikboikov.net/searxng/atom?h=custom</id>
<link rel='self' href='https://git.ikboikov.net/searxng/atom?h=custom'/>
<link rel='alternate' type='text/html' href='https://git.ikboikov.net/searxng/'/>
<updated>2024-07-14T16:10:06Z</updated>
<entry>
<title>[mod] revision of the settings_loader</title>
<updated>2024-07-14T16:10:06Z</updated>
<author>
<name>Markus Heiser</name>
<email>markus.heiser@darmarit.de</email>
</author>
<published>2024-06-12T16:01:18Z</published>
<link rel='alternate' type='text/html' href='https://git.ikboikov.net/searxng/commit/?id=2039060b640189e250020e6e17db10b0a0730e7e'/>
<id>urn:sha1:2039060b640189e250020e6e17db10b0a0730e7e</id>
<content type='text'>
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 &lt;markus.heiser@darmarit.de&gt;
</content>
</entry>
</feed>
