diff options
author | Markus Heiser <markus.heiser@darmarit.de> | 2024-10-22 09:05:00 +0200 |
---|---|---|
committer | Markus Heiser <markus.heiser@darmarIT.de> | 2024-10-23 05:29:15 +0200 |
commit | b14d885f235512572531a5336eb26a97f133f0aa (patch) | |
tree | 0592cda28dde23cca0c69de70d9b7a6ce220e04a /searx | |
parent | 050451347b021d05d26c7a0797c790bbd83442e4 (diff) | |
download | searxng-b14d885f235512572531a5336eb26a97f133f0aa.tar.gz searxng-b14d885f235512572531a5336eb26a97f133f0aa.zip |
[fix] favicons: don't hard code settings folder to /etc/searxng
The location of the local settings depends on environment ``SEARXNG_SETTINGS_PATH``
and can be different from ``/etc/searxng``. Issue was reported on Matrix [1].
To get the location function ``searx.settings_loader.get_user_cfg_folder()``
should be used.
[1] https://matrix.to/#/!vxScbLNEAmRvOraXBn:matrix.org/$5xNMYvONGB-mPt2B3ttoL27QncRFhkjGkO-TISdmP08?via=matrix.org&via=tchncs.de&via=envs.net
Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
Diffstat (limited to 'searx')
-rw-r--r-- | searx/favicons/__init__.py | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/searx/favicons/__init__.py b/searx/favicons/__init__.py index 2b3da1016..39c4ad716 100644 --- a/searx/favicons/__init__.py +++ b/searx/favicons/__init__.py @@ -22,8 +22,9 @@ def init(): # pylint: disable=import-outside-toplevel from . import config, cache, proxy + from .. import settings_loader - cfg_file = pathlib.Path("/etc/searxng/favicons.toml") + cfg_file = (settings_loader.get_user_cfg_folder() or pathlib.Path("/etc/searxng")) / "favicons.toml" if not cfg_file.exists(): if is_active(): logger.error(f"missing favicon config: {cfg_file}") @@ -34,4 +35,4 @@ def init(): cache.init(cfg.cache) proxy.init(cfg.proxy) - del cache, config, proxy, cfg + del cache, config, proxy, cfg, settings_loader |