From 969dd09df0384c8cb57cfc9004ac62193751171b Mon Sep 17 00:00:00 2001 From: squeak Date: Wed, 31 Mar 2021 14:54:53 +0200 Subject: [PATCH] Added home directory to created user, which seemed necessary. --- scripts/install | 8 ++++---- scripts/remove | 1 + scripts/restore | 2 +- scripts/upgrade | 2 +- 4 files changed, 7 insertions(+), 6 deletions(-) diff --git a/scripts/install b/scripts/install index 6b59589..a61c550 100755 --- a/scripts/install +++ b/scripts/install @@ -42,7 +42,7 @@ app=$YNH_APP_INSTANCE_NAME #================================================= # CHECK IF THE APP CAN BE INSTALLED WITH THESE ARGS #================================================= -ynh_script_progression --message="Validating installation parameters..." --time --weight=1 +ynh_script_progression --message="Validating installation parameters..." --weight=1 final_path=/opt/yunohost/$app test ! -e "$final_path" || ynh_die --message="This path already contains a folder" @@ -53,7 +53,7 @@ ynh_webpath_register --app=$app --domain=$domain --path_url=$path_url #================================================= # STORE SETTINGS FROM MANIFEST #================================================= -ynh_script_progression --message="Storing installation settings..." --time --weight=1 +ynh_script_progression --message="Storing installation settings..." --weight=1 ynh_app_setting_set --app=$app --key=domain --value=$domain ynh_app_setting_set --app=$app --key=path --value=$path_url @@ -69,7 +69,7 @@ ynh_app_setting_set --app=$app --key=maxmind_license_key --value=$maxmind_licens #================================================= # FIND AND OPEN A PORT #================================================= -ynh_script_progression --message="Finding an available port..." --time --weight=1 +ynh_script_progression --message="Finding an available port..." --weight=1 # Find an available port port=$(ynh_find_port --port=8080) @@ -133,7 +133,7 @@ ynh_add_nginx_config ynh_script_progression --message="Configuring system user..." --time --weight=1 # Create a system user -ynh_system_user_create --username=$app +ynh_system_user_create --username=$app --home_dir="/home/$app" #================================================= # SPECIFIC SETUP diff --git a/scripts/remove b/scripts/remove index 6fdc3f9..bd3b2b0 100755 --- a/scripts/remove +++ b/scripts/remove @@ -108,6 +108,7 @@ ynh_script_progression --message="Removing the dedicated system user..." --time # Delete a system user ynh_system_user_delete --username=$app +ynh_secure_remove --file="/home/$app/" #================================================= # END OF SCRIPT diff --git a/scripts/restore b/scripts/restore index b6aadc2..7cc4707 100755 --- a/scripts/restore +++ b/scripts/restore @@ -65,7 +65,7 @@ ynh_restore_file --origin_path="$final_path" ynh_script_progression --message="Recreating the dedicated system user..." --time --weight=1 # Create the dedicated user (if not existing) -ynh_system_user_create --username=$app +ynh_system_user_create --username=$app --home_dir="/home/$app" #================================================= # RESTORE USER RIGHTS diff --git a/scripts/upgrade b/scripts/upgrade index c028e1e..abc9adc 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -97,7 +97,7 @@ ynh_install_nodejs --nodejs_version=$nodejs_version ynh_script_progression --message="Making sure dedicated system user exists..." --time --weight=1 # Create a dedicated user (if not existing) -ynh_system_user_create --username=$app +ynh_system_user_create --username=$app --home_dir="/home/$app/" #================================================= # SPECIFIC UPGRADE