20def init():
21
22
23
24 from . import config, cache, proxy
25 from .. import settings_loader
26
27 cfg_file = (settings_loader.get_user_cfg_folder() or pathlib.Path("/etc/searxng")) / "favicons.toml"
28 if not cfg_file.exists():
29 if is_active():
30 logger.error(f"missing favicon config: {cfg_file}")
31 cfg_file = config.DEFAULT_CFG_TOML_PATH
32
33 logger.debug(f"load favicon config: {cfg_file}")
34 cfg = config.FaviconConfig.from_toml_file(cfg_file, use_cache=True)
35 cache.init(cfg.cache)
36 proxy.init(cfg.proxy)
37
38 del cache, config, proxy, cfg, settings_loader