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" #=================================================