From 77aa0303a14e181ebf290489c7f5a449c4e07324 Mon Sep 17 00:00:00 2001 From: Thomas <51749973+Thovi98@users.noreply.github.com> Date: Mon, 14 Aug 2023 12:14:37 +0200 Subject: [PATCH 01/14] try fix upgrade --- scripts/install | 6 ++++++ scripts/upgrade | 16 ++++++++++++++++ 2 files changed, 22 insertions(+) diff --git a/scripts/install b/scripts/install index 444a511..e43fa30 100755 --- a/scripts/install +++ b/scripts/install @@ -16,6 +16,9 @@ ynh_script_progression --message="Installing dependencies..." --weight=5 ynh_exec_warn_less ynh_install_nodejs --nodejs_version=$nodejs_version +# Upgrade NPM +ynh_npm install --global npm@latest + # Install Yarn ynh_npm install --global yarn @@ -53,6 +56,9 @@ pushd $install_dir ynh_script_progression --message="Fetching Yarn dev dependencies... This can be very long, be patient !" --weight=18 ynh_exec_warn_less ynh_exec_as $app env $ynh_node_load_PATH yarn install --network-timeout=30000 + # fix issue "Type error: Cannot find module 'pulltorefreshjs' or its corresponding type declarations." + ynh_exec_as $app $ynh_node_load_PATH $ynh_npm install pulltorefreshjs@latest + ynh_script_progression --message="Building Yarn dev dependencies... This can be very long, be patient !" --weight=25 ynh_exec_warn_less ynh_exec_as $app env $ynh_node_load_PATH yarn run build diff --git a/scripts/upgrade b/scripts/upgrade index eb8cca9..4e63e10 100755 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -18,6 +18,19 @@ 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" +#================================================= +# INSTALL DEPENDENCIES +#================================================= +ynh_script_progression --message="Installing dependencies..." --weight=5 + +ynh_exec_warn_less ynh_install_nodejs --nodejs_version=$nodejs_version + +# Upgrade NPM +ynh_npm install --global npm@latest + +# Install Yarn +ynh_npm install --global yarn + #================================================= # "REBUILD" THE APP (DEPLOY NEW SOURCES, RERUN NPM BUILD...) #================================================= @@ -43,6 +56,9 @@ pushd $install_dir ynh_script_progression --message="Fetching Yarn dev dependencies... This can be very long, be patient !" --weight=18 ynh_exec_warn_less ynh_exec_as $app env $ynh_node_load_PATH yarn install --network-timeout=30000 + # fix issue "Type error: Cannot find module 'pulltorefreshjs' or its corresponding type declarations." + ynh_exec_as $app $ynh_node_load_PATH $ynh_npm install pulltorefreshjs@latest + ynh_script_progression --message="Building Yarn dev dependencies... This can be very long, be patient !" --weight=25 ynh_exec_warn_less ynh_exec_as $app env $ynh_node_load_PATH yarn run build From 255af128ff2839344a51689e446218d34d9fbca1 Mon Sep 17 00:00:00 2001 From: Thomas <51749973+Thovi98@users.noreply.github.com> Date: Mon, 14 Aug 2023 12:26:24 +0200 Subject: [PATCH 02/14] fix ? --- scripts/install | 3 --- scripts/upgrade | 3 --- 2 files changed, 6 deletions(-) diff --git a/scripts/install b/scripts/install index e43fa30..52c448f 100755 --- a/scripts/install +++ b/scripts/install @@ -16,9 +16,6 @@ ynh_script_progression --message="Installing dependencies..." --weight=5 ynh_exec_warn_less ynh_install_nodejs --nodejs_version=$nodejs_version -# Upgrade NPM -ynh_npm install --global npm@latest - # Install Yarn ynh_npm install --global yarn diff --git a/scripts/upgrade b/scripts/upgrade index 4e63e10..7b235a9 100755 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -25,9 +25,6 @@ ynh_script_progression --message="Installing dependencies..." --weight=5 ynh_exec_warn_less ynh_install_nodejs --nodejs_version=$nodejs_version -# Upgrade NPM -ynh_npm install --global npm@latest - # Install Yarn ynh_npm install --global yarn From 5e34b317ca24bed70148083f724b7ead46f004df Mon Sep 17 00:00:00 2001 From: Thomas <51749973+Thovi98@users.noreply.github.com> Date: Mon, 14 Aug 2023 12:38:18 +0200 Subject: [PATCH 03/14] fix --- scripts/install | 5 +++++ scripts/upgrade | 5 +++++ 2 files changed, 10 insertions(+) diff --git a/scripts/install b/scripts/install index 52c448f..0424dca 100755 --- a/scripts/install +++ b/scripts/install @@ -16,9 +16,14 @@ ynh_script_progression --message="Installing dependencies..." --weight=5 ynh_exec_warn_less ynh_install_nodejs --nodejs_version=$nodejs_version +# Upgrade NPM +ynh_npm install --global npm@latest + # Install Yarn ynh_npm install --global yarn +npm cache clean --force + #================================================= # DOWNLOAD, CHECK AND UNPACK SOURCE #================================================= diff --git a/scripts/upgrade b/scripts/upgrade index 7b235a9..7c635c9 100755 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -25,9 +25,14 @@ ynh_script_progression --message="Installing dependencies..." --weight=5 ynh_exec_warn_less ynh_install_nodejs --nodejs_version=$nodejs_version +# Upgrade NPM +ynh_npm install --global npm@latest + # Install Yarn ynh_npm install --global yarn +npm cache clean --force + #================================================= # "REBUILD" THE APP (DEPLOY NEW SOURCES, RERUN NPM BUILD...) #================================================= From 7aa7f7e2bb16da1013e4f81114d4c7e3bd755121 Mon Sep 17 00:00:00 2001 From: Thomas <51749973+Thovi98@users.noreply.github.com> Date: Mon, 14 Aug 2023 12:52:01 +0200 Subject: [PATCH 04/14] test --- scripts/install | 4 +--- scripts/upgrade | 4 +--- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/scripts/install b/scripts/install index 0424dca..2092215 100755 --- a/scripts/install +++ b/scripts/install @@ -22,8 +22,6 @@ ynh_npm install --global npm@latest # Install Yarn ynh_npm install --global yarn -npm cache clean --force - #================================================= # DOWNLOAD, CHECK AND UNPACK SOURCE #================================================= @@ -56,7 +54,7 @@ pushd $install_dir ynh_use_nodejs ynh_script_progression --message="Fetching Yarn dev dependencies... This can be very long, be patient !" --weight=18 - ynh_exec_warn_less ynh_exec_as $app env $ynh_node_load_PATH yarn install --network-timeout=30000 + ynh_exec_warn_less ynh_exec_as $app env $ynh_node_load_PATH yarn install --network-timeout=30000 --legacy-peer-deps # fix issue "Type error: Cannot find module 'pulltorefreshjs' or its corresponding type declarations." ynh_exec_as $app $ynh_node_load_PATH $ynh_npm install pulltorefreshjs@latest diff --git a/scripts/upgrade b/scripts/upgrade index 7c635c9..2949fd9 100755 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -31,8 +31,6 @@ ynh_npm install --global npm@latest # Install Yarn ynh_npm install --global yarn -npm cache clean --force - #================================================= # "REBUILD" THE APP (DEPLOY NEW SOURCES, RERUN NPM BUILD...) #================================================= @@ -56,7 +54,7 @@ pushd $install_dir ynh_use_nodejs ynh_script_progression --message="Fetching Yarn dev dependencies... This can be very long, be patient !" --weight=18 - ynh_exec_warn_less ynh_exec_as $app env $ynh_node_load_PATH yarn install --network-timeout=30000 + ynh_exec_warn_less ynh_exec_as $app env $ynh_node_load_PATH yarn install --network-timeout=30000 --legacy-peer-deps # fix issue "Type error: Cannot find module 'pulltorefreshjs' or its corresponding type declarations." ynh_exec_as $app $ynh_node_load_PATH $ynh_npm install pulltorefreshjs@latest From 23780206e6a1323b0d00d66270fa12601d4a4ace Mon Sep 17 00:00:00 2001 From: Thomas <51749973+Thovi98@users.noreply.github.com> Date: Mon, 14 Aug 2023 13:03:00 +0200 Subject: [PATCH 05/14] fix --- scripts/install | 4 ++-- scripts/upgrade | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/scripts/install b/scripts/install index 2092215..a57870b 100755 --- a/scripts/install +++ b/scripts/install @@ -54,10 +54,10 @@ pushd $install_dir ynh_use_nodejs ynh_script_progression --message="Fetching Yarn dev dependencies... This can be very long, be patient !" --weight=18 - ynh_exec_warn_less ynh_exec_as $app env $ynh_node_load_PATH yarn install --network-timeout=30000 --legacy-peer-deps + ynh_exec_warn_less ynh_exec_as $app env $ynh_node_load_PATH yarn install --network-timeout=30000 # fix issue "Type error: Cannot find module 'pulltorefreshjs' or its corresponding type declarations." - ynh_exec_as $app $ynh_node_load_PATH $ynh_npm install pulltorefreshjs@latest + ynh_exec_as $app $ynh_node_load_PATH $ynh_npm install pulltorefreshjs ynh_script_progression --message="Building Yarn dev dependencies... This can be very long, be patient !" --weight=25 ynh_exec_warn_less ynh_exec_as $app env $ynh_node_load_PATH yarn run build diff --git a/scripts/upgrade b/scripts/upgrade index 2949fd9..a84d1eb 100755 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -54,10 +54,10 @@ pushd $install_dir ynh_use_nodejs ynh_script_progression --message="Fetching Yarn dev dependencies... This can be very long, be patient !" --weight=18 - ynh_exec_warn_less ynh_exec_as $app env $ynh_node_load_PATH yarn install --network-timeout=30000 --legacy-peer-deps + ynh_exec_warn_less ynh_exec_as $app env $ynh_node_load_PATH yarn install --network-timeout=30000 # fix issue "Type error: Cannot find module 'pulltorefreshjs' or its corresponding type declarations." - ynh_exec_as $app $ynh_node_load_PATH $ynh_npm install pulltorefreshjs@latest + ynh_exec_as $app $ynh_node_load_PATH $ynh_npm install pulltorefreshjs ynh_script_progression --message="Building Yarn dev dependencies... This can be very long, be patient !" --weight=25 ynh_exec_warn_less ynh_exec_as $app env $ynh_node_load_PATH yarn run build From e5972ba9869e54ba3b2f21e799d1a20c13aea109 Mon Sep 17 00:00:00 2001 From: Thomas <51749973+Thovi98@users.noreply.github.com> Date: Mon, 14 Aug 2023 13:12:44 +0200 Subject: [PATCH 06/14] test --- scripts/install | 2 +- scripts/upgrade | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/scripts/install b/scripts/install index a57870b..30e4d55 100755 --- a/scripts/install +++ b/scripts/install @@ -57,7 +57,7 @@ pushd $install_dir ynh_exec_warn_less ynh_exec_as $app env $ynh_node_load_PATH yarn install --network-timeout=30000 # fix issue "Type error: Cannot find module 'pulltorefreshjs' or its corresponding type declarations." - ynh_exec_as $app $ynh_node_load_PATH $ynh_npm install pulltorefreshjs + ynh_exec_warn_less ynh_exec_as $app env $ynh_node_load_PATH yarn install pulltorefreshjs ynh_script_progression --message="Building Yarn dev dependencies... This can be very long, be patient !" --weight=25 ynh_exec_warn_less ynh_exec_as $app env $ynh_node_load_PATH yarn run build diff --git a/scripts/upgrade b/scripts/upgrade index a84d1eb..8e6a7a4 100755 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -55,9 +55,9 @@ pushd $install_dir ynh_script_progression --message="Fetching Yarn dev dependencies... This can be very long, be patient !" --weight=18 ynh_exec_warn_less ynh_exec_as $app env $ynh_node_load_PATH yarn install --network-timeout=30000 - + # fix issue "Type error: Cannot find module 'pulltorefreshjs' or its corresponding type declarations." - ynh_exec_as $app $ynh_node_load_PATH $ynh_npm install pulltorefreshjs + ynh_exec_warn_less ynh_exec_as $app env $ynh_node_load_PATH yarn install pulltorefreshjs ynh_script_progression --message="Building Yarn dev dependencies... This can be very long, be patient !" --weight=25 ynh_exec_warn_less ynh_exec_as $app env $ynh_node_load_PATH yarn run build From 82ee385b6e30b3ada967c323378fea7849e18ab2 Mon Sep 17 00:00:00 2001 From: Thomas <51749973+Thovi98@users.noreply.github.com> Date: Mon, 14 Aug 2023 13:29:10 +0200 Subject: [PATCH 07/14] fix --- scripts/install | 2 +- scripts/upgrade | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/install b/scripts/install index 30e4d55..27a5f68 100755 --- a/scripts/install +++ b/scripts/install @@ -57,7 +57,7 @@ pushd $install_dir ynh_exec_warn_less ynh_exec_as $app env $ynh_node_load_PATH yarn install --network-timeout=30000 # fix issue "Type error: Cannot find module 'pulltorefreshjs' or its corresponding type declarations." - ynh_exec_warn_less ynh_exec_as $app env $ynh_node_load_PATH yarn install pulltorefreshjs + ynh_exec_warn_less ynh_exec_as $app env $ynh_node_load_PATH yarn add pulltorefreshjs ynh_script_progression --message="Building Yarn dev dependencies... This can be very long, be patient !" --weight=25 ynh_exec_warn_less ynh_exec_as $app env $ynh_node_load_PATH yarn run build diff --git a/scripts/upgrade b/scripts/upgrade index 8e6a7a4..29207a3 100755 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -57,7 +57,7 @@ pushd $install_dir ynh_exec_warn_less ynh_exec_as $app env $ynh_node_load_PATH yarn install --network-timeout=30000 # fix issue "Type error: Cannot find module 'pulltorefreshjs' or its corresponding type declarations." - ynh_exec_warn_less ynh_exec_as $app env $ynh_node_load_PATH yarn install pulltorefreshjs + ynh_exec_warn_less ynh_exec_as $app env $ynh_node_load_PATH yarn add pulltorefreshjs ynh_script_progression --message="Building Yarn dev dependencies... This can be very long, be patient !" --weight=25 ynh_exec_warn_less ynh_exec_as $app env $ynh_node_load_PATH yarn run build From f9aee7070c718465bc0ee18a8f4a648cc7e08f39 Mon Sep 17 00:00:00 2001 From: Thomas <51749973+Thovi98@users.noreply.github.com> Date: Mon, 14 Aug 2023 13:32:42 +0200 Subject: [PATCH 08/14] fix linter full_domain --- manifest.toml | 1 - 1 file changed, 1 deletion(-) diff --git a/manifest.toml b/manifest.toml index f4de157..1d2efa1 100644 --- a/manifest.toml +++ b/manifest.toml @@ -26,7 +26,6 @@ ram.runtime = "50M" [install] [install.domain] type = "domain" - full_domain = true [install.init_main_permission] type = "group" From 8815a131ac363a08fc3334aec710bb8428132e1e Mon Sep 17 00:00:00 2001 From: Thomas <51749973+Thovi98@users.noreply.github.com> Date: Mon, 14 Aug 2023 15:40:02 +0200 Subject: [PATCH 09/14] try proposed fix --- scripts/install | 2 +- scripts/upgrade | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/install b/scripts/install index 27a5f68..f821d15 100755 --- a/scripts/install +++ b/scripts/install @@ -57,7 +57,7 @@ pushd $install_dir ynh_exec_warn_less ynh_exec_as $app env $ynh_node_load_PATH yarn install --network-timeout=30000 # fix issue "Type error: Cannot find module 'pulltorefreshjs' or its corresponding type declarations." - ynh_exec_warn_less ynh_exec_as $app env $ynh_node_load_PATH yarn add pulltorefreshjs + ynh_exec_warn_less ynh_exec_as $app env $ynh_node_load_PATH npm i --save-dev @types/pulltorefreshjs ynh_script_progression --message="Building Yarn dev dependencies... This can be very long, be patient !" --weight=25 ynh_exec_warn_less ynh_exec_as $app env $ynh_node_load_PATH yarn run build diff --git a/scripts/upgrade b/scripts/upgrade index 29207a3..01eb7e0 100755 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -57,7 +57,7 @@ pushd $install_dir ynh_exec_warn_less ynh_exec_as $app env $ynh_node_load_PATH yarn install --network-timeout=30000 # fix issue "Type error: Cannot find module 'pulltorefreshjs' or its corresponding type declarations." - ynh_exec_warn_less ynh_exec_as $app env $ynh_node_load_PATH yarn add pulltorefreshjs + ynh_exec_warn_less ynh_exec_as $app env $ynh_node_load_PATH npm i --save-dev @types/pulltorefreshjs ynh_script_progression --message="Building Yarn dev dependencies... This can be very long, be patient !" --weight=25 ynh_exec_warn_less ynh_exec_as $app env $ynh_node_load_PATH yarn run build From 0d972336d95c12917bc87c6938249c890dd4480e Mon Sep 17 00:00:00 2001 From: Thomas <51749973+Thovi98@users.noreply.github.com> Date: Thu, 24 Aug 2023 14:40:17 +0200 Subject: [PATCH 10/14] Update install --- scripts/install | 3 --- 1 file changed, 3 deletions(-) diff --git a/scripts/install b/scripts/install index f821d15..eafb68a 100755 --- a/scripts/install +++ b/scripts/install @@ -56,9 +56,6 @@ pushd $install_dir ynh_script_progression --message="Fetching Yarn dev dependencies... This can be very long, be patient !" --weight=18 ynh_exec_warn_less ynh_exec_as $app env $ynh_node_load_PATH yarn install --network-timeout=30000 - # fix issue "Type error: Cannot find module 'pulltorefreshjs' or its corresponding type declarations." - ynh_exec_warn_less ynh_exec_as $app env $ynh_node_load_PATH npm i --save-dev @types/pulltorefreshjs - ynh_script_progression --message="Building Yarn dev dependencies... This can be very long, be patient !" --weight=25 ynh_exec_warn_less ynh_exec_as $app env $ynh_node_load_PATH yarn run build From d6aae580819f1614912b3cab36a678cc3ac2cb5e Mon Sep 17 00:00:00 2001 From: Thomas <51749973+Thovi98@users.noreply.github.com> Date: Thu, 24 Aug 2023 14:40:54 +0200 Subject: [PATCH 11/14] Update upgrade --- scripts/upgrade | 3 --- 1 file changed, 3 deletions(-) diff --git a/scripts/upgrade b/scripts/upgrade index 01eb7e0..98c51bd 100755 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -55,9 +55,6 @@ pushd $install_dir ynh_script_progression --message="Fetching Yarn dev dependencies... This can be very long, be patient !" --weight=18 ynh_exec_warn_less ynh_exec_as $app env $ynh_node_load_PATH yarn install --network-timeout=30000 - - # fix issue "Type error: Cannot find module 'pulltorefreshjs' or its corresponding type declarations." - ynh_exec_warn_less ynh_exec_as $app env $ynh_node_load_PATH npm i --save-dev @types/pulltorefreshjs ynh_script_progression --message="Building Yarn dev dependencies... This can be very long, be patient !" --weight=25 ynh_exec_warn_less ynh_exec_as $app env $ynh_node_load_PATH yarn run build From c9f7c055008b7e8bd8e0f670b0f5da85be15be7f Mon Sep 17 00:00:00 2001 From: Thomas <51749973+Thovi98@users.noreply.github.com> Date: Sat, 26 Aug 2023 21:24:26 +0200 Subject: [PATCH 12/14] increase timeout --- scripts/install | 2 +- scripts/upgrade | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/install b/scripts/install index eafb68a..3aed925 100755 --- a/scripts/install +++ b/scripts/install @@ -54,7 +54,7 @@ pushd $install_dir ynh_use_nodejs ynh_script_progression --message="Fetching Yarn dev dependencies... This can be very long, be patient !" --weight=18 - ynh_exec_warn_less ynh_exec_as $app env $ynh_node_load_PATH yarn install --network-timeout=30000 + ynh_exec_warn_less ynh_exec_as $app env $ynh_node_load_PATH yarn install --network-timeout=100000 ynh_script_progression --message="Building Yarn dev dependencies... This can be very long, be patient !" --weight=25 ynh_exec_warn_less ynh_exec_as $app env $ynh_node_load_PATH yarn run build diff --git a/scripts/upgrade b/scripts/upgrade index 98c51bd..f3c5540 100755 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -54,7 +54,7 @@ pushd $install_dir ynh_use_nodejs ynh_script_progression --message="Fetching Yarn dev dependencies... This can be very long, be patient !" --weight=18 - ynh_exec_warn_less ynh_exec_as $app env $ynh_node_load_PATH yarn install --network-timeout=30000 + ynh_exec_warn_less ynh_exec_as $app env $ynh_node_load_PATH yarn install --network-timeout=100000 ynh_script_progression --message="Building Yarn dev dependencies... This can be very long, be patient !" --weight=25 ynh_exec_warn_less ynh_exec_as $app env $ynh_node_load_PATH yarn run build From 00e24dcd49b90b6d8f901de830e8314ccea592ae Mon Sep 17 00:00:00 2001 From: Thomas <51749973+Thovi98@users.noreply.github.com> Date: Wed, 6 Sep 2023 16:21:22 +0200 Subject: [PATCH 13/14] Update upgrade --- scripts/upgrade | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/upgrade b/scripts/upgrade index f3c5540..28f151f 100755 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -39,7 +39,7 @@ ynh_npm install --global yarn ynh_script_progression --message="Setting up source files..." --weight=1 # Download, check integrity, uncompress and patch the source from app.src -ynh_setup_source --dest_dir="$install_dir" +ynh_setup_source --dest_dir="$install_dir" --keep="config" chmod 750 "$install_dir" chmod -R o-rwx "$install_dir" From 7b06373fc331f2539a6beab8dbfc5f6647720067 Mon Sep 17 00:00:00 2001 From: Thomas <51749973+Thovi98@users.noreply.github.com> Date: Wed, 6 Sep 2023 17:53:53 +0200 Subject: [PATCH 14/14] Update upgrade --- scripts/upgrade | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/scripts/upgrade b/scripts/upgrade index 28f151f..8458172 100755 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -38,8 +38,21 @@ ynh_npm install --global yarn #================================================= ynh_script_progression --message="Setting up source files..." --weight=1 +if [ "$upgrade_type" == "UPGRADE_APP" ] +then + ynh_script_progression --message="Upgrading source files..." + # Move old app dir + mv ${install_dir} ${install_dir}.old + # Download, check integrity, uncompress and patch the source from app.src -ynh_setup_source --dest_dir="$install_dir" --keep="config" +ynh_setup_source --dest_dir="$install_dir" + +# restore data + cp -a ${install_dir}.old/config ${install_dir} + + # delete temp directory + ynh_secure_remove --file=${install_dir}.old +fi chmod 750 "$install_dir" chmod -R o-rwx "$install_dir"