From c5771253636c9155097c67c2a697bc1065f4a52c Mon Sep 17 00:00:00 2001 From: axolotle Date: Tue, 17 Oct 2023 14:18:21 +0200 Subject: [PATCH] portal: temp disable 'show_other_domains_apps' settings due to missing domain info in ldap --- share/config_domain.toml | 6 +++--- src/domain.py | 2 +- src/portal.py | 25 +++++++++++++++---------- 3 files changed, 19 insertions(+), 14 deletions(-) diff --git a/share/config_domain.toml b/share/config_domain.toml index 6fc5fc50a..d56a46b8e 100644 --- a/share/config_domain.toml +++ b/share/config_domain.toml @@ -7,9 +7,9 @@ name = "Features" [feature.portal] name = "Portal" - [feature.portal.show_other_domains_apps] - type = "boolean" - default = false + # [feature.portal.show_other_domains_apps] + # type = "boolean" + # default = false [feature.portal.portal_title] type = "string" diff --git a/src/domain.py b/src/domain.py index a5a68ca0f..98420b4be 100644 --- a/src/domain.py +++ b/src/domain.py @@ -735,7 +735,7 @@ class DomainConfigPanel(ConfigPanel): portal_options = [ "default_app", - "show_other_domains_apps", + # "show_other_domains_apps", "portal_title", "portal_logo", "portal_theme", diff --git a/src/portal.py b/src/portal.py index 6cd4b7816..9326bcc4b 100644 --- a/src/portal.py +++ b/src/portal.py @@ -109,7 +109,7 @@ def _get_portal_settings(domain: Union[str, None] = None): "portal_logo": "", "portal_theme": "system", "portal_title": "YunoHost", - "show_other_domains_apps": False, + # "show_other_domains_apps": False, "domain": domain, } @@ -130,12 +130,13 @@ def portal_public(): if portal_settings["public"]: portal_settings["apps"] = _get_apps() - if not portal_settings["show_other_domains_apps"]: - portal_settings["apps"] = { - name: data - for name, data in portal_settings["apps"].items() - if portal_settings["domain"] in data["url"] - } + # FIXME/TODO; See: filter apps that are available on specified domain + # if not portal_settings["show_other_domains_apps"]: + # portal_settings["apps"] = { + # name: data + # for name, data in portal_settings["apps"].items() + # if portal_settings["domain"] in data["url"] + # } return portal_settings @@ -152,9 +153,13 @@ def portal_me(): groups = [g for g in groups if g not in [username, "all_users"]] apps = _get_apps(username) - settings = _get_portal_settings(domain=domain) - if not settings["show_other_domains_apps"]: - apps = {name: data for name, data in apps.items() if domain in data["url"]} + # FIXME / TODO: filter apps that are available on specified domain + # settings = _get_portal_settings(domain=domain) + # if not settings["show_other_domains_apps"]: + # apps = {name: data for name, data in apps.items() if domain in data["url"]} + # App's `domain` info is not available in LDAP data, we need another config file + # that would be readable by the `ynh-portal` user. This conf file could be generated + # in `app_ssowatconf()` result_dict = { "username": username,