diff --git a/scripts/restore b/scripts/restore index 2b271ba..f44b751 100644 --- a/scripts/restore +++ b/scripts/restore @@ -47,10 +47,6 @@ ynh_script_progression --message="Restoring the app main directory..." ynh_restore_file --origin_path="$final_path" -chmod 750 "$final_path" -chmod -R o-rwx "$final_path" -chown -R $app:www-data "$final_path" - #================================================= # RESTORE THE DATA DIRECTORY #================================================= @@ -58,12 +54,6 @@ ynh_script_progression --message="Restoring the data directory..." ynh_restore_file --origin_path="/home/yunohost.app/ssh_chroot_directories/$ssh_user" --not_mandatory -mkdir -p $datadir - -chmod 750 "$datadir" -chmod -R o-rwx "$datadir" -chown -R $app:www-data "$datadir" - #================================================= # SPECIFIC RESTORATION #================================================= @@ -73,6 +63,32 @@ chown -R $app:www-data "$datadir" # Load functions ssh_chroot_xxx source "$final_path/ssh_chroot/ssh_chroot.sh" +#================================================= +# INSTALL QUOTAS SYSTEM +#================================================= +ynh_script_progression --message="Install quotas system" --weight=3 + +# https://github.com/maniackcrudelis/ssh_chroot/blob/master/unix_quotas/unix_quotas.sh +if ! IS_PACKAGE_CHECK; then + quotas_install +fi + +#================================================= +# CONFIGURE FSTAB TO SUPPORT QUOTAS +#================================================= +ynh_script_progression --message="Configure fstab to support quotas" --weight=3 + +# https://github.com/maniackcrudelis/ssh_chroot/blob/master/unix_quotas/unix_quotas.sh +# Set fstab +if ! IS_PACKAGE_CHECK +then + quotas_find_mount_point "$user_dir" + quotas_set_fstab "$quotas_mount_point" + + # Activate quotas + quotas_activate "$quotas_mount_point" +fi + #================================================= # UPDATE THE CHROOT DIRECTORY #=================================================