From a735d5718c374d29cfe87c8a0190883e885b6a36 Mon Sep 17 00:00:00 2001 From: yalh76 Date: Sun, 31 Mar 2019 22:51:17 +0200 Subject: [PATCH 01/12] Cleanup script --- scripts/upgrade | 18 ------------------ 1 file changed, 18 deletions(-) diff --git a/scripts/upgrade b/scripts/upgrade index 843069f0..87a042b5 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -123,28 +123,10 @@ ynh_add_fpm_config # ... #================================================= -### Verify the checksum of a file, stored by `ynh_store_file_checksum` in the install script. -### And create a backup of this file if the checksum is different. So the file will be backed up if the admin had modified it. ynh_backup_if_checksum_is_different "$final_path/CONFIG_FILE" # Recalculate and store the checksum of the file for the next upgrade. ynh_store_file_checksum "$final_path/CONFIG_FILE" -#================================================= -# SETUP LOGROTATE -#================================================= -ynh_print_info "Upgrading logrotate configuration..." - -# Use logrotate to manage app-specific logfile(s) -ynh_use_logrotate --non-append - -#================================================= -# SETUP SYSTEMD -#================================================= -ynh_print_info "Upgrading systemd configuration..." - -# Create a dedicated systemd config -ynh_add_systemd_config - #================================================= # GENERIC FINALIZATION #================================================= From 6a36abe2a6bedc5b6dafe02bec1d1fb537df8209 Mon Sep 17 00:00:00 2001 From: yalh76 Date: Sun, 31 Mar 2019 23:09:51 +0200 Subject: [PATCH 02/12] Fix upgarde script --- scripts/upgrade | 36 ++++++++++++++++++++++++++++++++---- 1 file changed, 32 insertions(+), 4 deletions(-) diff --git a/scripts/upgrade b/scripts/upgrade index 87a042b5..8e9922ea 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -99,6 +99,8 @@ ynh_add_nginx_config #================================================= ynh_print_info "Upgrading dependencies..." +ynh_install_php --phpversion="7.2" + ynh_install_app_dependencies "$pkg_dependencies" #================================================= @@ -115,17 +117,43 @@ ynh_system_user_create "$app" ynh_print_info "Upgrading php-fpm configuration..." # Create a dedicated php-fpm config -ynh_add_fpm_config +ynh_add_fpm_config --phpversion="7.2" + +#Ugly move waiting 'ynh_add_fpm_config --phpversion='' released +mv -f "/etc/php/7.0/fpm/pool.d/$app.conf" "/etc/php/7.2/fpm/pool.d/$app.conf" +systemctl reload php7.0-fpm +systemctl reload php7.2-fpm #================================================= # SPECIFIC UPGRADE #================================================= -# ... +# INSTALL PHP DEPENDENCIES #================================================= +chown -R "$app": "$final_path" + +ynh_install_composer --workdir="$final_path" + +#================================================= +# DEPLOYMENT +#================================================= + +pushd "$final_path" + php7.2 artisan config:clear + php7.2 artisan config:cache + php7.2 artisan route:clear + php7.2 artisan route:cache + php7.2 artisan storage:link + php7.2 artisan migrate --force + php7.2 artisan update + php7.2 artisan horizon:purge +popd + + + ynh_backup_if_checksum_is_different "$final_path/CONFIG_FILE" # Recalculate and store the checksum of the file for the next upgrade. -ynh_store_file_checksum "$final_path/CONFIG_FILE" +ynh_store_file_checksum "$final_path/.env" #================================================= # GENERIC FINALIZATION @@ -134,7 +162,7 @@ ynh_store_file_checksum "$final_path/CONFIG_FILE" #================================================= # Set permissions on app files -chown -R root: "$final_path" +chown -R "$app": "$final_path" #================================================= # SETUP SSOWAT From 4073e76c1712b01f6555ce454a68f61bebaed5f9 Mon Sep 17 00:00:00 2001 From: yalh76 Date: Sun, 31 Mar 2019 23:15:34 +0200 Subject: [PATCH 03/12] Activate upgrade check --- check_process | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/check_process b/check_process index 8d6c7569..74293a75 100644 --- a/check_process +++ b/check_process @@ -9,7 +9,8 @@ setup_nourl=0 setup_private=0 setup_public=0 - upgrade=0 + upgrade=1 + upgrade=1 from_commit=a2549aa86776cf7a88c0be9c34c4de4cf348f8d3 backup_restore=1 multi_instance=0 incorrect_path=0 From e68231e80dbdcb51d596edf2adf49ebe22e74bbe Mon Sep 17 00:00:00 2001 From: yalh76 Date: Mon, 1 Apr 2019 00:47:40 +0200 Subject: [PATCH 04/12] fix php-fpm upgrade --- scripts/upgrade | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/scripts/upgrade b/scripts/upgrade index 8e9922ea..43e89c46 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -116,6 +116,10 @@ ynh_system_user_create "$app" #================================================= ynh_print_info "Upgrading php-fpm configuration..." +mv -f "/etc/php/7.2/fpm/pool.d/$app.conf" "/etc/php/7.0/fpm/pool.d/$app.conf" +systemctl reload php7.0-fpm +systemctl reload php7.2-fpm + # Create a dedicated php-fpm config ynh_add_fpm_config --phpversion="7.2" From 2b661d3e2e1875f5b53f2be999440e4c6f2ca44c Mon Sep 17 00:00:00 2001 From: yalh76 Date: Mon, 1 Apr 2019 01:16:05 +0200 Subject: [PATCH 05/12] remove upgrade from non working version --- check_process | 1 - 1 file changed, 1 deletion(-) diff --git a/check_process b/check_process index 74293a75..45e5c5e6 100644 --- a/check_process +++ b/check_process @@ -10,7 +10,6 @@ setup_private=0 setup_public=0 upgrade=1 - upgrade=1 from_commit=a2549aa86776cf7a88c0be9c34c4de4cf348f8d3 backup_restore=1 multi_instance=0 incorrect_path=0 From ec26cf58e131843eb2325c7a571b53de4413a471 Mon Sep 17 00:00:00 2001 From: yalh76 Date: Mon, 1 Apr 2019 02:54:54 +0200 Subject: [PATCH 06/12] fix php-fpm --- scripts/install | 5 ++--- scripts/remove | 9 ++++----- scripts/upgrade | 13 +++---------- 3 files changed, 9 insertions(+), 18 deletions(-) diff --git a/scripts/install b/scripts/install index 4c263969..ef9b9e32 100644 --- a/scripts/install +++ b/scripts/install @@ -106,9 +106,8 @@ ynh_print_info "Configuring php-fpm..." # Create a dedicated php-fpm config ynh_add_fpm_config --phpversion="7.2" -#Ugly move waiting 'ynh_add_fpm_config --phpversion='' released -mv "/etc/php/7.0/fpm/pool.d/$app.conf" "/etc/php/7.2/fpm/pool.d/$app.conf" -systemctl reload php7.0-fpm +#Workaround waiting 'ynh_add_fpm_config --phpversion='' released +cp "/etc/php/7.0/fpm/pool.d/$app.conf" "/etc/php/7.2/fpm/pool.d/$app.conf" systemctl reload php7.2-fpm #================================================= diff --git a/scripts/remove b/scripts/remove index 5784d04e..7bea232a 100644 --- a/scripts/remove +++ b/scripts/remove @@ -47,14 +47,13 @@ ynh_remove_nginx_config #================================================= ynh_print_info "Removing php-fpm configuration" -#Ugly move waiting 'ynh_add_fpm_config --phpversion='' released -mv "/etc/php/7.2/fpm/pool.d/$app.conf" "/etc/php/7.0/fpm/pool.d/$app.conf" -systemctl reload php7.2-fpm -systemctl reload php7.0-fpm - # Remove the dedicated php-fpm config ynh_remove_fpm_config +#Workaround waiting 'ynh_add_fpm_config --phpversion='' released +ynh_secure_remove "/etc/php/7.2/fpm/pool.d/$app.conf" +systemctl reload php7.2-fpm + #================================================= # REMOVE DEPENDENCIES #================================================= diff --git a/scripts/upgrade b/scripts/upgrade index 43e89c46..a8299a8f 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -116,16 +116,11 @@ ynh_system_user_create "$app" #================================================= ynh_print_info "Upgrading php-fpm configuration..." -mv -f "/etc/php/7.2/fpm/pool.d/$app.conf" "/etc/php/7.0/fpm/pool.d/$app.conf" -systemctl reload php7.0-fpm -systemctl reload php7.2-fpm - # Create a dedicated php-fpm config ynh_add_fpm_config --phpversion="7.2" -#Ugly move waiting 'ynh_add_fpm_config --phpversion='' released -mv -f "/etc/php/7.0/fpm/pool.d/$app.conf" "/etc/php/7.2/fpm/pool.d/$app.conf" -systemctl reload php7.0-fpm +#Workaround waiting 'ynh_add_fpm_config --phpversion='' released +cp -f "/etc/php/7.0/fpm/pool.d/$app.conf" "/etc/php/7.2/fpm/pool.d/$app.conf" systemctl reload php7.2-fpm #================================================= @@ -153,9 +148,7 @@ pushd "$final_path" php7.2 artisan horizon:purge popd - - -ynh_backup_if_checksum_is_different "$final_path/CONFIG_FILE" +ynh_backup_if_checksum_is_different "$final_path/.env" # Recalculate and store the checksum of the file for the next upgrade. ynh_store_file_checksum "$final_path/.env" From bb89459f9148e1ada7a188bd61af3beb2c3d7bb5 Mon Sep 17 00:00:00 2001 From: yalh76 Date: Mon, 1 Apr 2019 06:12:43 +0200 Subject: [PATCH 07/12] Revert "fix php-fpm" This reverts commit ec26cf58e131843eb2325c7a571b53de4413a471. --- scripts/install | 5 +++-- scripts/remove | 9 +++++---- scripts/upgrade | 13 ++++++++++--- 3 files changed, 18 insertions(+), 9 deletions(-) diff --git a/scripts/install b/scripts/install index ef9b9e32..4c263969 100644 --- a/scripts/install +++ b/scripts/install @@ -106,8 +106,9 @@ ynh_print_info "Configuring php-fpm..." # Create a dedicated php-fpm config ynh_add_fpm_config --phpversion="7.2" -#Workaround waiting 'ynh_add_fpm_config --phpversion='' released -cp "/etc/php/7.0/fpm/pool.d/$app.conf" "/etc/php/7.2/fpm/pool.d/$app.conf" +#Ugly move waiting 'ynh_add_fpm_config --phpversion='' released +mv "/etc/php/7.0/fpm/pool.d/$app.conf" "/etc/php/7.2/fpm/pool.d/$app.conf" +systemctl reload php7.0-fpm systemctl reload php7.2-fpm #================================================= diff --git a/scripts/remove b/scripts/remove index 7bea232a..5784d04e 100644 --- a/scripts/remove +++ b/scripts/remove @@ -47,13 +47,14 @@ ynh_remove_nginx_config #================================================= ynh_print_info "Removing php-fpm configuration" +#Ugly move waiting 'ynh_add_fpm_config --phpversion='' released +mv "/etc/php/7.2/fpm/pool.d/$app.conf" "/etc/php/7.0/fpm/pool.d/$app.conf" +systemctl reload php7.2-fpm +systemctl reload php7.0-fpm + # Remove the dedicated php-fpm config ynh_remove_fpm_config -#Workaround waiting 'ynh_add_fpm_config --phpversion='' released -ynh_secure_remove "/etc/php/7.2/fpm/pool.d/$app.conf" -systemctl reload php7.2-fpm - #================================================= # REMOVE DEPENDENCIES #================================================= diff --git a/scripts/upgrade b/scripts/upgrade index a8299a8f..43e89c46 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -116,11 +116,16 @@ ynh_system_user_create "$app" #================================================= ynh_print_info "Upgrading php-fpm configuration..." +mv -f "/etc/php/7.2/fpm/pool.d/$app.conf" "/etc/php/7.0/fpm/pool.d/$app.conf" +systemctl reload php7.0-fpm +systemctl reload php7.2-fpm + # Create a dedicated php-fpm config ynh_add_fpm_config --phpversion="7.2" -#Workaround waiting 'ynh_add_fpm_config --phpversion='' released -cp -f "/etc/php/7.0/fpm/pool.d/$app.conf" "/etc/php/7.2/fpm/pool.d/$app.conf" +#Ugly move waiting 'ynh_add_fpm_config --phpversion='' released +mv -f "/etc/php/7.0/fpm/pool.d/$app.conf" "/etc/php/7.2/fpm/pool.d/$app.conf" +systemctl reload php7.0-fpm systemctl reload php7.2-fpm #================================================= @@ -148,7 +153,9 @@ pushd "$final_path" php7.2 artisan horizon:purge popd -ynh_backup_if_checksum_is_different "$final_path/.env" + + +ynh_backup_if_checksum_is_different "$final_path/CONFIG_FILE" # Recalculate and store the checksum of the file for the next upgrade. ynh_store_file_checksum "$final_path/.env" From 7b3a3e78927701a055876c5ae4cfbc11d2861786 Mon Sep 17 00:00:00 2001 From: yalh76 Date: Mon, 1 Apr 2019 06:17:25 +0200 Subject: [PATCH 08/12] Fix php-fpm --- scripts/upgrade | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/upgrade b/scripts/upgrade index 43e89c46..4e1d2624 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -117,8 +117,8 @@ ynh_system_user_create "$app" ynh_print_info "Upgrading php-fpm configuration..." mv -f "/etc/php/7.2/fpm/pool.d/$app.conf" "/etc/php/7.0/fpm/pool.d/$app.conf" -systemctl reload php7.0-fpm systemctl reload php7.2-fpm +systemctl reload php7.0-fpm # Create a dedicated php-fpm config ynh_add_fpm_config --phpversion="7.2" From 8f7e97629b685ea24757d937874fb85c4c2bc5b5 Mon Sep 17 00:00:00 2001 From: yalh76 Date: Mon, 1 Apr 2019 07:30:55 +0200 Subject: [PATCH 09/12] Update php-fpm upgrade --- scripts/upgrade | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/scripts/upgrade b/scripts/upgrade index 4e1d2624..8883b7f8 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -116,7 +116,8 @@ ynh_system_user_create "$app" #================================================= ynh_print_info "Upgrading php-fpm configuration..." -mv -f "/etc/php/7.2/fpm/pool.d/$app.conf" "/etc/php/7.0/fpm/pool.d/$app.conf" +#Ugly move waiting 'ynh_add_fpm_config --phpversion='' released +mv "/etc/php/7.2/fpm/pool.d/$app.conf" "/etc/php/7.0/fpm/pool.d/$app.conf" systemctl reload php7.2-fpm systemctl reload php7.0-fpm @@ -124,7 +125,7 @@ systemctl reload php7.0-fpm ynh_add_fpm_config --phpversion="7.2" #Ugly move waiting 'ynh_add_fpm_config --phpversion='' released -mv -f "/etc/php/7.0/fpm/pool.d/$app.conf" "/etc/php/7.2/fpm/pool.d/$app.conf" +mv "/etc/php/7.0/fpm/pool.d/$app.conf" "/etc/php/7.2/fpm/pool.d/$app.conf" systemctl reload php7.0-fpm systemctl reload php7.2-fpm From 924d805b4cf96c6c34b485c3dbe5ebf8d4707611 Mon Sep 17 00:00:00 2001 From: yalh76 Date: Mon, 1 Apr 2019 19:53:50 +0200 Subject: [PATCH 10/12] Fix php-fpm --- scripts/remove | 8 ++++++++ scripts/upgrade | 6 ++++-- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/scripts/remove b/scripts/remove index 5784d04e..f8bd8478 100644 --- a/scripts/remove +++ b/scripts/remove @@ -82,6 +82,14 @@ ynh_print_info "Removing the dedicated system user" # Delete a system user ynh_system_user_delete "$app" +#================================================= +# START PHP-FPM 7.0 FPM +#================================================= +ynh_print_info "Start php7.0-fpm" + +#Sometimes with package_check php7.0-fpm fail to reload and stop. So starting the service, just in case. +systemctl start php7.0-fpm + #================================================= # END OF SCRIPT #================================================= diff --git a/scripts/upgrade b/scripts/upgrade index 8883b7f8..ba7bb706 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -117,7 +117,8 @@ ynh_system_user_create "$app" ynh_print_info "Upgrading php-fpm configuration..." #Ugly move waiting 'ynh_add_fpm_config --phpversion='' released -mv "/etc/php/7.2/fpm/pool.d/$app.conf" "/etc/php/7.0/fpm/pool.d/$app.conf" +mv -f "/etc/php/7.2/fpm/pool.d/$app.conf" "/etc/php/7.0/fpm/pool.d/$app.conf" +sleep 5 systemctl reload php7.2-fpm systemctl reload php7.0-fpm @@ -125,7 +126,8 @@ systemctl reload php7.0-fpm ynh_add_fpm_config --phpversion="7.2" #Ugly move waiting 'ynh_add_fpm_config --phpversion='' released -mv "/etc/php/7.0/fpm/pool.d/$app.conf" "/etc/php/7.2/fpm/pool.d/$app.conf" +mv -f "/etc/php/7.0/fpm/pool.d/$app.conf" "/etc/php/7.2/fpm/pool.d/$app.conf" +sleep 5 systemctl reload php7.0-fpm systemctl reload php7.2-fpm From 23b328182ca8f0c6d9fd0614fae6b1a7408ee65e Mon Sep 17 00:00:00 2001 From: yalh76 Date: Mon, 1 Apr 2019 19:55:18 +0200 Subject: [PATCH 11/12] Change version number --- manifest.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/manifest.json b/manifest.json index 7bec3d1c..e49f9740 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~ynh3", "url": "https://pixelfed.org/", "license": "AGPL-3.0-or-later", "maintainer": { From 96c861040c0e2a1cfbcb52b44e5017666452a427 Mon Sep 17 00:00:00 2001 From: yalh76 Date: Mon, 1 Apr 2019 21:52:18 +0200 Subject: [PATCH 12/12] Activate additional features --- check_process | 8 ++++---- manifest.json | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/check_process b/check_process index 45e5c5e6..f753394d 100644 --- a/check_process +++ b/check_process @@ -7,12 +7,12 @@ setup_sub_dir=0 setup_root=1 setup_nourl=0 - setup_private=0 - setup_public=0 + setup_private=1 + setup_public=1 upgrade=1 backup_restore=1 - multi_instance=0 - incorrect_path=0 + multi_instance=1 + incorrect_path=1 port_already_use=0 change_url=0 ;;; Levels diff --git a/manifest.json b/manifest.json index e49f9740..7731889c 100644 --- a/manifest.json +++ b/manifest.json @@ -13,9 +13,9 @@ "email": "jean-baptiste@holcroft.fr" }, "requirements": { - "yunohost": ">= 3.0.0" + "yunohost": ">= 3.4" }, - "multi_instance": false, + "multi_instance": true, "services": [ "nginx" ],