diff --git a/locales/en.json b/locales/en.json index 51aced289..dcd5e4581 100644 --- a/locales/en.json +++ b/locales/en.json @@ -371,6 +371,9 @@ "domain_config_portal_title": "Custom title", "domain_config_portal_user_intro": "Custom user intro", "domain_config_portal_user_intro_help": "You can use HTML, basic styles will be applied to generic elements.", + "domain_config_search_engine": "Search engine URL", + "domain_config_search_engine_help": "An URL with an empty query string like `https://duckduckgo.com/?q=`, with `q=` as duckduckgo's empty query parameter", + "domain_config_search_engine_name": "Search engine name", "domain_config_show_other_domains_apps": "Show other domain's apps", "domain_config_xmpp": "Instant messaging (XMPP)", "domain_config_xmpp_help": "NB: some XMPP features will require that you update your DNS records and regenerate your Lets Encrypt certificate to be enabled", diff --git a/share/config_domain.toml b/share/config_domain.toml index 69ced9054..f6459785f 100644 --- a/share/config_domain.toml +++ b/share/config_domain.toml @@ -27,6 +27,14 @@ name = "Features" choices = ["system", "light", "dark", "cupcake", "bumblebee", "emerald", "corporate", "synthwave", "retro", "cyberpunk", "valentine", "halloween", "garden", "forest", "aqua", "lofi", "pastel", "fantasy", "wireframe", "black", "luxury", "dracula", "cmyk", "autumn", "business", "acid", "lemonade", "night", "coffee", "winter"] default = "system" + [feature.portal.search_engine] + type = "url" + default = "" + + [feature.portal.search_engine_name] + type = "string" + visible = "search_engine" + [feature.portal.portal_user_intro] type = "text" diff --git a/src/domain.py b/src/domain.py index 981cdebe8..5ac6e63d4 100644 --- a/src/domain.py +++ b/src/domain.py @@ -782,6 +782,8 @@ def _get_DomainConfigPanel(): "portal_title", "portal_logo", "portal_theme", + "search_engine", + "search_engine_name", "portal_user_intro", "portal_public_intro", ] @@ -797,7 +799,8 @@ def _get_DomainConfigPanel(): portal_values = form.dict(include=set(portal_options)) # Remove logo from values else filename will replace b64 content - portal_values.pop("portal_logo") + if "portal_logo" in portal_values: + portal_values.pop("portal_logo") if "portal_logo" in next_settings: if previous_settings.get("portal_logo"):