From 8deb3ea7c398ca1b17a7b6a1911b5642e8dc88ea Mon Sep 17 00:00:00 2001 From: einhornimmond Date: Wed, 14 Feb 2024 16:58:05 +0100 Subject: [PATCH 1/5] add videos to deployment readme --- deployment/hetzner_cloud/README.md | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/deployment/hetzner_cloud/README.md b/deployment/hetzner_cloud/README.md index d03ff0b46..d2cd66a35 100644 --- a/deployment/hetzner_cloud/README.md +++ b/deployment/hetzner_cloud/README.md @@ -1,7 +1,4 @@ # Setup on Hetzner Cloud Server -Suggested minimal Plan: CX41 -4x vCPU, 16 GB Ram, 160 GB Disk Space, 20.71 € per month (04.01.2024) - Suggested OS: Debian 12 @@ -15,6 +12,10 @@ ssh_authorized_keys: - ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIAkLGbzbG7KIGfkssKJBkc/0EVAzQ/8vjvVHzNdxhK8J yourname ``` +I made a (german) video to show it to you: + +[![Video](https://img.youtube.com/vi/fORK3Bt3lPw/hqdefault.jpg)](https://www.youtube.com/watch?v=fORK3Bt3lPw) + ## After Setup Cloud Server with cloudConfig.yaml ### setup your domain pointing on server ip address ### login to your new server as root @@ -99,16 +100,20 @@ nano .env # adjust values accordingly ``` -### Run `install.sh` +### Run `install.sh` with branch name ***!!! Attention !!!*** Don't use this script if you have custom config in /etc/nginx/conf.d, because this script will remove it and ln ../bare_metal/nginx/conf.d ```bash cd ~/gradido/deployment/hetzner_cloud -sudo ./install.sh +sudo ./install.sh release-2_2_0 ``` +I made a (german) video to show it to you: + +[![Video](https://img.youtube.com/vi/9h-55Si6bMk/hqdefault.jpg)](https://www.youtube.com/watch?v=9h-55Si6bMk) + ### Make yourself admin - Create an account on your new gradido instance - Click the link in the activation email @@ -122,3 +127,6 @@ sudo mysql -D gradido_community -e "insert into user_roles(user_id, role) values - login with you newly created user - if you has a link to `Admin Area` it worked and you are admin +I made a (german) video to show it to you: + +[![Video](https://img.youtube.com/vi/xVQ5t4MnLrE/hqdefault.jpg)](https://www.youtube.com/watch?v=xVQ5t4MnLrE) From aeb7a7d2be160e909df3a33c95c180037084f8fc Mon Sep 17 00:00:00 2001 From: einhornimmond Date: Thu, 15 Feb 2024 18:17:14 +0100 Subject: [PATCH 2/5] replace ?? with ||, check if FEDERATION_VALIDATE_COMMUNITY_TIMER is valid number --- backend/src/config/index.ts | 4 ++-- backend/src/federation/validateCommunities.ts | 4 ++++ 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/backend/src/config/index.ts b/backend/src/config/index.ts index b94178157..607aace6c 100644 --- a/backend/src/config/index.ts +++ b/backend/src/config/index.ts @@ -128,8 +128,8 @@ if ( const federation = { FEDERATION_BACKEND_SEND_ON_API: process.env.FEDERATION_BACKEND_SEND_ON_API ?? '1_0', - FEDERATION_VALIDATE_COMMUNITY_TIMER: - Number(process.env.FEDERATION_VALIDATE_COMMUNITY_TIMER) ?? 60000, + FEDERATION_VALIDATE_COMMUNITY_TIMER: // ?? operator don't work here as expected + Number(process.env.FEDERATION_VALIDATE_COMMUNITY_TIMER) || 60000, FEDERATION_XCOM_SENDCOINS_ENABLED: process.env.FEDERATION_XCOM_SENDCOINS_ENABLED === 'true' ?? false, // default value for community-uuid is equal uuid of stage-3 diff --git a/backend/src/federation/validateCommunities.ts b/backend/src/federation/validateCommunities.ts index f19d606bd..1013db98e 100644 --- a/backend/src/federation/validateCommunities.ts +++ b/backend/src/federation/validateCommunities.ts @@ -13,8 +13,12 @@ import { backendLogger as logger } from '@/server/logger' import { startCommunityAuthentication } from './authenticateCommunities' import { PublicCommunityInfoLoggingView } from './client/1_0/logging/PublicCommunityInfoLogging.view' import { ApiVersionType } from './enum/apiVersionType' +import { LogError } from '@/server/LogError' export async function startValidateCommunities(timerInterval: number): Promise { + if (Number.isNaN(timerInterval) || timerInterval <= 0) { + throw new LogError('FEDERATION_VALIDATE_COMMUNITY_TIMER is not a positive number') + } logger.info( `Federation: startValidateCommunities loop with an interval of ${timerInterval} ms...`, ) From efa361810b92625c0f5941b22f7b6906a580e2f2 Mon Sep 17 00:00:00 2001 From: einhornimmond Date: Thu, 15 Feb 2024 18:29:11 +0100 Subject: [PATCH 3/5] lint fix --- backend/src/config/index.ts | 3 ++- backend/src/federation/validateCommunities.ts | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/backend/src/config/index.ts b/backend/src/config/index.ts index 607aace6c..efda3fc31 100644 --- a/backend/src/config/index.ts +++ b/backend/src/config/index.ts @@ -128,7 +128,8 @@ if ( const federation = { FEDERATION_BACKEND_SEND_ON_API: process.env.FEDERATION_BACKEND_SEND_ON_API ?? '1_0', - FEDERATION_VALIDATE_COMMUNITY_TIMER: // ?? operator don't work here as expected + // ?? operator don't work here as expected + FEDERATION_VALIDATE_COMMUNITY_TIMER: Number(process.env.FEDERATION_VALIDATE_COMMUNITY_TIMER) || 60000, FEDERATION_XCOM_SENDCOINS_ENABLED: process.env.FEDERATION_XCOM_SENDCOINS_ENABLED === 'true' ?? false, diff --git a/backend/src/federation/validateCommunities.ts b/backend/src/federation/validateCommunities.ts index 1013db98e..b76e22087 100644 --- a/backend/src/federation/validateCommunities.ts +++ b/backend/src/federation/validateCommunities.ts @@ -8,12 +8,12 @@ import { FederatedCommunityLoggingView } from '@logging/FederatedCommunityLoggin import { FederationClient as V1_0_FederationClient } from '@/federation/client/1_0/FederationClient' import { PublicCommunityInfo } from '@/federation/client/1_0/model/PublicCommunityInfo' import { FederationClientFactory } from '@/federation/client/FederationClientFactory' +import { LogError } from '@/server/LogError' import { backendLogger as logger } from '@/server/logger' import { startCommunityAuthentication } from './authenticateCommunities' import { PublicCommunityInfoLoggingView } from './client/1_0/logging/PublicCommunityInfoLogging.view' import { ApiVersionType } from './enum/apiVersionType' -import { LogError } from '@/server/LogError' export async function startValidateCommunities(timerInterval: number): Promise { if (Number.isNaN(timerInterval) || timerInterval <= 0) { From 48f69ca89841058f837e056f505f408494b5adfa Mon Sep 17 00:00:00 2001 From: einhornimmond Date: Thu, 15 Feb 2024 19:33:27 +0100 Subject: [PATCH 4/5] Update backend/src/config/index.ts Co-authored-by: clauspeterhuebner <86960882+clauspeterhuebner@users.noreply.github.com> --- backend/src/config/index.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/backend/src/config/index.ts b/backend/src/config/index.ts index efda3fc31..2555a1730 100644 --- a/backend/src/config/index.ts +++ b/backend/src/config/index.ts @@ -130,7 +130,7 @@ const federation = { FEDERATION_BACKEND_SEND_ON_API: process.env.FEDERATION_BACKEND_SEND_ON_API ?? '1_0', // ?? operator don't work here as expected FEDERATION_VALIDATE_COMMUNITY_TIMER: - Number(process.env.FEDERATION_VALIDATE_COMMUNITY_TIMER) || 60000, + Number(process.env.FEDERATION_VALIDATE_COMMUNITY_TIMER ?? 60000) , FEDERATION_XCOM_SENDCOINS_ENABLED: process.env.FEDERATION_XCOM_SENDCOINS_ENABLED === 'true' ?? false, // default value for community-uuid is equal uuid of stage-3 From ea24651ca019d25514742dd6057cd91159636e0c Mon Sep 17 00:00:00 2001 From: einhornimmond Date: Thu, 15 Feb 2024 19:59:34 +0100 Subject: [PATCH 5/5] fix lint --- backend/src/config/index.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/backend/src/config/index.ts b/backend/src/config/index.ts index 2555a1730..0aed77583 100644 --- a/backend/src/config/index.ts +++ b/backend/src/config/index.ts @@ -129,8 +129,9 @@ if ( const federation = { FEDERATION_BACKEND_SEND_ON_API: process.env.FEDERATION_BACKEND_SEND_ON_API ?? '1_0', // ?? operator don't work here as expected - FEDERATION_VALIDATE_COMMUNITY_TIMER: - Number(process.env.FEDERATION_VALIDATE_COMMUNITY_TIMER ?? 60000) , + FEDERATION_VALIDATE_COMMUNITY_TIMER: Number( + process.env.FEDERATION_VALIDATE_COMMUNITY_TIMER ?? 60000, + ), FEDERATION_XCOM_SENDCOINS_ENABLED: process.env.FEDERATION_XCOM_SENDCOINS_ENABLED === 'true' ?? false, // default value for community-uuid is equal uuid of stage-3