From 2b130e0d3513ba2445486c189398f988641a8467 Mon Sep 17 00:00:00 2001 From: tituspijean Date: Sat, 25 Sep 2021 22:46:35 +0200 Subject: [PATCH] Fix permissions in restore too --- scripts/install | 2 -- scripts/restore | 8 +++++++- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/scripts/install b/scripts/install index 335a112..b7447b9 100644 --- a/scripts/install +++ b/scripts/install @@ -77,8 +77,6 @@ ynh_script_progression --message="Configuring PHP-FPM..." --weight=5 # Create a dedicated PHP-FPM config ynh_add_fpm_config --phpversion=$YNH_PHP_VERSION --package="$extra_php_dependencies" -#phpversion=$(ynh_app_setting_get --app=$app --key=phpversion) - #================================================= # ADD A CONFIGURATION diff --git a/scripts/restore b/scripts/restore index 030a67d..4ba8ebe 100644 --- a/scripts/restore +++ b/scripts/restore @@ -65,7 +65,13 @@ ynh_system_user_create --username=$app #================================================= # Restore permissions on app files -chown -R $app:$app $final_path +chmod -R o-rwx "$final_path" +chown -R $app:www-data "$final_path" +find "$final_path" -type d -exec chmod 550 {} + +find "$final_path" -type f -exec chmod 440 {} + +find "$final_path/data" -type d -exec chmod 770 {} + +find "$final_path/data" -type f -exec chmod 660 {} + +chmod 660 "$final_path/config.local.php" #================================================= # RESTORE THE PHP-FPM CONFIGURATION