From 69730f95e47772f68c1d6475ce0cf30cbd75fa6e Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Tue, 16 Nov 2021 20:59:52 +0100 Subject: [PATCH 1/3] 4.3 --- manifest.json | 2 +- scripts/_common.sh | 2 +- scripts/install | 12 ++++++++++-- scripts/remove | 8 ++++++++ scripts/restore | 8 ++++++++ scripts/upgrade | 9 ++++++++- 6 files changed, 36 insertions(+), 5 deletions(-) diff --git a/manifest.json b/manifest.json index a12d621..e01a8e4 100644 --- a/manifest.json +++ b/manifest.json @@ -20,7 +20,7 @@ "email": "" }, "requirements": { - "yunohost": ">= 4.2.7" + "yunohost": ">= 4.3.0" }, "multi_instance": true, "services": [ diff --git a/scripts/_common.sh b/scripts/_common.sh index 2df6b97..e760661 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}-zip php${YNH_PHP_VERSION}-curl php${YNH_PHP_VERSION}-mbstring php${YNH_PHP_VERSION}-ldap php${YNH_PHP_VERSION}-json php${YNH_PHP_VERSION}-xml" +pkg_dependencies="php${YNH_PHP_VERSION}-zip php${YNH_PHP_VERSION}-curl php${YNH_PHP_VERSION}-mbstring php${YNH_PHP_VERSION}-ldap php${YNH_PHP_VERSION}-json php${YNH_PHP_VERSION}-xml" #================================================= # PERSONAL HELPERS diff --git a/scripts/install b/scripts/install index 58feb03..346c249 100755 --- a/scripts/install +++ b/scripts/install @@ -23,6 +23,7 @@ ynh_abort_if_errors domain=$YNH_APP_ARG_DOMAIN path_url=$YNH_APP_ARG_PATH is_public=$YNH_APP_ARG_IS_PUBLIC +phpversion=$YNH_PHP_VERSION app=$YNH_APP_INSTANCE_NAME @@ -44,6 +45,14 @@ 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 +ynh_app_setting_set --app=$app --key=phpversion --value=$phpversion + +#================================================= +# INSTALL DEPENDENCIES +#================================================= +ynh_script_progression --message="Installing dependencies..." --weight=1 + +ynh_install_app_dependencies $pkg_dependencies #================================================= # CREATE DEDICATED USER @@ -81,8 +90,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" -phpversion=$(ynh_app_setting_get --app=$app --key=phpversion) +ynh_add_fpm_config #================================================= # CREATE DATA DIRECTORY diff --git a/scripts/remove b/scripts/remove index cd0fc9e..9ef1edc 100755 --- a/scripts/remove +++ b/scripts/remove @@ -28,6 +28,14 @@ ynh_script_progression --message="Removing app main directory..." --weight=1 # Remove the app directory securely ynh_secure_remove --file="$final_path" +#================================================= +# REMOVE DEPENDENCIES +#================================================= +ynh_script_progression --message="Removing dependencies..." --weight=1 + +# Remove metapackage and its dependencies +ynh_remove_app_dependencies + #================================================= # REMOVE DATA DIR #================================================= diff --git a/scripts/restore b/scripts/restore index 4d41443..39df734 100755 --- a/scripts/restore +++ b/scripts/restore @@ -86,6 +86,14 @@ ynh_script_progression --message="Restoring the PHP-FPM configuration..." --weig ynh_restore_file --origin_path="/etc/php/$phpversion/fpm/pool.d/$app.conf" +#================================================= +# REINSTALL DEPENDENCIES +#================================================= +ynh_script_progression --message="Reinstalling dependencies..." --weight=1 + +# Define and install dependencies +ynh_install_app_dependencies $pkg_dependencies + #================================================= # GENERIC FINALIZATION #================================================= diff --git a/scripts/upgrade b/scripts/upgrade index 7489c3d..96dc505 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -82,13 +82,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=1 # Create a dedicated PHP-FPM config -ynh_add_fpm_config --package="$extra_php_dependencies" +ynh_add_fpm_config #================================================= # RELOAD NGINX From a2b3974aacbf4fd0909f622587bc8d034a9b83f1 Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Tue, 16 Nov 2021 22:29:16 +0100 Subject: [PATCH 2/3] Update nginx.conf --- conf/nginx.conf | 5 ----- 1 file changed, 5 deletions(-) diff --git a/conf/nginx.conf b/conf/nginx.conf index 6f7a86a..3ae9ba7 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 ifm.php; # Common parameter to increase upload size limit in conjunction with dedicated php-fpm file From e12fca86c0e7a96204421b8d2259c9d2702b9dcf Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Mon, 29 Nov 2021 18:18:52 +0100 Subject: [PATCH 3/3] Update remove --- scripts/remove | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/scripts/remove b/scripts/remove index 9ef1edc..8a036c1 100755 --- a/scripts/remove +++ b/scripts/remove @@ -28,14 +28,6 @@ ynh_script_progression --message="Removing app main directory..." --weight=1 # Remove the app directory securely ynh_secure_remove --file="$final_path" -#================================================= -# REMOVE DEPENDENCIES -#================================================= -ynh_script_progression --message="Removing dependencies..." --weight=1 - -# Remove metapackage and its dependencies -ynh_remove_app_dependencies - #================================================= # REMOVE DATA DIR #================================================= @@ -63,6 +55,14 @@ ynh_script_progression --message="Removing PHP-FPM configuration..." --weight=1 # 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 #=================================================