mirror of
https://github.com/searxng/searxng.git
synced 2026-06-13 05:17:50 +02:00
[mod] typification of the preference settings
no functional change / except the missing online doc which is now available::
$ make docs.live
$ xdg-open "http://127.0.0.1:8000/admin/settings/settings_preferences.html"
Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
This commit is contained in:
committed by
Brock Vojkovic
parent
e1d25c5078
commit
4ac822fd7f
+7
-6
@@ -10,6 +10,7 @@ from os.path import dirname, abspath
|
||||
import logging
|
||||
|
||||
import msgspec
|
||||
from ._settings import SettingsPref
|
||||
|
||||
# Debug
|
||||
LOG_FORMAT_DEBUG: str = '%(levelname)-7s %(name)-30.30s: %(message)s'
|
||||
@@ -44,15 +45,15 @@ def init_settings():
|
||||
cfg = cfg or {}
|
||||
apply_schema(cfg, SCHEMA, [])
|
||||
|
||||
if cfg['server']['public_instance']:
|
||||
cfg['server']['image_proxy'] = True
|
||||
lock = cfg.setdefault('preferences', {}).setdefault('lock', [])
|
||||
if 'image_proxy' not in lock:
|
||||
lock.append('image_proxy')
|
||||
|
||||
settings.clear()
|
||||
settings.update(cfg)
|
||||
|
||||
if get_setting("server.public_instance"):
|
||||
# enable image proxy for public instances #6125
|
||||
settings["server"]["image_proxy"] = True
|
||||
pref: SettingsPref = get_setting("preferences")
|
||||
pref.lock.add("image_proxy")
|
||||
|
||||
sxng_debug = get_setting("general.debug")
|
||||
if sxng_debug:
|
||||
_logging_config_debug()
|
||||
|
||||
Reference in New Issue
Block a user