From f8dbe70af7a41ec26967e02d95274effa99100d6 Mon Sep 17 00:00:00 2001 From: yalh76 Date: Tue, 13 Apr 2021 01:06:18 +0200 Subject: [PATCH] Fix rights --- scripts/install | 2 +- scripts/restore | 2 +- scripts/upgrade | 13 +++++++++++++ 3 files changed, 15 insertions(+), 2 deletions(-) diff --git a/scripts/install b/scripts/install index 4744d0b..a49069f 100644 --- a/scripts/install +++ b/scripts/install @@ -98,7 +98,7 @@ mkdir -p "$final_path/$app" chmod 750 "$final_path" chmod -R o-rwx "$final_path" -chown -R $app:$app "$final_path" +chown -R $app:www-data "$final_path" #================================================= # NGINX CONFIGURATION diff --git a/scripts/restore b/scripts/restore index fa4c5dc..8d4dfb4 100644 --- a/scripts/restore +++ b/scripts/restore @@ -68,7 +68,7 @@ ynh_restore_file --origin_path="$final_path" chmod 750 "$final_path" chmod -R o-rwx "$final_path" -chown -R $app:$app "$final_path" +chown -R $app:www-data "$final_path" #================================================= # RESTORE THE PHP-FPM CONFIGURATION diff --git a/scripts/upgrade b/scripts/upgrade index bf0c66d..65b4063 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -69,6 +69,19 @@ ynh_script_progression --message="Making sure dedicated system user exists..." # Create a dedicated user (if not existing) ynh_system_user_create --username=$app --home_dir="$final_path" +#================================================= +# DOWNLOAD, CHECK AND UNPACK SOURCE +#================================================= + +if [ "$upgrade_type" == "UPGRADE_APP" ] +then + mkdir -p "$final_path/$app" +fi + +chmod 750 "$final_path" +chmod -R o-rwx "$final_path" +chown -R $app:www-data "$final_path" + #================================================= # NGINX CONFIGURATION #=================================================