diff --git a/check_process b/check_process index 901667fe..8d6c7569 100644 --- a/check_process +++ b/check_process @@ -10,7 +10,7 @@ setup_private=0 setup_public=0 upgrade=0 - backup_restore=0 + backup_restore=1 multi_instance=0 incorrect_path=0 port_already_use=0 diff --git a/manifest.json b/manifest.json index 7bec3d1c..2dfbb7d8 100644 --- a/manifest.json +++ b/manifest.json @@ -5,7 +5,7 @@ "description": { "en": "ActivityPub Federated Image Sharing" }, - "version": "0.8.4~ynh1", + "version": "0.8.4~ynh2", "url": "https://pixelfed.org/", "license": "AGPL-3.0-or-later", "maintainer": { diff --git a/scripts/backup b/scripts/backup index 8871560e..cdaf227c 100644 --- a/scripts/backup +++ b/scripts/backup @@ -14,10 +14,6 @@ source /usr/share/yunohost/helpers # MANAGE SCRIPT FAILURE #================================================= -ynh_clean_setup () { - ### Remove this function if there's nothing to clean before calling the remove script. - true -} # Exit if an error occurs during the execution of the script ynh_abort_if_errors @@ -56,34 +52,12 @@ ynh_print_info "Backing up php-fpm configuration..." ynh_backup "/etc/php/7.2/fpm/pool.d/$app.conf" #================================================= -# BACKUP THE PostgreSQL DATABASE +# BACKUP THE POSTGRESQL DATABASE #================================================= ynh_print_info "Backing up the PostgreSQL database..." ynh_psql_dump_db "$db_name" > db.sql -#================================================= -# SPECIFIC BACKUP -#================================================= -# BACKUP LOGROTATE -#================================================= -ynh_print_info "Backing up logrotate configuration..." - -ynh_backup "/etc/logrotate.d/$app" - -#================================================= -# BACKUP SYSTEMD -#================================================= -ynh_print_info "Backing up systemd configuration..." - -ynh_backup "/etc/systemd/system/$app.service" - -#================================================= -# BACKUP A CRON FILE -#================================================= - -ynh_backup "/etc/cron.d/$app" - #================================================= # END OF SCRIPT #================================================= diff --git a/scripts/restore b/scripts/restore index d9035164..549039d4 100644 --- a/scripts/restore +++ b/scripts/restore @@ -14,10 +14,6 @@ source /usr/share/yunohost/helpers # MANAGE SCRIPT FAILURE #================================================= -ynh_clean_setup () { - #### Remove this function if there's nothing to clean before calling the remove script. - true -} # Exit if an error occurs during the execution of the script ynh_abort_if_errors @@ -72,13 +68,7 @@ ynh_system_user_create "$app" #================================================= # Restore permissions on app files -chown -R root: "$final_path" - -#================================================= -# RESTORE THE PHP-FPM CONFIGURATION -#================================================= - -ynh_restore_file "/etc/php/7.2/fpm/pool.d/$app.conf" +chown -R "$app": "$final_path" #================================================= # SPECIFIC RESTORATION @@ -88,10 +78,12 @@ ynh_restore_file "/etc/php/7.2/fpm/pool.d/$app.conf" ynh_print_info "Reinstalling dependencies..." # Define and install dependencies +ynh_install_php --phpversion="7.2" + ynh_install_app_dependencies "$pkg_dependencies" #================================================= -# RESTORE THE PostgreSQL DATABASE +# RESTORE THE POSTGRESQL DATABASE #================================================= ynh_print_info "Restoring the PostgreSQL database..." @@ -100,30 +92,10 @@ ynh_psql_create_db "$db_name" "$db_name" "$db_pwd" ynh_psql_execute_file_as_root ./db.sql "$db_name" #================================================= -# RESTORE SYSTEMD -#================================================= -ynh_print_info "Restoring the systemd configuration..." - -ynh_restore_file "/etc/systemd/system/$app.service" -systemctl enable "$app".service - -#================================================= -# ADVERTISE SERVICE IN ADMIN PANEL +# RESTORE THE PHP-FPM CONFIGURATION #================================================= -yunohost service add "$app" --log "/var/log/$app/$app.log" - -#================================================= -# RESTORE THE CRON FILE -#================================================= - -ynh_restore_file "/etc/cron.d/$app" - -#================================================= -# RESTORE THE LOGROTATE CONFIGURATION -#================================================= - -ynh_restore_file "/etc/logrotate.d/$app" +ynh_restore_file "/etc/php/7.2/fpm/pool.d/$app.conf" #================================================= # GENERIC FINALIZATION