From e98051b3eb2461aa1835b031b11baf621d1def3b Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Sat, 18 Sep 2021 16:56:45 +0200 Subject: [PATCH 01/10] Fix --- conf/nginx.conf | 9 ++++----- manifest.json | 6 ------ scripts/change_url | 2 +- scripts/install | 2 +- 4 files changed, 6 insertions(+), 13 deletions(-) diff --git a/conf/nginx.conf b/conf/nginx.conf index 0a2987b..3af9dcc 100755 --- a/conf/nginx.conf +++ b/conf/nginx.conf @@ -1,14 +1,13 @@ -#sub_path_only rewrite ^__PATH__$ __PATH__/ permanent; -location __PATH__/ { +location / { # Force usage of https if ($scheme = http) { rewrite ^ https://$server_name$request_uri? permanent; } - proxy_pass http://127.0.0.1:__PORT__/; - proxy_set_header Host $host; - proxy_pass_header Server; + proxy_pass http://127.0.0.1:__PORT__/; + proxy_set_header Host $host; + proxy_pass_header Server; proxy_buffering off; more_set_headers "X-Frame-Options : ALLOWALL"; proxy_set_header X-Real-IP $remote_addr; diff --git a/manifest.json b/manifest.json index f7e4ac6..6fae416 100755 --- a/manifest.json +++ b/manifest.json @@ -32,12 +32,6 @@ "name": "domain", "type": "domain" }, - { - "name": "path", - "type": "path", - "example": "/n8n", - "default": "/n8n" - }, { "name": "admin", "type": "user" diff --git a/scripts/change_url b/scripts/change_url index 6c5ec6a..17b25b5 100755 --- a/scripts/change_url +++ b/scripts/change_url @@ -17,7 +17,7 @@ old_domain=$YNH_APP_OLD_DOMAIN old_path=$YNH_APP_OLD_PATH new_domain=$YNH_APP_NEW_DOMAIN -new_path=$YNH_APP_NEW_PATH +new_path="/" app=$YNH_APP_INSTANCE_NAME diff --git a/scripts/install b/scripts/install index b2e0d44..adb32a3 100755 --- a/scripts/install +++ b/scripts/install @@ -24,7 +24,7 @@ ynh_abort_if_errors #================================================= domain=$YNH_APP_ARG_DOMAIN -path_url=$YNH_APP_ARG_PATH +path_url="/" is_public=$YNH_APP_ARG_IS_PUBLIC password=$YNH_APP_ARG_PASSWORD admin=$YNH_APP_ARG_ADMIN From e865d296e3b52398e74b18b3adf17e2e18dc928d Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Sat, 18 Sep 2021 19:08:21 +0200 Subject: [PATCH 02/10] Update install --- scripts/install | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/install b/scripts/install index adb32a3..ee7869e 100755 --- a/scripts/install +++ b/scripts/install @@ -104,7 +104,7 @@ ynh_script_progression --message="Installing $app..." --weight=2 pushd $final_path ynh_use_nodejs #ynh_exec_as $app - ynh_exec_warn_less env $ynh_node_load_PATH npm install n8n -g --unsafe-perm + ynh_exec_warn_less env $ynh_node_load_PATH npm install n8n --unsafe-perm popd chmod 750 "$final_path" From 9cbc8897472b29795e7b829026f615cf1cb548e6 Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Sat, 18 Sep 2021 19:12:30 +0200 Subject: [PATCH 03/10] Update remove --- scripts/remove | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/scripts/remove b/scripts/remove index 9034446..577b97f 100755 --- a/scripts/remove +++ b/scripts/remove @@ -19,6 +19,8 @@ app=$YNH_APP_INSTANCE_NAME domain=$(ynh_app_setting_get --app=$app --key=domain) port=$(ynh_app_setting_get --app=$app --key=port) 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 #================================================= # STANDARD REMOVE @@ -41,7 +43,6 @@ ynh_script_progression --message="Stopping and removing the systemd service..." # Remove the dedicated systemd config ynh_remove_systemd_config - #================================================= # REMOVE THE MYSQL DATABASE #================================================= From cd09fa892aea9feab528e8f301136b85c41c7022 Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Sat, 18 Sep 2021 19:45:40 +0200 Subject: [PATCH 04/10] Update systemd.service --- conf/systemd.service | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/conf/systemd.service b/conf/systemd.service index 3b83872..89eeaa0 100755 --- a/conf/systemd.service +++ b/conf/systemd.service @@ -9,7 +9,7 @@ Group=__APP__ WorkingDirectory=__FINALPATH__/ Environment=PATH=__ENV_PATH__ Environment=NODE_ENV=production -ExecStart=__YNH_NPM__ __APP__ start +ExecStart=__FINALPATH__/node_modules/n8n/bin/n8n Restart=always [Install] From f06bdcd72a3310f6691a3f077f24edfefb98f3e4 Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Sat, 18 Sep 2021 19:46:32 +0200 Subject: [PATCH 05/10] Fix --- scripts/install | 2 +- scripts/restore | 2 +- scripts/upgrade | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/scripts/install b/scripts/install index ee7869e..578e656 100755 --- a/scripts/install +++ b/scripts/install @@ -165,7 +165,7 @@ yunohost service add $app --description="" --log="/var/log/$app/$app.log" ynh_script_progression --message="Starting a systemd service..." --weight=6 # Start a systemd service -ynh_systemd_action --service_name=$app --action=restart --log_path=systemd #--line_match="" +ynh_systemd_action --service_name=$app --action=restart --log_path=systemd --line_match="Editor is now accessible via:" #================================================= # SETUP SSOWAT diff --git a/scripts/restore b/scripts/restore index 2c637fb..0de7510 100755 --- a/scripts/restore +++ b/scripts/restore @@ -115,7 +115,7 @@ systemctl enable $app.service --quiet #================================================= ynh_script_progression --message="Starting a systemd service..." --weight=8 -ynh_systemd_action --service_name=$app --action=restart --log_path=systemd #--line_match="" +ynh_systemd_action --service_name=$app --action=restart --log_path=systemd --line_match="Editor is now accessible via:" #================================================= # GENERIC FINALIZATION diff --git a/scripts/upgrade b/scripts/upgrade index 33dcfd1..5359fa5 100755 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -113,7 +113,7 @@ yunohost service add $app --description="" --log="/var/log/$app/$app.log" #================================================= ynh_script_progression --message="Starting a systemd service..." --weight=6 -ynh_systemd_action --service_name=$app --action=restart --log_path=systemd +ynh_systemd_action --service_name=$app --action=restart --log_path=systemd --line_match="Editor is now accessible via:" #================================================= # RELOAD NGINX From 0a15ae1c46ba72b7af38247e6842405328f57405 Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Sat, 18 Sep 2021 20:42:24 +0200 Subject: [PATCH 06/10] Fix --- scripts/backup | 1 + scripts/upgrade | 1 + 2 files changed, 2 insertions(+) diff --git a/scripts/backup b/scripts/backup index 7ccb90f..ec9e38b 100755 --- a/scripts/backup +++ b/scripts/backup @@ -25,6 +25,7 @@ app=$YNH_APP_INSTANCE_NAME final_path=$(ynh_app_setting_get --app=$app --key=final_path) domain=$(ynh_app_setting_get --app=$app --key=domain) db_name=$(ynh_app_setting_get --app=$app --key=db_name) +datadir=$(ynh_app_setting_get --app=$app --key=datadir) #================================================= # DECLARE DATA AND CONF FILES TO BACKUP diff --git a/scripts/upgrade b/scripts/upgrade index 5359fa5..fd81123 100755 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -21,6 +21,7 @@ path_url=$(ynh_app_setting_get --app=$app --key=path) final_path=$(ynh_app_setting_get --app=$app --key=final_path) port=$(ynh_app_setting_get --app=$app --key=port) db_name=$(ynh_app_setting_get --app=$app --key=db_name) +datadir=$(ynh_app_setting_get --app=$app --key=datadir) #================================================= # CHECK VERSION From 6d99dffed09e7e9c5a3438c1a8967623e47100fc Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Sat, 18 Sep 2021 22:26:15 +0200 Subject: [PATCH 07/10] Fix --- scripts/install | 3 +-- scripts/restore | 2 +- scripts/upgrade | 5 +++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/scripts/install b/scripts/install index 578e656..40be7bd 100755 --- a/scripts/install +++ b/scripts/install @@ -103,7 +103,6 @@ ynh_script_progression --message="Installing $app..." --weight=2 pushd $final_path ynh_use_nodejs - #ynh_exec_as $app ynh_exec_warn_less env $ynh_node_load_PATH npm install n8n --unsafe-perm popd @@ -157,7 +156,7 @@ ynh_add_systemd_config #================================================= ynh_script_progression --message="Integrating service in YunoHost..." --weight=3 -yunohost service add $app --description="" --log="/var/log/$app/$app.log" +yunohost service add $app --description="Workflow Automation Tool" --log="/var/log/$app/$app.log" #================================================= # START SYSTEMD SERVICE diff --git a/scripts/restore b/scripts/restore index 0de7510..4de43ee 100755 --- a/scripts/restore +++ b/scripts/restore @@ -100,7 +100,7 @@ ynh_mysql_connect_as --user=$db_user --password=$db_pwd --database=$db_name < ./ #================================================= ynh_script_progression --message="Integrating service in YunoHost..." --weight=3 -yunohost service add $app --description="" --log="/var/log/$app/$app.log" +yunohost service add $app --description="Workflow Automation Tool" --log="/var/log/$app/$app.log" #================================================= # RESTORE SYSTEMD diff --git a/scripts/upgrade b/scripts/upgrade index fd81123..3f8ff5a 100755 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -71,7 +71,7 @@ then # Download, check integrity, uncompress and patch the source from app.src pushd $final_path ynh_use_nodejs - ynh_exec_as $app env $ynh_node_load_PATH npm install n8n@${n8n_version} + ynh_exec_warn_less env $ynh_node_load_PATH npm install n8n@${n8n_version} popd fi @@ -99,6 +99,7 @@ ynh_install_nodejs --nodejs_version=$nodejs_version #================================================= ynh_script_progression --message="Upgrading systemd configuration..." --weight=2 +ynh_replace_string --match_string="__ENV_PATH__" --replace_string="$PATH" --target_file="../conf/systemd.service" # Create a dedicated systemd config ynh_add_systemd_config @@ -107,7 +108,7 @@ ynh_add_systemd_config #================================================= ynh_script_progression --message="Integrating service in YunoHost..." --weight=2 -yunohost service add $app --description="" --log="/var/log/$app/$app.log" +yunohost service add $app --description="Workflow Automation Tool" --log="/var/log/$app/$app.log" #================================================= # START SYSTEMD SERVICE From 23367cd030e3cd1bd37c736de7adcedea22c73e6 Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Sat, 18 Sep 2021 22:28:04 +0200 Subject: [PATCH 08/10] Fix --- conf/app.src | 6 ------ conf/systemd.service | 2 +- 2 files changed, 1 insertion(+), 7 deletions(-) delete mode 100755 conf/app.src diff --git a/conf/app.src b/conf/app.src deleted file mode 100755 index 1f01e26..0000000 --- a/conf/app.src +++ /dev/null @@ -1,6 +0,0 @@ -SOURCE_URL=https://github.com/n8n-io/n8n/archive/refs/tags/n8n@0.132.2.tar.gz -SOURCE_SUM=26b419f6a8859f3bced47ed616e48fa76b3f9121c376319342206e335564c5f3 -SOURCE_SUM_PRG=sha256sum -SOURCE_FORMAT=tar.gz -SOURCE_IN_SUBDIR=true -SOURCE_FILENAME= diff --git a/conf/systemd.service b/conf/systemd.service index 89eeaa0..3033471 100755 --- a/conf/systemd.service +++ b/conf/systemd.service @@ -1,5 +1,5 @@ [Unit] -Description=n8n +Description=n8n: Workflow Automation Tool After=syslog.target network.target [Service] From b2d9437c328174def6ee38a860a24cf198c021a5 Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Sat, 18 Sep 2021 22:48:21 +0200 Subject: [PATCH 09/10] Fix --- conf/.env | 2 +- conf/config.json | 0 2 files changed, 1 insertion(+), 1 deletion(-) delete mode 100644 conf/config.json diff --git a/conf/.env b/conf/.env index 583d395..bb1957b 100644 --- a/conf/.env +++ b/conf/.env @@ -18,7 +18,7 @@ N8N_BASIC_AUTH_PASSWORD=__PASSWORD__ # Optional timezone to set which gets used by Cron-Node by default # If not set New York time will be used -GENERIC_TIMEZONE=Europe/Paris +GENERIC_TIMEZONE=__TIMEZONE__ # The email address to use for the SSL certificate creation SSL_EMAIL=user@example.com diff --git a/conf/config.json b/conf/config.json deleted file mode 100644 index e69de29..0000000 From ec381b9cb15309af847827919de960c66580c8ba Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Sat, 18 Sep 2021 22:48:58 +0200 Subject: [PATCH 10/10] Update install --- scripts/install | 1 + 1 file changed, 1 insertion(+) diff --git a/scripts/install b/scripts/install index 40be7bd..403e001 100755 --- a/scripts/install +++ b/scripts/install @@ -28,6 +28,7 @@ path_url="/" is_public=$YNH_APP_ARG_IS_PUBLIC password=$YNH_APP_ARG_PASSWORD admin=$YNH_APP_ARG_ADMIN +timezone="$(cat /etc/timezone)" app=$YNH_APP_INSTANCE_NAME