summaryrefslogtreecommitdiff
path: root/docs
diff options
context:
space:
mode:
authorMarkus Heiser <markus.heiser@darmarit.de>2024-06-12 18:01:18 +0200
committerMarkus Heiser <markus.heiser@darmarIT.de>2024-07-14 18:10:06 +0200
commit2039060b640189e250020e6e17db10b0a0730e7e (patch)
treede3d278a4cce77d40e893206e4b0f756b3411e03 /docs
parente4da22ee51d86252144885ec5ba11e8c13ed2010 (diff)
downloadsearxng-2039060b640189e250020e6e17db10b0a0730e7e.tar.gz
searxng-2039060b640189e250020e6e17db10b0a0730e7e.zip
[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>
Diffstat (limited to 'docs')
-rw-r--r--docs/admin/settings/index.rst2
-rw-r--r--docs/src/searx.settings.rst8
2 files changed, 10 insertions, 0 deletions
diff --git a/docs/admin/settings/index.rst b/docs/admin/settings/index.rst
index 005ee37e1..acc91dbdd 100644
--- a/docs/admin/settings/index.rst
+++ b/docs/admin/settings/index.rst
@@ -1,3 +1,5 @@
+.. _searxng settings.yml:
+
========
Settings
========
diff --git a/docs/src/searx.settings.rst b/docs/src/searx.settings.rst
new file mode 100644
index 000000000..1496c407c
--- /dev/null
+++ b/docs/src/searx.settings.rst
@@ -0,0 +1,8 @@
+.. _searx.settings_loader:
+
+===============
+Settings Loader
+===============
+
+.. automodule:: searx.settings_loader
+ :members: