From a925c085631f458968c3978215908f9919c0f51a Mon Sep 17 00:00:00 2001 From: yalh76 Date: Thu, 7 Jan 2021 20:10:33 +0100 Subject: [PATCH] Fix for stretch --- scripts/_common.sh | 6 ++++-- scripts/backup | 3 ++- scripts/install | 8 +++----- scripts/remove | 10 ++++++++++ scripts/restore | 5 ++++- scripts/upgrade | 3 ++- 6 files changed, 25 insertions(+), 10 deletions(-) diff --git a/scripts/_common.sh b/scripts/_common.sh index 8464ffd..93609c9 100644 --- a/scripts/_common.sh +++ b/scripts/_common.sh @@ -4,10 +4,12 @@ # COMMON VARIABLES #================================================= +# dependencies used by the app +pkg_dependencies="libawl-php" + YNH_PHP_VERSION="7.3" -# dependencies used by the app -pkg_dependencies="php${YNH_PHP_VERSION}-soap php${YNH_PHP_VERSION}-imap php${YNH_PHP_VERSION}-xsl php${YNH_PHP_VERSION}-curl libawl-php php${YNH_PHP_VERSION}-xml php${YNH_PHP_VERSION}-ldap php${YNH_PHP_VERSION}-cli php${YNH_PHP_VERSION}-mbstring php${YNH_PHP_VERSION}-memcached" +extra_php_dependencies="php${YNH_PHP_VERSION}-soap php${YNH_PHP_VERSION}-imap php${YNH_PHP_VERSION}-xsl php${YNH_PHP_VERSION}-curl php${YNH_PHP_VERSION}-xml php${YNH_PHP_VERSION}-ldap php${YNH_PHP_VERSION}-cli php${YNH_PHP_VERSION}-mbstring php${YNH_PHP_VERSION}-memcached" #================================================= # PERSONAL HELPERS diff --git a/scripts/backup b/scripts/backup index e0c5f29..89a96c0 100755 --- a/scripts/backup +++ b/scripts/backup @@ -13,7 +13,6 @@ source /usr/share/yunohost/helpers #================================================= # MANAGE SCRIPT FAILURE #================================================= -ynh_print_info --message="Managing script failure..." ynh_clean_setup () { true @@ -63,6 +62,8 @@ ynh_backup --src_path="/etc/nginx/conf.d/$domain.d/$app.conf" ynh_backup --src_path="/etc/php/$phpversion/fpm/pool.d/$app.conf" +#================================================= +# SPECIFIC BACKUP #================================================= # BACKUP LOGROTATE #================================================= diff --git a/scripts/install b/scripts/install index 0d3975f..df26e45 100755 --- a/scripts/install +++ b/scripts/install @@ -12,7 +12,6 @@ source /usr/share/yunohost/helpers #================================================= # MANAGE SCRIPT FAILURE #================================================= -ynh_print_info --message="Managing script failure..." ynh_clean_setup () { true @@ -23,7 +22,6 @@ ynh_abort_if_errors #================================================= # RETRIEVE ARGUMENTS FROM THE MANIFEST #================================================= -ynh_script_progression --message="Retrieving arguments from the manifest..." domain=$YNH_APP_ARG_DOMAIN path_url="/Microsoft-Server-ActiveSync" @@ -49,11 +47,10 @@ ynh_webpath_register --app=$app --domain=$domain --path_url=$path_url #================================================= # STORE SETTINGS FROM MANIFEST #================================================= -ynh_print_info --message="Storing installation settings..." +ynh_script_progression --message="Storing installation settings..." ynh_app_setting_set --app=$app --key=domain --value=$domain ynh_app_setting_set --app=$app --key=path --value=$path_url - ynh_app_setting_set --app=$app --key=statedir --value="$statedir" ynh_app_setting_set --app=$app --key=final_logpath --value="$final_logpath" @@ -101,7 +98,8 @@ ynh_system_user_create --username=$app ynh_script_progression --message="Configuring PHP-FPM..." # Create a dedicated php-fpm config -ynh_add_fpm_config +ynh_add_fpm_config --usage=low --footprint=low --package="$extra_php_dependencies" +phpversion=$(ynh_app_setting_get --app=$app --key=phpversion) #================================================= # SPECIFIC SETUP diff --git a/scripts/remove b/scripts/remove index f351894..a107d11 100755 --- a/scripts/remove +++ b/scripts/remove @@ -74,6 +74,16 @@ ynh_script_progression --message="Removing statedir and final_logpath..." ynh_secure_remove --file="$statedir" ynh_secure_remove --file="$final_logpath" +#================================================= +# GENERIC FINALIZATION +#================================================= +# REMOVE DEDICATED USER +#================================================= +ynh_script_progression --message="Removing the dedicated system user..." + +# Delete a system user +ynh_system_user_delete --username=$app + #================================================= # END OF SCRIPT #================================================= diff --git a/scripts/restore b/scripts/restore index 6239337..af5ec35 100755 --- a/scripts/restore +++ b/scripts/restore @@ -13,7 +13,7 @@ source /usr/share/yunohost/helpers #================================================= # MANAGE SCRIPT FAILURE #================================================= -ynh_print_info --message="Managing script failure..." +ynh_script_progression --message="Managing script failure..." ynh_clean_setup () { true @@ -92,6 +92,9 @@ ynh_script_progression --message="Restoring PHP-FPM configuration..." ynh_restore_file --origin_path="/etc/php/$phpversion/fpm/pool.d/$app.conf" +# Recreate a dedicated php-fpm config +ynh_add_fpm_config --usage=low --footprint=low --package="$extra_php_dependencies" + #================================================= # SPECIFIC RESTORATION #================================================= diff --git a/scripts/upgrade b/scripts/upgrade index f248998..5622664 100755 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -123,7 +123,8 @@ ynh_system_user_create --username=$app ynh_script_progression --message="Upgrading PHP-FPM configuration..." # Create a dedicated php-fpm config -ynh_add_fpm_config +ynh_add_fpm_config --usage=low --footprint=low --package="$extra_php_dependencies" +phpversion=$(ynh_app_setting_get --app=$app --key=phpversion) #================================================= # SPECIFIC UPGRADE