From be0c9d0e34803bf4217d857581089bd2661ffd13 Mon Sep 17 00:00:00 2001 From: einhornimmond Date: Wed, 26 Nov 2025 09:17:43 +0100 Subject: [PATCH] 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,