diff --git a/scripts/_common.sh b/scripts/_common.sh index 207a233..6bc9b12 100755 --- a/scripts/_common.sh +++ b/scripts/_common.sh @@ -110,6 +110,11 @@ ensure_vars_set() { ynh_app_setting_set --app="$app" --key=e2e_enabled_by_default --value="$e2e_enabled_by_default" fi + if [ -z "${turnserver_pwd:-}" ]; then + turnserver_pwd=$(ynh_string_random --length=30) + ynh_app_setting_set --app="$app" --key=turnserver_pwd --value="$turnserver_pwd" + fi + if [ -z "${web_client_location:-}" ] then web_client_location="https://matrix.to/" diff --git a/scripts/install b/scripts/install index 5a62c35..b212a49 100644 --- a/scripts/install +++ b/scripts/install @@ -159,10 +159,6 @@ configure_nginx #================================================= ynh_script_progression --message="Configuring Synapse..." --weight=2 -# Find password for turnserver and database -turnserver_pwd=$(ynh_string_random --length=30) -ynh_app_setting_set --app=$app --key=turnserver_pwd --value=$turnserver_pwd - ynh_add_jinja_config --template="homeserver.yaml" --destination="/etc/matrix-$app/homeserver.yaml" ynh_add_config --template="log.yaml" --destination="/etc/matrix-$app/log.yaml" ynh_add_config --template=sliding_proxy.conf --destination=/etc/matrix-$app/sliding_proxy.conf diff --git a/sources/update_synapse_for_appservice.sh b/sources/update_synapse_for_appservice.sh index bf6979c..5abacfe 100644 --- a/sources/update_synapse_for_appservice.sh +++ b/sources/update_synapse_for_appservice.sh @@ -18,8 +18,8 @@ for f in $(ls /etc/matrix-$app/app-service/); do done # Set permissions -chown matrix-$app $service_config_file -chown matrix-$app /etc/matrix-$app/app-service/* +chown $app $service_config_file +chown $app /etc/matrix-$app/app-service/* chmod 600 $service_config_file chmod 600 /etc/matrix-$app/app-service/*