From 22e905cc481000c6f24358d2007bf69c0282c014 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89ric=20Gaspar?= <46165813+ericgaspar@users.noreply.github.com> Date: Sat, 20 Nov 2021 18:31:00 +0100 Subject: [PATCH] 4.3 (#60) * 4.3 * Fix --- conf/nginx.conf | 5 ----- manifest.json | 2 +- scripts/_common.sh | 2 +- scripts/install | 9 ++++++++- scripts/remove | 8 ++++++++ scripts/restore | 10 +++++++++- scripts/upgrade | 9 ++++++++- 7 files changed, 35 insertions(+), 10 deletions(-) diff --git a/conf/nginx.conf b/conf/nginx.conf index f1da700..5714403 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; - } - more_set_headers "Referrer-Policy: origin always"; more_set_headers "X-Content-Type-Options: nosniff"; more_set_headers "X-XSS-Protection: 1; mode=block"; diff --git a/manifest.json b/manifest.json index 958cd12..2b92c9c 100644 --- a/manifest.json +++ b/manifest.json @@ -21,7 +21,7 @@ "email": "anmol@datamol.org" }, "requirements": { - "yunohost": ">= 4.2.4" + "yunohost": ">= 4.3.0" }, "multi_instance": true, "services": [ diff --git a/scripts/_common.sh b/scripts/_common.sh index e932edf..ac31ed1 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}-curl php${YNH_PHP_VERSION}-gd php${YNH_PHP_VERSION}-cli php${YNH_PHP_VERSION}-mysql php${YNH_PHP_VERSION}-xml php${YNH_PHP_VERSION}-mbstring" +pkg_dependencies="php${YNH_PHP_VERSION}-curl php${YNH_PHP_VERSION}-gd php${YNH_PHP_VERSION}-cli php${YNH_PHP_VERSION}-mysql php${YNH_PHP_VERSION}-xml php${YNH_PHP_VERSION}-mbstring" #================================================= # PERSONAL HELPERS diff --git a/scripts/install b/scripts/install index af0fc07..329a2c9 100755 --- a/scripts/install +++ b/scripts/install @@ -47,6 +47,13 @@ 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 + #================================================= # CREATE A MYSQL DATABASE #================================================= @@ -93,7 +100,7 @@ ynh_add_nginx_config ynh_script_progression --message="Configuring PHP-FPM..." --weight=3 # Create a dedicated PHP-FPM config -ynh_add_fpm_config --usage=low --footprint=low --package="$extra_php_dependencies" +ynh_add_fpm_config --usage=low --footprint=low phpversion=$(ynh_app_setting_get --app=$app --key=phpversion) #================================================= diff --git a/scripts/remove b/scripts/remove index a0d4af7..8246f27 100755 --- a/scripts/remove +++ b/scripts/remove @@ -31,6 +31,14 @@ ynh_script_progression --message="Removing the MySQL database..." --weight=1 # Remove a database if it exists, along with the associated user ynh_mysql_remove_db --db_user=$db_user --db_name=$db_name +#================================================= +# REMOVE DEPENDENCIES +#================================================= +ynh_script_progression --message="Removing dependencies..." --time --weight=1 + +# Remove metapackage and its dependencies +ynh_remove_app_dependencies + #================================================= # REMOVE APP MAIN DIR #================================================= diff --git a/scripts/restore b/scripts/restore index 4c4c94a..842d4de 100755 --- a/scripts/restore +++ b/scripts/restore @@ -76,7 +76,15 @@ ynh_script_progression --message="Restoring PHP-FPM configuration..." --weight=2 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" +ynh_add_fpm_config --usage=low --footprint=low + +#================================================= +# 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 76f50e9..6b3d888 100755 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -126,13 +126,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..." --time --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 --usage=low --footprint=low --package="$extra_php_dependencies" +ynh_add_fpm_config --usage=low --footprint=low #================================================= # SETUP A CRON