From c4eeab7e7e7e6483fcd760f4e427da602214f652 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?E=CC=81ric=20Gaspar?= <46165813+ericgaspar@users.noreply.github.com> Date: Fri, 15 Sep 2023 13:46:10 +0200 Subject: [PATCH] v2 --- manifest.toml | 6 +++--- scripts/install | 11 +---------- scripts/remove | 5 ----- scripts/restore | 25 +++++++------------------ scripts/upgrade | 8 +------- 5 files changed, 12 insertions(+), 43 deletions(-) diff --git a/manifest.toml b/manifest.toml index a7fa07a..5d64846 100644 --- a/manifest.toml +++ b/manifest.toml @@ -16,7 +16,7 @@ admindoc = "https://github.com/roundcube/roundcubemail/wiki" code = "https://github.com/roundcube/roundcubemail" [integration] -yunohost = ">= 11.1.19" +yunohost = ">= 11.2" architectures = "all" multi_instance = true ldap = true @@ -36,7 +36,7 @@ ram.runtime = "50M" [install.language] ask.en = "Choose the application language" ask.fr = "Choisissez la langue de l'application" - type = "string" + type = "select" choices = ["de_DE", "en_GB", "fr_FR", "it_IT"] default = "en_GB" @@ -60,7 +60,7 @@ ram.runtime = "50M" main.url = "/" [resources.apt] - packages = "mariadb-server php-pear php8.1-ldap php8.1-mysql php8.1-json php8.1-cli php8.1-intl php8.1-zip php8.1-gd php8.1-mbstring php8.1-dom php8.1-curl" + packages = "mariadb-server, php-pear, php8.2-ldap, php8.1-mysql, php8.1-cli, php8.1-intl, php8.1-zip, php8.1-gd, php8.1-mbstring, php8.1-dom, php8.1-curl" [resources.database] type = "mysql" diff --git a/scripts/install b/scripts/install index 33b195a..e8eb9dd 100644 --- a/scripts/install +++ b/scripts/install @@ -22,8 +22,6 @@ fpm_usage="low" #================================================= ynh_script_progression --message="Storing installation settings..." --weight=2 -ynh_app_setting_set --app=$app --key=with_carddav --value=$with_carddav -ynh_app_setting_set --app=$app --key=language --value=$language ynh_app_setting_set --app=$app --key=fpm_footprint --value=$fpm_footprint ynh_app_setting_set --app=$app --key=fpm_free_footprint --value=$fpm_free_footprint ynh_app_setting_set --app=$app --key=fpm_usage --value=$fpm_usage @@ -36,7 +34,6 @@ ynh_script_progression --message="Setting up source files..." --weight=7 # Download, check integrity, uncompress and patch the source from app.src ynh_setup_source --dest_dir="$install_dir" -chmod 750 "$install_dir" chmod -R o-rwx "$install_dir" chown -R $app:www-data "$install_dir" @@ -48,11 +45,6 @@ ynh_script_progression --message="Configuring NGINX web server..." --weight=2 # Create a dedicated NGINX config ynh_add_nginx_config -#================================================= -# PHP-FPM CONFIGURATION -#================================================= -ynh_script_progression --message="Configuring PHP-FPM..." --weight=2 - # Create a dedicated php-fpm config ynh_add_fpm_config --usage=$fpm_usage --footprint=$fpm_footprint @@ -74,8 +66,7 @@ ynh_install_composer #================================================= ynh_script_progression --message="Initializing database..." --weight=3 -ynh_mysql_connect_as --user="$db_user" --password="$db_pwd" --database="$db_name" \ - < "$install_dir/SQL/mysql.initial.sql" +ynh_mysql_connect_as --user="$db_user" --password="$db_pwd" --database="$db_name" < "$install_dir/SQL/mysql.initial.sql" #================================================= # CONFIGURE ROUNDCUBE diff --git a/scripts/remove b/scripts/remove index 0900108..4fb7e3c 100644 --- a/scripts/remove +++ b/scripts/remove @@ -17,11 +17,6 @@ ynh_script_progression --message="Removing NGINX web server configuration..." -- # Remove the dedicated NGINX config ynh_remove_nginx_config -#================================================= -# REMOVE PHP-FPM CONFIGURATION -#================================================= -ynh_script_progression --message="Removing PHP-FPM configuration..." --weight=3 - # Remove the dedicated PHP-FPM config ynh_remove_fpm_config diff --git a/scripts/restore b/scripts/restore index dd187b0..e87c0a6 100644 --- a/scripts/restore +++ b/scripts/restore @@ -16,10 +16,16 @@ ynh_script_progression --message="Restoring $app main directory..." --weight=4 ynh_restore_file --origin_path="$install_dir" -chmod 750 "$install_dir" chmod -R o-rwx "$install_dir" chown -R $app:www-data "$install_dir" +#================================================= +# RESTORE THE MYSQL DATABASE +#================================================= +ynh_script_progression --message="Restoring the MySQL database..." --weight=5 + +ynh_mysql_connect_as --user=$db_user --password=$db_pwd --database=$db_name < ./db.sql + #================================================= # RESTORE THE PHP-FPM CONFIGURATION #================================================= @@ -27,25 +33,8 @@ ynh_script_progression --message="Restoring the PHP-FPM configuration..." --weig ynh_restore_file --origin_path="/etc/php/$phpversion/fpm/pool.d/$app.conf" -# Recreate a dedicated php-fpm config -ynh_add_fpm_config --usage=$fpm_usage --footprint=$fpm_footprint --phpversion=$phpversion - -#================================================= -# RESTORE THE NGINX CONFIGURATION -#================================================= -ynh_script_progression --message="Restoring the NGINX web server configuration..." --weight=1 - ynh_restore_file --origin_path="/etc/nginx/conf.d/$domain.d/$app.conf" -#================================================= -# SPECIFIC RESTORATION -#================================================= -# RESTORE THE MYSQL DATABASE -#================================================= -ynh_script_progression --message="Restoring the MySQL database..." --weight=5 - -ynh_mysql_connect_as --user=$db_user --password=$db_pwd --database=$db_name < ./db.sql - #================================================= # GENERIC FINALIZATION #================================================= diff --git a/scripts/upgrade b/scripts/upgrade index f6fec20..dc4c03f 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -72,7 +72,6 @@ then ynh_setup_source --dest_dir="$install_dir" fi -chmod 750 "$install_dir" chmod -R o-rwx "$install_dir" chown -R $app:www-data "$install_dir" @@ -82,12 +81,7 @@ chown -R $app:www-data "$install_dir" ynh_script_progression --message="Upgrading PHP-FPM configuration..." --weight=5 # Create a dedicated PHP-FPM config -ynh_add_fpm_config --phpversion=$phpversion --usage=$fpm_usage --footprint=$fpm_footprint - -#================================================= -# NGINX CONFIGURATION -#================================================= -ynh_script_progression --message="Upgrading NGINX web server configuration..." --weight=1 +ynh_add_fpm_config --usage=$fpm_usage --footprint=$fpm_footprint # Create a dedicated NGINX config ynh_add_nginx_config