From 0816c591e2c4af2f7a8326427bc5498bb257130e Mon Sep 17 00:00:00 2001 From: yalh76 Date: Mon, 14 Mar 2022 00:52:27 +0100 Subject: [PATCH] Fix permissions --- scripts/install | 4 ++++ scripts/restore | 4 ++++ scripts/upgrade | 4 ++++ 3 files changed, 12 insertions(+) diff --git a/scripts/install b/scripts/install index 61b2e40..b5bfe77 100644 --- a/scripts/install +++ b/scripts/install @@ -80,6 +80,10 @@ ynh_setup_source --dest_dir="$final_path" # Delete the install directory. ynh_secure_remove "$final_path/install" +chmod 750 "$final_path" +chmod -R o-rwx "$final_path" +chown -R $app:www-data "$final_path" + #================================================= # NGINX CONFIGURATION #================================================= diff --git a/scripts/restore b/scripts/restore index 8fb6b0d..13d199c 100644 --- a/scripts/restore +++ b/scripts/restore @@ -69,6 +69,10 @@ ynh_script_progression --message="Restoring the app main directory..." --weight= ynh_restore_file --origin_path="$final_path" +chmod 750 "$final_path" +chmod -R o-rwx "$final_path" +chown -R $app:www-data "$final_path" + # Les fichiers appartiennent à root chown -R root: $final_path # Sauf les dossiers includes, files et upload diff --git a/scripts/upgrade b/scripts/upgrade index 3fb83d0..d54ad5d 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -97,6 +97,10 @@ then # ynh_secure_remove "$final_path/install" fi +chmod 750 "$final_path" +chmod -R o-rwx "$final_path" +chown -R $app:www-data "$final_path" + #================================================= # NGINX CONFIGURATION #=================================================