From 7c1c6c8e15645e12f8a500b5c3d232e84659e554 Mon Sep 17 00:00:00 2001 From: Alexandre Aubin Date: Mon, 7 Jun 2021 18:32:16 +0200 Subject: [PATCH] Fix weird permission stuff --- scripts/install | 3 +-- scripts/restore | 17 ++++++----------- scripts/upgrade | 3 +-- 3 files changed, 8 insertions(+), 15 deletions(-) diff --git a/scripts/install b/scripts/install index 4bdd3f7..481b999 100644 --- a/scripts/install +++ b/scripts/install @@ -218,9 +218,8 @@ ynh_app_setting_set --app=$app --key=final_path --value=$final_path mkdir -pm 0755 $final_path cp -a ../sources/* ${final_path}/ -chmod -R 0644 ${final_path}/* chmod 750 "$final_path" -chmod -R o-rwx "$final_path" +chmod o-rwx "$final_path" chown -R $app:www-data "$final_path" #================================================= diff --git a/scripts/restore b/scripts/restore index e5ae118..b388245 100644 --- a/scripts/restore +++ b/scripts/restore @@ -68,6 +68,12 @@ ynh_script_progression --message="Restoring the app main directory..." ynh_restore_file --origin_path="$final_path" +# Restore permissions on app files +chmod 750 "$final_path" +chmod o-rwx "$final_path" +chown -R $app:www-data "$final_path" + + if [[ $firmware_nonfree -eq 1 ]]; then check_armbian_nonfree_conflict ynh_install_extra_app_dependencies --repo="deb http://deb.debian.org/debian $(ynh_get_debian_release) non-free" --package="$nonfree_firmware_packages" @@ -94,17 +100,6 @@ ynh_restore_file --origin_path="/usr/local/bin/$service_name" ynh_restore_file --origin_path="/etc/init.d/hostapd" -#================================================= -# RESTORE USER RIGHTS -#================================================= -ynh_script_progression --message="Restoring user rights..." - -# Restore permissions on app files -chmod -R 0644 ${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 c54e8c7..1db62df 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -110,9 +110,8 @@ then fi # Restore permissions on app files -chmod -R 0644 ${final_path}/* chmod 750 "$final_path" -chmod -R o-rwx "$final_path" +chmod o-rwx "$final_path" chown -R $app:www-data "$final_path" #=================================================