From 78c1776113f39a2955095da0760960fda96decdf Mon Sep 17 00:00:00 2001 From: yalh76 Date: Sun, 31 Mar 2019 21:28:40 +0200 Subject: [PATCH 1/7] backup script cleanup --- scripts/backup | 28 +--------------------------- 1 file changed, 1 insertion(+), 27 deletions(-) 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 #================================================= From 734cf8778f074d4f44b0487a3e4a5aed99e71ab9 Mon Sep 17 00:00:00 2001 From: yalh76 Date: Sun, 31 Mar 2019 21:30:19 +0200 Subject: [PATCH 2/7] restore script cleanup --- scripts/restore | 32 +------------------------------- 1 file changed, 1 insertion(+), 31 deletions(-) diff --git a/scripts/restore b/scripts/restore index d9035164..9696c169 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 @@ -91,7 +87,7 @@ ynh_print_info "Reinstalling dependencies..." ynh_install_app_dependencies "$pkg_dependencies" #================================================= -# RESTORE THE PostgreSQL DATABASE +# RESTORE THE POSTGRESQL DATABASE #================================================= ynh_print_info "Restoring the PostgreSQL database..." @@ -99,32 +95,6 @@ ynh_psql_test_if_first_run 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 -#================================================= - -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" - #================================================= # GENERIC FINALIZATION #================================================= From e8f8164a3ca05545495bd5b9e651b265281ceffc Mon Sep 17 00:00:00 2001 From: yalh76 Date: Sun, 31 Mar 2019 21:31:36 +0200 Subject: [PATCH 3/7] Fix final_path owner --- scripts/restore | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/restore b/scripts/restore index 9696c169..99761488 100644 --- a/scripts/restore +++ b/scripts/restore @@ -68,7 +68,7 @@ ynh_system_user_create "$app" #================================================= # Restore permissions on app files -chown -R root: "$final_path" +chown -R "$app": "$final_path" #================================================= # RESTORE THE PHP-FPM CONFIGURATION From fe44c98eaac2eab429daafaf86143211adae27e3 Mon Sep 17 00:00:00 2001 From: yalh76 Date: Sun, 31 Mar 2019 21:32:15 +0200 Subject: [PATCH 4/7] Add PHP installation --- scripts/restore | 2 ++ 1 file changed, 2 insertions(+) diff --git a/scripts/restore b/scripts/restore index 99761488..38b43353 100644 --- a/scripts/restore +++ b/scripts/restore @@ -84,6 +84,8 @@ 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" #================================================= From 3b95413fa0fbef84ea82ff23f8a060e54e75c391 Mon Sep 17 00:00:00 2001 From: yalh76 Date: Sun, 31 Mar 2019 21:33:18 +0200 Subject: [PATCH 5/7] move php+fpm restoration after php installation --- scripts/restore | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/scripts/restore b/scripts/restore index 38b43353..549039d4 100644 --- a/scripts/restore +++ b/scripts/restore @@ -70,12 +70,6 @@ ynh_system_user_create "$app" # Restore permissions on app files chown -R "$app": "$final_path" -#================================================= -# RESTORE THE PHP-FPM CONFIGURATION -#================================================= - -ynh_restore_file "/etc/php/7.2/fpm/pool.d/$app.conf" - #================================================= # SPECIFIC RESTORATION #================================================= @@ -97,6 +91,12 @@ ynh_psql_test_if_first_run ynh_psql_create_db "$db_name" "$db_name" "$db_pwd" ynh_psql_execute_file_as_root ./db.sql "$db_name" +#================================================= +# RESTORE THE PHP-FPM CONFIGURATION +#================================================= + +ynh_restore_file "/etc/php/7.2/fpm/pool.d/$app.conf" + #================================================= # GENERIC FINALIZATION #================================================= From 03ed439e003498d84a7419824c09c3b2dfc57b89 Mon Sep 17 00:00:00 2001 From: yalh76 Date: Sun, 31 Mar 2019 21:48:23 +0200 Subject: [PATCH 6/7] Activate backup_restore check --- check_process | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 From cbe4796a5629514a61757def9ae71852c2af30bd Mon Sep 17 00:00:00 2001 From: yalh76 Date: Mon, 1 Apr 2019 18:18:37 +0200 Subject: [PATCH 7/7] Update version number --- manifest.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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": {