diff --git a/scripts/_common.sh b/scripts/_common.sh index 83fd3d93..57e7a4ea 100755 --- a/scripts/_common.sh +++ b/scripts/_common.sh @@ -65,6 +65,7 @@ install_sources() { get_domain_list() { yunohost --output-as plain domain list | grep -E "^#" -v | sort | uniq | while read domain; do - echo -n " - https://$domain\n" + domain_list=" - https://$domain"$'\n' + echo -n "$domain_list" done } diff --git a/scripts/config b/scripts/config index 7fcf350b..ec3f6469 100644 --- a/scripts/config +++ b/scripts/config @@ -27,8 +27,7 @@ is_free_registration=$(ynh_app_setting_get --app $app --key is_free_registration jitsi_server=$(ynh_app_setting_get --app=$app --key=jitsi_server) e2e_enabled_by_default=$(ynh_app_setting_get --app=$app --key=e2e_enabled_by_default) synapse_user_app_pwd=$(ynh_app_setting_get --app=$app --key=synapse_user_app_pwd) -domain_whitelist_client_=$(get_domain_list) -domain_whitelist_client=${domain_whitelist_client_%"\n"} +domain_whitelist_client=$(get_domain_list) main_domain=$(yunohost domain list --output-as json | jq -r .main) #================================================= diff --git a/scripts/install b/scripts/install index 64230b59..2a524b70 100644 --- a/scripts/install +++ b/scripts/install @@ -36,8 +36,7 @@ report_stats="false" allow_public_rooms="false" e2e_enabled_by_default="true" default_domain_value="Same than the domain" -domain_whitelist_client_=$(get_domain_list) -domain_whitelist_client=${domain_whitelist_client_%"\n"} +domain_whitelist_client=$(get_domain_list) #================================================= # RETRIEVE ARGUMENTS FROM THE MANIFEST @@ -304,12 +303,12 @@ public_ip6="$(curl -s ipv6.yunohost.org)" || true turn_external_ip="" if [ -n "$public_ip4" ] && ynh_validate_ip4 --ip_address="$public_ip4" then - turn_external_ip+="external-ip="$public_ip4%"\n" + turn_external_ip+="external-ip=$public_ip4"$'\n' fi if [ -n "$public_ip6" ] && ynh_validate_ip6 --ip_address="$public_ip6" then - turn_external_ip+="external-ip="$public_ip6%"\n" + turn_external_ip+="external-ip=$public_ip6"$'\n' fi ynh_add_config --template="turnserver.conf" --destination="/etc/matrix-$app/coturn.conf" diff --git a/scripts/restore b/scripts/restore index 8c9ddc77..a10e2ecd 100644 --- a/scripts/restore +++ b/scripts/restore @@ -182,12 +182,12 @@ public_ip6="$(curl -s ipv6.yunohost.org)" || true turn_external_ip="" if [ -n "$public_ip4" ] && ynh_validate_ip4 --ip_address="$public_ip4" then - turn_external_ip+="external-ip="$public_ip4%"\n" + turn_external_ip+="external-ip=$public_ip4"$'\n' fi if [ -n "$public_ip6" ] && ynh_validate_ip6 --ip_address="$public_ip6" then - turn_external_ip+="external-ip="$public_ip6%"\n" + turn_external_ip+="external-ip=$public_ip6"$'\n' fi ynh_add_config --template="turnserver.conf" --destination="/etc/matrix-$app/coturn.conf" diff --git a/scripts/upgrade b/scripts/upgrade index 21358869..33be0e8f 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -41,8 +41,7 @@ registration_shared_secret=$(ynh_app_setting_get --app=$app --key=registration_s form_secret=$(ynh_app_setting_get --app=$app --key=form_secret) macaroon_secret_key=$(ynh_app_setting_get --app=$app --key=macaroon_secret_key) synapse_user_app_pwd=$(ynh_app_setting_get --app=$app --key=synapse_user_app_pwd) -domain_whitelist_client_=$(get_domain_list) -domain_whitelist_client=${domain_whitelist_client_%"\n"} +domain_whitelist_client=$(get_domain_list) main_domain=$(yunohost domain list --output-as json | jq -r .main) #================================================= @@ -359,12 +358,12 @@ public_ip6="$(curl -s ipv6.yunohost.org)" || true turn_external_ip="" if [ -n "$public_ip4" ] && ynh_validate_ip4 --ip_address="$public_ip4" then - turn_external_ip+="external-ip="$public_ip4%"\n" + turn_external_ip+="external-ip=$public_ip4"$'\n' fi if [ -n "$public_ip6" ] && ynh_validate_ip6 --ip_address="$public_ip6" then - turn_external_ip+="external-ip="$public_ip6%"\n" + turn_external_ip+="external-ip=$public_ip6"$'\n' fi ynh_add_config --template="turnserver.conf" --destination="/etc/matrix-$app/coturn.conf"