diff --git a/backend/.env.dist b/backend/.env.dist index 3b6fe2ce4..29db81322 100644 --- a/backend/.env.dist +++ b/backend/.env.dist @@ -1,4 +1,4 @@ -CONFIG_VERSION=v11.2022-10-27 +CONFIG_VERSION=v12.2022-11-10 # Server PORT=4000 @@ -63,5 +63,12 @@ EVENT_PROTOCOL_DISABLED=false # DHT # if you set this value, the DHT hyperswarm will start to announce and listen -# on an hash created from this tpoic +# on an hash created from this topic # DHT_TOPIC=GRADIDO_HUB +# Define the following federation properties to individualize this community instance +# for federation per hyperswarm +# FEDERATE_COMMUNITY_NAME=Gradido Community Development +# FEDERATE_COMMUNITY_URL==http://localhost/ +# FEDERATE_COMMUNITY_PORT=4000 +# FEDERATE_COMMUNITY_UUID=14466b15-4631-4b1b-9110-dd6694356d9c +# FEDERATE_KEY_SECRET=a51ef8ac7ef1abf162fb7a65261acd7a diff --git a/backend/.env.template b/backend/.env.template index d009d08ff..69e486515 100644 --- a/backend/.env.template +++ b/backend/.env.template @@ -56,5 +56,10 @@ WEBHOOK_ELOPAGE_SECRET=$WEBHOOK_ELOPAGE_SECRET # EventProtocol EVENT_PROTOCOL_DISABLED=$EVENT_PROTOCOL_DISABLED -# DHT +# DHT/Federation DHT_TOPIC=$DHT_TOPIC +FEDERATE_COMMUNITY_NAME=$FEDERATE_COMMUNITY_NAME +FEDERATE_COMMUNITY_URL=$FEDERATE_COMMUNITY_URL +FEDERATE_COMMUNITY_PORT=$FEDERATE_COMMUNITY_PORT +FEDERATE_COMMUNITY_UUID=$FEDERATE_COMMUNITY_UUID +FEDERATE_KEY_SECRET=$FEDERATE_KEY_SECRET diff --git a/backend/src/config/index.ts b/backend/src/config/index.ts index e7139033b..78a3319ed 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: 'v11.2022-10-27', + EXPECTED: 'v12.2022-11-10', CURRENT: '', }, } @@ -118,6 +118,12 @@ if ( const federation = { DHT_TOPIC: process.env.DHT_TOPIC || null, + FEDERATE_COMMUNITY_NAME: process.env.FEDERATE_COMMUNITY_NAME || community.COMMUNITY_NAME, + FEDERATE_COMMUNITY_URL: process.env.FEDERATE_COMMUNITY_URL || community.COMMUNITY_URL, + FEDERATE_COMMUNITY_PORT: process.env.FEDERATE_COMMUNITY_PORT || server.PORT, + FEDERATE_COMMUNITY_UUID: + process.env.FEDERATE_COMMUNITY_UUID || '14466b15-4631-4b1b-9110-dd6694356d9c', + FEDERATE_KEY_SECRET: process.env.FEDERATE_KEY_SECRET || loginServer.LOGIN_SERVER_KEY, } const CONFIG = {