From 07b3839c76beb41fc2af21c42befe67ea3d032a3 Mon Sep 17 00:00:00 2001 From: yalh76 Date: Sun, 15 Aug 2021 16:18:21 +0200 Subject: [PATCH] Fix rights --- scripts/install | 4 ++++ scripts/restore | 8 ++++++-- scripts/upgrade | 16 ++++++++++++++++ 3 files changed, 26 insertions(+), 2 deletions(-) diff --git a/scripts/install b/scripts/install index f0cba25..54ec914 100644 --- a/scripts/install +++ b/scripts/install @@ -99,6 +99,10 @@ ynh_app_setting_set --app=$app --key=final_path --value=$final_path # Download, check integrity, uncompress and patch the source from app.src ln -s /usr/share/zabbix "$final_path" +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 96c3d42..0b6bb27 100644 --- a/scripts/restore +++ b/scripts/restore @@ -36,7 +36,7 @@ phpversion=$(ynh_app_setting_get --app=$app --key=phpversion) #================================================= ynh_script_progression --message="Validating restoration parameters..." -ynh_secure_remove $final_path +ynh_secure_remove --file="$final_path" #================================================= # STANDARD RESTORATION STEPS @@ -52,7 +52,11 @@ ynh_restore_file --origin_path="/etc/nginx/conf.d/$domain.d/$app.conf" #================================================= ynh_script_progression --message="Restoring the app main directory..." -ln -s /usr/share/zabbix /var/www/zabbix +ln -s /usr/share/zabbix "$final_path" + +chmod 750 "$final_path" +chmod -R o-rwx "$final_path" +chown -R $app:www-data "$final_path" #================================================= # RESTORE THE PHP-FPM CONFIGURATION diff --git a/scripts/upgrade b/scripts/upgrade index 4e33283..95dc2a6 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -74,6 +74,22 @@ if ynh_legacy_permissions_exists; then ynh_legacy_permissions_delete_all fi +#================================================= +# DOWNLOAD, CHECK AND UNPACK SOURCE +#================================================= + +if [ "$upgrade_type" == "UPGRADE_APP" ] +then + ynh_script_progression --message="Upgrading source files..." + + # Download, check integrity, uncompress and patch the source from app.src + ln -s /usr/share/zabbix "$final_path" +fi + +chmod 750 "$final_path" +chmod -R o-rwx "$final_path" +chown -R $app:www-data "$final_path" + #================================================= # NGINX CONFIGURATION #=================================================