From 5a78228af31269de4b6a9818cbf699689d6b427f Mon Sep 17 00:00:00 2001 From: Ulf Gebhardt Date: Tue, 7 Feb 2023 00:16:53 +0100 Subject: [PATCH 1/4] remove EVENT_PROTOCOL_DISABLED from backend & bare_metal deployment --- backend/.env.dist | 3 --- backend/.env.template | 3 --- backend/src/config/index.ts | 7 +------ backend/src/event/EventProtocolEmitter.ts | 6 ------ deployment/bare_metal/.env.dist | 5 +---- 5 files changed, 2 insertions(+), 22 deletions(-) diff --git a/backend/.env.dist b/backend/.env.dist index ba5b89fa9..3e54b0566 100644 --- a/backend/.env.dist +++ b/backend/.env.dist @@ -55,9 +55,6 @@ EMAIL_CODE_REQUEST_TIME=10 # Webhook WEBHOOK_ELOPAGE_SECRET=secret -# EventProtocol -EVENT_PROTOCOL_DISABLED=false - # SET LOG LEVEL AS NEEDED IN YOUR .ENV # POSSIBLE VALUES: all | trace | debug | info | warn | error | fatal # LOG_LEVEL=info diff --git a/backend/.env.template b/backend/.env.template index f73b87353..e75798325 100644 --- a/backend/.env.template +++ b/backend/.env.template @@ -54,9 +54,6 @@ EMAIL_CODE_REQUEST_TIME=$EMAIL_CODE_REQUEST_TIME # Webhook WEBHOOK_ELOPAGE_SECRET=$WEBHOOK_ELOPAGE_SECRET -# EventProtocol -EVENT_PROTOCOL_DISABLED=$EVENT_PROTOCOL_DISABLED - # Federation FEDERATION_DHT_TOPIC=$FEDERATION_DHT_TOPIC FEDERATION_DHT_SEED=$FEDERATION_DHT_SEED diff --git a/backend/src/config/index.ts b/backend/src/config/index.ts index d010b4ab0..63ea9c5b6 100644 --- a/backend/src/config/index.ts +++ b/backend/src/config/index.ts @@ -17,7 +17,7 @@ const constants = { LOG_LEVEL: process.env.LOG_LEVEL || 'info', CONFIG_VERSION: { DEFAULT: 'DEFAULT', - EXPECTED: 'v14.2022-12-22', + EXPECTED: 'v15.2023-02-07', CURRENT: '', }, } @@ -99,11 +99,6 @@ const webhook = { WEBHOOK_ELOPAGE_SECRET: process.env.WEBHOOK_ELOPAGE_SECRET || 'secret', } -const eventProtocol = { - // global switch to enable writing of EventProtocol-Entries - EVENT_PROTOCOL_DISABLED: process.env.EVENT_PROTOCOL_DISABLED === 'true' || false, -} - // This is needed by graphql-directive-auth process.env.APP_SECRET = server.JWT_SECRET diff --git a/backend/src/event/EventProtocolEmitter.ts b/backend/src/event/EventProtocolEmitter.ts index 9cde4939f..a87e8a256 100644 --- a/backend/src/event/EventProtocolEmitter.ts +++ b/backend/src/event/EventProtocolEmitter.ts @@ -1,14 +1,8 @@ import { Event } from '@/event/Event' import { backendLogger as logger } from '@/server/logger' import { EventProtocol } from '@entity/EventProtocol' -import CONFIG from '@/config' export const writeEvent = async (event: Event): Promise => { - if (CONFIG.EVENT_PROTOCOL_DISABLED) { - logger.info('EventProtocol is disabled', CONFIG.EVENT_PROTOCOL_DISABLED) - return null - } - logger.info('writeEvent', event) const dbEvent = new EventProtocol() dbEvent.type = event.type diff --git a/deployment/bare_metal/.env.dist b/deployment/bare_metal/.env.dist index e816c9236..9c9c7ac82 100644 --- a/deployment/bare_metal/.env.dist +++ b/deployment/bare_metal/.env.dist @@ -27,7 +27,7 @@ COMMUNITY_DESCRIPTION="Gradido Development Stage1 Test Community" COMMUNITY_SUPPORT_MAIL=support@supportmail.com # backend -BACKEND_CONFIG_VERSION=v14.2022-12-22 +BACKEND_CONFIG_VERSION=v15.2023-02-07 JWT_EXPIRES_IN=10m GDT_API_URL=https://gdt.gradido.net @@ -56,9 +56,6 @@ EMAIL_CODE_REQUEST_TIME=10 WEBHOOK_ELOPAGE_SECRET=secret -# EventProtocol -EVENT_PROTOCOL_DISABLED=false - # Federation # if you set the value of FEDERATION_DHT_TOPIC, the DHT hyperswarm will start to announce and listen # on an hash created from this topic From 24ca1563b898c338b4870cc50489d7ed753c5f20 Mon Sep 17 00:00:00 2001 From: Ulf Gebhardt Date: Tue, 7 Feb 2023 00:17:37 +0100 Subject: [PATCH 2/4] remove EVENT_PROTOCOL_DISABLED from dht-node --- dht-node/.env.dist | 3 --- dht-node/.env.template | 3 --- dht-node/src/config/index.ts | 7 +------ 3 files changed, 1 insertion(+), 12 deletions(-) diff --git a/dht-node/.env.dist b/dht-node/.env.dist index c1641ea98..09e25ccb6 100644 --- a/dht-node/.env.dist +++ b/dht-node/.env.dist @@ -8,9 +8,6 @@ DB_PASSWORD= DB_DATABASE=gradido_community TYPEORM_LOGGING_RELATIVE_PATH=typeorm.dht-node.log -# EventProtocol -EVENT_PROTOCOL_DISABLED=false - # SET LOG LEVEL AS NEEDED IN YOUR .ENV # POSSIBLE VALUES: all | trace | debug | info | warn | error | fatal # LOG_LEVEL=info diff --git a/dht-node/.env.template b/dht-node/.env.template index eca7cb277..b31667fdb 100644 --- a/dht-node/.env.template +++ b/dht-node/.env.template @@ -8,9 +8,6 @@ DB_PASSWORD=$DB_PASSWORD DB_DATABASE=gradido_community TYPEORM_LOGGING_RELATIVE_PATH=$TYPEORM_LOGGING_RELATIVE_PATH -# EventProtocol -EVENT_PROTOCOL_DISABLED=$EVENT_PROTOCOL_DISABLED - # Federation FEDERATION_DHT_TOPIC=$FEDERATION_DHT_TOPIC FEDERATION_DHT_SEED=$FEDERATION_DHT_SEED diff --git a/dht-node/src/config/index.ts b/dht-node/src/config/index.ts index 02cbb20e9..cb6fe7c77 100644 --- a/dht-node/src/config/index.ts +++ b/dht-node/src/config/index.ts @@ -9,7 +9,7 @@ const constants = { LOG_LEVEL: process.env.LOG_LEVEL || 'info', CONFIG_VERSION: { DEFAULT: 'DEFAULT', - EXPECTED: 'v1.2023-01-01', + EXPECTED: 'v2.2023-02-07', CURRENT: '', }, } @@ -28,11 +28,6 @@ const database = { process.env.TYPEORM_LOGGING_RELATIVE_PATH || 'typeorm.dht-node.log', } -const eventProtocol = { - // global switch to enable writing of EventProtocol-Entries - EVENT_PROTOCOL_DISABLED: process.env.EVENT_PROTOCOL_DISABLED === 'true' || false, -} - const federation = { FEDERATION_DHT_TOPIC: process.env.FEDERATION_DHT_TOPIC || 'GRADIDO_HUB', FEDERATION_DHT_SEED: process.env.FEDERATION_DHT_SEED || null, From 4d3ea26365ef873292207b4b10166abc969af850 Mon Sep 17 00:00:00 2001 From: Ulf Gebhardt Date: Tue, 7 Feb 2023 00:17:49 +0100 Subject: [PATCH 3/4] remove comment on federation --- federation/src/config/index.ts | 4 ---- 1 file changed, 4 deletions(-) diff --git a/federation/src/config/index.ts b/federation/src/config/index.ts index c2d81d2c8..588f52c60 100644 --- a/federation/src/config/index.ts +++ b/federation/src/config/index.ts @@ -52,10 +52,6 @@ const community = { process.env.COMMUNITY_DESCRIPTION || 'Die lokale Entwicklungsumgebung von Gradido.', } */ -// const eventProtocol = { -// global switch to enable writing of EventProtocol-Entries -// EVENT_PROTOCOL_DISABLED: process.env.EVENT_PROTOCOL_DISABLED === 'true' || false, -// } // This is needed by graphql-directive-auth // process.env.APP_SECRET = server.JWT_SECRET From 151f381d9405a03f4bdb196ccff61621f99404ee Mon Sep 17 00:00:00 2001 From: Ulf Gebhardt Date: Tue, 7 Feb 2023 00:29:07 +0100 Subject: [PATCH 4/4] fix config aggregation on dht-node & backend --- backend/src/config/index.ts | 1 - dht-node/src/config/index.ts | 1 - 2 files changed, 2 deletions(-) diff --git a/backend/src/config/index.ts b/backend/src/config/index.ts index 63ea9c5b6..4cca9e0e2 100644 --- a/backend/src/config/index.ts +++ b/backend/src/config/index.ts @@ -134,7 +134,6 @@ const CONFIG = { ...email, ...loginServer, ...webhook, - ...eventProtocol, ...federation, } diff --git a/dht-node/src/config/index.ts b/dht-node/src/config/index.ts index cb6fe7c77..795925ee3 100644 --- a/dht-node/src/config/index.ts +++ b/dht-node/src/config/index.ts @@ -50,7 +50,6 @@ const CONFIG = { ...constants, ...server, ...database, - ...eventProtocol, ...federation, }