portal: improve domain setting fetch + set show_other_domains_apps to false by default ?

This commit is contained in:
Alexandre Aubin 2023-09-27 20:40:50 +02:00
parent a4366e88fc
commit a0dbf6a5b0
2 changed files with 13 additions and 12 deletions

View file

@ -9,7 +9,7 @@ name = "Features"
[feature.portal.show_other_domains_apps] [feature.portal.show_other_domains_apps]
type = "boolean" type = "boolean"
default = 1 default = false
[feature.portal.portal_title] [feature.portal.portal_title]
type = "string" type = "string"

View file

@ -59,18 +59,19 @@ def _get_portal_settings(domain: Union[str, None] = None):
domain = request.get_header("host") domain = request.get_header("host")
if Path(f"{DOMAIN_SETTINGS_DIR}/{domain}.portal.yml").exists(): assert domain and "/" not in domain
settings = read_yaml(f"{DOMAIN_SETTINGS_DIR}/{domain}.portal.yml")
else:
settings = {
"public": False,
"portal_logo": "",
"portal_theme": "system",
"portal_title": "YunoHost",
"show_other_domains_apps": 1,
}
settings["domain"] = domain settings = {
"public": False,
"portal_logo": "",
"portal_theme": "system",
"portal_title": "YunoHost",
"show_other_domains_apps": false,
"domain": domain,
}
if Path(f"{DOMAIN_SETTINGS_DIR}/{domain}.portal.yml").exists():
settings.update(read_yaml(f"{DOMAIN_SETTINGS_DIR}/{domain}.portal.yml"))
return settings return settings