From 003a99da89f3912360e8d9b1b842dd00732c45da Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89ric=20Gaspar?= <46165813+ericgaspar@users.noreply.github.com> Date: Fri, 24 Feb 2023 20:14:15 +0100 Subject: [PATCH] Fix --- manifest.json | 2 +- scripts/_common.sh | 6 ++++-- scripts/install | 9 ++++++++- scripts/remove | 8 ++++++++ scripts/restore | 10 +++++++++- scripts/upgrade | 9 ++++++++- 6 files changed, 38 insertions(+), 6 deletions(-) diff --git a/manifest.json b/manifest.json index 2ba200b..2db64a4 100644 --- a/manifest.json +++ b/manifest.json @@ -21,7 +21,7 @@ "email": "liberodark@gmail.com" }, "requirements": { - "yunohost": ">= 4.3.0" + "yunohost": ">= 11.0.9" }, "multi_instance": true, "services": [ diff --git a/scripts/_common.sh b/scripts/_common.sh index 7079161..1042bd9 100644 --- a/scripts/_common.sh +++ b/scripts/_common.sh @@ -4,9 +4,11 @@ # COMMON VARIABLES #================================================= -YNH_PHP_VERSION="7.3" +YNH_PHP_VERSION="7.4" -extra_php_dependencies="php${YNH_PHP_VERSION}-mysql php${YNH_PHP_VERSION}-gd" +php_dependencies="php${YNH_PHP_VERSION}-mysql php${YNH_PHP_VERSION}-gd" + +pkg_dependencies="$php_dependencies" #================================================= # PERSONAL HELPERS diff --git a/scripts/install b/scripts/install index 43ba35a..b8a32a5 100644 --- a/scripts/install +++ b/scripts/install @@ -55,6 +55,13 @@ ynh_script_progression --message="Finding an available port..." --weight=1 port=$(ynh_find_port --port=8095) ynh_app_setting_set --app=$app --key=port --value=$port +#================================================= +# INSTALL DEPENDENCIES +#================================================= +ynh_script_progression --message="Installing dependencies..." --weight=1 + +ynh_install_app_dependencies $pkg_dependencies + #================================================= # CREATE DEDICATED USER #================================================= @@ -100,7 +107,7 @@ ynh_add_nginx_config ynh_script_progression --message="Configuring PHP-FPM..." --weight=3 # Create a dedicated PHP-FPM config -ynh_add_fpm_config --package="$extra_php_dependencies" +ynh_add_fpm_config phpversion=$(ynh_app_setting_get --app=$app --key=phpversion) #================================================= diff --git a/scripts/remove b/scripts/remove index 9c7ee4c..0581050 100644 --- a/scripts/remove +++ b/scripts/remove @@ -54,6 +54,14 @@ ynh_script_progression --message="Removing PHP-FPM configuration..." --weight=1 # Remove the dedicated PHP-FPM config ynh_remove_fpm_config +#================================================= +# REMOVE DEPENDENCIES +#================================================= +ynh_script_progression --message="Removing dependencies..." --weight=1 + +# Remove metapackage and its dependencies +ynh_remove_app_dependencies + #================================================= # GENERIC FINALIZATION #================================================= diff --git a/scripts/restore b/scripts/restore index 6bec0d9..7d95606 100644 --- a/scripts/restore +++ b/scripts/restore @@ -67,6 +67,14 @@ chmod 750 "$final_path" chmod -R o-rwx "$final_path" chown -R $app:www-data "$final_path" +#================================================= +# REINSTALL DEPENDENCIES +#================================================= +ynh_script_progression --message="Reinstalling dependencies..." --weight=1 + +# Define and install dependencies +ynh_install_app_dependencies $pkg_dependencies + #================================================= # RESTORE THE PHP-FPM CONFIGURATION #================================================= @@ -74,7 +82,7 @@ ynh_script_progression --message="Restoring the PHP-FPM configuration..." --weig ynh_restore_file --origin_path="/etc/php/$phpversion/fpm/pool.d/$app.conf" -ynh_add_fpm_config --package="$extra_php_dependencies" +ynh_add_fpm_config #================================================= # RESTORE THE MYSQL DATABASE diff --git a/scripts/upgrade b/scripts/upgrade index 6dff00a..2dead6c 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -78,6 +78,13 @@ chmod 750 "$final_path" chmod -R o-rwx "$final_path" chown -R $app:www-data "$final_path" +#================================================= +# UPGRADE DEPENDENCIES +#================================================= +ynh_script_progression --message="Upgrading dependencies..." --weight=1 + +ynh_install_app_dependencies $pkg_dependencies + #================================================= # NGINX CONFIGURATION #================================================= @@ -92,7 +99,7 @@ ynh_add_nginx_config ynh_script_progression --message="Upgrading PHP-FPM configuration..." --weight=1 # Create a dedicated PHP-FPM config -ynh_add_fpm_config --package="$extra_php_dependencies" +ynh_add_fpm_config #================================================= # RELOAD NGINX