From b974313d0bc66819834936a249052b2c3335cb45 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?E=CC=81ric=20Gaspar?= <46165813+ericgaspar@users.noreply.github.com> Date: Fri, 7 Jun 2024 22:41:48 +0200 Subject: [PATCH 01/13] Update nginx.conf --- conf/nginx.conf | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/conf/nginx.conf b/conf/nginx.conf index 8ae2f3e..0217f01 100644 --- a/conf/nginx.conf +++ b/conf/nginx.conf @@ -7,11 +7,11 @@ location __PATH__/ { proxy_buffering off; more_set_headers "X-Frame-Options : ALLOWALL"; - proxy_set_header X-Real-IP $remote_addr; # http://wiki.nginx.org/HttpProxyModule - proxy_set_header X-Forwarded-For $remote_addr; # EP logs to show the actual remote IP - proxy_set_header X-Forwarded-Proto $scheme; # for EP to set secure cookie flag when https is used - proxy_set_header Host $host; # pass the host header - proxy_http_version 1.1; # recommended with keepalive connections + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-For $remote_addr; + proxy_set_header X-Forwarded-Proto $scheme; + proxy_set_header Host $host; + proxy_http_version 1.1; # WebSocket proxying - from http://nginx.org/en/docs/http/websocket.html proxy_set_header Upgrade $http_upgrade; From f7cd8a5ccb4c6b1c8fb5653e39e960af7d75b926 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?E=CC=81ric=20Gaspar?= <46165813+ericgaspar@users.noreply.github.com> Date: Fri, 7 Jun 2024 22:49:32 +0200 Subject: [PATCH 02/13] Update install --- scripts/install | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/install b/scripts/install index 344dcc8..fe5402a 100644 --- a/scripts/install +++ b/scripts/install @@ -81,7 +81,7 @@ ynh_script_progression --message="Installing $app..." --weight=10 pushd $install_dir ynh_use_nodejs ynh_exec_warn_less env $ynh_node_load_PATH corepack enable && COREPACK_ENABLE_DOWNLOAD_PROMPT=0 corepack prepare pnpm@latest --activate - ynh_exec_warn_less env $ynh_node_load_PATH ETHERPAD_PRODUCTION=true COREPACK_ENABLE_DOWNLOAD_PROMPT=0 bin/installDeps.sh + ynh_exec_warn_less env $ynh_node_load_PATH ETHERPAD_PRODUCTION=1 COREPACK_ENABLE_DOWNLOAD_PROMPT=0 bin/installDeps.sh popd #================================================= From be1621968da9091e7ac6c9e0f0bb6ff96f6d41b6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?E=CC=81ric=20Gaspar?= <46165813+ericgaspar@users.noreply.github.com> Date: Fri, 7 Jun 2024 22:56:52 +0200 Subject: [PATCH 03/13] fix --- conf/systemd.service | 2 +- scripts/install | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/conf/systemd.service b/conf/systemd.service index 39c863b..8c84f18 100644 --- a/conf/systemd.service +++ b/conf/systemd.service @@ -7,7 +7,7 @@ Type=simple User=__APP__ Group=__APP__ WorkingDirectory=__INSTALL_DIR__/ -Environment="ETHERPAD_PRODUCTION=true" +Environment="ETHERPAD_PRODUCTION=1" Environment="NODE_ENV=production" Environment="__YNH_NODE_LOAD_PATH__" ExecStart=__INSTALL_DIR__/bin/run.sh diff --git a/scripts/install b/scripts/install index fe5402a..5a05fb7 100644 --- a/scripts/install +++ b/scripts/install @@ -81,7 +81,7 @@ ynh_script_progression --message="Installing $app..." --weight=10 pushd $install_dir ynh_use_nodejs ynh_exec_warn_less env $ynh_node_load_PATH corepack enable && COREPACK_ENABLE_DOWNLOAD_PROMPT=0 corepack prepare pnpm@latest --activate - ynh_exec_warn_less env $ynh_node_load_PATH ETHERPAD_PRODUCTION=1 COREPACK_ENABLE_DOWNLOAD_PROMPT=0 bin/installDeps.sh + ynh_exec_warn_less env $ynh_node_load_PATH ETHERPAD_PRODUCTION=1 COREPACK_ENABLE_DOWNLOAD_PROMPT=0 pnpm --recursive i --production popd #================================================= From ce5af2a9293e50b701307d5d7cc8df6cd47e1d44 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?E=CC=81ric=20Gaspar?= <46165813+ericgaspar@users.noreply.github.com> Date: Fri, 7 Jun 2024 23:08:35 +0200 Subject: [PATCH 04/13] 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 8c84f18..e5a1e68 100644 --- a/conf/systemd.service +++ b/conf/systemd.service @@ -10,7 +10,7 @@ WorkingDirectory=__INSTALL_DIR__/ Environment="ETHERPAD_PRODUCTION=1" Environment="NODE_ENV=production" Environment="__YNH_NODE_LOAD_PATH__" -ExecStart=__INSTALL_DIR__/bin/run.sh +ExecStart=__NODEJS_PATH__/pnpm run prod Restart=always # Sandboxing options to harden security From 21e5e7d34ad86626d005581aba552a1b8c8c2239 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?E=CC=81ric=20Gaspar?= <46165813+ericgaspar@users.noreply.github.com> Date: Fri, 7 Jun 2024 23:17:37 +0200 Subject: [PATCH 05/13] Update _common.sh --- scripts/_common.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/_common.sh b/scripts/_common.sh index 184eecc..9195d57 100644 --- a/scripts/_common.sh +++ b/scripts/_common.sh @@ -4,7 +4,7 @@ # COMMON VARIABLES #================================================= -nodejs_version=22 +nodejs_version=18 #================================================= # PERSONAL HELPERS From 2b65e103fc23a62a928058ac90d59a06bbca0c49 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?E=CC=81ric=20Gaspar?= <46165813+ericgaspar@users.noreply.github.com> Date: Fri, 7 Jun 2024 23:22:18 +0200 Subject: [PATCH 06/13] Update systemd.service --- conf/systemd.service | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/conf/systemd.service b/conf/systemd.service index e5a1e68..5210a9e 100644 --- a/conf/systemd.service +++ b/conf/systemd.service @@ -10,7 +10,8 @@ WorkingDirectory=__INSTALL_DIR__/ Environment="ETHERPAD_PRODUCTION=1" Environment="NODE_ENV=production" Environment="__YNH_NODE_LOAD_PATH__" -ExecStart=__NODEJS_PATH__/pnpm run prod +ExecStart=__INSTALL_DIR__/bin/run.sh +#ExecStart=__NODEJS_PATH__/pnpm run prod Restart=always # Sandboxing options to harden security From a4e9fd5fcf9a0e7b33c9eb35853510c0fe5f03ea Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?E=CC=81ric=20Gaspar?= <46165813+ericgaspar@users.noreply.github.com> Date: Sat, 8 Jun 2024 11:45:45 +0200 Subject: [PATCH 07/13] fix --- conf/systemd.service | 4 +--- scripts/install | 2 +- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/conf/systemd.service b/conf/systemd.service index 5210a9e..748a48d 100644 --- a/conf/systemd.service +++ b/conf/systemd.service @@ -7,11 +7,9 @@ Type=simple User=__APP__ Group=__APP__ WorkingDirectory=__INSTALL_DIR__/ -Environment="ETHERPAD_PRODUCTION=1" Environment="NODE_ENV=production" Environment="__YNH_NODE_LOAD_PATH__" -ExecStart=__INSTALL_DIR__/bin/run.sh -#ExecStart=__NODEJS_PATH__/pnpm run prod +ExecStart=__NODEJS_PATH__/pnpm run prod Restart=always # Sandboxing options to harden security diff --git a/scripts/install b/scripts/install index 5a05fb7..364cc9a 100644 --- a/scripts/install +++ b/scripts/install @@ -81,7 +81,7 @@ ynh_script_progression --message="Installing $app..." --weight=10 pushd $install_dir ynh_use_nodejs ynh_exec_warn_less env $ynh_node_load_PATH corepack enable && COREPACK_ENABLE_DOWNLOAD_PROMPT=0 corepack prepare pnpm@latest --activate - ynh_exec_warn_less env $ynh_node_load_PATH ETHERPAD_PRODUCTION=1 COREPACK_ENABLE_DOWNLOAD_PROMPT=0 pnpm --recursive i --production + ynh_exec_warn_less env $ynh_node_load_PATH pnpm --recursive i --production popd #================================================= From 34726a655bfda7d7ed49b77c4b0a5106ca031e68 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?E=CC=81ric=20Gaspar?= <46165813+ericgaspar@users.noreply.github.com> Date: Sat, 8 Jun 2024 11:46:17 +0200 Subject: [PATCH 08/13] Update install --- scripts/install | 1 + 1 file changed, 1 insertion(+) diff --git a/scripts/install b/scripts/install index 364cc9a..cf767ff 100644 --- a/scripts/install +++ b/scripts/install @@ -82,6 +82,7 @@ pushd $install_dir ynh_use_nodejs ynh_exec_warn_less env $ynh_node_load_PATH corepack enable && COREPACK_ENABLE_DOWNLOAD_PROMPT=0 corepack prepare pnpm@latest --activate ynh_exec_warn_less env $ynh_node_load_PATH pnpm --recursive i --production + ynh_secure_remove --file="$install_dir/var/minified*" popd #================================================= From 884f330de4486d4026a374f740ac00e385b1b620 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?E=CC=81ric=20Gaspar?= <46165813+ericgaspar@users.noreply.github.com> Date: Sat, 8 Jun 2024 11:47:31 +0200 Subject: [PATCH 09/13] Update upgrade --- scripts/upgrade | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/scripts/upgrade b/scripts/upgrade index ac5a20f..e6bbe3f 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -102,7 +102,8 @@ ynh_script_progression --message="Installing $app..." --weight=10 pushd $install_dir ynh_use_nodejs ynh_exec_warn_less env $ynh_node_load_PATH corepack enable && COREPACK_ENABLE_DOWNLOAD_PROMPT=0 corepack prepare pnpm@latest --activate - ynh_exec_warn_less env $ynh_node_load_PATH ETHERPAD_PRODUCTION=true COREPACK_ENABLE_DOWNLOAD_PROMPT=0 bin/installDeps.sh + ynh_exec_warn_less env $ynh_node_load_PATH pnpm --recursive i --production + ynh_secure_remove --file="$install_dir/var/minified*" popd #================================================= From 58c08a2a4ca1327aedcc47e191000bd7523cad69 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?E=CC=81ric=20Gaspar?= <46165813+ericgaspar@users.noreply.github.com> Date: Sat, 8 Jun 2024 11:51:24 +0200 Subject: [PATCH 10/13] Update _common.sh --- scripts/_common.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/_common.sh b/scripts/_common.sh index 9195d57..44277c5 100644 --- a/scripts/_common.sh +++ b/scripts/_common.sh @@ -4,7 +4,7 @@ # COMMON VARIABLES #================================================= -nodejs_version=18 +nodejs_version=20 #================================================= # PERSONAL HELPERS From 2874b44435c03e8be88742dd159ee57840dab749 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?E=CC=81ric=20Gaspar?= <46165813+ericgaspar@users.noreply.github.com> Date: Sat, 8 Jun 2024 11:53:32 +0200 Subject: [PATCH 11/13] Update install --- scripts/install | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/scripts/install b/scripts/install index cf767ff..4fb8238 100644 --- a/scripts/install +++ b/scripts/install @@ -82,7 +82,6 @@ pushd $install_dir ynh_use_nodejs ynh_exec_warn_less env $ynh_node_load_PATH corepack enable && COREPACK_ENABLE_DOWNLOAD_PROMPT=0 corepack prepare pnpm@latest --activate ynh_exec_warn_less env $ynh_node_load_PATH pnpm --recursive i --production - ynh_secure_remove --file="$install_dir/var/minified*" popd #================================================= @@ -92,6 +91,8 @@ ynh_script_progression --message="Starting a systemd service..." --weight=6 ynh_systemd_action --service_name=$app --action=restart --log_path=systemd --line_match="Your Etherpad version is" +ynh_secure_remove --file="$install_dir/var/minified*" + #================================================= # END OF SCRIPT #================================================= From 946cf8d7c5e58ffc270169f8cc2fce265bfdc95d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?E=CC=81ric=20Gaspar?= <46165813+ericgaspar@users.noreply.github.com> Date: Sat, 8 Jun 2024 12:02:27 +0200 Subject: [PATCH 12/13] Update install --- scripts/install | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/scripts/install b/scripts/install index 4fb8238..9c88ec9 100644 --- a/scripts/install +++ b/scripts/install @@ -84,6 +84,11 @@ pushd $install_dir ynh_exec_warn_less env $ynh_node_load_PATH pnpm --recursive i --production popd +pushd $install_dir/admin + ynh_exec_warn_less env $ynh_node_load_PATH pnpm run build + cp ./dist/* ../src/templates/admin +popd + #================================================= # START SYSTEMD SERVICE #================================================= @@ -91,8 +96,6 @@ ynh_script_progression --message="Starting a systemd service..." --weight=6 ynh_systemd_action --service_name=$app --action=restart --log_path=systemd --line_match="Your Etherpad version is" -ynh_secure_remove --file="$install_dir/var/minified*" - #================================================= # END OF SCRIPT #================================================= From 0f12c4cbf9bcd80b81ca388ec9e19c6dbd448a73 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?E=CC=81ric=20Gaspar?= <46165813+ericgaspar@users.noreply.github.com> Date: Sat, 8 Jun 2024 12:04:35 +0200 Subject: [PATCH 13/13] Update install --- scripts/install | 5 ----- 1 file changed, 5 deletions(-) diff --git a/scripts/install b/scripts/install index 9c88ec9..364cc9a 100644 --- a/scripts/install +++ b/scripts/install @@ -84,11 +84,6 @@ pushd $install_dir ynh_exec_warn_less env $ynh_node_load_PATH pnpm --recursive i --production popd -pushd $install_dir/admin - ynh_exec_warn_less env $ynh_node_load_PATH pnpm run build - cp ./dist/* ../src/templates/admin -popd - #================================================= # START SYSTEMD SERVICE #=================================================