Settings Loader - SearXNG Documentation (2026.12.6+8db8dcca1) Contents Menu Expand Light mode Dark mode Auto light/dark, in light mode Auto light/dark, in dark mode
Settings Loader
Implementations for loading configurations from YAML files. This essentially
includes the configuration of the (SearXNG appl )
server. The default configuration for the application server is loaded from the
DEFAULT_SETTINGS_FILE . This default
configuration can be completely replaced or customized individually and the SEARXNG_SETTINGS_PATH environment
variable can be used to set the location from which the local customizations are
to be loaded. The rules used for this can be found in the
get_user_cfg_folder function.
By default, local configurations are expected in folder
/etc/searxngfrom where applications can load them with theget_yaml_cfgfunction.By default, customized SearXNG appl settings are expected in a file named
settings.yml.
- searx.settings_loader. DEFAULT_SETTINGS_FILE = PosixPath('/home/runner/work/searxng/searxng/searx/settings.yml')
The git://searx/settings.yml file with all the default settings.
- searx.settings_loader. load_yaml ( file_name : str | Path ) → dict [ str , dict [ str , dict [ str , JSONType ] | list [ JSONType ] | str | int | float | bool | None ] | list [ dict [ str , JSONType ] | list [ JSONType ] | str | int | float | bool | None ] | str | int | float | bool | None ] [source]
Load YAML config from a file.
- searx.settings_loader. get_yaml_cfg ( file_name : str | Path ) → dict [ str , dict [ str , dict [ str , JSONType ] | list [ JSONType ] | str | int | float | bool | None ] | list [ dict [ str , JSONType ] | list [ JSONType ] | str | int | float | bool | None ] | str | int | float | bool | None ] [source]
Shortcut to load a YAML config from a file, located in the
in the
searxfolder of the SearXNG installation
- searx.settings_loader. get_user_cfg_folder ( ) → Path | None [source]
Returns folder where the local configurations are located.
If the
SEARXNG_SETTINGS_PATHenvironment is set and points to a folder (e.g./etc/mysxng/), all local configurations are expected in this folder. The settings of the SearXNG appl then expected insettings.yml(e.g./etc/mysxng/settings.yml).If the
SEARXNG_SETTINGS_PATHenvironment is set and points to a file (e.g./etc/mysxng/myinstance.yml), this file contains the settings of the SearXNG appl and the folder (e.g./etc/mysxng/) is used for all other configurations.This type (
SEARXNG_SETTINGS_PATHpoints to a file) is suitable for use cases in which different profiles of the SearXNG appl are to be managed, such as in test scenarios.If folder
/etc/searxngexists, it is used.
In case none of the above path exists,
Noneis returned. In case of environmentSEARXNG_SETTINGS_PATHis set, but the (folder or file) does not exists, aEnvironmentErroris raised.
- searx.settings_loader. load_settings ( load_user_settings : bool = True ) → tuple [ dict [ str , dict [ str , dict [ str , JSONType ] | list [ JSONType ] | str | int | float | bool | None ] | list [ dict [ str , JSONType ] | list [ JSONType ] | str | int | float | bool | None ] | str | int | float | bool | None ] , str ] [source]
Function for loading the settings of the SearXNG application (settings.yml ).