From 9f96cd268f3516ce05dacf347034ce22283482f4 Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Sun, 16 Oct 2022 21:18:35 +0200 Subject: [PATCH] Upgrade --- conf/app.src | 4 ++-- conf/nginx.conf | 2 +- manifest.json | 6 +++--- scripts/_common.sh | 2 +- scripts/install | 16 ++++++++-------- scripts/restore | 17 ++++++++++------- scripts/upgrade | 17 +++++++++-------- 7 files changed, 34 insertions(+), 30 deletions(-) diff --git a/conf/app.src b/conf/app.src index 4ffd88a..7b27c08 100644 --- a/conf/app.src +++ b/conf/app.src @@ -1,5 +1,5 @@ -SOURCE_URL=https://github.com/leenooks/phpLDAPadmin/archive/1.2.6.3.tar.gz -SOURCE_SUM=718f805403279f8e54caa1046b5f43c989e3bce82c408d22d349b5393e4a2cea +SOURCE_URL=https://github.com/leenooks/phpLDAPadmin/archive/1.2.6.4.tar.gz +SOURCE_SUM=92e390c013714c75439737633ad4576bc642d87b0091fab6226cbbcb13a0ea48 SOURCE_SUM_PRG=sha256sum SOURCE_FORMAT=tar.gz SOURCE_IN_SUBDIR=true diff --git a/conf/nginx.conf b/conf/nginx.conf index 6d8ad6b..773a64d 100644 --- a/conf/nginx.conf +++ b/conf/nginx.conf @@ -2,7 +2,7 @@ location __PATH__/ { # Path to source - alias __FINALPATH__/ ; + alias __FINALPATH__/; index index.php; diff --git a/manifest.json b/manifest.json index bbfdbff..16d3f6b 100644 --- a/manifest.json +++ b/manifest.json @@ -6,7 +6,7 @@ "en": "Manage OpenLDAP database over the web", "fr": "Application web de gestion de la base OpenLDAP" }, - "version": "1.2.6.3~ynh1", + "version": "1.2.6.4~ynh1", "url": "http://www.phpldapadmin.org", "upstream": { "license": "GPL-2.0-or-later", @@ -21,12 +21,12 @@ "email": "aymhce@gmail.com" }, "requirements": { - "yunohost": ">= 4.3.0" + "yunohost": ">= 11.0.9" }, "multi_instance": true, "services": [ "nginx", - "php7.3-fpm" + "php8.0-fpm" ], "arguments": { "install" : [ diff --git a/scripts/_common.sh b/scripts/_common.sh index d7614e9..b7c971c 100644 --- a/scripts/_common.sh +++ b/scripts/_common.sh @@ -4,7 +4,7 @@ # COMMON VARIABLES #================================================= -YNH_PHP_VERSION="7.3" +YNH_PHP_VERSION="8.0" #================================================= # PERSONAL HELPERS diff --git a/scripts/install b/scripts/install index 33832b7..6d573e2 100755 --- a/scripts/install +++ b/scripts/install @@ -64,14 +64,6 @@ chmod 750 "$final_path" chmod -R o-rwx "$final_path" chown -R $app:www-data "$final_path" -#================================================= -# NGINX CONFIGURATION -#================================================= -ynh_script_progression --message="Configuring NGINX web server..." --weight=2 - -# Create a dedicated NGINX config -ynh_add_nginx_config - #================================================= # PHP-FPM CONFIGURATION #================================================= @@ -81,6 +73,14 @@ ynh_script_progression --message="Configuring PHP-FPM..." --weight=3 ynh_add_fpm_config phpversion=$(ynh_app_setting_get --app=$app --key=phpversion) +#================================================= +# NGINX CONFIGURATION +#================================================= +ynh_script_progression --message="Configuring NGINX web server..." --weight=2 + +# Create a dedicated NGINX config +ynh_add_nginx_config + #================================================= # MODIFY A CONFIG FILE #================================================= diff --git a/scripts/restore b/scripts/restore index 5241b00..11c120d 100755 --- a/scripts/restore +++ b/scripts/restore @@ -35,16 +35,11 @@ phpversion=$(ynh_app_setting_get --app=$app --key=phpversion) #================================================= ynh_script_progression --message="Validating restoration parameters..." --weight=2 -test ! -d $final_path || ynh_die --message="There is already a directory: $final_path " +test ! -d $final_path \ + || ynh_die --message="There is already a directory: $final_path " #================================================= # STANDARD RESTORATION STEPS -#================================================= -# RESTORE THE NGINX CONFIGURATION -#================================================= - -ynh_restore_file --origin_path="/etc/nginx/conf.d/$domain.d/$app.conf" - #================================================= # RECREATE THE DEDICATED USER #================================================= @@ -67,9 +62,17 @@ chown -R $app:www-data "$final_path" #================================================= # RESTORE THE PHP-FPM CONFIGURATION #================================================= +ynh_script_progression --message="Restoring the PHP-FPM configuration..." --weight=1 ynh_restore_file --origin_path="/etc/php/$phpversion/fpm/pool.d/$app.conf" +#================================================= +# 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 #================================================= diff --git a/scripts/upgrade b/scripts/upgrade index 7e2c182..c7ff7da 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -90,14 +90,6 @@ chmod 750 "$final_path" chmod -R o-rwx "$final_path" chown -R $app:www-data "$final_path" -#================================================= -# NGINX CONFIGURATION -#================================================= -ynh_script_progression --message="Upgrading NGINX web server configuration..." --weight=2 - -# Create a dedicated NGINX config -ynh_add_nginx_config - #================================================= # PHP-FPM CONFIGURATION #================================================= @@ -106,9 +98,18 @@ ynh_script_progression --message="Upgrading PHP-FPM configuration..." --weight=5 # Create a dedicated PHP-FPM config ynh_add_fpm_config +#================================================= +# NGINX CONFIGURATION +#================================================= +ynh_script_progression --message="Upgrading NGINX web server configuration..." --weight=2 + +# Create a dedicated NGINX config +ynh_add_nginx_config + #================================================= # MODIFY A CONFIG FILE #================================================= +ynh_script_progression --message="Adding a configuration file..." --weight=1 ynh_add_config --template="../conf/config.php.example" --destination="$final_path/config/config.php" chmod 644 $final_path/config/config.php