From 5faba7307f29ea88dda11210b9c7299759f0bc59 Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Sat, 9 Apr 2022 09:48:58 +0200 Subject: [PATCH] fix --- conf/nginx.conf | 5 ----- conf/systemd.service | 2 +- manifest.json | 4 ++-- scripts/change_url | 4 ++-- scripts/install | 3 +-- scripts/restore | 5 +---- scripts/upgrade | 13 +++++++++++-- 7 files changed, 18 insertions(+), 18 deletions(-) diff --git a/conf/nginx.conf b/conf/nginx.conf index c1846d3..b4e82f8 100644 --- a/conf/nginx.conf +++ b/conf/nginx.conf @@ -1,10 +1,5 @@ location ^~ / { - # Force usage of https - if ($scheme = http) { - rewrite ^ https://$server_name$request_uri? permanent; - } - proxy_pass http://127.0.0.1:__PORT__/; proxy_redirect off; proxy_set_header Host $host; diff --git a/conf/systemd.service b/conf/systemd.service index 0f4b534..181c898 100644 --- a/conf/systemd.service +++ b/conf/systemd.service @@ -1,5 +1,5 @@ [Unit] -Description=Ethercalc: collaborative spreadsheet editor. +Description=Ethercalc: collaborative spreadsheet editor After=network.target [Service] diff --git a/manifest.json b/manifest.json index ff01d61..e44091f 100644 --- a/manifest.json +++ b/manifest.json @@ -6,7 +6,7 @@ "en": "Real-time collaborative spreadsheet editor", "fr": "Feuille de calcul collaborative en ligne" }, - "version": "20201228~ynh4", + "version": "20201228~ynh5", "url": "https://ethercalc.net/", "upstream": { "license": "CPAL-1.0", @@ -22,7 +22,7 @@ }, "multi_instance": true, "requirements": { - "yunohost": ">= 4.2.4" + "yunohost": ">= 4.3.0" }, "services": [ "nginx" diff --git a/scripts/change_url b/scripts/change_url index 8273e43..a7a8996 100644 --- a/scripts/change_url +++ b/scripts/change_url @@ -70,7 +70,7 @@ fi #================================================= ynh_script_progression --message="Stopping a systemd service..." --weight=1 -ynh_systemd_action --service_name=$app --action="stop" --log_path="/var/log/$app/$app.log" +ynh_systemd_action --service_name=$app --action="stop" --log_path="systemd" #================================================= # MODIFY URL IN NGINX CONF @@ -108,7 +108,7 @@ fi #================================================= ynh_script_progression --message="Starting a systemd service..." --weight=3 -ynh_systemd_action --service_name=$app --action="start" --log_path="/var/log/$app/$app.log" +ynh_systemd_action --service_name=$app --action="start" --log_path="systemd" #================================================= # RELOAD NGINX diff --git a/scripts/install b/scripts/install index e21720b..91caed6 100644 --- a/scripts/install +++ b/scripts/install @@ -113,8 +113,7 @@ popd #================================================= ynh_script_progression --message="Configuring a systemd service..." --weight=1 -ynh_replace_string --match_string="__ENV_PATH__" --replace_string="$PATH" --target_file="../conf/systemd.service" - +env_path="$PATH" ynh_add_systemd_config #================================================= diff --git a/scripts/restore b/scripts/restore index 63e6ce5..c076203 100644 --- a/scripts/restore +++ b/scripts/restore @@ -29,9 +29,6 @@ app=$YNH_APP_INSTANCE_NAME domain=$(ynh_app_setting_get --app=$app --key=domain) path_url=$(ynh_app_setting_get --app=$app --key=path) final_path=$(ynh_app_setting_get --app=$app --key=final_path) -db_name=$(ynh_app_setting_get --app=$app --key=db_name) -db_user=$db_name -phpversion=$(ynh_app_setting_get --app=$app --key=phpversion) #================================================= # CHECK IF THE APP CAN BE RESTORED @@ -99,7 +96,7 @@ yunohost service add $app --description "Collaborative spreadsheet editor" --log #================================================= ynh_script_progression --message="Starting a systemd service..." --weight=1 -ynh_systemd_action --service_name=$app --action="start" --log_path="/var/log/$app/$app.log" +ynh_systemd_action --service_name=$app --action="start" --log_path="systemd" #================================================= # GENERIC FINALIZATION diff --git a/scripts/upgrade b/scripts/upgrade index 94a3fa6..83a2cfa 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -66,7 +66,7 @@ fi #================================================= ynh_script_progression --message="Stopping a systemd service..." --weight=3 -ynh_systemd_action --service_name=$app --action="stop" --log_path="/var/log/$app/$app.log" +ynh_systemd_action --service_name=$app --action="stop" --log_path="systemd" #================================================= # CREATE DEDICATED USER @@ -120,6 +120,15 @@ pushd "$final_path" ynh_exec_warn_less npm i zappajs popd +#================================================= +# SETUP SYSTEMD +#================================================= +ynh_script_progression --message="Upgrading systemd configuration..." --weight=1 + +env_path="$PATH" +# Create a dedicated systemd config +ynh_add_systemd_config + #================================================= # INTEGRATE SERVICE IN YUNOHOST #================================================= @@ -132,7 +141,7 @@ yunohost service add $app --description "Collaborative spreadsheet editor" --log #================================================= ynh_script_progression --message="Starting a systemd service..." --weight=5 -ynh_systemd_action --service_name=$app --action="start" --log_path="/var/log/$app/$app.log" +ynh_systemd_action --service_name=$app --action="start" --log_path="systemd" #================================================= # RELOAD NGINX