diff --git a/check_process b/check_process index 8d6c7569..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 - upgrade=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 2dfbb7d8..7731889c 100644 --- a/manifest.json +++ b/manifest.json @@ -5,7 +5,7 @@ "description": { "en": "ActivityPub Federated Image Sharing" }, - "version": "0.8.4~ynh2", + "version": "0.8.4~ynh3", "url": "https://pixelfed.org/", "license": "AGPL-3.0-or-later", "maintainer": { @@ -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" ], 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 843069f0..ba7bb706 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" #================================================= @@ -114,36 +116,51 @@ ynh_system_user_create "$app" #================================================= ynh_print_info "Upgrading php-fpm configuration..." +#Ugly move waiting 'ynh_add_fpm_config --phpversion='' released +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 + # 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" +sleep 5 +systemctl reload php7.0-fpm +systemctl reload php7.2-fpm #================================================= # SPECIFIC UPGRADE #================================================= -# ... +# INSTALL PHP DEPENDENCIES #================================================= -### 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. +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" - -#================================================= -# 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 +ynh_store_file_checksum "$final_path/.env" #================================================= # GENERIC FINALIZATION @@ -152,7 +169,7 @@ ynh_add_systemd_config #================================================= # Set permissions on app files -chown -R root: "$final_path" +chown -R "$app": "$final_path" #================================================= # SETUP SSOWAT