From 61876c8206404eb0ce07fbcc13e7491fcfa861b4 Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Mon, 22 Nov 2021 13:48:31 +0100 Subject: [PATCH] Add --purge option --- conf/app.src | 1 - conf/nginx.conf | 5 ----- manifest.json | 2 +- scripts/remove | 20 +++++++++++--------- 4 files changed, 12 insertions(+), 16 deletions(-) diff --git a/conf/app.src b/conf/app.src index 5a7af15..16a8307 100644 --- a/conf/app.src +++ b/conf/app.src @@ -3,4 +3,3 @@ SOURCE_SUM=77bd4b69cb822ac8cac9df6890f17a673c978b10d8dd6fce46b60c763b859f74 SOURCE_SUM_PRG=sha256sum SOURCE_FORMAT=tar.gz SOURCE_IN_SUBDIR=true -SOURCE_FILENAME= diff --git a/conf/nginx.conf b/conf/nginx.conf index ecb2372..c92f5a3 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; - } - client_max_body_size 10G; client_body_timeout 30m; proxy_read_timeout 30m; diff --git a/manifest.json b/manifest.json index 65d47dd..66a5e31 100644 --- a/manifest.json +++ b/manifest.json @@ -20,7 +20,7 @@ "email": "julien.malik@paraiso.me" }, "requirements": { - "yunohost": ">= 4.2.4" + "yunohost": ">= 4.3.0" }, "multi_instance": false, "services": [ diff --git a/scripts/remove b/scripts/remove index 1e7f07f..f7a2c97 100755 --- a/scripts/remove +++ b/scripts/remove @@ -30,6 +30,17 @@ ynh_script_progression --message="Removing app main directory..." --weight=2 # Remove the app directory securely ynh_secure_remove --file="$final_path" +#================================================= +# REMOVE DATA DIR +#================================================= + +# Remove the data directory if --purge option is used +if [ "${YNH_APP_PURGE:-0}" -eq 1 ] +then + ynh_script_progression --message="Removing app data directory..." --weight=1 + ynh_secure_remove --file="$datadir" +fi + #================================================= # REMOVE THE NGINX CONFIGURATION #================================================= @@ -53,15 +64,6 @@ ynh_script_progression --message="Removing the cron file..." --weight=1 ynh_secure_remove --file="/etc/cron.d/$app" -#================================================= -# SPECIFIC REMOVE -#================================================= -# REMOVE THE DATA DIRECTORY -#================================================= -ynh_script_progression --message="Removing data directory..." --weight=1 - -ynh_secure_remove --file="$datadir" - #================================================= # GENERIC FINALISATION #=================================================