From 6fafa49312300e0a2ae44c1056a412b8367cf28f Mon Sep 17 00:00:00 2001 From: JensDiemer Date: Fri, 7 Oct 2022 08:30:35 +0200 Subject: [PATCH] Transfer "/etc/yunohost/current_host" see: https://forum.yunohost.org/t/call-for-feedback-sso-portal-in-multi-domain-context-how-should-it-work/7491/11 --- conf/settings.py | 2 ++ scripts/_common.sh | 4 ++++ 2 files changed, 6 insertions(+) diff --git a/conf/settings.py b/conf/settings.py index 9dc44ee..b7506b6 100644 --- a/conf/settings.py +++ b/conf/settings.py @@ -34,6 +34,8 @@ assert LOG_FILE.is_file(), f'File not exists: {LOG_FILE}' PATH_URL = '__PATH_URL__' # $YNH_APP_ARG_PATH PATH_URL = PATH_URL.strip('/') +YNH_CURRENT_HOST = '__YNH_CURRENT_HOST__' # YunoHost main domain from: /etc/yunohost/current_host + # ----------------------------------------------------------------------------- # config_panel.toml settings: diff --git a/scripts/_common.sh b/scripts/_common.sh index 24083aa..b14c5d7 100644 --- a/scripts/_common.sh +++ b/scripts/_common.sh @@ -11,6 +11,10 @@ admin=$YNH_APP_ARG_ADMIN is_public=$YNH_APP_ARG_IS_PUBLIC app=$YNH_APP_INSTANCE_NAME +# Transfer the main SSO domain to the App: +ynh_current_host=$(cat /etc/yunohost/current_host) +__YNH_CURRENT_HOST__=${ynh_current_host} + #================================================= # ARGUMENTS FROM CONFIG PANEL #=================================================