From 67ecffaa5fbdd234d6e8cac28e3da04a53d93a6a Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Sun, 12 Dec 2021 17:34:21 +0100 Subject: [PATCH 1/3] 4.3 --- conf/nginx.conf | 5 ----- manifest.json | 2 +- 2 files changed, 1 insertion(+), 6 deletions(-) diff --git a/conf/nginx.conf b/conf/nginx.conf index ab36d3b..fdfb341 100644 --- a/conf/nginx.conf +++ b/conf/nginx.conf @@ -4,11 +4,6 @@ location __PATH__/ { # Path to source alias __FINALPATH__/ ; - # Force usage of https - if ($scheme = http) { - rewrite ^ https://$server_name$request_uri? permanent; - } - index index.php; if (!-e $request_filename) { diff --git a/manifest.json b/manifest.json index 44998bf..7241409 100644 --- a/manifest.json +++ b/manifest.json @@ -21,7 +21,7 @@ "email": "" }, "requirements": { - "yunohost": ">= 4.2.4" + "yunohost": ">= 4.3.0" }, "multi_instance": true, "services": [ From 62aa1f2fbeb42dcd61dc524ea7afd884e58916b2 Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Sun, 12 Dec 2021 17:35:27 +0100 Subject: [PATCH 2/3] Update restore --- scripts/restore | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/scripts/restore b/scripts/restore index aa11eb0..0f773b7 100644 --- a/scripts/restore +++ b/scripts/restore @@ -33,8 +33,7 @@ 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 From 3d05ff4f1ce44ae8b4902bfd94add9ed3d11a90b Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Sun, 12 Dec 2021 17:39:50 +0100 Subject: [PATCH 3/3] fix --- scripts/_common.sh | 2 +- scripts/install | 8 +++++++- scripts/remove | 8 ++++++++ scripts/restore | 8 ++++++++ scripts/upgrade | 37 ++++++++++++++++++++++--------------- 5 files changed, 46 insertions(+), 17 deletions(-) diff --git a/scripts/_common.sh b/scripts/_common.sh index e7b081e..6dc05ac 100644 --- a/scripts/_common.sh +++ b/scripts/_common.sh @@ -6,7 +6,7 @@ YNH_PHP_VERSION="7.3" -extra_php_dependencies="php${YNH_PHP_VERSION}-mbstring php${YNH_PHP_VERSION}-xmlrpc php${YNH_PHP_VERSION}-soap php${YNH_PHP_VERSION}-mysql php${YNH_PHP_VERSION}-gd php${YNH_PHP_VERSION}-xml php${YNH_PHP_VERSION}-cli php${YNH_PHP_VERSION}-zip" +pkg_dependencies="php${YNH_PHP_VERSION}-mbstring php${YNH_PHP_VERSION}-xmlrpc php${YNH_PHP_VERSION}-soap php${YNH_PHP_VERSION}-mysql php${YNH_PHP_VERSION}-gd php${YNH_PHP_VERSION}-xml php${YNH_PHP_VERSION}-cli php${YNH_PHP_VERSION}-zip" #================================================= # PERSONAL HELPERS diff --git a/scripts/install b/scripts/install index ac43060..64743db 100644 --- a/scripts/install +++ b/scripts/install @@ -43,6 +43,12 @@ ynh_script_progression --message="Storing installation settings..." --weight=1 ynh_app_setting_set --app=$app --key=domain --value=$domain ynh_app_setting_set --app=$app --key=path --value=$path_url +#================================================= +# INSTALL DEPENDENCIES +#================================================= +ynh_script_progression --message="Installing dependencies..." --weight=1 + +ynh_install_app_dependencies $pkg_dependencies #================================================= # STANDARD MODIFICATIONS @@ -91,7 +97,7 @@ ynh_add_nginx_config ynh_script_progression --message="Configuring PHP-FPM..." --weight=2 # 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 7f22442..dbf77d2 100644 --- a/scripts/remove +++ b/scripts/remove @@ -52,6 +52,14 @@ ynh_script_progression --message="Removing PHP-FPM configuration..." --weight=3 # 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 0f773b7..2441075 100644 --- a/scripts/restore +++ b/scripts/restore @@ -72,6 +72,14 @@ ynh_restore_file --origin_path="/etc/php/$phpversion/fpm/pool.d/$app.conf" ynh_add_fpm_config +#================================================= +# REINSTALL DEPENDENCIES +#================================================= +ynh_script_progression --message="Reinstalling dependencies..." --weight=1 + +# Define and install dependencies +ynh_install_app_dependencies $pkg_dependencies + #================================================= # RESTORE THE MYSQL DATABASE #================================================= diff --git a/scripts/upgrade b/scripts/upgrade index 5cf5a17..33c0742 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -29,6 +29,20 @@ phpversion=$(ynh_app_setting_get --app=$app --key=phpversion) upgrade_type=$(ynh_check_app_version_changed) +#================================================= +# BACKUP BEFORE UPGRADE THEN ACTIVE TRAP +#================================================= +ynh_script_progression --message="Backing up Backdrop before upgrading (may take a while)..." --weight=7 + +# Backup the current version of the app +ynh_backup_before_upgrade +ynh_clean_setup () { + # restore it if the upgrade fails + ynh_restore_upgradebackup +} +# Exit if an error occurs during the execution of the script +ynh_abort_if_errors + #================================================= # ENSURE DOWNWARD COMPATIBILITY #================================================= @@ -53,20 +67,6 @@ if ynh_legacy_permissions_exists; then ynh_app_setting_delete --app=$app --key=is_public fi -#================================================= -# BACKUP BEFORE UPGRADE THEN ACTIVE TRAP -#================================================= -ynh_script_progression --message="Backing up Backdrop before upgrading (may take a while)..." --weight=7 - -# Backup the current version of the app -ynh_backup_before_upgrade -ynh_clean_setup () { - # restore it if the upgrade fails - ynh_restore_upgradebackup -} -# Exit if an error occurs during the execution of the script -ynh_abort_if_errors - #================================================= # CREATE DEDICATED USER #================================================= @@ -102,13 +102,20 @@ ynh_script_progression --message="Upgrading NGINX web server configuration..." - # Create a dedicated NGINX config ynh_add_nginx_config +#================================================= +# UPGRADE DEPENDENCIES +#================================================= +ynh_script_progression --message="Upgrading dependencies..." --weight=1 + +ynh_install_app_dependencies $pkg_dependencies + #================================================= # PHP-FPM CONFIGURATION #================================================= ynh_script_progression --message="Upgrading PHP-FPM configuration..." --weight=2 # Create a dedicated PHP-FPM config -ynh_add_fpm_config --package="$extra_php_dependencies" +ynh_add_fpm_config #================================================= # GENERIC FINALIZATION