From 36d700e170e7f446719782513c11a9654d8a9ae8 Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Sat, 18 Sep 2021 19:24:35 +0200 Subject: [PATCH 01/10] Update remove --- scripts/remove | 2 ++ 1 file changed, 2 insertions(+) diff --git a/scripts/remove b/scripts/remove index 9034446..6eac120 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 From 690f8ee51bd326d1327fa6c0ec2d1a9e48971ab6 Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Sat, 18 Sep 2021 19:44:48 +0200 Subject: [PATCH 02/10] Fix --- scripts/install | 3 +-- scripts/restore | 2 +- scripts/upgrade | 2 +- 3 files changed, 3 insertions(+), 4 deletions(-) diff --git a/scripts/install b/scripts/install index b2e0d44..09eb7f1 100755 --- a/scripts/install +++ b/scripts/install @@ -103,8 +103,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${n8n_version} --unsafe-perm popd chmod 750 "$final_path" 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 9981d1ce9e94f962231e33925eddd20219ec8420 Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Sat, 18 Sep 2021 19:45:19 +0200 Subject: [PATCH 03/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 923bb2866111e3cde97f5ce12f162cb644738136 Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Sat, 18 Sep 2021 19:51:43 +0200 Subject: [PATCH 04/10] Update install --- scripts/install | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/install b/scripts/install index 09eb7f1..dc3a850 100755 --- a/scripts/install +++ b/scripts/install @@ -103,7 +103,7 @@ ynh_script_progression --message="Installing $app..." --weight=2 pushd $final_path ynh_use_nodejs - ynh_exec_warn_less env $ynh_node_load_PATH npm install n8n${n8n_version} --unsafe-perm + ynh_exec_warn_less env $ynh_node_load_PATH npm install n8n --unsafe-perm popd chmod 750 "$final_path" From 91ab2dd53ced8d83046e1adc217179adeacc03b6 Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Sat, 18 Sep 2021 20:41:07 +0200 Subject: [PATCH 05/10] Fix --- check_process | 2 +- manifest.json | 2 +- scripts/backup | 1 + scripts/upgrade | 1 + 4 files changed, 4 insertions(+), 2 deletions(-) diff --git a/check_process b/check_process index 717bdc3..f0adfa2 100755 --- a/check_process +++ b/check_process @@ -13,7 +13,7 @@ upgrade=1 #upgrade=1 from_commit= backup_restore=1 - multi_instance=1 + multi_instance=0 change_url=1 ;;; Options Email= diff --git a/manifest.json b/manifest.json index f7e4ac6..bebff77 100755 --- a/manifest.json +++ b/manifest.json @@ -22,7 +22,7 @@ "requirements": { "yunohost": ">= 4.2.4" }, - "multi_instance": true, + "multi_instance": false, "services": [ "nginx" ], 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 2ccc2dd6c456714daedd4d6fdb2722ed96f1d127 Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Sat, 18 Sep 2021 22:24:48 +0200 Subject: [PATCH 06/10] Fix --- scripts/install | 2 +- scripts/restore | 2 +- scripts/upgrade | 5 +++-- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/scripts/install b/scripts/install index dc3a850..384c285 100755 --- a/scripts/install +++ b/scripts/install @@ -156,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 8c814e6081da9ffcb8cf7706d73f8b5bb92aa5af Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Sat, 18 Sep 2021 22:29:04 +0200 Subject: [PATCH 07/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 41ee398214beb347d80216c957fc3fffcdc3db48 Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Sat, 18 Sep 2021 22:42:46 +0200 Subject: [PATCH 08/10] Add timezone --- conf/.env | 2 +- scripts/install | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) 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/scripts/install b/scripts/install index 384c285..a66a97a 100755 --- a/scripts/install +++ b/scripts/install @@ -28,6 +28,7 @@ path_url=$YNH_APP_ARG_PATH 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 From ad444b8b6d8d7fa445387fcee38d1cc286b3f712 Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Sat, 18 Sep 2021 22:45:03 +0200 Subject: [PATCH 09/10] Fix --- scripts/install | 2 +- scripts/upgrade | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/install b/scripts/install index a66a97a..c47de2e 100755 --- a/scripts/install +++ b/scripts/install @@ -165,7 +165,7 @@ yunohost service add $app --description="Workflow Automation Tool" --log="/var/l 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/upgrade b/scripts/upgrade index 3f8ff5a..c260f62 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_warn_less env $ynh_node_load_PATH npm install n8n@${n8n_version} + ynh_exec_warn_less env $ynh_node_load_PATH npm update n8n popd fi From ac2b97a0d181b38be479d987d7c31d0a8412bd3c Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Sat, 18 Sep 2021 22:46:47 +0200 Subject: [PATCH 10/10] Delete config.json --- conf/config.json | 0 1 file changed, 0 insertions(+), 0 deletions(-) delete mode 100644 conf/config.json diff --git a/conf/config.json b/conf/config.json deleted file mode 100644 index e69de29..0000000