diff --git a/scripts/install b/scripts/install index 3c12d01..1545444 100644 --- a/scripts/install +++ b/scripts/install @@ -117,6 +117,8 @@ public_path=/home/yunohost.app/$app ynh_app_setting_set --app=$app --key=public_path --value=$public_path mkdir -p $public_path +chown -R $app:www-data $public_path +chmod 755 $public_path #================================================= # NGINX CONFIGURATION @@ -185,19 +187,6 @@ ynh_script_progression --message="Configuring a systemd service..." # Create a dedicated systemd config ynh_add_systemd_config -#================================================= -# GENERIC FINALIZATION -#================================================= -# SECURE FILES AND DIRECTORIES -#================================================= -ynh_script_progression --message="Securing files and directories..." - -# Set permissions to app files -chown -R $app:www-data $final_path -chmod -R o-rwx "$final_path" -chown -R $app:www-data $public_path -chmod 755 $public_path - #================================================= # SETUP LOGROTATE #================================================= diff --git a/scripts/restore b/scripts/restore index 19399f2..66b9de4 100644 --- a/scripts/restore +++ b/scripts/restore @@ -69,15 +69,10 @@ ynh_script_progression --message="Restoring the app main directory..." ynh_restore_file --origin_path="$final_path" -#================================================= -# RESTORE USER RIGHTS -#================================================= -ynh_script_progression --message="Restoring user rights..." - # Restore permissions on app files -chown -R $app:www-data $final_path +chmod 750 "$final_path" chmod -R o-rwx "$final_path" -chmod 755 $public_path +chown -R $app:www-data "$final_path" #================================================= # SPECIFIC RESTORATION