From a679952ed008a0b98784e0b8cf13ccf544c5f369 Mon Sep 17 00:00:00 2001 From: einhornimmond Date: Sat, 15 Mar 2025 10:07:54 +0100 Subject: [PATCH 1/8] increase node js version --- backend/.nvmrc | 2 +- backend/Dockerfile | 2 +- config/.nvmrc | 2 +- database/.nvmrc | 2 +- database/Dockerfile | 2 +- deployment/bare_metal/start.sh | 61 +++++++++++-------- deployment/hetzner_cloud/install.sh | 4 +- .../migration/2_5_1-2_5_2/README.md | 15 +++++ .../migration/2_5_1-2_5_2/upgradeNodeJs.sh | 20 ++++++ federation/.nvmrc | 2 +- federation/Dockerfile | 2 +- 11 files changed, 80 insertions(+), 34 deletions(-) create mode 100644 deployment/hetzner_cloud/migration/2_5_1-2_5_2/README.md create mode 100644 deployment/hetzner_cloud/migration/2_5_1-2_5_2/upgradeNodeJs.sh diff --git a/backend/.nvmrc b/backend/.nvmrc index 79bdb1b97..216afccff 100644 --- a/backend/.nvmrc +++ b/backend/.nvmrc @@ -1 +1 @@ -v18.7.0 +v18.20.7 diff --git a/backend/Dockerfile b/backend/Dockerfile index b755ecd38..2375568e6 100644 --- a/backend/Dockerfile +++ b/backend/Dockerfile @@ -1,7 +1,7 @@ ################################################################################## # BASE ########################################################################### ################################################################################## -FROM node:18.7.0-alpine3.16 as base +FROM node:18.20.7-alpine3.21 as base # ENVs (available in production aswell, can be overwritten by commandline or env file) ## DOCKER_WORKDIR would be a classical ARG, but that is not multi layer persistent - shame diff --git a/config/.nvmrc b/config/.nvmrc index 79bdb1b97..216afccff 100644 --- a/config/.nvmrc +++ b/config/.nvmrc @@ -1 +1 @@ -v18.7.0 +v18.20.7 diff --git a/database/.nvmrc b/database/.nvmrc index 02c4afe7d..5a0afb48b 100644 --- a/database/.nvmrc +++ b/database/.nvmrc @@ -1 +1 @@ -v18.7.0 \ No newline at end of file +v18.20.7 \ No newline at end of file diff --git a/database/Dockerfile b/database/Dockerfile index e34a4dbb6..3e6be7dbc 100644 --- a/database/Dockerfile +++ b/database/Dockerfile @@ -1,7 +1,7 @@ ################################################################################## # BASE ########################################################################### ################################################################################## -FROM node:18.7.0-alpine3.16 as base +FROM node:18.20.7-alpine3.21 as base # ENVs (available in production aswell, can be overwritten by commandline or env file) ## DOCKER_WORKDIR would be a classical ARG, but that is not multi layer persistent - shame diff --git a/deployment/bare_metal/start.sh b/deployment/bare_metal/start.sh index 7b413d3ff..19ce3ffc9 100755 --- a/deployment/bare_metal/start.sh +++ b/deployment/bare_metal/start.sh @@ -1,4 +1,12 @@ #!/bin/bash + +# helper functions +log_step() { + local message="$1" + echo -e "\e[34m$message\e[0m" # blue in console + echo "
$message
" >> "$UPDATE_HTML" # blue in html +} + # check for parameter if [ -z "$1" ]; then echo "Usage: Please provide a branch name as the first argument." @@ -75,18 +83,18 @@ TODAY=$(date +"%Y-%m-%d") exec > >(tee -a $UPDATE_HTML) 2>&1 # configure nginx for the update-page -echo 'Configuring nginx to serve the update-page' >> $UPDATE_HTML +log_step 'Configuring nginx to serve the update-page' ln -sf $SCRIPT_DIR/nginx/sites-available/update-page.conf $SCRIPT_DIR/nginx/sites-enabled/default sudo /etc/init.d/nginx restart # stop all services -echo 'Stop and delete all Gradido services' >> $UPDATE_HTML +log_step "Stop and delete all Gradido services" pm2 delete all pm2 save # git BRANCH=$1 -echo "Starting with git pull - branch:$BRANCH" >> $UPDATE_HTML +log_step "Starting with git pull - branch:$BRANCH" cd $PROJECT_ROOT # TODO: this overfetches alot, but ensures we can use start.sh with tags git fetch --all @@ -99,7 +107,7 @@ export BUILD_COMMIT="$(git rev-parse HEAD)" # *** set FEDERATION_PORT from FEDERATION_COMMUNITY_APIS and create gradido-federation.conf file rm -f $NGINX_CONFIG_DIR/gradido.conf.tmp rm -f $NGINX_CONFIG_DIR/gradido-federation.conf.locations -echo "====================================================================================================" >> $UPDATE_HTML +log_step "====================================================================================================" IFS="," read -a API_ARRAY <<< $FEDERATION_COMMUNITY_APIS for api in "${API_ARRAY[@]}" do @@ -109,18 +117,18 @@ do FEDERATION_PORT=${FEDERATION_COMMUNITY_API_PORT:-5000} FEDERATION_PORT=$(($FEDERATION_PORT + $port)) export FEDERATION_PORT - echo "create ngingx config: location /api/$FEDERATION_APIVERSION to http://127.0.0.1:$FEDERATION_PORT" >> $UPDATE_HTML + log_step "create ngingx config: location /api/$FEDERATION_APIVERSION to http://127.0.0.1:$FEDERATION_PORT" envsubst '$FEDERATION_APIVERSION, $FEDERATION_PORT' < $NGINX_CONFIG_DIR/gradido-federation.conf.template >> $NGINX_CONFIG_DIR/gradido-federation.conf.locations done unset FEDERATION_APIVERSION unset FEDERATION_PORT -echo "====================================================================================================" >> $UPDATE_HTML +log_step "====================================================================================================" # *** 2nd read gradido-federation.conf file in env variable to be replaced in 3rd step export FEDERATION_NGINX_CONF=$(< $NGINX_CONFIG_DIR/gradido-federation.conf.locations) # *** 3rd generate gradido nginx config including federation modules per api-version -echo 'Generate new gradido nginx config' >> $UPDATE_HTML +log_step 'Generate new gradido nginx config' case "$URL_PROTOCOL" in 'https') TEMPLATE_FILE="gradido.conf.ssl.template" ;; *) TEMPLATE_FILE="gradido.conf.template" ;; @@ -132,18 +140,20 @@ rm $NGINX_CONFIG_DIR/gradido.conf.tmp rm $NGINX_CONFIG_DIR/gradido-federation.conf.locations # Generate update-page.conf from template -echo 'Generate new update-page nginx config' >> $UPDATE_HTML +log_step 'Generate new update-page nginx config' case "$URL_PROTOCOL" in 'https') TEMPLATE_FILE="update-page.conf.ssl.template" ;; *) TEMPLATE_FILE="update-page.conf.template" ;; esac envsubst "$(env | sed -e 's/=.*//' -e 's/^/\$/g')" < $NGINX_CONFIG_DIR/$TEMPLATE_FILE > $NGINX_CONFIG_DIR/update-page.conf +log_step 'Clean tmp and yarn cache' # Clean tmp folder - remove yarn files find /tmp -name "yarn--*" -exec rm -r {} \; # Clean user cache folder rm -Rf ~/.cache/yarn +log_step 'Remove all node_modules and build folders' # Remove node_modules folders # we had problems with corrupted node_modules folder rm -Rf $PROJECT_ROOT/database/node_modules @@ -164,6 +174,7 @@ rm -Rf $PROJECT_ROOT/admin/build rm -Rf $PROJECT_ROOT/dht-node/build rm -Rf $PROJECT_ROOT/federation/build +log_step 'Regenerate .env files' # Regenerate .env files cp -f $PROJECT_ROOT/database/.env $PROJECT_ROOT/database/.env.bak cp -f $PROJECT_ROOT/backend/.env $PROJECT_ROOT/backend/.env.bak @@ -179,7 +190,7 @@ envsubst "$(env | sed -e 's/=.*//' -e 's/^/\$/g')" < $PROJECT_ROOT/dht-node/.env envsubst "$(env | sed -e 's/=.*//' -e 's/^/\$/g')" < $PROJECT_ROOT/federation/.env.template > $PROJECT_ROOT/federation/.env # Install & build database -echo 'Updating database' >> $UPDATE_HTML +log_step 'Updating database' cd $PROJECT_ROOT/database yarn install yarn build @@ -191,13 +202,13 @@ else fi # Install & build config -echo 'Updating config' >> $UPDATE_HTML +log_step 'Updating config' cd $PROJECT_ROOT/config yarn install yarn build # Install & build backend -echo 'Updating backend' >> $UPDATE_HTML +log_step 'Updating backend' cd $PROJECT_ROOT/backend # TODO maybe handle this differently? unset NODE_ENV @@ -211,7 +222,7 @@ export NODE_ENV=production # Install & build frontend -echo 'Updating frontend' >> $UPDATE_HTML +log_step 'Updating frontend' cd $PROJECT_ROOT/frontend # TODO maybe handle this differently? unset NODE_ENV @@ -224,7 +235,7 @@ yarn build export NODE_ENV=production # Install & build admin -echo 'Updating admin' >> $UPDATE_HTML +log_step 'Updating admin' cd $PROJECT_ROOT/admin # TODO maybe handle this differently? unset NODE_ENV @@ -239,7 +250,7 @@ export NODE_ENV=production nvm use default # Install & build dht-node -echo 'Updating dht-node' >> $UPDATE_HTML +log_step 'Updating dht-node' cd $PROJECT_ROOT/dht-node # TODO maybe handle this differently? unset NODE_ENV @@ -249,7 +260,7 @@ yarn build export NODE_ENV=production # Install & build federation -echo 'Updating federation' >> $UPDATE_HTML +log_step 'Updating federation' cd $PROJECT_ROOT/federation # TODO maybe handle this differently? unset NODE_ENV @@ -268,34 +279,34 @@ if [ ! -z $FEDERATION_DHT_TOPIC ]; then pm2 start --name gradido-dht-node "yarn --cwd $PROJECT_ROOT/dht-node start" -l $GRADIDO_LOG_PATH/pm2.dht-node.$TODAY.log --log-date-format 'YYYY-MM-DD HH:mm:ss.SSS' pm2 save else - echo "=====================================================================" >> $UPDATE_HTML - echo "WARNING: FEDERATION_DHT_TOPIC not configured. DHT-Node not started..." >> $UPDATE_HTML - echo "=====================================================================" >> $UPDATE_HTML -fi + log_step "=====================================================================" + log_step "WARNING: FEDERATION_DHT_TOPIC not configured. DHT-Node not started..." + log_step "=====================================================================" +fi # set FEDERATION_PORT from FEDERATION_COMMUNITY_APIS IFS="," read -a API_ARRAY <<< $FEDERATION_COMMUNITY_APIS for api in "${API_ARRAY[@]}" do export FEDERATION_API=$api - echo "FEDERATION_API=$FEDERATION_API" >> $UPDATE_HTML + log_step "FEDERATION_API=$FEDERATION_API" export MODULENAME=gradido-federation-$api - echo "MODULENAME=$MODULENAME" >> $UPDATE_HTML + log_step "MODULENAME=$MODULENAME" # calculate port by remove '_' and add value of api to baseport port=${api//_/} FEDERATION_PORT=${FEDERATION_COMMUNITY_API_PORT:-5000} FEDERATION_PORT=$(($FEDERATION_PORT + $port)) export FEDERATION_PORT - echo "====================================================" >> $UPDATE_HTML - echo " start $MODULENAME listening on port=$FEDERATION_PORT" >> $UPDATE_HTML - echo "====================================================" >> $UPDATE_HTML + log_step "====================================================" + log_step " start $MODULENAME listening on port=$FEDERATION_PORT" + log_step "====================================================" # pm2 delete $MODULENAME pm2 start --name $MODULENAME "yarn --cwd $PROJECT_ROOT/federation start" -l $GRADIDO_LOG_PATH/pm2.$MODULENAME.$TODAY.log --log-date-format 'YYYY-MM-DD HH:mm:ss.SSS' pm2 save done # let nginx showing gradido -echo 'Configuring nginx to serve gradido again' >> $UPDATE_HTML +log_step 'Configuring nginx to serve gradido again' ln -sf $SCRIPT_DIR/nginx/sites-available/gradido.conf $SCRIPT_DIR/nginx/sites-enabled/default sudo /etc/init.d/nginx restart diff --git a/deployment/hetzner_cloud/install.sh b/deployment/hetzner_cloud/install.sh index 1be3548cc..ac43c6421 100755 --- a/deployment/hetzner_cloud/install.sh +++ b/deployment/hetzner_cloud/install.sh @@ -124,11 +124,11 @@ sudo systemctl daemon-reload # setup https with certbot certbot certonly --nginx --non-interactive --agree-tos --domains $COMMUNITY_HOST --email $COMMUNITY_SUPPORT_MAIL -# Install node 16. with nvm, with nodesource is depracted +# Install node 18 sudo -u gradido bash -c 'curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.7/install.sh | bash' # Close and reopen your terminal to start using nvm or run the following to use it now: sudo -u gradido bash -c 'export NVM_DIR="$HOME/.nvm" && [ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh"' -sudo -u gradido bash -c '. $HOME/.nvm/nvm.sh && nvm install 16' # first installed version will be set to default automatic +sudo -u gradido bash -c '. $HOME/.nvm/nvm.sh && nvm install v18.20.7' # first installed version will be set to default automatic # Install yarn sudo -u gradido bash -c '. $HOME/.nvm/nvm.sh && npm i -g yarn' diff --git a/deployment/hetzner_cloud/migration/2_5_1-2_5_2/README.md b/deployment/hetzner_cloud/migration/2_5_1-2_5_2/README.md new file mode 100644 index 000000000..7534ce060 --- /dev/null +++ b/deployment/hetzner_cloud/migration/2_5_1-2_5_2/README.md @@ -0,0 +1,15 @@ +## Migrate from Gradido Version 2.5.1 to 2.5.2 +### What +We need to upgrade the used nodejs version in deployment. Until now for pm2, backend, dht-node, federation nodejs 16 was used, +but some newer npm libs don't work with this old nodejs version so we upgrade to nodejs 18.20.7 + +### What you can do now +You need to only run this [upgradeNodeJs.sh](upgradeNodeJs.sh) with `release-2_5_2-beta` as parameter +```bash +cd /home/gradido/gradido/deployment/hetzner_cloud/migration/2_5_1-2_5_2 +sudo ./upgradeNodeJs.sh `release-2_5_2-beta` +``` + +It will stop pm2, install new nodejs version + pm2 + yarn, remove nodejs 16. +Then it will call start.sh with first parameter of ./upgradeNodeJs.sh as his first parameter + diff --git a/deployment/hetzner_cloud/migration/2_5_1-2_5_2/upgradeNodeJs.sh b/deployment/hetzner_cloud/migration/2_5_1-2_5_2/upgradeNodeJs.sh new file mode 100644 index 000000000..baef7550d --- /dev/null +++ b/deployment/hetzner_cloud/migration/2_5_1-2_5_2/upgradeNodeJs.sh @@ -0,0 +1,20 @@ +#!/bin/bash +# check for parameter +if [ -z "$1" ]; then + echo "Usage: Please provide a branch name as the first argument." + exit 1 +fi + +# stop all services +pm2 delete all +pm2 save + +# upgrade node js version +nvm install 18.20.7 +nvm use 18.20.7 +nvm alias default 18.20.7 +npm install -g pm2 yarn +nvm uninstall 16 + +# Start gradido +sudo -u gradido $SCRIPT_PATH/start.sh $1 \ No newline at end of file diff --git a/federation/.nvmrc b/federation/.nvmrc index 02c4afe7d..5a0afb48b 100644 --- a/federation/.nvmrc +++ b/federation/.nvmrc @@ -1 +1 @@ -v18.7.0 \ No newline at end of file +v18.20.7 \ No newline at end of file diff --git a/federation/Dockerfile b/federation/Dockerfile index 26c83ad7b..0227f8da7 100644 --- a/federation/Dockerfile +++ b/federation/Dockerfile @@ -1,7 +1,7 @@ ################################################################################## # BASE ########################################################################### ################################################################################## -FROM node:18.7.0-alpine3.16 as base +FROM node:18.20.7-alpine3.21 as base # ENVs (available in production aswell, can be overwritten by commandline or env file) ## DOCKER_WORKDIR would be a classical ARG, but that is not multi layer persistent - shame From c06c8b07a341cadc3f9504a4332bc2c42e8832be Mon Sep 17 00:00:00 2001 From: einhornimmond Date: Sat, 15 Mar 2025 10:19:44 +0100 Subject: [PATCH 2/8] fix color --- deployment/bare_metal/start.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/deployment/bare_metal/start.sh b/deployment/bare_metal/start.sh index 19ce3ffc9..d78391bdd 100755 --- a/deployment/bare_metal/start.sh +++ b/deployment/bare_metal/start.sh @@ -3,8 +3,8 @@ # helper functions log_step() { local message="$1" - echo -e "\e[34m$message\e[0m" # blue in console - echo "
$message
" >> "$UPDATE_HTML" # blue in html + echo -e "\e[34m$message\e[0m" > /dev/tty # blue in console + echo "

$message

" >> "$UPDATE_HTML" # blue in html } # check for parameter From 5853fff27cf53cfec1eac3cb417cc3ded80a97b9 Mon Sep 17 00:00:00 2001 From: einhornimmond Date: Sat, 15 Mar 2025 10:34:19 +0100 Subject: [PATCH 3/8] change default database server from localhost to 127.0.0.1 to prevent ipv6 errors --- backend/.env.dist | 2 +- backend/.env.org | 2 +- backend/.env.template | 2 +- database/.env.dist | 2 +- database/.env.template | 2 +- dht-node/.env.dist | 2 +- dht-node/.env.template | 2 +- docker-compose.yml | 2 +- federation/.env.dist | 2 +- federation/.env.template | 2 +- 10 files changed, 10 insertions(+), 10 deletions(-) diff --git a/backend/.env.dist b/backend/.env.dist index 51a751a23..689e138e4 100644 --- a/backend/.env.dist +++ b/backend/.env.dist @@ -6,7 +6,7 @@ GRAPHIQL=false GDT_ACTIVE=false # Database -DB_HOST=localhost +DB_HOST=127.0.0.1 DB_PORT=3306 DB_USER=root DB_PASSWORD= diff --git a/backend/.env.org b/backend/.env.org index fb95c950d..a0082aab1 100644 --- a/backend/.env.org +++ b/backend/.env.org @@ -6,7 +6,7 @@ GRAPHIQL=false GDT_API_URL=https://gdt.gradido.net # Database -DB_HOST=localhost +DB_HOST=127.0.0.1 DB_PORT=3306 DB_USER=root DB_PASSWORD= diff --git a/backend/.env.template b/backend/.env.template index 2205417a3..ffdb4f542 100644 --- a/backend/.env.template +++ b/backend/.env.template @@ -8,7 +8,7 @@ GRAPHIQL=false GDT_API_URL=$GDT_API_URL # Database -DB_HOST=localhost +DB_HOST=127.0.0.1 DB_PORT=3306 DB_USER=$DB_USER DB_PASSWORD=$DB_PASSWORD diff --git a/database/.env.dist b/database/.env.dist index 0b2c342ca..658d4d08d 100644 --- a/database/.env.dist +++ b/database/.env.dist @@ -1,4 +1,4 @@ -DB_HOST=localhost +DB_HOST=127.0.0.1 DB_PORT=3306 DB_USER=root DB_PASSWORD= diff --git a/database/.env.template b/database/.env.template index e21d4548c..b5aebba8f 100644 --- a/database/.env.template +++ b/database/.env.template @@ -1,6 +1,6 @@ CONFIG_VERSION=$DATABASE_CONFIG_VERSION -DB_HOST=localhost +DB_HOST=127.0.0.1 DB_PORT=3306 DB_USER=$DB_USER DB_PASSWORD=$DB_PASSWORD diff --git a/dht-node/.env.dist b/dht-node/.env.dist index fa07fc904..351bc251d 100644 --- a/dht-node/.env.dist +++ b/dht-node/.env.dist @@ -1,5 +1,5 @@ # Database -DB_HOST=localhost +DB_HOST=127.0.0.1 DB_PORT=3306 DB_USER=root DB_PASSWORD= diff --git a/dht-node/.env.template b/dht-node/.env.template index b4cef7f5e..ad5765f96 100644 --- a/dht-node/.env.template +++ b/dht-node/.env.template @@ -2,7 +2,7 @@ CONFIG_VERSION=$FEDERATION_DHT_CONFIG_VERSION # Database -DB_HOST=localhost +DB_HOST=127.0.0.1 DB_PORT=3306 DB_USER=$DB_USER DB_PASSWORD=$DB_PASSWORD diff --git a/docker-compose.yml b/docker-compose.yml index 372877bf1..88fc3bbcf 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -67,7 +67,7 @@ services: ## MARIADB ############################################## ######################################################### mariadb: - image: mariadb:10.5 + image: mariadb:10.11.6 environment: - MARIADB_ALLOW_EMPTY_ROOT_PASSWORD=1 - MARIADB_USER=root diff --git a/federation/.env.dist b/federation/.env.dist index 42b3d05bf..2255436d5 100644 --- a/federation/.env.dist +++ b/federation/.env.dist @@ -1,5 +1,5 @@ # Database -DB_HOST=localhost +DB_HOST=127.0.0.1 DB_PORT=3306 DB_DATABASE=gradido_community DB_USER=root diff --git a/federation/.env.template b/federation/.env.template index 9a029c3d1..a4ac298ef 100644 --- a/federation/.env.template +++ b/federation/.env.template @@ -6,7 +6,7 @@ LOG_LEVEL=$LOG_LEVEL GRAPHIQL=false # Database -DB_HOST=localhost +DB_HOST=127.0.0.1 DB_PORT=3306 DB_USER=$DB_USER DB_PASSWORD=$DB_PASSWORD From 5c3b121a5806a0a83997555f07221bb35ed295c3 Mon Sep 17 00:00:00 2001 From: einhornimmond Date: Sat, 15 Mar 2025 10:39:03 +0100 Subject: [PATCH 4/8] no need for extra nvm change for admin and frontend, because default version is now the correct one --- deployment/bare_metal/start.sh | 8 -------- 1 file changed, 8 deletions(-) diff --git a/deployment/bare_metal/start.sh b/deployment/bare_metal/start.sh index d78391bdd..5950547d0 100755 --- a/deployment/bare_metal/start.sh +++ b/deployment/bare_metal/start.sh @@ -226,9 +226,6 @@ log_step 'Updating frontend' cd $PROJECT_ROOT/frontend # TODO maybe handle this differently? unset NODE_ENV -nvm use -nvm install -npm i -g yarn yarn install yarn build # TODO maybe handle this differently? @@ -239,16 +236,11 @@ log_step 'Updating admin' cd $PROJECT_ROOT/admin # TODO maybe handle this differently? unset NODE_ENV -nvm use -nvm install -npm i -g yarn yarn install yarn build # TODO maybe handle this differently? export NODE_ENV=production -nvm use default - # Install & build dht-node log_step 'Updating dht-node' cd $PROJECT_ROOT/dht-node From 5409524bb8eeea4686ae5b8bc6fe32e127e4fee1 Mon Sep 17 00:00:00 2001 From: einhornimmond Date: Sat, 15 Mar 2025 10:56:05 +0100 Subject: [PATCH 5/8] use same nodejs version also for dht-node docker --- dht-node/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dht-node/Dockerfile b/dht-node/Dockerfile index 6e35176a3..7610bbac3 100644 --- a/dht-node/Dockerfile +++ b/dht-node/Dockerfile @@ -1,7 +1,7 @@ ################################################################################## # BASE ########################################################################### ################################################################################## -FROM node:19.5.0-alpine3.17 as base +FROM node:18.20.7-alpine3.21 as base #FROM ubuntu:latest as base # ENVs (available in production aswell, can be overwritten by commandline or env file) From fe9f9d5761b190f6615b3cda7a3491d4fc110fa3 Mon Sep 17 00:00:00 2001 From: einhornimmond Date: Sat, 15 Mar 2025 11:02:06 +0100 Subject: [PATCH 6/8] remove part which is failing and seems to be not needed at all --- dht-node/Dockerfile | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/dht-node/Dockerfile b/dht-node/Dockerfile index 7610bbac3..dab401762 100644 --- a/dht-node/Dockerfile +++ b/dht-node/Dockerfile @@ -33,10 +33,10 @@ LABEL maintainer="support@gradido.net" # Install Additional Software ## install: sodium requirements -RUN apk add --no-cache --virtual build-deps python3 alpine-sdk autoconf libtool automake && \ - mkdir -p /prebuilds && cd /prebuilds && npm init -y && npm install sodium-native@3.1.1 && \ - apk del build-deps -ENV SODIUM_NATIVE_PREBUILD=/prebuilds/node_modules/sodium-native/ +#RUN apk add --no-cache --virtual build-deps python3 alpine-sdk autoconf libtool automake && \ +# mkdir -p /prebuilds && cd /prebuilds && npm init -y && npm install sodium-native@3.1.1 && \ +# apk del build-deps +#ENV SODIUM_NATIVE_PREBUILD=/prebuilds/node_modules/sodium-native/ # Settings ## Expose Container Port From f2113bf6a55e8e3aae78f55ad128832d3c6514a7 Mon Sep 17 00:00:00 2001 From: einhornimmond Date: Sat, 15 Mar 2025 11:04:21 +0100 Subject: [PATCH 7/8] missing update --- dht-node/.nvmrc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dht-node/.nvmrc b/dht-node/.nvmrc index 9dfdb2923..5a0afb48b 100644 --- a/dht-node/.nvmrc +++ b/dht-node/.nvmrc @@ -1 +1 @@ -v19.5.0 \ No newline at end of file +v18.20.7 \ No newline at end of file From 9bd7983f8d35f7794e0f1e4b3826269081240497 Mon Sep 17 00:00:00 2001 From: einhornimmond Date: Sat, 15 Mar 2025 11:22:01 +0100 Subject: [PATCH 8/8] use same test call like backend --- .github/workflows/test_dht_node.yml | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/.github/workflows/test_dht_node.yml b/.github/workflows/test_dht_node.yml index 2bbbd5e6d..4cb50a093 100644 --- a/.github/workflows/test_dht_node.yml +++ b/.github/workflows/test_dht_node.yml @@ -29,7 +29,7 @@ jobs: steps: - name: Checkout code uses: actions/checkout@v3 - + - name: Build 'test' image run: | docker build --target test -t "gradido/dht-node:test" -f dht-node/Dockerfile . @@ -49,7 +49,7 @@ jobs: steps: - name: Checkout code uses: actions/checkout@v3 - + - name: Lint run: cd database && yarn && cd ../config && yarn install && cd ../dht-node && yarn && yarn run lint @@ -61,7 +61,7 @@ jobs: steps: - name: Checkout code uses: actions/checkout@v3 - + - name: Download Docker Image uses: actions/download-artifact@v4 with: @@ -70,10 +70,10 @@ jobs: - name: Load Docker Image run: docker load < /tmp/dht-node.tar - + - name: docker-compose mariadb run: docker compose -f docker-compose.yml -f docker-compose.test.yml up --detach --no-deps mariadb - + - name: Sleep for 30 seconds run: sleep 30s shell: bash @@ -85,7 +85,7 @@ jobs: run: sleep 30s shell: bash - #- name: Unit tests - # run: cd database && yarn && yarn build && cd ../dht-node && yarn && yarn test - name: Unit tests - run: docker run --env NODE_ENV=test --env DB_HOST=mariadb --network gradido_internal-net --rm gradido/dht-node:test yarn run test + run: cd database && yarn && yarn build && cd ../config && yarn install && cd ../dht-node && yarn && yarn test + #- name: Unit tests + # run: docker run --env NODE_ENV=test --env DB_HOST=mariadb --network gradido_internal-net --rm gradido/dht-node:test yarn run test