From 34a786ab1ee7c4705be02ea3f493956f07782ffc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?E=CC=81ric=20Gaspar?= <46165813+ericgaspar@users.noreply.github.com> Date: Tue, 26 Sep 2023 10:29:33 +0200 Subject: [PATCH] cleaning --- manifest.toml | 4 ++-- scripts/install | 13 ++++--------- scripts/remove | 4 ++-- scripts/restore | 2 +- scripts/upgrade | 15 +++++---------- 5 files changed, 14 insertions(+), 24 deletions(-) diff --git a/manifest.toml b/manifest.toml index 8a0cd4f..4516a79 100644 --- a/manifest.toml +++ b/manifest.toml @@ -22,7 +22,7 @@ multi_instance = true ldap = false sso = false disk = "50M" -ram.build = "50M" +ram.build = "200M" ram.runtime = "50M" [install] @@ -51,7 +51,7 @@ ram.runtime = "50M" main.url = "/" [resources.apt] - packages = "mariadb-server, php8.0-cli,php8.0-curl, php8.0-fileinfo, php8.0-gd, php8.0-mbstring, php8.0-mysqli, php8.0-simplexml, php8.0-xml, php8.0-intl, php8.0-ldap, php8.0-xmlrpc, php8.0-bz2, php8.0-zip" + packages = "mariadb-server, php8.2-cli,php8.2-curl, php8.2-fileinfo, php8.2-gd, php8.2-mbstring, php8.2-mysqli, php8.2-simplexml, php8.2-xml, php8.2-intl, php8.2-ldap, php8.2-xmlrpc, php8.2-bz2, php8.2-zip" [resources.database] type = "mysql" diff --git a/scripts/install b/scripts/install index 66ed3ca..10bb889 100644 --- a/scripts/install +++ b/scripts/install @@ -21,9 +21,9 @@ chmod -R o-rwx "$install_dir" chown -R $app:www-data "$install_dir" #================================================= -# PHP-FPM CONFIGURATION +# SYSTEM CONFIGURATION #================================================= -ynh_script_progression --message="Configuring PHP-FPM..." --weight=1 +ynh_script_progression --message="Adding system configurations related to $app..." --weight=1 # Create a dedicated PHP-FPM config ynh_add_fpm_config @@ -31,6 +31,8 @@ ynh_add_fpm_config # Create a dedicated NGINX config ynh_add_nginx_config +ynh_add_config --template="../conf/cron" --destination="/etc/cron.d/$app" + #================================================= # SPECIFIC SETUP #================================================= @@ -43,13 +45,6 @@ pushd $install_dir php$phpversion bin/console glpi:config:set url_base https://$domain$path popd -#================================================= -# CONFIGURE CRON -#================================================= -ynh_script_progression --message="Configuring a cron file..." --weight=1 - -ynh_add_config --template="../conf/cron" --destination="/etc/cron.d/$app" - #================================================= # END OF SCRIPT #================================================= diff --git a/scripts/remove b/scripts/remove index a18a484..b88f6a3 100644 --- a/scripts/remove +++ b/scripts/remove @@ -10,9 +10,9 @@ source _common.sh source /usr/share/yunohost/helpers #================================================= -# REMOVE NGINX CONFIGURATION +# REMOVE SYSTEM CONFIGURATIONS #================================================= -ynh_script_progression --message="Removing NGINX web server configuration..." --weight=1 +ynh_script_progression --message="Removing system configurations related to $app..." --weight=1 # Remove the dedicated NGINX config ynh_remove_nginx_config diff --git a/scripts/restore b/scripts/restore index af8cf5b..6a49b01 100644 --- a/scripts/restore +++ b/scripts/restore @@ -30,7 +30,7 @@ ynh_mysql_connect_as --user=$db_user --password=$db_pwd --database=$db_name < ./ #================================================= # RESTORE THE PHP-FPM CONFIGURATION #================================================= -ynh_script_progression --message="Restoring the PHP-FPM configuration..." --weight=1 +ynh_script_progression --message="Restoring system configurations related to $app..." --weight=1 ynh_restore_file --origin_path="/etc/php/$phpversion/fpm/pool.d/$app.conf" diff --git a/scripts/upgrade b/scripts/upgrade index a2e91fc..72aa312 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -31,9 +31,9 @@ chmod -R o-rwx "$install_dir" chown -R $app:www-data "$install_dir" #================================================= -# PHP-FPM CONFIGURATION +# REAPPLY SYSTEM CONFIGURATIONS #================================================= -ynh_script_progression --message="Upgrading PHP-FPM configuration..." --weight=1 +ynh_script_progression --message="Upgrading system configurations related to $app..." --weight=1 # Create a dedicated PHP-FPM config ynh_add_fpm_config @@ -41,6 +41,8 @@ ynh_add_fpm_config # Create a dedicated NGINX config ynh_add_nginx_config +ynh_add_config --template="../conf/cron" --destination="/etc/cron.d/$app" + #================================================= # SPECIFIC UPGRADE #================================================= @@ -49,16 +51,9 @@ ynh_add_nginx_config ynh_script_progression --message="Updating the database..." --weight=1 pushd $install_dir - php$phpversion bin/console db:update --no-interaction + php$phpversion bin/console db:update --no-interaction --no-telemetry popd -#================================================= -# UPDATE CRON -#================================================= -ynh_script_progression --message="Updating a cron file..." --weight=1 - -ynh_add_config --template="../conf/cron" --destination="/etc/cron.d/$app" - #================================================= # END OF SCRIPT #=================================================