summaryrefslogtreecommitdiff
path: root/searx/_settings.py
diff options
context:
space:
mode:
authorMarkus Heiser <markus.heiser@darmarit.de>2026-05-30 14:43:50 +0200
committerBrock Vojkovic <brock@vojk.au>2026-05-30 22:43:50 +0800
commit4ac822fd7fbb5bd35b3e0d8695e4942fbc4d202a (patch)
tree43b6d3b44b51813c817cafc4d5647e89b3d33f9b /searx/_settings.py
parente1d25c5078dfc5c8b3ba90e818d25eff1b0135ce (diff)
[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>
Diffstat (limited to 'searx/_settings.py')
-rw-r--r--searx/_settings.py42
1 files changed, 42 insertions, 0 deletions
diff --git a/searx/_settings.py b/searx/_settings.py
new file mode 100644
index 000000000..0db62474c
--- /dev/null
+++ b/searx/_settings.py
@@ -0,0 +1,42 @@
+# SPDX-License-Identifier: AGPL-3.0-or-later
+"""Implementation of the :py:obj:`preference <searx.preference>` settings."""
+# pylint: disable = too-few-public-methods
+
+import typing as t
+import msgspec
+
+
+class SettingsPref(msgspec.Struct, kw_only=True, forbid_unknown_fields=True):
+ """Options for configuring the preferences
+
+ .. code:: yaml
+
+ preferences:
+ lock:
+ - favicon_resolver
+ - image_proxy
+ - method
+ # ...
+
+ """
+
+ lock: set[
+ t.Literal[
+ "categories",
+ "language",
+ "locale",
+ "autocomplete",
+ "favicon_resolver",
+ "image_proxy",
+ "method",
+ "safesearch",
+ "theme",
+ "results_on_new_tab",
+ "doi_resolver",
+ "simple_style",
+ "center_alignment",
+ "query_in_title",
+ "search_on_category_select",
+ ]
+ ] = set()
+ """Lock arbitrary settings on the preferences page."""