1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/synapse_ynh.git synced 2024-09-03 20:26:38 +02:00

Merge pull request #360 from Gredin67/fix-sso-client-whithelist-generation

Fix lists in config
This commit is contained in:
Josue-T 2023-01-15 12:53:41 +01:00 committed by GitHub
commit 42fe0302b3
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 16 additions and 12 deletions

View file

@ -71,6 +71,6 @@ install_sources() {
get_domain_list() { get_domain_list() {
yunohost --output-as plain domain list | grep -E "^#" -v | sort | uniq | while read domain; do yunohost --output-as plain domain list | grep -E "^#" -v | sort | uniq | while read domain; do
echo -n " - https://$domain\n" echo -n " - https://$domain\n"
done done
} }

View file

@ -49,7 +49,8 @@ synapse_db_name="matrix_$app"
synapse_db_user="matrix_$app" synapse_db_user="matrix_$app"
synapse_db_name="matrix_$app" synapse_db_name="matrix_$app"
upstream_version=$(ynh_app_upstream_version) upstream_version=$(ynh_app_upstream_version)
domain_whitelist_client=$(get_domain_list) domain_whitelist_client_=$(get_domain_list)
domain_whitelist_client=${domain_whitelist_client_%"\n"}
# Check if the new path stay /_matrix if not exit # Check if the new path stay /_matrix if not exit

View file

@ -27,7 +27,8 @@ is_free_registration=$(ynh_app_setting_get --app $app --key is_free_registration
jitsi_server=$(ynh_app_setting_get --app=$app --key=jitsi_server) 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) 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) synapse_user_app_pwd=$(ynh_app_setting_get --app=$app --key=synapse_user_app_pwd)
domain_whitelist_client=$(get_domain_list) domain_whitelist_client_=$(get_domain_list)
domain_whitelist_client=${domain_whitelist_client_%"\n"}
main_domain=$(yunohost domain list --output-as json | jq -r .main) main_domain=$(yunohost domain list --output-as json | jq -r .main)
#================================================= #=================================================

View file

@ -36,7 +36,8 @@ report_stats="false"
allow_public_rooms="false" allow_public_rooms="false"
e2e_enabled_by_default="true" e2e_enabled_by_default="true"
default_domain_value="Same than the domain" default_domain_value="Same than the domain"
domain_whitelist_client=$(get_domain_list) domain_whitelist_client_=$(get_domain_list)
domain_whitelist_client=${domain_whitelist_client_%"\n"}
#================================================= #=================================================
# RETRIEVE ARGUMENTS FROM THE MANIFEST # RETRIEVE ARGUMENTS FROM THE MANIFEST
@ -302,12 +303,12 @@ public_ip6="$(curl -s ipv6.yunohost.org)" || true
turn_external_ip="" turn_external_ip=""
if [ -n "$public_ip4" ] && ynh_validate_ip4 --ip_address="$public_ip4" if [ -n "$public_ip4" ] && ynh_validate_ip4 --ip_address="$public_ip4"
then then
turn_external_ip+="\nexternal-ip=$public_ip4" turn_external_ip+="external-ip="$public_ip4%"\n"
fi fi
if [ -n "$public_ip6" ] && ynh_validate_ip6 --ip_address="$public_ip6" if [ -n "$public_ip6" ] && ynh_validate_ip6 --ip_address="$public_ip6"
then then
turn_external_ip+="\nexternal-ip=$public_ip6" turn_external_ip+="external-ip="$public_ip6%"\n"
fi fi
ynh_add_config --template="turnserver.conf" --destination="/etc/matrix-$app/coturn.conf" ynh_add_config --template="turnserver.conf" --destination="/etc/matrix-$app/coturn.conf"

View file

@ -182,12 +182,12 @@ public_ip6="$(curl -s ipv6.yunohost.org)" || true
turn_external_ip="" turn_external_ip=""
if [ -n "$public_ip4" ] && ynh_validate_ip4 --ip_address="$public_ip4" if [ -n "$public_ip4" ] && ynh_validate_ip4 --ip_address="$public_ip4"
then then
turn_external_ip+="\nexternal-ip=$public_ip4" turn_external_ip+="external-ip="$public_ip4%"\n"
fi fi
if [ -n "$public_ip6" ] && ynh_validate_ip6 --ip_address="$public_ip6" if [ -n "$public_ip6" ] && ynh_validate_ip6 --ip_address="$public_ip6"
then then
turn_external_ip+="\nexternal-ip=$public_ip6" turn_external_ip+="external-ip="$public_ip6%"\n"
fi fi
ynh_add_config --template="turnserver.conf" --destination="/etc/matrix-$app/coturn.conf" ynh_add_config --template="turnserver.conf" --destination="/etc/matrix-$app/coturn.conf"

View file

@ -41,7 +41,8 @@ registration_shared_secret=$(ynh_app_setting_get --app=$app --key=registration_s
form_secret=$(ynh_app_setting_get --app=$app --key=form_secret) form_secret=$(ynh_app_setting_get --app=$app --key=form_secret)
macaroon_secret_key=$(ynh_app_setting_get --app=$app --key=macaroon_secret_key) 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) synapse_user_app_pwd=$(ynh_app_setting_get --app=$app --key=synapse_user_app_pwd)
domain_whitelist_client=$(get_domain_list) domain_whitelist_client_=$(get_domain_list)
domain_whitelist_client=${domain_whitelist_client_%"\n"}
main_domain=$(yunohost domain list --output-as json | jq -r .main) main_domain=$(yunohost domain list --output-as json | jq -r .main)
#================================================= #=================================================
@ -357,12 +358,12 @@ public_ip6="$(curl -s ipv6.yunohost.org)" || true
turn_external_ip="" turn_external_ip=""
if [ -n "$public_ip4" ] && ynh_validate_ip4 --ip_address="$public_ip4" if [ -n "$public_ip4" ] && ynh_validate_ip4 --ip_address="$public_ip4"
then then
turn_external_ip+="\nexternal-ip=$public_ip4" turn_external_ip+="external-ip="$public_ip4%"\n"
fi fi
if [ -n "$public_ip6" ] && ynh_validate_ip6 --ip_address="$public_ip6" if [ -n "$public_ip6" ] && ynh_validate_ip6 --ip_address="$public_ip6"
then then
turn_external_ip+="\nexternal-ip=$public_ip6" turn_external_ip+="external-ip="$public_ip6%"\n"
fi fi
ynh_add_config --template="turnserver.conf" --destination="/etc/matrix-$app/coturn.conf" ynh_add_config --template="turnserver.conf" --destination="/etc/matrix-$app/coturn.conf"