diff --git a/scripts/backup b/scripts/backup index a07766f..8cf6b3c 100755 --- a/scripts/backup +++ b/scripts/backup @@ -21,6 +21,15 @@ ynh_print_info --message="Declaring files to be backed up..." ynh_backup --src_path="$install_dir" +unlink "/home/$app/repos" +ynh_backup --src_path="/home/$app" + +#================================================= +# BACKUP THE REPOS DIRECTORY +#================================================= + +ynh_backup --src_path="/home/yunohost.app/$app" --is_big + #================================================= # BACKUP THE NGINX CONFIGURATION #================================================= diff --git a/scripts/install b/scripts/install index 910c2ad..f244b10 100755 --- a/scripts/install +++ b/scripts/install @@ -38,10 +38,10 @@ ynh_script_progression --message="Setting up source files..." --weight=1 # Download, check integrity, uncompress and patch the source from manifest.toml ynh_setup_source --dest_dir="$install_dir/app" -mkdir /home/$app -mkdir /home/$app/.ssh && chmod 700 /home/$app/.ssh -touch /home/$app/.ssh/authorized_keys && chmod 600 /home/$app/.ssh/authorized_keys -mkdir $install_dir/repos && chmod 700 $install_dir/repos +mkdir -p "/home/$app/.ssh" && chmod 700 "/home/$app/.ssh" +touch "/home/$app/.ssh/authorized_keys" && chmod 600 "/home/$app/.ssh/authorized_keys" +mkdir "/home/yunohost.app/$app" && chmod 700 "/home/yunohost.app/$app" +ln -s "/home/yunohost.app/$app" "/home/$app/repos" && chmod 700 "/home/$app/repos" chown -R $app:www-data "$install_dir" chown -R $app:www-data "/home/$app" diff --git a/scripts/remove b/scripts/remove index 3bc3d9b..b2abf47 100755 --- a/scripts/remove +++ b/scripts/remove @@ -33,6 +33,8 @@ ynh_secure_remove --file="/etc/cron.d/$app" ynh_secure_remove --file="/home/$app" +ynh_secure_remove --file="/home/yunohost.app/$app" + #================================================= # END OF SCRIPT #================================================= diff --git a/scripts/restore b/scripts/restore index 5c7b30d..3241426 100755 --- a/scripts/restore +++ b/scripts/restore @@ -19,6 +19,13 @@ ynh_restore_file --origin_path="$install_dir" chown -R $app:www-data "$install_dir" +ynh_restore_file --origin_path="/home/$app" +ynh_restore_file --origin_path="/home/yunohost.app/$app" + +chown -R $app:www-data "/home/$app" +chown -R $app:www-data "/home/yunohost.app/$app" --not_mandatory +ln -s "/home/yunohost.app/$app" "/home/$app/repos" && chmod 700 "/home/$app/repos" + #================================================= # REINSTALL DEPENDENCIES #=================================================