.oO SearXNG Developer Documentation Oo.
Loading...
Searching...
No Matches
searx.compat Namespace Reference

Functions

 limiter_fix_cfg (cfg, cfg_file)

Variables

list __all__
dict LIMITER_CFG_DEPRECATED

Detailed Description

Compatibility with older versions

Function Documentation

◆ limiter_fix_cfg()

searx.compat.limiter_fix_cfg ( cfg,
cfg_file )

Definition at line 34 of file compat.py.

34def limiter_fix_cfg(cfg, cfg_file):
35
36 kwargs = {
37 "category": DeprecationWarning,
38 "filename": str(cfg_file),
39 "lineno": 0,
40 "module": "searx.limiter",
41 }
42
43 for opt, msg in LIMITER_CFG_DEPRECATED.items():
44 try:
45 val = cfg.get(opt)
46 except KeyError:
47 continue
48
49 warnings.warn_explicit(msg, **kwargs)
50 if opt == "real_ip.ipv4_prefix":
51 cfg.set("botdetection.ipv4_prefix", val)
52 if opt == "real_ip.ipv6_prefix":
53 cfg.set("botdetection.ipv6_prefix", val)

Referenced by searx.limiter.get_cfg().

Here is the caller graph for this function:

Variable Documentation

◆ __all__

list searx.compat.__all__
private
Initial value:
1= [
2 "tomllib",
3]

Definition at line 6 of file compat.py.

◆ LIMITER_CFG_DEPRECATED

dict searx.compat.LIMITER_CFG_DEPRECATED
Initial value:
1= {
2 "real_ip": "limiter: config section 'real_ip' is deprecated",
3 "real_ip.x_for": "real_ip.x_for has been replaced by botdetection.trusted_proxies",
4 "real_ip.ipv4_prefix": "real_ip.ipv4_prefix has been replaced by botdetection.ipv4_prefix",
5 "real_ip.ipv6_prefix": "real_ip.ipv6_prefix has been replaced by botdetection.ipv6_prefix'",
6}

Definition at line 26 of file compat.py.