From d773b9563b5d08686ab3356df1aa0f6620f78e52 Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Sun, 9 Oct 2022 10:51:43 +0200 Subject: [PATCH] Cleaning --- conf/nginx.conf | 5 ----- manifest.json | 13 ++++++------- scripts/_common.sh | 2 +- scripts/install | 16 ++++++++-------- scripts/restore | 24 +++++++++++------------- scripts/upgrade | 16 ++++++++-------- 6 files changed, 34 insertions(+), 42 deletions(-) diff --git a/conf/nginx.conf b/conf/nginx.conf index 597aa80..91797ab 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 index.html; # Common parameter to increase upload size limit in conjunction with dedicated php-fpm file diff --git a/manifest.json b/manifest.json index 79ca8e1..5f57fa2 100644 --- a/manifest.json +++ b/manifest.json @@ -3,10 +3,10 @@ "id": "spftoolbox", "packaging_format": 1, "description": { - "en": "Look up DNS records such as SPF, MX, Whois, and more", - "fr": "Recherchez des enregistrements DNS tels que SPF, MX, Whois, etc." + "en": "Look up DNS records such as SPF, MX, Whois", + "fr": "Recherchez des enregistrements DNS tels que SPF, MX, Whois" }, - "version": "2.1.1~ynh1", + "version": "2.1.1~ynh2", "url": "http://spftoolbox.com/", "upstream": { "license": "MIT", @@ -21,19 +21,18 @@ "url": "https://www.abld.info" }, "requirements": { - "yunohost": ">= 4.2.4" + "yunohost": ">= 11.0.9" }, "multi_instance": true, "services": [ "nginx", - "php7.3-fpm" + "php7.4-fpm" ], "arguments": { "install" : [ { "name": "domain", - "type": "domain", - "example": "example.com" + "type": "domain" }, { "name": "path", diff --git a/scripts/_common.sh b/scripts/_common.sh index 4f9b49f..12242ec 100644 --- a/scripts/_common.sh +++ b/scripts/_common.sh @@ -4,7 +4,7 @@ # COMMON VARIABLES #================================================= -YNH_PHP_VERSION="7.3" +YNH_PHP_VERSION="7.4" # dependencies used by the app pkg_dependencies="whois" diff --git a/scripts/install b/scripts/install index faaa6ca..f8afa2c 100644 --- a/scripts/install +++ b/scripts/install @@ -75,14 +75,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..." - -# Create a dedicated nginx config -ynh_add_nginx_config - #================================================= # PHP-FPM CONFIGURATION #================================================= @@ -92,6 +84,14 @@ ynh_script_progression --message="Configuring PHP-FPM..." ynh_add_fpm_config phpversion=$(ynh_app_setting_get --app=$app --key=phpversion) +#================================================= +# NGINX CONFIGURATION +#================================================= +ynh_script_progression --message="Configuring NGINX web server..." + +# Create a dedicated nginx config +ynh_add_nginx_config + #================================================= # SETUP LOGROTATE #================================================= diff --git a/scripts/restore b/scripts/restore index adbbbc1..30709d9 100644 --- a/scripts/restore +++ b/scripts/restore @@ -39,13 +39,6 @@ test ! -d $final_path \ #================================================= # STANDARD RESTORATION STEPS -#================================================= -# RESTORE THE NGINX CONFIGURATION -#================================================= -ynh_script_progression --message="Restoring the NGINX configuration..." - -ynh_restore_file --origin_path="/etc/nginx/conf.d/$domain.d/$app.conf" - #================================================= # RECREATE THE DEDICATED USER #================================================= @@ -65,6 +58,14 @@ chmod 750 "$final_path" chmod -R o-rwx "$final_path" chown -R $app:www-data "$final_path" +#================================================= +# REINSTALL DEPENDENCIES +#================================================= +ynh_script_progression --message="Reinstalling dependencies..." + +# Define and install dependencies +ynh_install_app_dependencies $pkg_dependencies + #================================================= # RESTORE THE PHP-FPM CONFIGURATION #================================================= @@ -74,14 +75,11 @@ ynh_restore_file --origin_path="/etc/php/$phpversion/fpm/pool.d/$app.conf" ynh_add_fpm_config #================================================= -# SPECIFIC RESTORATION +# RESTORE THE NGINX CONFIGURATION #================================================= -# REINSTALL DEPENDENCIES -#================================================= -ynh_script_progression --message="Reinstalling dependencies..." +ynh_script_progression --message="Restoring the NGINX configuration..." -# Define and install dependencies -ynh_install_app_dependencies $pkg_dependencies +ynh_restore_file --origin_path="/etc/nginx/conf.d/$domain.d/$app.conf" #================================================= # RESTORE THE LOGROTATE CONFIGURATION diff --git a/scripts/upgrade b/scripts/upgrade index 48db94b..4b251d4 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -84,14 +84,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..." - -# Create a dedicated nginx config -ynh_add_nginx_config - #================================================= # UPGRADE DEPENDENCIES #================================================= @@ -107,6 +99,14 @@ ynh_script_progression --message="Upgrading PHP-FPM configuration..." # Create a dedicated php-fpm config ynh_add_fpm_config +#================================================= +# NGINX CONFIGURATION +#================================================= +ynh_script_progression --message="Upgrading NGINX web server configuration..." + +# Create a dedicated nginx config +ynh_add_nginx_config + #================================================= # SPECIFIC UPGRADE #=================================================