From 27ec1770c91d6bbc624027e414b64ce079dae0e9 Mon Sep 17 00:00:00 2001 From: Limezy Date: Wed, 1 May 2024 22:34:31 +0700 Subject: [PATCH] Tests +upgrade 2.2.1 --- scripts/backup | 9 +++++++++ scripts/install | 8 ++++---- scripts/remove | 2 ++ scripts/restore | 7 +++++++ 4 files changed, 22 insertions(+), 4 deletions(-) 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 #=================================================