From 08735a229661ed8fcd8efda04cb6566aaeb11e6d Mon Sep 17 00:00:00 2001 From: einhornimmond Date: Wed, 1 Oct 2025 16:44:36 +0200 Subject: [PATCH 01/19] add inspector and gradido node routes to nginx --- .gitmodules | 3 ++ deployment/bare_metal/.env.dist | 3 +- .../sites-available/gradido.conf.ssl.template | 47 +++++++++++++++++++ deployment/bare_metal/start.sh | 19 ++++++++ inspector | 1 + 5 files changed, 72 insertions(+), 1 deletion(-) create mode 160000 inspector diff --git a/.gitmodules b/.gitmodules index 8b1378917..8bc8740e0 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1 +1,4 @@ +[submodule "inspector"] + path = inspector + url = https://github.com/gradido/inspector.git diff --git a/deployment/bare_metal/.env.dist b/deployment/bare_metal/.env.dist index 11f5e1d76..f9a111feb 100644 --- a/deployment/bare_metal/.env.dist +++ b/deployment/bare_metal/.env.dist @@ -86,8 +86,9 @@ FEDERATION_COMMUNITY_APIS=1_0 GDT_ACTIVE=false # DLT-Connector (still in develop) -DLT_CONNECTOR=false +DLT_CONNECTOR=true DLT_CONNECTOR_PORT=6010 +NODE_SERVER_URL=http://localhost:8340/api # used for combining a newsletter on klicktipp with this gradido community # if used, user will be subscribed on register and can unsubscribe in his account diff --git a/deployment/bare_metal/nginx/sites-available/gradido.conf.ssl.template b/deployment/bare_metal/nginx/sites-available/gradido.conf.ssl.template index 3bc911d39..fd54a27cc 100644 --- a/deployment/bare_metal/nginx/sites-available/gradido.conf.ssl.template +++ b/deployment/bare_metal/nginx/sites-available/gradido.conf.ssl.template @@ -101,6 +101,22 @@ server { error_log $GRADIDO_LOG_PATH/nginx-error.backend.log warn; } + # Gradido-Node + location /dlt { + proxy_http_version 1.1; + proxy_set_header Upgrade $http_upgrade; + proxy_set_header Connection 'upgrade'; + proxy_set_header X-Forwarded-For $remote_addr; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header Host $host; + + proxy_pass http://127.0.0.1:8340/api/; + proxy_redirect off; + + access_log $GRADIDO_LOG_PATH/nginx-access.dlt.log gradido_log; + error_log $GRADIDO_LOG_PATH/nginx-error.dlt.log warn; + } + # Backend webhooks location /hook { limit_req zone=backend burst=20 nodelay; @@ -196,6 +212,37 @@ server { access_log $GRADIDO_LOG_PATH/nginx-access.admin.log gradido_log; error_log $GRADIDO_LOG_PATH/nginx-error.admin.log warn; } + + # Admin Frontend + location /inspector { + limit_req zone=frontend burst=30 nodelay; + limit_conn addr 20; + alias $PROJECT_ROOT/inspector/build/; + index index.html; + + # caching rules for assets + # static assets + location ~* \.(?:woff2?|ttf|otf|eot|jpg|jpeg|png|gif|svg|webp|ico)$ { + # keep assets for a week + add_header Cache-Control "public, max-age=604800"; + try_files $uri =404; + } + # hashed assets + location ~* \.(?:js|css|json)$ { + add_header Cache-Control "public, max-age=31536000, immutable"; + try_files $uri =404; + } + + try_files $uri $uri/ /index.html = 404; + + # don't cache index.html + add_header Cache-Control "no-cache, no-store, must-revalidate"; + add_header Pragma "no-cache"; + add_header Expires 0; + + access_log $GRADIDO_LOG_PATH/nginx-access.inspector.log gradido_log; + error_log $GRADIDO_LOG_PATH/nginx-error.inspector.log warn; + } # Federation $FEDERATION_NGINX_CONF diff --git a/deployment/bare_metal/start.sh b/deployment/bare_metal/start.sh index 19cafc077..ca9f7c57a 100755 --- a/deployment/bare_metal/start.sh +++ b/deployment/bare_metal/start.sh @@ -287,6 +287,17 @@ bun install log_step 'build all modules' turbo build --env-mode=loose --concurrency=$(nproc) +# build inspector and dlt-connector +log_step 'build inspector' +cd $PROJECT_ROOT/inspector +bun install +bun run build + +log_step 'build dlt-connector' +cd $PROJECT_ROOT/dlt-connector +bun install +bun run build + # database log_step 'Updating database' if [ "$DEPLOY_SEED_DATA" = "true" ]; then @@ -306,6 +317,14 @@ pm2 start --name gradido-backend \ -l $GRADIDO_LOG_PATH/pm2.backend.$TODAY.log \ --log-date-format 'YYYY-MM-DD HH:mm:ss.SSS' +if [ "$DLT_CONNECTOR" = true ] ; then + pm2 start --name dlt-connector \ + "env TZ=UTC NODE_ENV=production bun ./build/index.js" \ + --cwd $PROJECT_ROOT/dlt-connector \ + -l $GRADIDO_LOG_PATH/pm2.dlt-connector.$TODAY.log \ + --log-date-format 'YYYY-MM-DD HH:mm:ss.SSS' +fi + pm2 save if [ ! -z $FEDERATION_DHT_TOPIC ]; then pm2 start --name gradido-dht-node \ diff --git a/inspector b/inspector new file mode 160000 index 000000000..ab1fcc035 --- /dev/null +++ b/inspector @@ -0,0 +1 @@ +Subproject commit ab1fcc03546a1e98e4f236243d6cef1ae4a566d6 From f19c85ceb5c12f4809c99e58e2d827881d3bf79c Mon Sep 17 00:00:00 2001 From: einhornimmond Date: Sat, 25 Oct 2025 16:27:49 +0200 Subject: [PATCH 02/19] first draft --- deployment/bare_metal/.env.dist | 5 +- .../sites-available/gradido-dlt.conf.template | 46 ++++++++++++++++++ .../sites-available/gradido.conf.ssl.template | 48 +------------------ deployment/bare_metal/start.sh | 14 +++++- dlt-connector/src/config/schema.ts | 4 ++ inspector | 2 +- 6 files changed, 69 insertions(+), 50 deletions(-) create mode 100644 deployment/bare_metal/nginx/sites-available/gradido-dlt.conf.template diff --git a/deployment/bare_metal/.env.dist b/deployment/bare_metal/.env.dist index f9a111feb..76d6a76f5 100644 --- a/deployment/bare_metal/.env.dist +++ b/deployment/bare_metal/.env.dist @@ -86,9 +86,10 @@ FEDERATION_COMMUNITY_APIS=1_0 GDT_ACTIVE=false # DLT-Connector (still in develop) -DLT_CONNECTOR=true +DLT_CONNECTOR=false DLT_CONNECTOR_PORT=6010 -NODE_SERVER_URL=http://localhost:8340/api +DLT_NODE_SERVER_PORT=8340 +DLT_NODE_SERVER_URL=$URL_PROTOCOL://$COMMUNITY_HOST/dlt # used for combining a newsletter on klicktipp with this gradido community # if used, user will be subscribed on register and can unsubscribe in his account diff --git a/deployment/bare_metal/nginx/sites-available/gradido-dlt.conf.template b/deployment/bare_metal/nginx/sites-available/gradido-dlt.conf.template new file mode 100644 index 000000000..0fd2ba985 --- /dev/null +++ b/deployment/bare_metal/nginx/sites-available/gradido-dlt.conf.template @@ -0,0 +1,46 @@ + # Blockchain Explorer + location /inspector { + limit_req zone=frontend burst=30 nodelay; + limit_conn addr 20; + alias $PROJECT_ROOT/inspector/build/; + index index.html; + + # caching rules for assets + # static assets + location ~* \.(?:woff2?|ttf|otf|eot|jpg|jpeg|png|gif|svg|webp|ico)$ { + # keep assets for a week + add_header Cache-Control "public, max-age=604800"; + try_files $uri =404; + } + # hashed assets + location ~* \.(?:js|css|json)$ { + add_header Cache-Control "public, max-age=31536000, immutable"; + try_files $uri =404; + } + + try_files $uri $uri/ /index.html = 404; + + # don't cache index.html + add_header Cache-Control "no-cache, no-store, must-revalidate"; + add_header Pragma "no-cache"; + add_header Expires 0; + + access_log $GRADIDO_LOG_PATH/nginx-access.inspector.log gradido_log; + error_log $GRADIDO_LOG_PATH/nginx-error.inspector.log warn; + } + + # Gradido-Node + location /dlt { + proxy_http_version 1.1; + proxy_set_header Upgrade $http_upgrade; + proxy_set_header Connection 'upgrade'; + proxy_set_header X-Forwarded-For $remote_addr; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header Host $host; + + proxy_pass http://127.0.0.1:$DLT_NODE_SERVER_PORT/api; + proxy_redirect off; + + access_log $GRADIDO_LOG_PATH/nginx-access.dlt.log gradido_log; + error_log $GRADIDO_LOG_PATH/nginx-error.dlt.log warn; + } \ No newline at end of file diff --git a/deployment/bare_metal/nginx/sites-available/gradido.conf.ssl.template b/deployment/bare_metal/nginx/sites-available/gradido.conf.ssl.template index fd54a27cc..72ac17390 100644 --- a/deployment/bare_metal/nginx/sites-available/gradido.conf.ssl.template +++ b/deployment/bare_metal/nginx/sites-available/gradido.conf.ssl.template @@ -101,22 +101,6 @@ server { error_log $GRADIDO_LOG_PATH/nginx-error.backend.log warn; } - # Gradido-Node - location /dlt { - proxy_http_version 1.1; - proxy_set_header Upgrade $http_upgrade; - proxy_set_header Connection 'upgrade'; - proxy_set_header X-Forwarded-For $remote_addr; - proxy_set_header X-Real-IP $remote_addr; - proxy_set_header Host $host; - - proxy_pass http://127.0.0.1:8340/api/; - proxy_redirect off; - - access_log $GRADIDO_LOG_PATH/nginx-access.dlt.log gradido_log; - error_log $GRADIDO_LOG_PATH/nginx-error.dlt.log warn; - } - # Backend webhooks location /hook { limit_req zone=backend burst=20 nodelay; @@ -213,36 +197,8 @@ server { error_log $GRADIDO_LOG_PATH/nginx-error.admin.log warn; } - # Admin Frontend - location /inspector { - limit_req zone=frontend burst=30 nodelay; - limit_conn addr 20; - alias $PROJECT_ROOT/inspector/build/; - index index.html; - - # caching rules for assets - # static assets - location ~* \.(?:woff2?|ttf|otf|eot|jpg|jpeg|png|gif|svg|webp|ico)$ { - # keep assets for a week - add_header Cache-Control "public, max-age=604800"; - try_files $uri =404; - } - # hashed assets - location ~* \.(?:js|css|json)$ { - add_header Cache-Control "public, max-age=31536000, immutable"; - try_files $uri =404; - } - - try_files $uri $uri/ /index.html = 404; - - # don't cache index.html - add_header Cache-Control "no-cache, no-store, must-revalidate"; - add_header Pragma "no-cache"; - add_header Expires 0; - - access_log $GRADIDO_LOG_PATH/nginx-access.inspector.log gradido_log; - error_log $GRADIDO_LOG_PATH/nginx-error.inspector.log warn; - } + # dlt + $DLT_NGINX_CONF # Federation $FEDERATION_NGINX_CONF diff --git a/deployment/bare_metal/start.sh b/deployment/bare_metal/start.sh index ca9f7c57a..b228e117e 100755 --- a/deployment/bare_metal/start.sh +++ b/deployment/bare_metal/start.sh @@ -185,6 +185,7 @@ cd $PROJECT_ROOT git fetch --all git checkout $BRANCH_NAME git pull +git submodule update --init --recursive export BUILD_COMMIT="$(git rev-parse HEAD)" # install missing dependencies @@ -213,6 +214,16 @@ unset FEDERATION_APIVERSION unset FEDERATION_PORT log_step "====================================================================================================" +# prepare inspector and gradido dlt node nginx config blocks if enabled +if [ "$DLT_CONNECTOR" = true ] ; then + log_step "prepare inspector and dlt gradido node nginx config block" + envsubst '$DLT_NODE_SERVER_PORT' < $NGINX_CONFIG_DIR/gradido-dlt.conf.template >> $NGINX_CONFIG_DIR/gradido-dlt.conf + export DLT_NGINX_CONF=$(< $NGINX_CONFIG_DIR/gradido-dlt.conf) + rm $NGINX_CONFIG_DIR/gradido-dlt.conf +else + export DLT_NGINX_CONF="# dlt is disabled" +fi + # *** 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) @@ -222,8 +233,9 @@ case "$URL_PROTOCOL" in 'https') TEMPLATE_FILE="gradido.conf.ssl.template" ;; *) TEMPLATE_FILE="gradido.conf.template" ;; esac -envsubst '$FEDERATION_NGINX_CONF' < $NGINX_CONFIG_DIR/$TEMPLATE_FILE > $NGINX_CONFIG_DIR/gradido.conf.tmp +envsubst '$FEDERATION_NGINX_CONF,$DLT_NGINX_CONF' < $NGINX_CONFIG_DIR/$TEMPLATE_FILE > $NGINX_CONFIG_DIR/gradido.conf.tmp unset FEDERATION_NGINX_CONF +unset DLT_NGINX_CONF envsubst "$(env | sed -e 's/=.*//' -e 's/^/\$/g')" < $NGINX_CONFIG_DIR/gradido.conf.tmp > $NGINX_CONFIG_DIR/gradido.conf rm $NGINX_CONFIG_DIR/gradido.conf.tmp rm $NGINX_CONFIG_DIR/gradido-federation.conf.locations diff --git a/dlt-connector/src/config/schema.ts b/dlt-connector/src/config/schema.ts index 08eeb2b80..185d0b899 100644 --- a/dlt-connector/src/config/schema.ts +++ b/dlt-connector/src/config/schema.ts @@ -20,6 +20,10 @@ export const configSchema = v.object({ ), '6010', ), + DLT_GRADIDO_NODE_SERVER_HOME_FOLDER: v.optional( + v.string('The home folder for the gradido dlt node server'), + '~/.gradido', // currently hardcoded in dlt gradido node server + ), JWT_SECRET: v.optional( v.pipe( v.string('The JWT secret for connecting to the backend'), diff --git a/inspector b/inspector index ab1fcc035..8e29fd44e 160000 --- a/inspector +++ b/inspector @@ -1 +1 @@ -Subproject commit ab1fcc03546a1e98e4f236243d6cef1ae4a566d6 +Subproject commit 8e29fd44efbede40649f850a674118e2d4379897 From 437b7421d7d0be913d3025366bd6007b3a00a28e Mon Sep 17 00:00:00 2001 From: einhornimmond Date: Sat, 25 Oct 2025 16:39:58 +0200 Subject: [PATCH 03/19] fix test --- deployment/bare_metal/start.sh | 19 +++++++++++-------- dlt-connector/.env.dist | 13 +++++++------ dlt-connector/src/config/schema.ts | 4 ---- 3 files changed, 18 insertions(+), 18 deletions(-) diff --git a/deployment/bare_metal/start.sh b/deployment/bare_metal/start.sh index b228e117e..03bf44f8d 100755 --- a/deployment/bare_metal/start.sh +++ b/deployment/bare_metal/start.sh @@ -256,6 +256,7 @@ MODULES=( admin dht-node federation + inspector ) if [ "$FAST_MODE" = false ] ; then @@ -300,15 +301,17 @@ log_step 'build all modules' turbo build --env-mode=loose --concurrency=$(nproc) # build inspector and dlt-connector -log_step 'build inspector' -cd $PROJECT_ROOT/inspector -bun install -bun run build +if [ "$DLT_CONNECTOR" = true ]; then + log_step 'build inspector' + cd $PROJECT_ROOT/inspector + bun install + bun run build -log_step 'build dlt-connector' -cd $PROJECT_ROOT/dlt-connector -bun install -bun run build + log_step 'build dlt-connector' + cd $PROJECT_ROOT/dlt-connector + bun install + bun run build +fi # database log_step 'Updating database' diff --git a/dlt-connector/.env.dist b/dlt-connector/.env.dist index 8253699ca..165ca7bd0 100644 --- a/dlt-connector/.env.dist +++ b/dlt-connector/.env.dist @@ -1,19 +1,20 @@ -CONFIG_VERSION=v6.2024-02-20 - # SET LOG LEVEL AS NEEDED IN YOUR .ENV # POSSIBLE VALUES: all | trace | debug | info | warn | error | fatal # LOG_LEVEL=info -# IOTA -IOTA_API_URL=https://chrysalis-nodes.iota.org -IOTA_COMMUNITY_ALIAS=GRADIDO: TestHelloWelt2 -IOTA_HOME_COMMUNITY_SEED=aabbccddeeff00112233445566778899aabbccddeeff00112233445566778899 +HOME_COMMUNITY_SEED=aabbccddeeff00112233445566778899aabbccddeeff00112233445566778899 # DLT-Connector DLT_CONNECTOR_PORT=6010 # Gradido Node Server URL DLT_NODE_SERVER_PORT=8340 +DLT_GRADIDO_NODE_SERVER_VERSION=0.9.0 + +HIERO_ACTIVE=true +HIERO_HEDERA_NETWORK=testnet +HIERO_OPERATOR_ID="YOUR_OPERATOR_ID" +HIERO_OPERATOR_KEY="YOUR_OPERATOR_ED25519_PRIVATE_KEY_IN_DER_FORMAT" # Gradido Blockchain GRADIDO_BLOCKCHAIN_CRYPTO_APP_SECRET=21ffbbc616fe diff --git a/dlt-connector/src/config/schema.ts b/dlt-connector/src/config/schema.ts index 3862a0dd5..67a43383d 100644 --- a/dlt-connector/src/config/schema.ts +++ b/dlt-connector/src/config/schema.ts @@ -21,10 +21,6 @@ export const configSchema = v.object({ ), '6010', ), - DLT_GRADIDO_NODE_SERVER_HOME_FOLDER: v.optional( - v.string('The home folder for the gradido dlt node server'), - '~/.gradido', // currently hardcoded in dlt gradido node server - ), JWT_SECRET: v.optional( v.pipe( v.string('The JWT secret for connecting to the backend'), From 72fadb91c4759eed823d251f4e568bcb554987e2 Mon Sep 17 00:00:00 2001 From: einhornimmond Date: Sat, 25 Oct 2025 16:45:14 +0200 Subject: [PATCH 04/19] missing if --- deployment/bare_metal/start.sh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/deployment/bare_metal/start.sh b/deployment/bare_metal/start.sh index 03bf44f8d..5976525c8 100755 --- a/deployment/bare_metal/start.sh +++ b/deployment/bare_metal/start.sh @@ -256,8 +256,10 @@ MODULES=( admin dht-node federation - inspector ) +if [ "$DLT_CONNECTOR" = true ] ; then + MODULES+=("inspector") +fi if [ "$FAST_MODE" = false ] ; then log_step 'Clean tmp, bun and yarn cache' From 5f832fb89aea98d2cc9baa847dd967b712f46d68 Mon Sep 17 00:00:00 2001 From: einhornimmond Date: Sat, 25 Oct 2025 16:53:27 +0200 Subject: [PATCH 05/19] case with missing .env --- deployment/bare_metal/start.sh | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/deployment/bare_metal/start.sh b/deployment/bare_metal/start.sh index 5976525c8..42b16a2f3 100755 --- a/deployment/bare_metal/start.sh +++ b/deployment/bare_metal/start.sh @@ -290,7 +290,10 @@ fi log_step 'Regenerate .env files' for dir in "${MODULES[@]}"; do base="$PROJECT_ROOT/$dir" - cp -f $base/.env $base/.env.bak + # Backup .env file if exists + if [ -f "$base/.env" ]; then + cp -f $base/.env $base/.env.bak + fi envsubst "$(env | sed -e 's/=.*//' -e 's/^/\$/g')" < $base/.env.template > $base/.env done From a9339c1e6c6627efee584f613c5c2eaccd4e3c78 Mon Sep 17 00:00:00 2001 From: einhornimmond Date: Sat, 25 Oct 2025 17:03:47 +0200 Subject: [PATCH 06/19] fixes for deploy script --- deployment/bare_metal/.env.dist | 10 ++-------- deployment/bare_metal/start.sh | 1 + dlt-connector/.env.template | 25 +++++++++++++++++++++++++ inspector | 2 +- 4 files changed, 29 insertions(+), 9 deletions(-) create mode 100644 dlt-connector/.env.template diff --git a/deployment/bare_metal/.env.dist b/deployment/bare_metal/.env.dist index abe2d0202..dc11fff71 100644 --- a/deployment/bare_metal/.env.dist +++ b/deployment/bare_metal/.env.dist @@ -22,14 +22,6 @@ EMAIL_CODE_VALID_TIME=1440 # also used for password reset code EMAIL_CODE_REQUEST_TIME=10 -# Need to adjust by updates -# config versions -DATABASE_CONFIG_VERSION=v1.2022-03-18 -BACKEND_CONFIG_VERSION=v23.2024-04-04 -FRONTEND_CONFIG_VERSION=v6.2024-02-27 -ADMIN_CONFIG_VERSION=v2.2024-01-04 -FEDERATION_CONFIG_VERSION=v2.2023-08-24 -FEDERATION_DHT_CONFIG_VERSION=v4.2024-01-17 FEDERATION_DHT_TOPIC=GRADIDO_HUB # Need adjustments for test system @@ -85,6 +77,8 @@ FEDERATION_COMMUNITY_APIS=1_0 # externe gradido services (more added in future) GDT_ACTIVE=false +AUTO_POLL_INTERVAL=30000 + # DLT-Connector (still in develop) DLT_CONNECTOR=false DLT_CONNECTOR_PORT=6010 diff --git a/deployment/bare_metal/start.sh b/deployment/bare_metal/start.sh index 42b16a2f3..49e7c728b 100755 --- a/deployment/bare_metal/start.sh +++ b/deployment/bare_metal/start.sh @@ -259,6 +259,7 @@ MODULES=( ) if [ "$DLT_CONNECTOR" = true ] ; then MODULES+=("inspector") + MODULES+=("dlt-connector") fi if [ "$FAST_MODE" = false ] ; then diff --git a/dlt-connector/.env.template b/dlt-connector/.env.template new file mode 100644 index 000000000..963d0169b --- /dev/null +++ b/dlt-connector/.env.template @@ -0,0 +1,25 @@ +# SET LOG LEVEL AS NEEDED IN YOUR .ENV +# POSSIBLE VALUES: all | trace | debug | info | warn | error | fatal +# LOG_LEVEL=info + +HOME_COMMUNITY_SEED=$HOME_COMMUNITY_SEED + +# DLT-Connector +DLT_CONNECTOR_PORT=$DLT_CONNECTOR_PORT + +# Gradido Node Server URL +DLT_NODE_SERVER_PORT=$DLT_NODE_SERVER_PORT +DLT_GRADIDO_NODE_SERVER_VERSION=$DLT_GRADIDO_NODE_SERVER_VERSION + +HIERO_ACTIVE=$HIERO_ACTIVE +HIERO_HEDERA_NETWORK=$HIERO_HEDERA_NETWORK +HIERO_OPERATOR_ID=$HIERO_OPERATOR_ID +HIERO_OPERATOR_KEY=$HIERO_OPERATOR_KEY + +# Gradido Blockchain +GRADIDO_BLOCKCHAIN_CRYPTO_APP_SECRET=$GRADIDO_BLOCKCHAIN_CRYPTO_APP_SECRET +GRADIDO_BLOCKCHAIN_SERVER_CRYPTO_KEY=$GRADIDO_BLOCKCHAIN_SERVER_CRYPTO_KEY + +# Route to Backend +PORT=$PORT +JWT_SECRET=$JWT_SECRET \ No newline at end of file diff --git a/inspector b/inspector index 8e29fd44e..cf13ca7c3 160000 --- a/inspector +++ b/inspector @@ -1 +1 @@ -Subproject commit 8e29fd44efbede40649f850a674118e2d4379897 +Subproject commit cf13ca7c3fb225a05e9c414ce1691929bef43444 From 5a2e8807a2be1b20937eeb4e9f3dca491fcf5fd6 Mon Sep 17 00:00:00 2001 From: einhornimmond Date: Sat, 25 Oct 2025 17:19:03 +0200 Subject: [PATCH 07/19] update inspector --- inspector | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/inspector b/inspector index cf13ca7c3..5e0014f6a 160000 --- a/inspector +++ b/inspector @@ -1 +1 @@ -Subproject commit cf13ca7c3fb225a05e9c414ce1691929bef43444 +Subproject commit 5e0014f6ad568415eaeec112a37a362a49c29e13 From 69a6c820e2728b58420f372c977a46d5d9fa2786 Mon Sep 17 00:00:00 2001 From: einhornimmond Date: Sat, 25 Oct 2025 17:23:11 +0200 Subject: [PATCH 08/19] add less to inspector --- inspector | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/inspector b/inspector index 5e0014f6a..9c57ed032 160000 --- a/inspector +++ b/inspector @@ -1 +1 @@ -Subproject commit 5e0014f6ad568415eaeec112a37a362a49c29e13 +Subproject commit 9c57ed032d2e0523cfb5c6400c3a841147a7f957 From 9c62322be024575317ff08114fd2ecdec30aee9c Mon Sep 17 00:00:00 2001 From: einhornimmond Date: Sat, 25 Oct 2025 17:24:26 +0200 Subject: [PATCH 09/19] correct path --- deployment/bare_metal/start.sh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/deployment/bare_metal/start.sh b/deployment/bare_metal/start.sh index 49e7c728b..cb53206a5 100755 --- a/deployment/bare_metal/start.sh +++ b/deployment/bare_metal/start.sh @@ -317,6 +317,8 @@ if [ "$DLT_CONNECTOR" = true ]; then cd $PROJECT_ROOT/dlt-connector bun install bun run build + + cd $PROJECT_ROOT fi # database From 7085e55d299f53a58a9b3d098c79f3d6a5ebff6e Mon Sep 17 00:00:00 2001 From: einhornimmond Date: Sat, 25 Oct 2025 17:48:24 +0200 Subject: [PATCH 10/19] small fixes --- deployment/bare_metal/.env.dist | 3 +++ dlt-connector/src/config/schema.ts | 5 ++++- inspector | 2 +- 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/deployment/bare_metal/.env.dist b/deployment/bare_metal/.env.dist index dc11fff71..059822ea4 100644 --- a/deployment/bare_metal/.env.dist +++ b/deployment/bare_metal/.env.dist @@ -12,6 +12,8 @@ EMAIL_PASSWORD=1234 EMAIL_SMTP_HOST=smtp.lustig.de EMAIL_SMTP_PORT=587 +PORT=4000 + # if set to true allow sending gradidos to another communities FEDERATION_XCOM_SENDCOINS_ENABLED=false @@ -84,6 +86,7 @@ DLT_CONNECTOR=false DLT_CONNECTOR_PORT=6010 DLT_NODE_SERVER_PORT=8340 DLT_NODE_SERVER_URL=$URL_PROTOCOL://$COMMUNITY_HOST/dlt +DLT_GRADIDO_NODE_SERVER_VERSION=0.9.0 DLT_GRADIDO_NODE_SERVER_HOME_FOLDER=/home/gradido/.gradido # used for combining a newsletter on klicktipp with this gradido community diff --git a/dlt-connector/src/config/schema.ts b/dlt-connector/src/config/schema.ts index 67a43383d..645f07470 100644 --- a/dlt-connector/src/config/schema.ts +++ b/dlt-connector/src/config/schema.ts @@ -80,7 +80,10 @@ export const configSchema = v.object({ '8340', ), DLT_GRADIDO_NODE_SERVER_VERSION: v.optional( - v.string('The version of the DLT node server'), + v.pipe( + v.string('The version of the DLT node server, for example: 0.9.0'), + v.regex(/^\d+\.\d+\.\d+$/), + ), '0.9.0', ), DLT_GRADIDO_NODE_SERVER_HOME_FOLDER: v.optional( diff --git a/inspector b/inspector index 9c57ed032..8b63929c7 160000 --- a/inspector +++ b/inspector @@ -1 +1 @@ -Subproject commit 9c57ed032d2e0523cfb5c6400c3a841147a7f957 +Subproject commit 8b63929c7e73ee5c542e05607213f6c80019cf52 From b09dd70e81acc0b28d690e47845a4d71c40ba001 Mon Sep 17 00:00:00 2001 From: einhornimmond Date: Tue, 28 Oct 2025 09:52:06 +0100 Subject: [PATCH 11/19] update inspector, fix frontend env problem --- inspector | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/inspector b/inspector index 8b63929c7..c7fc92da3 160000 --- a/inspector +++ b/inspector @@ -1 +1 @@ -Subproject commit 8b63929c7e73ee5c542e05607213f6c80019cf52 +Subproject commit c7fc92da31e80a27558d3887543446079dc55b5e From 9c85b7829f3ab004ab3cd0eb0226903a827a9da3 Mon Sep 17 00:00:00 2001 From: einhornimmond Date: Tue, 28 Oct 2025 10:03:53 +0100 Subject: [PATCH 12/19] change PORT env variable to BACKEND_PORT to prevent mix-ups with native PORT env from nginx in Docker --- backend/.env.dist | 2 +- backend/.env.template | 2 +- backend/.env.test_e2e | 1 + backend/Dockerfile | 4 +-- backend/src/config/index.ts | 2 +- backend/src/config/schema.ts | 2 +- backend/src/index.ts | 6 ++-- deployment/bare_metal/.env.dist | 10 ++++++- dlt-connector/.env.template | 2 +- .../src/client/backend/BackendClient.ts | 2 +- dlt-connector/src/config/schema.ts | 2 +- docker-compose.override.yml | 20 +++++++++++++ docker-compose.yml | 30 +++++++++++++++++-- 13 files changed, 69 insertions(+), 16 deletions(-) diff --git a/backend/.env.dist b/backend/.env.dist index 8d5ba317c..0860b9c94 100644 --- a/backend/.env.dist +++ b/backend/.env.dist @@ -1,5 +1,5 @@ # Server -PORT=4000 +BACKEND_PORT=4000 JWT_SECRET=secret123 JWT_EXPIRES_IN=10m GRAPHIQL=false diff --git a/backend/.env.template b/backend/.env.template index 9b0bc7df2..5212d1e1b 100644 --- a/backend/.env.template +++ b/backend/.env.template @@ -1,11 +1,11 @@ # must match the CONFIG_VERSION.EXPECTED definition in scr/config/index.ts -CONFIG_VERSION=$BACKEND_CONFIG_VERSION # Server JWT_SECRET=$JWT_SECRET JWT_EXPIRES_IN=$JWT_EXPIRES_IN GRAPHIQL=false GDT_API_URL=$GDT_API_URL +BACKEND_PORT=$BACKEND_PORT # Database DB_HOST=127.0.0.1 diff --git a/backend/.env.test_e2e b/backend/.env.test_e2e index e7f3a29c8..1a6c3a214 100644 --- a/backend/.env.test_e2e +++ b/backend/.env.test_e2e @@ -1,5 +1,6 @@ # Server JWT_EXPIRES_IN=2m +BACKEND_PORT=4000 GDT_ACTIVE=false HUMHUB_ACTIVE=false diff --git a/backend/Dockerfile b/backend/Dockerfile index eeab1ac17..f015350c0 100644 --- a/backend/Dockerfile +++ b/backend/Dockerfile @@ -17,7 +17,7 @@ ENV BUILD_COMMIT="0000000" ## SET NODE_ENV ENV NODE_ENV=production ## App relevant Envs -ENV PORT="4000" +ENV BACKEND_PORT="4000" ## Timezone ENV TZ=UTC ENV DB_HOST=mariadb @@ -42,7 +42,7 @@ LABEL maintainer="support@gradido.net" # Settings ## Expose Container Port -EXPOSE ${PORT} +EXPOSE ${BACKEND_PORT} ## Workdir RUN mkdir -p ${DOCKER_WORKDIR} diff --git a/backend/src/config/index.ts b/backend/src/config/index.ts index b583156b5..f29f0b0f7 100644 --- a/backend/src/config/index.ts +++ b/backend/src/config/index.ts @@ -16,7 +16,7 @@ const logging = { } const server = { - PORT: process.env.PORT ?? 4000, + BACKEND_PORT: process.env.BACKEND_PORT ?? 4000, JWT_SECRET: process.env.JWT_SECRET ?? 'secret123', JWT_EXPIRES_IN: process.env.JWT_EXPIRES_IN ?? '10m', REDEEM_JWT_TOKEN_EXPIRATION: process.env.REDEEM_JWT_TOKEN_EXPIRATION ?? '10m', diff --git a/backend/src/config/schema.ts b/backend/src/config/schema.ts index f4e6033ea..4b13b4e64 100644 --- a/backend/src/config/schema.ts +++ b/backend/src/config/schema.ts @@ -260,7 +260,7 @@ export const schema = Joi.object({ }) .description('JWT key for HumHub integration, must be the same as configured in humhub'), - PORT: Joi.number() + BACKEND_PORT: Joi.number() .integer() .min(1024) .max(49151) diff --git a/backend/src/index.ts b/backend/src/index.ts index 283554a9d..db4bf76b5 100644 --- a/backend/src/index.ts +++ b/backend/src/index.ts @@ -12,12 +12,12 @@ async function main() { const { app } = await createServer(getLogger('apollo')) await writeJwtKeyPairInHomeCommunity() - app.listen(CONFIG.PORT, () => { + app.listen(CONFIG.BACKEND_PORT, () => { // biome-ignore lint/suspicious/noConsole: no need for logging the start message - console.log(`Server is running at http://localhost:${CONFIG.PORT}`) + console.log(`Server is running at http://localhost:${CONFIG.BACKEND_PORT}`) if (CONFIG.GRAPHIQL) { // biome-ignore lint/suspicious/noConsole: no need for logging the start message - console.log(`GraphIQL available at http://localhost:${CONFIG.PORT}`) + console.log(`GraphIQL available at http://localhost:${CONFIG.BACKEND_PORT}`) } }) await startValidateCommunities(Number(CONFIG.FEDERATION_VALIDATE_COMMUNITY_TIMER)) diff --git a/deployment/bare_metal/.env.dist b/deployment/bare_metal/.env.dist index 059822ea4..a0e449ac2 100644 --- a/deployment/bare_metal/.env.dist +++ b/deployment/bare_metal/.env.dist @@ -12,7 +12,7 @@ EMAIL_PASSWORD=1234 EMAIL_SMTP_HOST=smtp.lustig.de EMAIL_SMTP_PORT=587 -PORT=4000 +BACKEND_PORT=4000 # if set to true allow sending gradidos to another communities FEDERATION_XCOM_SENDCOINS_ENABLED=false @@ -24,6 +24,14 @@ EMAIL_CODE_VALID_TIME=1440 # also used for password reset code EMAIL_CODE_REQUEST_TIME=10 +# Need to adjust by updates +# config versions +DATABASE_CONFIG_VERSION=v1.2022-03-18 +BACKEND_CONFIG_VERSION=v23.2024-04-04 +FRONTEND_CONFIG_VERSION=v6.2024-02-27 +ADMIN_CONFIG_VERSION=v2.2024-01-04 +FEDERATION_CONFIG_VERSION=v2.2023-08-24 +FEDERATION_DHT_CONFIG_VERSION=v4.2024-01-17 FEDERATION_DHT_TOPIC=GRADIDO_HUB # Need adjustments for test system diff --git a/dlt-connector/.env.template b/dlt-connector/.env.template index 963d0169b..92819f579 100644 --- a/dlt-connector/.env.template +++ b/dlt-connector/.env.template @@ -21,5 +21,5 @@ GRADIDO_BLOCKCHAIN_CRYPTO_APP_SECRET=$GRADIDO_BLOCKCHAIN_CRYPTO_APP_SECRET GRADIDO_BLOCKCHAIN_SERVER_CRYPTO_KEY=$GRADIDO_BLOCKCHAIN_SERVER_CRYPTO_KEY # Route to Backend -PORT=$PORT +BACKEND_PORT=$BACKEND_PORT JWT_SECRET=$JWT_SECRET \ No newline at end of file diff --git a/dlt-connector/src/client/backend/BackendClient.ts b/dlt-connector/src/client/backend/BackendClient.ts index 7f779fd73..ce9660e36 100644 --- a/dlt-connector/src/client/backend/BackendClient.ts +++ b/dlt-connector/src/client/backend/BackendClient.ts @@ -30,7 +30,7 @@ export class BackendClient { */ private constructor() { this.logger = getLogger(`${LOG4JS_BASE_CATEGORY}.client.BackendClient`) - this.urlValue = `http://localhost:${CONFIG.PORT}` + this.urlValue = `http://localhost:${CONFIG.BACKEND_PORT}` this.logger.addContext('url', this.urlValue) this.client = new GraphQLClient(this.urlValue, { diff --git a/dlt-connector/src/config/schema.ts b/dlt-connector/src/config/schema.ts index 645f07470..9490e8a00 100644 --- a/dlt-connector/src/config/schema.ts +++ b/dlt-connector/src/config/schema.ts @@ -90,7 +90,7 @@ export const configSchema = v.object({ v.string('The home folder for the gradido dlt node server'), path.join(__dirname, '..', '..', 'gradido_node'), ), - PORT: v.optional( + BACKEND_PORT: v.optional( v.pipe( v.string('A valid port on which the backend server is running'), v.transform((input: string) => Number(input)), diff --git a/docker-compose.override.yml b/docker-compose.override.yml index 3d68512ce..3898f9991 100644 --- a/docker-compose.override.yml +++ b/docker-compose.override.yml @@ -43,6 +43,26 @@ services: # bind the local folder to the docker to allow live reload - .:/app + ######################################################## + # INSPECTOR ############################################ + ######################################################## + inspector: + # name the image so that it cannot be found in a DockerHub repository, otherwise it will not be built locally from the 'dockerfile' but pulled from there + image: gradido/inspector:local-development + build: + target: development + networks: + - external-net + - internal-net + environment: + - NODE_ENV=development + volumes: + # This makes sure the docker container has its own node modules. + # Therefore it is possible to have a different node version on the host machine + - node_modules_inspector:/app/node_modules + # bind the local folder to the docker to allow live reload + - .:/app + ######################################################## # BACKEND ############################################## ######################################################## diff --git a/docker-compose.yml b/docker-compose.yml index aeaac0c60..d2d88cc9c 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -61,6 +61,30 @@ services: volumes: - ./logs/nginx/admin:/var/log/nginx + ######################################################## + # INSPECTOR ########################################### + ######################################################## + inspector: + # name the image so that it cannot be found in a DockerHub repository, otherwise it will not be built locally from the 'dockerfile' but pulled from there + image: gradido/inspector:local-production + build: + context: ./inspector + dockerfile: Dockerfile + target: production + networks: + - internal-net + ports: + - ${INSPECTOR_MODULE_PORT:-3100}:3100 + environment: + - NODE_ENV=production + - BUILD_COMMIT=${BUILD_COMMIT} + - BUILD_COMMIT_SHORT=${BUILD_COMMIT_SHORT} + - BUILD_VERSION=${BUILD_VERSION} + # - DEBUG=true + volumes: + - ./logs/nginx/inspector:/var/log/nginx + + ######################################################### ## MARIADB ############################################## ######################################################### @@ -97,7 +121,7 @@ services: environment: # Envs used in Dockerfile # - DOCKER_WORKDIR="/app" - # - PORT=4000 + - BACKEND_PORT=4000 - BUILD_DATE - BUILD_VERSION - BUILD_COMMIT @@ -132,7 +156,6 @@ services: environment: # Envs used in Dockerfile # - DOCKER_WORKDIR="/app" - # - PORT=5000 - BUILD_DATE - BUILD_VERSION - BUILD_COMMIT @@ -167,7 +190,8 @@ services: environment: # Envs used in Dockerfile # - DOCKER_WORKDIR="/app" - - PORT=6010 + - DLT_CONNECTOR_PORT=6010 + - BACKEND_PORT=4000 - BUILD_DATE - BUILD_VERSION - BUILD_COMMIT From 72c0b3d8df011118d79041344f16d525343589f3 Mon Sep 17 00:00:00 2001 From: einhornimmond Date: Thu, 6 Nov 2025 12:37:34 +0100 Subject: [PATCH 13/19] try to fix deploy script --- deployment/bare_metal/start.sh | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/deployment/bare_metal/start.sh b/deployment/bare_metal/start.sh index cb53206a5..580123a75 100755 --- a/deployment/bare_metal/start.sh +++ b/deployment/bare_metal/start.sh @@ -214,14 +214,13 @@ unset FEDERATION_APIVERSION unset FEDERATION_PORT log_step "====================================================================================================" +export DLT_NGINX_CONF="${DLT_NGINX_CONF:-# dlt disabled}" # prepare inspector and gradido dlt node nginx config blocks if enabled if [ "$DLT_CONNECTOR" = true ] ; then log_step "prepare inspector and dlt gradido node nginx config block" envsubst '$DLT_NODE_SERVER_PORT' < $NGINX_CONFIG_DIR/gradido-dlt.conf.template >> $NGINX_CONFIG_DIR/gradido-dlt.conf export DLT_NGINX_CONF=$(< $NGINX_CONFIG_DIR/gradido-dlt.conf) rm $NGINX_CONFIG_DIR/gradido-dlt.conf -else - export DLT_NGINX_CONF="# dlt is disabled" fi # *** 2nd read gradido-federation.conf file in env variable to be replaced in 3rd step From be0c9d0e34803bf4217d857581089bd2661ffd13 Mon Sep 17 00:00:00 2001 From: einhornimmond Date: Wed, 26 Nov 2025 09:17:43 +0100 Subject: [PATCH 14/19] add link in frontend to inspector, change Env var name --- backend/src/config/index.ts | 3 +-- backend/src/config/schema.ts | 15 ++++----------- config-schema/src/commonSchema.ts | 5 +++++ deployment/bare_metal/.env.dist | 2 +- deployment/bare_metal/start.sh | 8 ++++---- frontend/src/components/ContentFooter.vue | 7 +++++++ frontend/src/config/schema.js | 2 ++ frontend/src/locales/de.json | 1 + frontend/src/locales/en.json | 1 + frontend/src/locales/es.json | 1 + frontend/src/locales/fr.json | 1 + frontend/src/locales/nl.json | 1 + frontend/vite.config.mjs | 1 + 13 files changed, 30 insertions(+), 18 deletions(-) diff --git a/backend/src/config/index.ts b/backend/src/config/index.ts index f29f0b0f7..be33b20c9 100644 --- a/backend/src/config/index.ts +++ b/backend/src/config/index.ts @@ -17,6 +17,7 @@ const logging = { const server = { BACKEND_PORT: process.env.BACKEND_PORT ?? 4000, + DLT_ACTIVE: process.env.DLT_ACTIVE === 'true' || false, JWT_SECRET: process.env.JWT_SECRET ?? 'secret123', JWT_EXPIRES_IN: process.env.JWT_EXPIRES_IN ?? '10m', REDEEM_JWT_TOKEN_EXPIRATION: process.env.REDEEM_JWT_TOKEN_EXPIRATION ?? '10m', @@ -41,9 +42,7 @@ const COMMUNITY_URL = process.env.COMMUNITY_URL ?? `${URL_PROTOCOL}://${COMMUNIT const DLT_CONNECTOR_PORT = process.env.DLT_CONNECTOR_PORT ?? 6010 const dltConnector = { - DLT_CONNECTOR: process.env.DLT_CONNECTOR === 'true' || false, DLT_CONNECTOR_URL: process.env.DLT_CONNECTOR_URL ?? `${COMMUNITY_URL}:${DLT_CONNECTOR_PORT}`, - DLT_GRADIDO_NODE_SERVER_HOME_FOLDER: process.env.DLT_GRADIDO_NODE_SERVER_HOME_FOLDER ?? '~/.gradido', } const community = { diff --git a/backend/src/config/schema.ts b/backend/src/config/schema.ts index 4b13b4e64..28b1f1803 100644 --- a/backend/src/config/schema.ts +++ b/backend/src/config/schema.ts @@ -4,6 +4,7 @@ import { COMMUNITY_SUPPORT_MAIL, COMMUNITY_URL, DECAY_START_TIME, + DLT_ACTIVE, GDT_ACTIVE, GDT_API_URL, GMS_ACTIVE, @@ -27,6 +28,7 @@ export const schema = Joi.object({ COMMUNITY_DESCRIPTION, COMMUNITY_SUPPORT_MAIL, DECAY_START_TIME, + DLT_ACTIVE, GDT_API_URL, GDT_ACTIVE, GMS_ACTIVE, @@ -68,20 +70,11 @@ export const schema = Joi.object({ .default('http://0.0.0.0/redeem/CL-') .required(), - DLT_CONNECTOR: Joi.boolean() - .description('Flag to indicate if DLT-Connector is used. (Still in development)') - .default(false) - .required(), - DLT_CONNECTOR_URL: Joi.string() .uri({ scheme: ['http', 'https'] }) .default('http://localhost:6010') - .when('DLT_CONNECTOR', { is: true, then: Joi.required() }) - .description('The URL for GDT API endpoint'), - - DLT_GRADIDO_NODE_SERVER_HOME_FOLDER: Joi.string() - .default('~/.gradido') - .description('The home folder for the gradido dlt node server'), + .when('DLT_ACTIVE', { is: true, then: Joi.required() }) + .description('The URL for DLT connector'), EMAIL: Joi.boolean() .default(false) diff --git a/config-schema/src/commonSchema.ts b/config-schema/src/commonSchema.ts index 250ea3182..f28115ea7 100644 --- a/config-schema/src/commonSchema.ts +++ b/config-schema/src/commonSchema.ts @@ -35,6 +35,11 @@ export const COMMUNITY_URL = Joi.string() .default('http://0.0.0.0') .required() +export const DLT_ACTIVE = Joi.boolean() + .description('Flag to indicate if the DLT (Decentralized Ledger Technology) service is used.') + .default(false) + .required() + export const GRAPHQL_URI = Joi.string() .uri({ scheme: ['http', 'https'] }) .description( diff --git a/deployment/bare_metal/.env.dist b/deployment/bare_metal/.env.dist index a0e449ac2..7be3ead1e 100644 --- a/deployment/bare_metal/.env.dist +++ b/deployment/bare_metal/.env.dist @@ -90,7 +90,7 @@ GDT_ACTIVE=false AUTO_POLL_INTERVAL=30000 # DLT-Connector (still in develop) -DLT_CONNECTOR=false +DLT_ACTIVE=false DLT_CONNECTOR_PORT=6010 DLT_NODE_SERVER_PORT=8340 DLT_NODE_SERVER_URL=$URL_PROTOCOL://$COMMUNITY_HOST/dlt diff --git a/deployment/bare_metal/start.sh b/deployment/bare_metal/start.sh index 580123a75..80ef55d39 100755 --- a/deployment/bare_metal/start.sh +++ b/deployment/bare_metal/start.sh @@ -216,7 +216,7 @@ log_step "====================================================================== export DLT_NGINX_CONF="${DLT_NGINX_CONF:-# dlt disabled}" # prepare inspector and gradido dlt node nginx config blocks if enabled -if [ "$DLT_CONNECTOR" = true ] ; then +if [ "$DLT_ACTIVE" = true ] ; then log_step "prepare inspector and dlt gradido node nginx config block" envsubst '$DLT_NODE_SERVER_PORT' < $NGINX_CONFIG_DIR/gradido-dlt.conf.template >> $NGINX_CONFIG_DIR/gradido-dlt.conf export DLT_NGINX_CONF=$(< $NGINX_CONFIG_DIR/gradido-dlt.conf) @@ -256,7 +256,7 @@ MODULES=( dht-node federation ) -if [ "$DLT_CONNECTOR" = true ] ; then +if [ "$DLT_ACTIVE" = true ] ; then MODULES+=("inspector") MODULES+=("dlt-connector") fi @@ -306,7 +306,7 @@ log_step 'build all modules' turbo build --env-mode=loose --concurrency=$(nproc) # build inspector and dlt-connector -if [ "$DLT_CONNECTOR" = true ]; then +if [ "$DLT_ACTIVE" = true ]; then log_step 'build inspector' cd $PROJECT_ROOT/inspector bun install @@ -339,7 +339,7 @@ pm2 start --name gradido-backend \ -l $GRADIDO_LOG_PATH/pm2.backend.$TODAY.log \ --log-date-format 'YYYY-MM-DD HH:mm:ss.SSS' -if [ "$DLT_CONNECTOR" = true ] ; then +if [ "$DLT_ACTIVE" = true ] ; then pm2 start --name dlt-connector \ "env TZ=UTC NODE_ENV=production bun ./build/index.js" \ --cwd $PROJECT_ROOT/dlt-connector \ diff --git a/frontend/src/components/ContentFooter.vue b/frontend/src/components/ContentFooter.vue index e749d0cd9..a33933907 100755 --- a/frontend/src/components/ContentFooter.vue +++ b/frontend/src/components/ContentFooter.vue @@ -43,6 +43,13 @@ {{ $t('navigation.support') }} + + {{ $t('footer.inspector') }} + diff --git a/frontend/src/config/schema.js b/frontend/src/config/schema.js index c7f7817b8..745e24b74 100644 --- a/frontend/src/config/schema.js +++ b/frontend/src/config/schema.js @@ -9,6 +9,7 @@ import { COMMUNITY_URL, DEBUG, DECAY_START_TIME, + DLT_ACTIVE, GMS_ACTIVE, GRAPHQL_URI, HUMHUB_ACTIVE, @@ -30,6 +31,7 @@ module.exports = Joi.object({ COMMUNITY_URL, DEBUG, DECAY_START_TIME, + DLT_ACTIVE, GMS_ACTIVE, GRAPHQL_URI, HUMHUB_ACTIVE, diff --git a/frontend/src/locales/de.json b/frontend/src/locales/de.json index e7741f83d..bf1fc818f 100644 --- a/frontend/src/locales/de.json +++ b/frontend/src/locales/de.json @@ -158,6 +158,7 @@ "year": "© {year}" }, "imprint": "Impressum", + "inspector": "Inspektor (experimentell)", "privacy_policy": "Datenschutzerklärung", "short_hash": "({shortHash})", "whitepaper": "Whitepaper" diff --git a/frontend/src/locales/en.json b/frontend/src/locales/en.json index d0ab23d1f..8739f322d 100644 --- a/frontend/src/locales/en.json +++ b/frontend/src/locales/en.json @@ -158,6 +158,7 @@ "year": "© {year}" }, "imprint": "Legal notice", + "inspector": "Inspector (experimental)", "privacy_policy": "Privacy policy", "short_hash": "({shortHash})", "whitepaper": "Whitepaper" diff --git a/frontend/src/locales/es.json b/frontend/src/locales/es.json index 9a0d4283f..5d0fcfe4c 100644 --- a/frontend/src/locales/es.json +++ b/frontend/src/locales/es.json @@ -140,6 +140,7 @@ "year": "© {year}" }, "imprint": "Aviso legal", + "inspector": "Inspector (experimental)", "privacy_policy": "Protección de Datos", "short_hash": "({shortHash})", "whitepaper": "Whitepaper" diff --git a/frontend/src/locales/fr.json b/frontend/src/locales/fr.json index 55bdf4ee3..0488efe13 100644 --- a/frontend/src/locales/fr.json +++ b/frontend/src/locales/fr.json @@ -145,6 +145,7 @@ "year": "© {year}" }, "imprint": "Notification légale", + "inspector": "Inspecteur (expérimental)", "privacy_policy": "Politique de confidentialité", "short_hash": "({shortHash})", "whitepaper": "Papier blanc" diff --git a/frontend/src/locales/nl.json b/frontend/src/locales/nl.json index 9b3f3d265..fb264d54e 100644 --- a/frontend/src/locales/nl.json +++ b/frontend/src/locales/nl.json @@ -140,6 +140,7 @@ "year": "© {year}" }, "imprint": "Colofon", + "inspector": "Inspecteur (experimenteel)", "privacy_policy": "Privacyverklaring", "short_hash": "({shortHash})", "whitepaper": "Witboek" diff --git a/frontend/vite.config.mjs b/frontend/vite.config.mjs index 4a0674b0f..d722601d0 100644 --- a/frontend/vite.config.mjs +++ b/frontend/vite.config.mjs @@ -114,6 +114,7 @@ export default defineConfig(async ({ command }) => { AUTO_POLL_INTERVAL: CONFIG.AUTO_POLL_INTERVAL, BUILD_COMMIT: CONFIG.BUILD_COMMIT, CROSS_TX_REDEEM_LINK_ACTIVE: CONFIG.CROSS_TX_REDEEM_LINK_ACTIVE, + DLT_ACTIVE: CONFIG.DLT_ACTIVE, GMS_ACTIVE: CONFIG.GMS_ACTIVE, HUMHUB_ACTIVE: CONFIG.HUMHUB_ACTIVE, DEFAULT_PUBLISHER_ID: null, From f5d39f39c4926b0521ac73816501fbb443f5efaa Mon Sep 17 00:00:00 2001 From: einhornimmond Date: Wed, 26 Nov 2025 11:05:50 +0100 Subject: [PATCH 15/19] update missed env name change --- backend/.env.dist | 2 +- backend/.env.org | 2 +- backend/.env.template | 2 +- .../src/apis/dltConnector/DltConnectorClient.test.ts | 8 ++++---- backend/src/apis/dltConnector/DltConnectorClient.ts | 2 +- .../apis/dltConnector/__mocks__/DltConnectorClient.ts | 2 +- backend/src/apis/dltConnector/index.ts | 10 +++++----- .../graphql/resolver/TransactionLinkResolver.test.ts | 2 +- .../src/graphql/resolver/TransactionResolver.test.ts | 2 +- backend/src/graphql/resolver/UserResolver.test.ts | 2 +- backend/src/graphql/resolver/semaphore.test.ts | 2 +- 11 files changed, 18 insertions(+), 18 deletions(-) diff --git a/backend/.env.dist b/backend/.env.dist index 0860b9c94..f9fcb035f 100644 --- a/backend/.env.dist +++ b/backend/.env.dist @@ -22,7 +22,7 @@ KLICKTIPP_APIKEY_DE=SomeFakeKeyDE KLICKTIPP_APIKEY_EN=SomeFakeKeyEN # DltConnector -DLT_CONNECTOR=true +DLT_ACTIVE=false DLT_CONNECTOR_URL=http://localhost:6010 # Community diff --git a/backend/.env.org b/backend/.env.org index 2267fdc50..d352693a6 100644 --- a/backend/.env.org +++ b/backend/.env.org @@ -22,7 +22,7 @@ KLICKTIPP_APIKEY_DE=SomeFakeKeyDE KLICKTIPP_APIKEY_EN=SomeFakeKeyEN # DltConnector -DLT_CONNECTOR=true +DLT_ACTIVE=true DLT_CONNECTOR_URL=http://localhost:6010 # Community diff --git a/backend/.env.template b/backend/.env.template index 5212d1e1b..98090546d 100644 --- a/backend/.env.template +++ b/backend/.env.template @@ -24,7 +24,7 @@ KLICKTIPP_APIKEY_DE=$KLICKTIPP_APIKEY_DE KLICKTIPP_APIKEY_EN=$KLICKTIPP_APIKEY_EN # DltConnector -DLT_CONNECTOR=$DLT_CONNECTOR +DLT_ACTIVE=$DLT_ACTIVE DLT_CONNECTOR_PORT=$DLT_CONNECTOR_PORT # Community diff --git a/backend/src/apis/dltConnector/DltConnectorClient.test.ts b/backend/src/apis/dltConnector/DltConnectorClient.test.ts index e3673791b..55acb6e04 100644 --- a/backend/src/apis/dltConnector/DltConnectorClient.test.ts +++ b/backend/src/apis/dltConnector/DltConnectorClient.test.ts @@ -5,17 +5,17 @@ import { DltConnectorClient } from './DltConnectorClient' describe('undefined DltConnectorClient', () => { it('invalid url', () => { CONFIG.DLT_CONNECTOR_URL = '' - CONFIG.DLT_CONNECTOR = true + CONFIG.DLT_ACTIVE = true const result = DltConnectorClient.getInstance() expect(result).toBeUndefined() CONFIG.DLT_CONNECTOR_URL = 'http://dlt-connector:6010' }) - it('DLT_CONNECTOR is false', () => { - CONFIG.DLT_CONNECTOR = false + it('DLT_ACTIVE is false', () => { + CONFIG.DLT_ACTIVE = false const result = DltConnectorClient.getInstance() expect(result).toBeUndefined() - CONFIG.DLT_CONNECTOR = true + CONFIG.DLT_ACTIVE = true }) }) diff --git a/backend/src/apis/dltConnector/DltConnectorClient.ts b/backend/src/apis/dltConnector/DltConnectorClient.ts index a5e162ba0..2a1ced85d 100644 --- a/backend/src/apis/dltConnector/DltConnectorClient.ts +++ b/backend/src/apis/dltConnector/DltConnectorClient.ts @@ -31,7 +31,7 @@ export class DltConnectorClient { * just one instance of each subclass around. */ public static getInstance(): DltConnectorClient | undefined { - if (!CONFIG.DLT_CONNECTOR || !CONFIG.DLT_CONNECTOR_URL) { + if (!CONFIG.DLT_ACTIVE || !CONFIG.DLT_CONNECTOR_URL) { logger.info(`dlt-connector are disabled via config...`) return } diff --git a/backend/src/apis/dltConnector/__mocks__/DltConnectorClient.ts b/backend/src/apis/dltConnector/__mocks__/DltConnectorClient.ts index 81a7c5398..5a2c96d79 100644 --- a/backend/src/apis/dltConnector/__mocks__/DltConnectorClient.ts +++ b/backend/src/apis/dltConnector/__mocks__/DltConnectorClient.ts @@ -30,7 +30,7 @@ export class DltConnectorClient { * just one instance of each subclass around. */ public static getInstance(): DltConnectorClient | undefined { - if (!CONFIG.DLT_CONNECTOR || !CONFIG.DLT_CONNECTOR_URL) { + if (!CONFIG.DLT_ACTIVE || !CONFIG.DLT_CONNECTOR_URL) { logger.info(`dlt-connector are disabled via config...`) return } diff --git a/backend/src/apis/dltConnector/index.ts b/backend/src/apis/dltConnector/index.ts index bce319674..dd192b82c 100644 --- a/backend/src/apis/dltConnector/index.ts +++ b/backend/src/apis/dltConnector/index.ts @@ -64,7 +64,7 @@ async function executeDltTransaction(draft: TransactionDraft | null, typeId: Dlt * and update dltTransactionId of transaction in db with hiero transaction id */ export async function registerAddressTransaction(user: DbUser, community: DbCommunity): Promise { - if (!CONFIG.DLT_CONNECTOR) { + if (!CONFIG.DLT_ACTIVE) { return Promise.resolve(null) } if (!user.id) { @@ -88,7 +88,7 @@ export async function contributionTransaction( signingUser: DbUser, createdAt: Date, ): Promise { - if (!CONFIG.DLT_CONNECTOR) { + if (!CONFIG.DLT_ACTIVE) { return Promise.resolve(null) } const homeCommunity = await getHomeCommunity() @@ -107,7 +107,7 @@ export async function transferTransaction( memo: string, createdAt: Date ): Promise { - if (!CONFIG.DLT_CONNECTOR) { + if (!CONFIG.DLT_ACTIVE) { return Promise.resolve(null) } // load community if not already loaded, maybe they are remote communities @@ -125,7 +125,7 @@ export async function transferTransaction( export async function deferredTransferTransaction(senderUser: DbUser, transactionLink: DbTransactionLink) : Promise { - if (!CONFIG.DLT_CONNECTOR) { + if (!CONFIG.DLT_ACTIVE) { return Promise.resolve(null) } // load community if not already loaded @@ -138,7 +138,7 @@ export async function deferredTransferTransaction(senderUser: DbUser, transactio export async function redeemDeferredTransferTransaction(transactionLink: DbTransactionLink, amount: string, createdAt: Date, recipientUser: DbUser) : Promise { - if (!CONFIG.DLT_CONNECTOR) { + if (!CONFIG.DLT_ACTIVE) { return Promise.resolve(null) } // load user and communities if not already loaded diff --git a/backend/src/graphql/resolver/TransactionLinkResolver.test.ts b/backend/src/graphql/resolver/TransactionLinkResolver.test.ts index b6abcb0b2..18eb9dde6 100644 --- a/backend/src/graphql/resolver/TransactionLinkResolver.test.ts +++ b/backend/src/graphql/resolver/TransactionLinkResolver.test.ts @@ -43,7 +43,7 @@ const logErrorLogger = getLogger(`${LOG4JS_BASE_CATEGORY_NAME}.server.LogError`) jest.mock('@/password/EncryptorUtils') -CONFIG.DLT_CONNECTOR = false +CONFIG.DLT_ACTIVE = false // mock semaphore to allow use fake timers jest.mock('database/src/util/TRANSACTIONS_LOCK') diff --git a/backend/src/graphql/resolver/TransactionResolver.test.ts b/backend/src/graphql/resolver/TransactionResolver.test.ts index a134ca84b..44c10deb9 100644 --- a/backend/src/graphql/resolver/TransactionResolver.test.ts +++ b/backend/src/graphql/resolver/TransactionResolver.test.ts @@ -38,7 +38,7 @@ import { CONFIG } from '@/config' jest.mock('@/password/EncryptorUtils') const logger = getLogger(`${LOG4JS_BASE_CATEGORY_NAME}.server.LogError`) -CONFIG.DLT_CONNECTOR = false +CONFIG.DLT_ACTIVE = false CONFIG.EMAIL = false let mutate: ApolloServerTestClient['mutate'] diff --git a/backend/src/graphql/resolver/UserResolver.test.ts b/backend/src/graphql/resolver/UserResolver.test.ts index cee570c94..aaa7bcca9 100644 --- a/backend/src/graphql/resolver/UserResolver.test.ts +++ b/backend/src/graphql/resolver/UserResolver.test.ts @@ -117,7 +117,7 @@ beforeAll(async () => { query = testEnv.query con = testEnv.con CONFIG.HUMHUB_ACTIVE = false - CONFIG.DLT_CONNECTOR = false + CONFIG.DLT_ACTIVE = false await cleanDB() }) diff --git a/backend/src/graphql/resolver/semaphore.test.ts b/backend/src/graphql/resolver/semaphore.test.ts index d0bf08b7c..dce6354ef 100644 --- a/backend/src/graphql/resolver/semaphore.test.ts +++ b/backend/src/graphql/resolver/semaphore.test.ts @@ -26,7 +26,7 @@ import { TRANSACTIONS_LOCK } from 'database' jest.mock('@/password/EncryptorUtils') -CONFIG.DLT_CONNECTOR = false +CONFIG.DLT_ACTIVE = false CONFIG.EMAIL = false let mutate: ApolloServerTestClient['mutate'] From 700c5a5c2197ee3c79fb376dfad5e65da7e83cf6 Mon Sep 17 00:00:00 2001 From: einhornimmond Date: Wed, 26 Nov 2025 11:20:45 +0100 Subject: [PATCH 16/19] fix bugs --- docker-compose.override.yml | 1 + frontend/src/components/ContentFooter.spec.js | 2 ++ frontend/src/components/ContentFooter.vue | 8 +++----- frontend/src/config/index.js | 2 ++ 4 files changed, 8 insertions(+), 5 deletions(-) diff --git a/docker-compose.override.yml b/docker-compose.override.yml index 3898f9991..e49d45a1c 100644 --- a/docker-compose.override.yml +++ b/docker-compose.override.yml @@ -228,6 +228,7 @@ volumes: node_modules_frontend: node_modules_backend: node_modules_federation: + node_modules_inspector: node_modules_database: node_modules_dlt_connector: turbo_cache: diff --git a/frontend/src/components/ContentFooter.spec.js b/frontend/src/components/ContentFooter.spec.js index 1fca50af2..418c2c580 100644 --- a/frontend/src/components/ContentFooter.spec.js +++ b/frontend/src/components/ContentFooter.spec.js @@ -4,6 +4,8 @@ import ContentFooter from './ContentFooter' import CONFIG from '@/config' import { BCol, BNav, BNavItem, BRow } from 'bootstrap-vue-next' +console.log(`CONFIG in ContentFooter.spec.js: ${JSON.stringify(CONFIG, null, 2)}`) + describe('ContentFooter', () => { let wrapper diff --git a/frontend/src/components/ContentFooter.vue b/frontend/src/components/ContentFooter.vue index a33933907..d6f120e49 100755 --- a/frontend/src/components/ContentFooter.vue +++ b/frontend/src/components/ContentFooter.vue @@ -43,11 +43,7 @@ {{ $t('navigation.support') }} - + {{ $t('footer.inspector') }} @@ -61,6 +57,8 @@ import CONFIG from '@/config' export default { data() { return { + dltActive: CONFIG.DLT_ACTIVE, + communityUrl: CONFIG.COMMUNITY_URL, year: new Date().getFullYear(), version: CONFIG.APP_VERSION, hash: CONFIG.BUILD_COMMIT, diff --git a/frontend/src/config/index.js b/frontend/src/config/index.js index f75ef910f..6e64797cc 100644 --- a/frontend/src/config/index.js +++ b/frontend/src/config/index.js @@ -2,6 +2,7 @@ // The whole contents is exposed to the client // Load Package Details for some default values +const { DLT_ACTIVE } = require('config-schema') const pkg = require('../../package') const constants = { @@ -38,6 +39,7 @@ if (process.env.FRONTEND_HOSTING === 'nodejs') { // version.FRONTEND_MODULE_PORT const features = { + DLT_ACTIVE: process.env.DLT_ACTIVE === 'true', GMS_ACTIVE: process.env.GMS_ACTIVE === 'true', HUMHUB_ACTIVE: process.env.HUMHUB_ACTIVE === 'true', AUTO_POLL_INTERVAL: Number.parseInt(process.env.AUTO_POLL_INTERVAL ?? 0), From 8b7da5fd68bd43f34fa376b4d30a66598cb47153 Mon Sep 17 00:00:00 2001 From: einhornimmond Date: Wed, 26 Nov 2025 11:22:52 +0100 Subject: [PATCH 17/19] remove debug console statement --- frontend/src/components/ContentFooter.spec.js | 2 -- 1 file changed, 2 deletions(-) diff --git a/frontend/src/components/ContentFooter.spec.js b/frontend/src/components/ContentFooter.spec.js index 418c2c580..1fca50af2 100644 --- a/frontend/src/components/ContentFooter.spec.js +++ b/frontend/src/components/ContentFooter.spec.js @@ -4,8 +4,6 @@ import ContentFooter from './ContentFooter' import CONFIG from '@/config' import { BCol, BNav, BNavItem, BRow } from 'bootstrap-vue-next' -console.log(`CONFIG in ContentFooter.spec.js: ${JSON.stringify(CONFIG, null, 2)}`) - describe('ContentFooter', () => { let wrapper From 183d4fdc83cce765ba3587c85ca783a887845a50 Mon Sep 17 00:00:00 2001 From: einhornimmond Date: Wed, 26 Nov 2025 11:25:33 +0100 Subject: [PATCH 18/19] remove accidently added line --- frontend/src/config/index.js | 1 - 1 file changed, 1 deletion(-) diff --git a/frontend/src/config/index.js b/frontend/src/config/index.js index 6e64797cc..d1d9966f8 100644 --- a/frontend/src/config/index.js +++ b/frontend/src/config/index.js @@ -2,7 +2,6 @@ // The whole contents is exposed to the client // Load Package Details for some default values -const { DLT_ACTIVE } = require('config-schema') const pkg = require('../../package') const constants = { From a4389e620218c3e3f315ce0776abba36de009de0 Mon Sep 17 00:00:00 2001 From: einhornimmond Date: Thu, 4 Dec 2025 08:39:51 +0100 Subject: [PATCH 19/19] add infos about submodules in README --- README.md | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/README.md b/README.md index 986066efa..a36be6e19 100644 --- a/README.md +++ b/README.md @@ -20,6 +20,7 @@ Clone the Gradido repository to your local machine. ```bash git clone https://github.com/gradido/gradido.git cd gradido +git submodule update --init --recursive ``` For local development, you can run Gradido with **Docker** or **natively**, depending on your preferences and system setup. If you don't have a native MariaDB or MySQL installation, Docker can be used to handle the database as well. @@ -227,6 +228,16 @@ In root folder calling `bun clear` will clear all turbo caches, node_modules and bun clear ``` +### git Submodule +The new Module `inspector` was added as git submodule. +So after +- `git clone` +- `git checkout` +- `git pull` + +you have to run `git submodule update --init` to get the correct submodule version. + +[Read More](https://git-scm.com/book/en/v2/Git-Tools-Submodules) ## Services defined in this package