From 5dbf9f89dd76bfac1825db7fcb404869f96cb355 Mon Sep 17 00:00:00 2001 From: Gredin67 Date: Tue, 10 Jan 2023 00:20:52 +0100 Subject: [PATCH] matrix.to --- scripts/upgrade | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/scripts/upgrade b/scripts/upgrade index 5e1e31b..9fb3487 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -173,6 +173,7 @@ if ! grep -q "$final_path" /etc/passwd; then sed --in-place -r "s@matrix-$app\:x\:([[:digit:]]+\:[[:digit:]]+)\:\:/.*/matrix-$app\:/usr/sbin/nologin@matrix-$app\:x\:\1\:\:$final_path\:/usr/sbin/nologin@g" /etc/passwd fi +#================================================= # MIGRATION 7 : Working config panel v1 #================================================= @@ -181,18 +182,23 @@ if [ -z $allow_public_rooms ]; then allow_public_rooms="false" fi -# Get app name of first Element Instance -element_instance="element" -element_domain=$(ynh_app_setting_get --app $element_instance --key domain) -element_path=$(ynh_app_setting_get --app $element_instance --key path) - # SET STANDARD SETTINGS FROM DEFAULT CONFIG +# Get app name of first Element Instance + if [ -z "$element_ynh_url" ] then - element_ynh_url="https://"+element_domain+element_path - ynh_app_setting_set --app=$app --key=element_ynh_url --value=$element_ynh_url + element_instance="element" + element_domain=$(ynh_app_setting_get --app $element_instance --key domain) + element_path=$(ynh_app_setting_get --app $element_instance --key path) + if [ -z "$element_domain" ]; then + element_ynh_url="https://matrix.to/" + else + element_ynh_url="https://"+element_domain+element_path + fi fi +ynh_app_setting_set --app=$app --key=element_ynh_url --value=$element_ynh_url + if [ -z "$allow_public_rooms_without_auth" ] then allow_public_rooms_without_auth=allow_public_rooms