From dc8319dc04e8572e920ad6bd515f0c25fe29a3c8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Josu=C3=A9=20Tille?= Date: Thu, 26 May 2022 17:27:30 +0200 Subject: [PATCH] Fix install --- scripts/change_url | 1 + scripts/install | 4 ++-- scripts/remove | 2 +- scripts/restore | 4 ++-- scripts/upgrade | 3 ++- 5 files changed, 8 insertions(+), 6 deletions(-) diff --git a/scripts/change_url b/scripts/change_url index b7135b4..b0488cc 100644 --- a/scripts/change_url +++ b/scripts/change_url @@ -43,6 +43,7 @@ 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="matrix-$app" +synapse_user_app="$app" synapse_db_name="matrix_$app" synapse_db_user="matrix_$app" synapse_db_name="matrix_$app" diff --git a/scripts/install b/scripts/install index 652ec8b..55d2768 100644 --- a/scripts/install +++ b/scripts/install @@ -26,7 +26,7 @@ ynh_abort_if_errors #================================================= synapse_user="matrix-$app" -synapse_user_app="$synapse_user-app" +synapse_user_app="$app" synapse_user_app_pwd="$(ynh_string_random --length=30)" synapse_db_name="matrix_$app" synapse_db_user="matrix_$app" @@ -144,7 +144,7 @@ ynh_install_app_dependencies $dependances ynh_script_progression --message="Configuring system user..." --weight=3 ynh_system_user_create --username=$synapse_user --home_dir=$final_path -yunohost user create $synapse_user_app -f Synapse -l Application -m synapse@$domain -p "$synapse_user_app_pwd" +yunohost user create $synapse_user_app -f Synapse -l Application -d $domain -p "$synapse_user_app_pwd" adduser $synapse_user ssl-cert adduser turnserver ssl-cert diff --git a/scripts/remove b/scripts/remove index efd7105..7452c0c 100755 --- a/scripts/remove +++ b/scripts/remove @@ -29,7 +29,7 @@ turnserver_alt_tls_port=$(ynh_app_setting_get --app=$app --key=turnserver_alt_tl #================================================= synapse_user="matrix-$app" -synapse_user_app="$synapse_user-app" +synapse_user_app="$app" synapse_db_name="matrix_$app" synapse_db_user="matrix_$app" synapse_db_name="matrix_$app" diff --git a/scripts/restore b/scripts/restore index 7de4732..fbd5353 100644 --- a/scripts/restore +++ b/scripts/restore @@ -45,7 +45,7 @@ synapse_user_app_pwd=$(ynh_app_setting_get --app=$app --key=synapse_user_app_pwd #================================================= synapse_user="matrix-$app" -synapse_user_app="$synapse_user-app" +synapse_user_app="$app" synapse_db_name="matrix_$app" synapse_db_user="matrix_$app" synapse_db_name="matrix_$app" @@ -79,7 +79,7 @@ ynh_script_progression --message="Recreating the dedicated system user..." --wei # Create the dedicated user (if not existing) ynh_system_user_create --username=$synapse_user --home_dir=$final_path -yunohost user create $synapse_user_app -f Synapse -l Application -m synapse@$domain -p "$synapse_user_app_pwd" +yunohost user create $synapse_user_app -f Synapse -l Application -d $domain -p "$synapse_user_app_pwd" adduser $synapse_user ssl-cert adduser turnserver ssl-cert diff --git a/scripts/upgrade b/scripts/upgrade index 580bffb..42b72bc 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -47,6 +47,7 @@ synapse_user_app_pwd=$(ynh_app_setting_get --app=$app --key=synapse_user_app_pwd #================================================= synapse_user="matrix-$app" +synapse_user_app="$app" synapse_db_name="matrix_$app" synapse_db_user="matrix_$app" synapse_db_name="matrix_$app" @@ -138,7 +139,7 @@ fi if [ -z $synapse_user_app_pwd ]; then synapse_user_app_pwd="$(ynh_string_random --length=30)" ynh_app_setting_set --app=$app --key=synapse_user_app_pwd --value=$synapse_user_app_pwd - yunohost user create $synapse_user_app -f Synapse -l Application -m synapse@$domain -p "$synapse_user_app_pwd" + yunohost user create $synapse_user_app -f Synapse -l Application -m $domain -p "$synapse_user_app_pwd" fi #=================================================