From b70565cabf0d888c4038043cb90262ebdce8f75d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Claus-Peter=20H=C3=BCbner?= Date: Thu, 26 Jan 2023 00:33:42 +0100 Subject: [PATCH 001/294] remove TestResolvers from previous PR "multiple graphql endpoints" --- .../src/graphql/api/1_0/resolver/Test2Resolver.ts | 12 ------------ .../src/graphql/api/1_0/resolver/TestResolver.ts | 12 ------------ .../src/graphql/api/1_1/resolver/TestResolver.ts | 12 ------------ .../src/graphql/api/2_0/resolver/TestResolver.ts | 12 ------------ 4 files changed, 48 deletions(-) delete mode 100644 federation/src/graphql/api/1_0/resolver/Test2Resolver.ts delete mode 100644 federation/src/graphql/api/1_0/resolver/TestResolver.ts delete mode 100644 federation/src/graphql/api/1_1/resolver/TestResolver.ts delete mode 100644 federation/src/graphql/api/2_0/resolver/TestResolver.ts diff --git a/federation/src/graphql/api/1_0/resolver/Test2Resolver.ts b/federation/src/graphql/api/1_0/resolver/Test2Resolver.ts deleted file mode 100644 index 3388003b8..000000000 --- a/federation/src/graphql/api/1_0/resolver/Test2Resolver.ts +++ /dev/null @@ -1,12 +0,0 @@ -import { Query, Resolver } from 'type-graphql' -import { federationLogger as logger } from '@/server/logger' -import { GetTestApiResult } from '../../GetTestApiResult' - -@Resolver() -export class Test2Resolver { - @Query(() => GetTestApiResult) - async test2(): Promise { - logger.info(`test api 2 1_0`) - return new GetTestApiResult('1_0') - } -} diff --git a/federation/src/graphql/api/1_0/resolver/TestResolver.ts b/federation/src/graphql/api/1_0/resolver/TestResolver.ts deleted file mode 100644 index 7291e5ef2..000000000 --- a/federation/src/graphql/api/1_0/resolver/TestResolver.ts +++ /dev/null @@ -1,12 +0,0 @@ -import { Field, ObjectType, Query, Resolver } from 'type-graphql' -import { federationLogger as logger } from '@/server/logger' -import { GetTestApiResult } from '../../GetTestApiResult' - -@Resolver() -export class TestResolver { - @Query(() => GetTestApiResult) - async test(): Promise { - logger.info(`test api 1_0`) - return new GetTestApiResult('1_0') - } -} diff --git a/federation/src/graphql/api/1_1/resolver/TestResolver.ts b/federation/src/graphql/api/1_1/resolver/TestResolver.ts deleted file mode 100644 index 8880cad6e..000000000 --- a/federation/src/graphql/api/1_1/resolver/TestResolver.ts +++ /dev/null @@ -1,12 +0,0 @@ -import { Field, ObjectType, Query, Resolver } from 'type-graphql' -import { federationLogger as logger } from '@/server/logger' -import { GetTestApiResult } from '../../GetTestApiResult' - -@Resolver() -export class TestResolver { - @Query(() => GetTestApiResult) - async test(): Promise { - logger.info(`test api 1_1`) - return new GetTestApiResult('1_1') - } -} diff --git a/federation/src/graphql/api/2_0/resolver/TestResolver.ts b/federation/src/graphql/api/2_0/resolver/TestResolver.ts deleted file mode 100644 index f50149e33..000000000 --- a/federation/src/graphql/api/2_0/resolver/TestResolver.ts +++ /dev/null @@ -1,12 +0,0 @@ -import { Field, ObjectType, Query, Resolver } from 'type-graphql' -import { federationLogger as logger } from '@/server/logger' -import { GetTestApiResult } from '../../GetTestApiResult' - -@Resolver() -export class TestResolver { - @Query(() => GetTestApiResult) - async test(): Promise { - logger.info(`test api 2_0`) - return new GetTestApiResult('2_0') - } -} From a05c2307ee4becd498ec85509d09e213810e5a41 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Claus-Peter=20H=C3=BCbner?= Date: Thu, 26 Jan 2023 00:34:45 +0100 Subject: [PATCH 002/294] add columns to communities table --- backend/src/config/index.ts | 2 +- .../Community.ts | 48 +++++++++++++++++++ database/entity/Community.ts | 2 +- .../0060-update_communities_table.ts | 22 +++++++++ federation/src/config/index.ts | 2 +- 5 files changed, 73 insertions(+), 3 deletions(-) create mode 100644 database/entity/0060-update_communities_table/Community.ts create mode 100644 database/migrations/0060-update_communities_table.ts diff --git a/backend/src/config/index.ts b/backend/src/config/index.ts index d010b4ab0..3b8d0d1d6 100644 --- a/backend/src/config/index.ts +++ b/backend/src/config/index.ts @@ -10,7 +10,7 @@ Decimal.set({ }) const constants = { - DB_VERSION: '0059-add_hide_amount_to_users', + DB_VERSION: '0060-update_communities_table', DECAY_START_TIME: new Date('2021-05-13 17:46:31-0000'), // GMT+0 LOG4JS_CONFIG: 'log4js-config.json', // default log level on production should be info diff --git a/database/entity/0060-update_communities_table/Community.ts b/database/entity/0060-update_communities_table/Community.ts new file mode 100644 index 000000000..3a9082667 --- /dev/null +++ b/database/entity/0060-update_communities_table/Community.ts @@ -0,0 +1,48 @@ +import { + BaseEntity, + Entity, + PrimaryGeneratedColumn, + Column, + CreateDateColumn, + UpdateDateColumn, +} from 'typeorm' + +@Entity('communities') +export class Community extends BaseEntity { + @PrimaryGeneratedColumn('increment', { unsigned: true }) + id: number + + @Column({ name: 'foreign', type: 'bool', nullable: false, default: false }) + foreign: boolean + + @Column({ name: 'public_key', type: 'binary', length: 64, default: null, nullable: true }) + publicKey: Buffer + + @Column({ name: 'api_version', length: 10, nullable: false }) + apiVersion: string + + @Column({ name: 'end_point', length: 255, nullable: false }) + endPoint: string + + @Column({ name: 'last_announced_at', type: 'datetime', nullable: false }) + lastAnnouncedAt: Date + + @Column({ name: 'pubkey_verified_at', type: 'datetime', nullable: false }) + pubKeyVerifiedAt: Date + + @CreateDateColumn({ + name: 'created_at', + type: 'datetime', + default: () => 'CURRENT_TIMESTAMP(3)', + nullable: false, + }) + createdAt: Date + + @UpdateDateColumn({ + name: 'updated_at', + type: 'datetime', + onUpdate: 'CURRENT_TIMESTAMP(3)', + nullable: true, + }) + updatedAt: Date | null +} diff --git a/database/entity/Community.ts b/database/entity/Community.ts index 457d03eae..80e5ace30 100644 --- a/database/entity/Community.ts +++ b/database/entity/Community.ts @@ -1 +1 @@ -export { Community } from './0058-add_communities_table/Community' +export { Community } from './0060-update_communities_table/Community' diff --git a/database/migrations/0060-update_communities_table.ts b/database/migrations/0060-update_communities_table.ts new file mode 100644 index 000000000..1047481ee --- /dev/null +++ b/database/migrations/0060-update_communities_table.ts @@ -0,0 +1,22 @@ +/* MIGRATION TO CREATE THE FEDERATION COMMUNITY TABLES + * + * This migration creates the `community` and 'communityfederation' tables in the `apollo` database (`gradido_community`). + */ + +/* eslint-disable @typescript-eslint/explicit-module-boundary-types */ +/* eslint-disable @typescript-eslint/no-explicit-any */ + +export async function upgrade(queryFn: (query: string, values?: any[]) => Promise>) { + await queryFn( + 'ALTER TABLE `communities` ADD COLUMN `foreign` tinyint(4) NOT NULL DEFAULT 0 AFTER `id`;', + ) + await queryFn( + 'ALTER TABLE `communities` ADD COLUMN `pubkey_verified_at` datetime(3) AFTER `last_announced_at`;', + ) +} + +export async function downgrade(queryFn: (query: string, values?: any[]) => Promise>) { + // write downgrade logic as parameter of queryFn + await queryFn('ALTER TABLE communities DROP COLUMN foreign;') + await queryFn('ALTER TABLE communities DROP COLUMN pubkey_verified_at;') +} diff --git a/federation/src/config/index.ts b/federation/src/config/index.ts index c2d81d2c8..2404c610f 100644 --- a/federation/src/config/index.ts +++ b/federation/src/config/index.ts @@ -11,7 +11,7 @@ Decimal.set({ */ const constants = { - DB_VERSION: '0059-add_hide_amount_to_users', + DB_VERSION: '0060-update_communities_table', // DECAY_START_TIME: new Date('2021-05-13 17:46:31-0000'), // GMT+0 LOG4JS_CONFIG: 'log4js-config.json', // default log level on production should be info From 4e1a6d965e620311c4d2f9678901accaa5299e56 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Claus-Peter=20H=C3=BCbner?= Date: Thu, 26 Jan 2023 00:35:28 +0100 Subject: [PATCH 003/294] create graphql endpoint for GetPublicKey request --- .../api/1_0/model/GetPublicKeyResult.ts | 11 +++++++++++ .../api/1_0/resolver/PublicKeyResolver.ts | 18 ++++++++++++++++++ federation/src/graphql/api/GetTestApiResult.ts | 11 ----------- 3 files changed, 29 insertions(+), 11 deletions(-) create mode 100644 federation/src/graphql/api/1_0/model/GetPublicKeyResult.ts create mode 100644 federation/src/graphql/api/1_0/resolver/PublicKeyResolver.ts delete mode 100644 federation/src/graphql/api/GetTestApiResult.ts diff --git a/federation/src/graphql/api/1_0/model/GetPublicKeyResult.ts b/federation/src/graphql/api/1_0/model/GetPublicKeyResult.ts new file mode 100644 index 000000000..1582ad892 --- /dev/null +++ b/federation/src/graphql/api/1_0/model/GetPublicKeyResult.ts @@ -0,0 +1,11 @@ +import { Field, ObjectType } from 'type-graphql' + +@ObjectType() +export class GetPublicKeyResult { + constructor(pubKey: string) { + this.publicKey = pubKey + } + + @Field(() => String) + publicKey: string +} diff --git a/federation/src/graphql/api/1_0/resolver/PublicKeyResolver.ts b/federation/src/graphql/api/1_0/resolver/PublicKeyResolver.ts new file mode 100644 index 000000000..53f0d0bd4 --- /dev/null +++ b/federation/src/graphql/api/1_0/resolver/PublicKeyResolver.ts @@ -0,0 +1,18 @@ +import { Field, ObjectType, Query, Resolver } from 'type-graphql' +import { federationLogger as logger } from '@/server/logger' +import { Community as DbCommunity } from '@entity/Community' +import { GetPublicKeyResult } from '../model/GetPublicKeyResult' + +@Resolver() +export class PublicKeyResolver { + @Query(() => GetPublicKeyResult) + async getPublicKey(): Promise { + logger.info(`getPublicKey()...`) + const homeCom = await DbCommunity.findOneOrFail({ + foreign: false, + apiVersion: '1_0', + }) + logger.info(`getPublicKey()... with publicKey=${homeCom.publicKey}`) + return new GetPublicKeyResult(homeCom.publicKey.toString()) + } +} diff --git a/federation/src/graphql/api/GetTestApiResult.ts b/federation/src/graphql/api/GetTestApiResult.ts deleted file mode 100644 index 7c8c6c487..000000000 --- a/federation/src/graphql/api/GetTestApiResult.ts +++ /dev/null @@ -1,11 +0,0 @@ -import { Field, ObjectType } from 'type-graphql' - -@ObjectType() -export class GetTestApiResult { - constructor(apiVersion: string) { - this.api = apiVersion - } - - @Field(() => String) - api: string -} From ae2097ff71439eab415573420b565c4bf25a321d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Claus-Peter=20H=C3=BCbner?= Date: Fri, 27 Jan 2023 21:55:43 +0100 Subject: [PATCH 004/294] rename pubkeyVerifiedAt to verifiedAt --- database/entity/0060-update_communities_table/Community.ts | 4 ++-- database/migrations/0060-update_communities_table.ts | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/database/entity/0060-update_communities_table/Community.ts b/database/entity/0060-update_communities_table/Community.ts index 3a9082667..73f098f46 100644 --- a/database/entity/0060-update_communities_table/Community.ts +++ b/database/entity/0060-update_communities_table/Community.ts @@ -27,8 +27,8 @@ export class Community extends BaseEntity { @Column({ name: 'last_announced_at', type: 'datetime', nullable: false }) lastAnnouncedAt: Date - @Column({ name: 'pubkey_verified_at', type: 'datetime', nullable: false }) - pubKeyVerifiedAt: Date + @Column({ name: 'verified_at', type: 'datetime', nullable: false }) + verifiedAt: Date @CreateDateColumn({ name: 'created_at', diff --git a/database/migrations/0060-update_communities_table.ts b/database/migrations/0060-update_communities_table.ts index 1047481ee..1e1b8411e 100644 --- a/database/migrations/0060-update_communities_table.ts +++ b/database/migrations/0060-update_communities_table.ts @@ -11,12 +11,12 @@ export async function upgrade(queryFn: (query: string, values?: any[]) => Promis 'ALTER TABLE `communities` ADD COLUMN `foreign` tinyint(4) NOT NULL DEFAULT 0 AFTER `id`;', ) await queryFn( - 'ALTER TABLE `communities` ADD COLUMN `pubkey_verified_at` datetime(3) AFTER `last_announced_at`;', + 'ALTER TABLE `communities` ADD COLUMN `verified_at` datetime(3) AFTER `last_announced_at`;', ) } export async function downgrade(queryFn: (query: string, values?: any[]) => Promise>) { // write downgrade logic as parameter of queryFn await queryFn('ALTER TABLE communities DROP COLUMN foreign;') - await queryFn('ALTER TABLE communities DROP COLUMN pubkey_verified_at;') + await queryFn('ALTER TABLE communities DROP COLUMN verified_at;') } From b542f6c81e8a2b1c38e1a394a289851b1b106b9b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Claus-Peter=20H=C3=BCbner?= Date: Tue, 31 Jan 2023 01:02:20 +0100 Subject: [PATCH 005/294] add column last_error_at --- database/entity/0060-update_communities_table/Community.ts | 3 +++ database/migrations/0060-update_communities_table.ts | 4 ++++ 2 files changed, 7 insertions(+) diff --git a/database/entity/0060-update_communities_table/Community.ts b/database/entity/0060-update_communities_table/Community.ts index 73f098f46..227400fdf 100644 --- a/database/entity/0060-update_communities_table/Community.ts +++ b/database/entity/0060-update_communities_table/Community.ts @@ -30,6 +30,9 @@ export class Community extends BaseEntity { @Column({ name: 'verified_at', type: 'datetime', nullable: false }) verifiedAt: Date + @Column({ name: 'last_error_at', type: 'datetime', nullable: false }) + lastErrorAt: Date + @CreateDateColumn({ name: 'created_at', type: 'datetime', diff --git a/database/migrations/0060-update_communities_table.ts b/database/migrations/0060-update_communities_table.ts index 1e1b8411e..55617fd0a 100644 --- a/database/migrations/0060-update_communities_table.ts +++ b/database/migrations/0060-update_communities_table.ts @@ -13,10 +13,14 @@ export async function upgrade(queryFn: (query: string, values?: any[]) => Promis await queryFn( 'ALTER TABLE `communities` ADD COLUMN `verified_at` datetime(3) AFTER `last_announced_at`;', ) + await queryFn( + 'ALTER TABLE `communities` ADD COLUMN `last_error_at` datetime(3) AFTER `verified_at`;', + ) } export async function downgrade(queryFn: (query: string, values?: any[]) => Promise>) { // write downgrade logic as parameter of queryFn await queryFn('ALTER TABLE communities DROP COLUMN foreign;') await queryFn('ALTER TABLE communities DROP COLUMN verified_at;') + await queryFn('ALTER TABLE communities DROP COLUMN last_error_at;') } From 72f882add3ffade6dd3c0dd67bca0048a1ad987f Mon Sep 17 00:00:00 2001 From: clauspeterhuebner <86960882+clauspeterhuebner@users.noreply.github.com> Date: Tue, 7 Feb 2023 22:34:30 +0100 Subject: [PATCH 006/294] Update database/migrations/0060-update_communities_table.ts Co-authored-by: Moriz Wahl --- database/migrations/0060-update_communities_table.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/database/migrations/0060-update_communities_table.ts b/database/migrations/0060-update_communities_table.ts index 55617fd0a..1804ee6c7 100644 --- a/database/migrations/0060-update_communities_table.ts +++ b/database/migrations/0060-update_communities_table.ts @@ -8,7 +8,7 @@ export async function upgrade(queryFn: (query: string, values?: any[]) => Promise>) { await queryFn( - 'ALTER TABLE `communities` ADD COLUMN `foreign` tinyint(4) NOT NULL DEFAULT 0 AFTER `id`;', + 'ALTER TABLE `communities` ADD COLUMN `foreign` tinyint(4) NOT NULL DEFAULT 1 AFTER `id`;', ) await queryFn( 'ALTER TABLE `communities` ADD COLUMN `verified_at` datetime(3) AFTER `last_announced_at`;', From fcab712f86468e5a19311f9284acd99a404f3bfd Mon Sep 17 00:00:00 2001 From: clauspeterhuebner <86960882+clauspeterhuebner@users.noreply.github.com> Date: Tue, 7 Feb 2023 22:35:12 +0100 Subject: [PATCH 007/294] Update database/entity/0060-update_communities_table/Community.ts Co-authored-by: Moriz Wahl --- database/entity/0060-update_communities_table/Community.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/database/entity/0060-update_communities_table/Community.ts b/database/entity/0060-update_communities_table/Community.ts index 227400fdf..d764fc98f 100644 --- a/database/entity/0060-update_communities_table/Community.ts +++ b/database/entity/0060-update_communities_table/Community.ts @@ -12,7 +12,7 @@ export class Community extends BaseEntity { @PrimaryGeneratedColumn('increment', { unsigned: true }) id: number - @Column({ name: 'foreign', type: 'bool', nullable: false, default: false }) + @Column({ name: 'foreign', type: 'bool', nullable: false, default: true }) foreign: boolean @Column({ name: 'public_key', type: 'binary', length: 64, default: null, nullable: true }) From d38539df7ceda1cfcd6aeaaf2f6035f040d255a9 Mon Sep 17 00:00:00 2001 From: elweyn Date: Tue, 14 Feb 2023 12:09:29 +0100 Subject: [PATCH 008/294] Add yarn build on gradido folder, goes into database, admin, frontend, backend, e2e-tests and federation. --- package.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/package.json b/package.json index 2220c1a85..626e3ed02 100644 --- a/package.json +++ b/package.json @@ -7,7 +7,8 @@ "author": "Ulf Gebhardt ", "license": "Apache-2.0", "scripts": { - "release": "scripts/release.sh" + "release": "scripts/release.sh", + "build": "yarn && cd database && yarn && cd ../frontend && yarn && cd ../admin && yarn && cd ../backend && yarn && cd ../e2e-tests && yarn && cd ../federation && yarn && cd .." }, "dependencies": { "auto-changelog": "^2.4.0", From 8e85bf30d02ac4f2051618425543788d2ce9f9d6 Mon Sep 17 00:00:00 2001 From: elweyn Date: Wed, 15 Feb 2023 16:15:47 +0100 Subject: [PATCH 009/294] Rename build to install so we can install gradido under packages with this command. --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 626e3ed02..86c345011 100644 --- a/package.json +++ b/package.json @@ -8,7 +8,7 @@ "license": "Apache-2.0", "scripts": { "release": "scripts/release.sh", - "build": "yarn && cd database && yarn && cd ../frontend && yarn && cd ../admin && yarn && cd ../backend && yarn && cd ../e2e-tests && yarn && cd ../federation && yarn && cd .." + "install": "yarn && cd database && yarn && cd ../frontend && yarn && cd ../admin && yarn && cd ../backend && yarn && cd ../e2e-tests && yarn && cd ../federation && yarn && cd .." }, "dependencies": { "auto-changelog": "^2.4.0", From 4db4e63200dd30f90b045f224c77950f8a21e7e7 Mon Sep 17 00:00:00 2001 From: elweyn Date: Wed, 15 Feb 2023 16:18:31 +0100 Subject: [PATCH 010/294] With install it collide with the normal install. --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 86c345011..e7fc91a96 100644 --- a/package.json +++ b/package.json @@ -8,7 +8,7 @@ "license": "Apache-2.0", "scripts": { "release": "scripts/release.sh", - "install": "yarn && cd database && yarn && cd ../frontend && yarn && cd ../admin && yarn && cd ../backend && yarn && cd ../e2e-tests && yarn && cd ../federation && yarn && cd .." + "installAll": "yarn && cd database && yarn && cd ../frontend && yarn && cd ../admin && yarn && cd ../backend && yarn && cd ../e2e-tests && yarn && cd ../federation && yarn && cd .." }, "dependencies": { "auto-changelog": "^2.4.0", From 81daa8324437760e59c47eabdda9bc50832e3afa Mon Sep 17 00:00:00 2001 From: elweyn Date: Wed, 15 Feb 2023 16:22:33 +0100 Subject: [PATCH 011/294] Add new command to the README. --- README.md | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 3d086018e..87b4f44e5 100644 --- a/README.md +++ b/README.md @@ -76,7 +76,11 @@ git clone git@github.com:gradido/gradido.git git submodule update --recursive --init ``` -### 2. Run docker-compose +### 2. Install modules + +You can go in each under folder (admin, frontend, database, backend, ...) and call ``yarn`` in each folder or you can call ``yarn installAll``. + +### 3. Run docker-compose Run docker-compose to bring up the development environment From ddae7f647dc1f7aa1d1324f4fbd1a937bd6935ab Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Claus-Peter=20H=C3=BCbner?= Date: Wed, 15 Feb 2023 23:11:16 +0100 Subject: [PATCH 012/294] describe and draw the current federation moduls and handshake --- .../TechnicalRequirements/Federation.md | 47 ++- .../graphics/TechnicalOverview_V1-19.drawio | 282 ++++++++++++++++++ .../image/TechnicalOverview_V1-19.svg | 1 + 3 files changed, 303 insertions(+), 27 deletions(-) create mode 100644 docu/Concepts/TechnicalRequirements/graphics/TechnicalOverview_V1-19.drawio create mode 100644 docu/Concepts/TechnicalRequirements/image/TechnicalOverview_V1-19.svg diff --git a/docu/Concepts/TechnicalRequirements/Federation.md b/docu/Concepts/TechnicalRequirements/Federation.md index 959aa8afe..7210756ff 100644 --- a/docu/Concepts/TechnicalRequirements/Federation.md +++ b/docu/Concepts/TechnicalRequirements/Federation.md @@ -4,29 +4,6 @@ This document contains the concept and technical details for the *federation* of But meanwhile the usage of a DHT like HyperSwarm promises more coverage of the gradido requirements out of the box. More details about HyperSwarm can be found here [@hyperswarm/dht](https://github.com/hyperswarm/dht). -## ActivityPub (deprecated) - -The activity pub defines a server-to-server federation protocol to share information between decentralized instances and will be the main komponent for the gradido community federation. - -At first we asume a *gradido community* as an *ActivityPub user*. A user is represented by "*actors*" via the users's accounts on servers. User's accounts on different servers corrsponds to different actors, which means community accounts on different servers corrsponds to different communities. - -Every community (actor) has an: - -* inbox: to get messages from the world -* outbox: to send messages to others - -and are simple endpoints or just URLs, which are described in the *ActivityStream* of each *ActivityPub community*. - -### Open Decision: - -It has to be decided, if the Federation will work with an internal or with external ActivityPub-Server, as shown in the picture below: - -![FederationActivityPub](./image/FederationActivityPub.png " ") - -The Variant A with an internal server contains the benefit to be as independent as possible from third party service providers and will not cause additional hosting costs. But this solution will cause the additional efforts of impementing an ActivityPub-Server in the gradido application and the responsibility for this component. - -The Varaint B with an external server contains the benefit to reduce the implementation efforts and the responsibility for an own ActivitPub-Server. But it will cause an additional dependency to a third party service provider and the growing hosting costs. - ## HyperSwarm The decision to switch from ActivityPub to HyperSwarm base on the arguments, that the *hyperswarm/dht* library will satify the most federation requirements out of the box. It is now to design the business requirements of the [gradido community communication](../BusinessRequirements/CommunityVerwaltung.md#UC-createCommunity) in a technical conception. @@ -41,12 +18,28 @@ To enable such a relationship between an existing community and a new community 2. Authentication 3. Autorized Communication -### Overview +### Overview of Federation-Handshake At first the following diagramm gives an overview of the three stages and shows the handshake between an existing community-A and a new created community-B including the data exchange for buildup such a federated, authenticated and autorized relationship. ![FederationHyperSwarm.png](./image/FederationHyperSwarm.png) +### Technical Architecture + +The previous described handshake will be done by several technical moduls of the gradido system. The following picture gives an overview about the moduls and how the communicate with each other. + +![img](./image/TechnicalOverview_V1-19.svg) + +As soon as a Gradido Community is up and running the DHT-Modul first write the home-community-entries in the database and starts with the federation per HyperSwarm. Each community, which is configured to listen on the GRADIDO_HUB of the DHT will be part of the Gradido-Net-Federation. That means each DHT-Modul of each community will receive the publicKey of all connected communities. The DHT-Modul will open for each received publicKey a communication-socket with the associated community DHT-Modul, to exchange api-version info and hosted urls for later direct communication between both communities. The exchanged api-version info and urls will be written in the own database. + +The up and running Backend-Modul contains a validation logic to verify the community entries from the own DHT-Modul. For each announced but unverified community-entry the GraphQL-Client is used to invoke a getPublicKey-Request. Depending on the containing api-version the matching GraphQL-Client is used and the getPublicKey-Request will be send to the given URL. + +As soon as the FederationModul of the assoziated community received the getPublicKey-request the own publicKey is read from database and send back in the response. + +The GraphQL-Client will read from the returned response data the publicKey of the other community and compare it with the data of the community-entry, which cause the getPublicKey-Request. If they match the community-entry will be updated be inserting the current timestamp in the verifiedAt-field of this community-entry. + +This federation and verification logic will work the whole time and can be monitored by observing the communities-table changes. The Admin-UI will contain a Page to have a look on the current state of the communities table content. + ### Prerequisits Before starting in describing the details of the federation handshake, some prerequisits have to be defined. @@ -235,7 +228,7 @@ For the first federation release the *DHT-Node* will be part of the *apollo serv | communityApiVersion.apiversion | keep existing value | | communityApiVersion.validFrom | exchangedData.API.validFrom | | communityApiVersion.verifiedAt | keep existing value | - * + * 3. After all received data is stored successfully, the *DHT-Node* starts the *stage2 - Authentication* of the federation handshake ### Stage2 - Authentication @@ -284,8 +277,8 @@ As soon the *openConnection* request is invoked: 3. check if the decrypted `parameter.signedAndEncryptedURL` is equals the selected url from the previous selected CommunityFederationEntry 1. if not then break the further processing of this request by only writing an error-log event. There will be no answer to the invoker community, because this community will only go on with a `openConnectionRedirect`-request from this community. 2. if yes then verify the signature of `parameter.signedAndEncryptedURL` with the `cf.pubKey` read in step 2 before - 3. -4. + 3. +4. ### Stage3 - Autorized Business Communication diff --git a/docu/Concepts/TechnicalRequirements/graphics/TechnicalOverview_V1-19.drawio b/docu/Concepts/TechnicalRequirements/graphics/TechnicalOverview_V1-19.drawio new file mode 100644 index 000000000..534804e1d --- /dev/null +++ b/docu/Concepts/TechnicalRequirements/graphics/TechnicalOverview_V1-19.drawio @@ -0,0 +1,282 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/docu/Concepts/TechnicalRequirements/image/TechnicalOverview_V1-19.svg b/docu/Concepts/TechnicalRequirements/image/TechnicalOverview_V1-19.svg new file mode 100644 index 000000000..4b407aa5a --- /dev/null +++ b/docu/Concepts/TechnicalRequirements/image/TechnicalOverview_V1-19.svg @@ -0,0 +1 @@ +
Community  "Gradido-Akademie"
Community  "Gradido-Akademie"
Gradido - technical Infrastructure-Overview
State of 02.2023
Gradido - technical Infrastructure-Overview...
Backend-Modul
GraphQL-API
Backend-Modul...
CommunityServer DB
CommunityServer DB
Layer 1:
Layer 1:
Layer 2:
Layer 2:
"GDT-Server"
base on C++ + mySQL
"GDT-Server"...
GDT-Server DB
GDT-Server DB
json-
ajax-
request
json-...
Layer 3:
Layer 3:
"Elopage"
external Service-Portal
"Elopage"...
"User-UI"
"User-UI"
graphql
graphql
json-
request
json-...
graphql
graphql
"Admin-UI"
"Admin-UI"
DHT-Modul
HyperSwarm
DHT-Modul...
Federation-Modul
GraphQL-API V2_0
Federation-Modul...
Federation-Modul
GraphQL-API V1_x
Federation-Modul...
Federation-Modul
GraphQL-API V1_1
Federation-Modul...
Federation-Modul
GraphQL-API V1_0
Federation-Modul...
GraphQL-Client V1_0
GraphQL-Client V1_0
GraphQL-Client V1_0
GraphQL-Client V1_0
GraphQL-Client V1_0
GraphQL-Client V1_0
GraphQL-Client V1_0
GraphQL-Client V1_0
Community "GallischesDorf-TBB"
Community "GallischesDorf-TBB"
Backend-Modul
GraphQL-API
Backend-Modul...
CommunityServer DB
CommunityServer DB
Layer 1:
Layer 1:
Layer 2:
Layer 2:
Layer 3:
Layer 3:
"User-UI"
"User-UI"
graphql
graphql
graphql
graphql
"Admin-UI"
"Admin-UI"
 DHT-Socket Communication 
 DHT-Socket Communication 
DHT-Modul
HyperSwarm
DHT-Modul...
Federation-Modul
GraphQL-API V1_1
Federation-Modul...
Federation-Modul
GraphQL-API V1_0
Federation-Modul...
graphQL-Handshake
graphQL-Handshake
GraphQL-Client V1_1
GraphQL-Client V1_1
graphQL-Handshake
graphQL-Handshake
GraphQL-Client V1_0
GraphQL-Client V1_0
graphQL-Handshake
graphQL-Handshake
graphQL-Handshake
graphQL-Handshake
Viewer does not support full SVG 1.1
\ No newline at end of file From d6044b4fe61bd26ec0ba7318523d12c1318bbb22 Mon Sep 17 00:00:00 2001 From: Einhornimmond Date: Thu, 16 Feb 2023 14:46:12 +0100 Subject: [PATCH 013/294] correct error with gdt server in graphic --- .../graphics/TechnicalOverview_V1-19.drawio | 144 +++++++++--------- .../image/TechnicalOverview_V1-19.svg | 2 +- 2 files changed, 73 insertions(+), 73 deletions(-) diff --git a/docu/Concepts/TechnicalRequirements/graphics/TechnicalOverview_V1-19.drawio b/docu/Concepts/TechnicalRequirements/graphics/TechnicalOverview_V1-19.drawio index 534804e1d..3ce2508d9 100644 --- a/docu/Concepts/TechnicalRequirements/graphics/TechnicalOverview_V1-19.drawio +++ b/docu/Concepts/TechnicalRequirements/graphics/TechnicalOverview_V1-19.drawio @@ -1,277 +1,277 @@ - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + diff --git a/docu/Concepts/TechnicalRequirements/image/TechnicalOverview_V1-19.svg b/docu/Concepts/TechnicalRequirements/image/TechnicalOverview_V1-19.svg index 4b407aa5a..2f5264182 100644 --- a/docu/Concepts/TechnicalRequirements/image/TechnicalOverview_V1-19.svg +++ b/docu/Concepts/TechnicalRequirements/image/TechnicalOverview_V1-19.svg @@ -1 +1 @@ -
Community  "Gradido-Akademie"
Community  "Gradido-Akademie"
Gradido - technical Infrastructure-Overview
State of 02.2023
Gradido - technical Infrastructure-Overview...
Backend-Modul
GraphQL-API
Backend-Modul...
CommunityServer DB
CommunityServer DB
Layer 1:
Layer 1:
Layer 2:
Layer 2:
"GDT-Server"
base on C++ + mySQL
"GDT-Server"...
GDT-Server DB
GDT-Server DB
json-
ajax-
request
json-...
Layer 3:
Layer 3:
"Elopage"
external Service-Portal
"Elopage"...
"User-UI"
"User-UI"
graphql
graphql
json-
request
json-...
graphql
graphql
"Admin-UI"
"Admin-UI"
DHT-Modul
HyperSwarm
DHT-Modul...
Federation-Modul
GraphQL-API V2_0
Federation-Modul...
Federation-Modul
GraphQL-API V1_x
Federation-Modul...
Federation-Modul
GraphQL-API V1_1
Federation-Modul...
Federation-Modul
GraphQL-API V1_0
Federation-Modul...
GraphQL-Client V1_0
GraphQL-Client V1_0
GraphQL-Client V1_0
GraphQL-Client V1_0
GraphQL-Client V1_0
GraphQL-Client V1_0
GraphQL-Client V1_0
GraphQL-Client V1_0
Community "GallischesDorf-TBB"
Community "GallischesDorf-TBB"
Backend-Modul
GraphQL-API
Backend-Modul...
CommunityServer DB
CommunityServer DB
Layer 1:
Layer 1:
Layer 2:
Layer 2:
Layer 3:
Layer 3:
"User-UI"
"User-UI"
graphql
graphql
graphql
graphql
"Admin-UI"
"Admin-UI"
 DHT-Socket Communication 
 DHT-Socket Communication 
DHT-Modul
HyperSwarm
DHT-Modul...
Federation-Modul
GraphQL-API V1_1
Federation-Modul...
Federation-Modul
GraphQL-API V1_0
Federation-Modul...
graphQL-Handshake
graphQL-Handshake
GraphQL-Client V1_1
GraphQL-Client V1_1
graphQL-Handshake
graphQL-Handshake
GraphQL-Client V1_0
GraphQL-Client V1_0
graphQL-Handshake
graphQL-Handshake
graphQL-Handshake
graphQL-Handshake
Viewer does not support full SVG 1.1
\ No newline at end of file +
Community  "Gradido-Akademie"
Community  "Gradido-Akademie"
Gradido - technical Infrastructure-Overview
State of 02.2023
Gradido - technical Infrastructure-Overview...
Backend-Modul
GraphQL-API
Backend-Modul...
CommunityServer DB
CommunityServer DB
Layer 1:
Layer 1:
Layer 2:
Layer 2:
"GDT-Server"
base on cakephp + mySQL
"GDT-Server"...
GDT-Server DB
GDT-Server DB
json-
ajax-
request
json-...
Layer 3:
Layer 3:
"Elopage"
external Service-Portal
"Elopage"...
"User-UI"
"User-UI"
graphql
graphql
json-
request
json-...
graphql
graphql
"Admin-UI"
"Admin-UI"
DHT-Modul
HyperSwarm
DHT-Modul...
Federation-Modul
GraphQL-API V2_0
Federation-Modul...
Federation-Modul
GraphQL-API V1_x
Federation-Modul...
Federation-Modul
GraphQL-API V1_1
Federation-Modul...
Federation-Modul
GraphQL-API V1_0
Federation-Modul...
GraphQL-Client V1_0
GraphQL-Client V1_0
GraphQL-Client V1_0
GraphQL-Client V1_0
GraphQL-Client V1_0
GraphQL-Client V1_0
GraphQL-Client V1_0
GraphQL-Client V1_0
Community "GallischesDorf-TBB"
Community "GallischesDorf-TBB"
Backend-Modul
GraphQL-API
Backend-Modul...
CommunityServer DB
CommunityServer DB
Layer 1:
Layer 1:
Layer 2:
Layer 2:
Layer 3:
Layer 3:
"User-UI"
"User-UI"
graphql
graphql
graphql
graphql
"Admin-UI"
"Admin-UI"
 DHT-Socket Communication 
 DHT-Socket Communication 
DHT-Modul
HyperSwarm
DHT-Modul...
Federation-Modul
GraphQL-API V1_1
Federation-Modul...
Federation-Modul
GraphQL-API V1_0
Federation-Modul...
graphQL-Handshake
graphQL-Handshake
GraphQL-Client V1_1
GraphQL-Client V1_1
graphQL-Handshake
graphQL-Handshake
GraphQL-Client V1_0
GraphQL-Client V1_0
graphQL-Handshake
graphQL-Handshake
graphQL-Handshake
graphQL-Handshake
Text is not SVG - cannot display
\ No newline at end of file From 225a8239ec028c4b1433800acc3affae7760c69b Mon Sep 17 00:00:00 2001 From: mahula Date: Fri, 17 Feb 2023 09:57:53 +0100 Subject: [PATCH 014/294] move all backend jobs to separate workflow file --- .github/workflows/test-admin-interface.yml | 69 ++++++++++++ .github/workflows/test.yml | 124 +-------------------- 2 files changed, 74 insertions(+), 119 deletions(-) create mode 100644 .github/workflows/test-admin-interface.yml diff --git a/.github/workflows/test-admin-interface.yml b/.github/workflows/test-admin-interface.yml new file mode 100644 index 000000000..d126a9075 --- /dev/null +++ b/.github/workflows/test-admin-interface.yml @@ -0,0 +1,69 @@ +name: Gradido Admin Interface Test CI + +on: + push: + branches: + - separate-admin-interface-workflow + +jobs: + build_test_admin: + name: Docker Build Test - Admin Interface + runs-on: ubuntu-latest + steps: + + - name: Checkout code + uses: actions/checkout@v3 + + - name: Admin Interface | Build 'test' image + run: docker build --target test -t "gradido/admin:test" admin/ --build-arg NODE_ENV="test" + + unit_test_admin: + name: Unit Tests - Admin Interface + runs-on: ubuntu-latest + steps: + - name: Checkout code + uses: actions/checkout@v3 + + - name: Admin Interface | Unit tests + run: | + cd admin && yarn && yarn run test + cp -r ./coverage ../ + + - name: Admin Interface | Coverage check + uses: webcraftmedia/coverage-check-action@master + with: + report_name: Coverage Admin Interface + type: lcov + result_path: ./admin/coverage/lcov.info + min_coverage: 97 + token: ${{ github.token }} + + lint_admin: + name: Lint - Admin Interface + runs-on: ubuntu-latest + steps: + - name: Checkout code + uses: actions/checkout@v3 + + - name: Admin Interface | Lint + run: cd admin && yarn && yarn run lint + + stylelint_admin: + name: Stylelint - Admin Interface + runs-on: ubuntu-latest + steps: + - name: Checkout code + uses: actions/checkout@v3 + + - name: Admin Interface | Stylelint + run: cd admin && yarn && yarn run stylelint + + locales_admin: + name: Locales - Admin Interface + runs-on: ubuntu-latest + steps: + - name: Checkout code + uses: actions/checkout@v3 + + - name: Admin Interface | Locales + run: cd admin && yarn && yarn run locales diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index badb47e87..722bef1c1 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -1,6 +1,9 @@ name: gradido test CI -on: push +on: + push: + branches: + - separate-admin-interface-workflow jobs: ############################################################################## @@ -29,31 +32,6 @@ jobs: name: docker-frontend-test path: /tmp/frontend.tar - ############################################################################## - # JOB: DOCKER BUILD TEST ADMIN INTERFACE ##################################### - ############################################################################## - build_test_admin: - name: Docker Build Test - Admin Interface - runs-on: ubuntu-latest - steps: - ########################################################################## - # CHECKOUT CODE ########################################################## - ########################################################################## - - name: Checkout code - uses: actions/checkout@v3 - ########################################################################## - # ADMIN INTERFACE ######################################################## - ########################################################################## - - name: Admin | Build `test` image - run: | - docker build --target test -t "gradido/admin:test" admin/ --build-arg NODE_ENV="test" - docker save "gradido/admin:test" > /tmp/admin.tar - - name: Upload Artifact - uses: actions/upload-artifact@v3 - with: - name: docker-admin-test - path: /tmp/admin.tar - ############################################################################## # JOB: DOCKER BUILD TEST BACKEND ############################################# ############################################################################## @@ -211,60 +189,6 @@ jobs: - name: Frontend | Stylelint run: cd frontend && yarn && yarn run stylelint - ############################################################################## - # JOB: LINT ADMIN INTERFACE ################################################## - ############################################################################## - lint_admin: - name: Lint - Admin Interface - runs-on: ubuntu-latest - steps: - ########################################################################## - # CHECKOUT CODE ########################################################## - ########################################################################## - - name: Checkout code - uses: actions/checkout@v3 - ########################################################################## - # LINT ADMIN INTERFACE ################################################### - ########################################################################## - - name: Admin Interface | Lint - run: cd admin && yarn && yarn run lint - - ############################################################################## - # JOB: STYLELINT ADMIN INTERFACE ############################################# - ############################################################################## - stylelint_admin: - name: Stylelint - Admin Interface - runs-on: ubuntu-latest - steps: - ########################################################################## - # CHECKOUT CODE ########################################################## - ########################################################################## - - name: Checkout code - uses: actions/checkout@v3 - ########################################################################## - # STYLELINT ADMIN INTERFACE ############################################## - ########################################################################## - - name: Admin Interface | Stylelint - run: cd admin && yarn && yarn run stylelint - - ############################################################################## - # JOB: LOCALES ADMIN ######################################################### - ############################################################################## - locales_admin: - name: Locales - Admin Interface - runs-on: ubuntu-latest - steps: - ########################################################################## - # CHECKOUT CODE ########################################################## - ########################################################################## - - name: Checkout code - uses: actions/checkout@v3 - ########################################################################## - # LOCALES FRONTEND ####################################################### - ########################################################################## - - name: Admin | Locales - run: cd admin && yarn && yarn run locales - ############################################################################## # JOB: LINT BACKEND ########################################################## ############################################################################## @@ -349,37 +273,6 @@ jobs: result_path: ./frontend/coverage/lcov.info min_coverage: 95 token: ${{ github.token }} - - ############################################################################## - # JOB: UNIT TEST ADMIN INTERFACE ############################################# - ############################################################################## - unit_test_admin: - name: Unit tests - Admin Interface - runs-on: ubuntu-latest - steps: - ########################################################################## - # CHECKOUT CODE ########################################################## - ########################################################################## - - name: Checkout code - uses: actions/checkout@v3 - ########################################################################## - # UNIT TESTS ADMIN INTERFACE ############################################# - ########################################################################## - - name: Admin Interface | Unit tests - run: | - cd admin && yarn && yarn run test - cp -r ./coverage ../ - ########################################################################## - # COVERAGE CHECK ADMIN INTERFACE ######################################### - ########################################################################## - - name: Admin Interface | Coverage check - uses: webcraftmedia/coverage-check-action@master - with: - report_name: Coverage Admin Interface - type: lcov - result_path: ./admin/coverage/lcov.info - min_coverage: 97 - token: ${{ github.token }} ############################################################################## # JOB: UNIT TEST BACKEND #################################################### @@ -459,7 +352,7 @@ jobs: end-to-end-tests: name: End-to-End Tests runs-on: ubuntu-latest - needs: [build_test_mariadb, build_test_database_up, build_test_admin, build_test_frontend, build_test_nginx] + needs: [build_test_mariadb, build_test_database_up, build_test_frontend, build_test_nginx] steps: ########################################################################## # CHECKOUT CODE ########################################################## @@ -490,13 +383,6 @@ jobs: path: /tmp - name: Load Docker Image (Frontend) run: docker load < /tmp/frontend.tar - - name: Download Docker Image (Admin Interface) - uses: actions/download-artifact@v3 - with: - name: docker-admin-test - path: /tmp - - name: Load Docker Image (Admin Interface) - run: docker load < /tmp/admin.tar - name: Download Docker Image (Nginx) uses: actions/download-artifact@v3 with: From d411ca76821756295647a69ab27da6871af40863 Mon Sep 17 00:00:00 2001 From: mahula Date: Tue, 21 Feb 2023 10:42:47 +0100 Subject: [PATCH 015/294] add file change check to test admin workflow --- .github/file-filters.yml | 4 ++++ .github/workflows/test-admin-interface.yml | 19 +++++++++++++++++++ 2 files changed, 23 insertions(+) create mode 100644 .github/file-filters.yml diff --git a/.github/file-filters.yml b/.github/file-filters.yml new file mode 100644 index 000000000..526cb0c7f --- /dev/null +++ b/.github/file-filters.yml @@ -0,0 +1,4 @@ +# These file filter patterns are used by the action https://github.com/dorny/paths-filter + +admin_locales: &admin_locales + - 'admin/src/locales/**' \ No newline at end of file diff --git a/.github/workflows/test-admin-interface.yml b/.github/workflows/test-admin-interface.yml index d126a9075..cfb888ff7 100644 --- a/.github/workflows/test-admin-interface.yml +++ b/.github/workflows/test-admin-interface.yml @@ -6,6 +6,23 @@ on: - separate-admin-interface-workflow jobs: + # + files-changed: + name: Detect File Changes - Admin Interface + runs-on: ubuntu-latest + outputs: + admin_locales: ${{ steps.changes.outputs.admin_locales }} + steps: + - uses: actions/checkout@v3.3.0 + + - name: Check for admin interface file changes + uses: dorny/paths-filter@v2.11.1 + id: changes + with: + token: ${{ github.token }} + filters: .github/file-filters.yml + list-files: shell + build_test_admin: name: Docker Build Test - Admin Interface runs-on: ubuntu-latest @@ -59,7 +76,9 @@ jobs: run: cd admin && yarn && yarn run stylelint locales_admin: + if: needs.files-changed.outputs.admin_locales == 'true' name: Locales - Admin Interface + needs: files-changed runs-on: ubuntu-latest steps: - name: Checkout code From ef9ad7e4a8f97094429c3aba953dd7b431ba96d5 Mon Sep 17 00:00:00 2001 From: mahula Date: Tue, 21 Feb 2023 11:17:36 +0100 Subject: [PATCH 016/294] add file change check for stylelinting to test admin workflow --- .github/file-filters.yml | 6 +++++- .github/workflows/test-admin-interface.yml | 3 +++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/.github/file-filters.yml b/.github/file-filters.yml index 526cb0c7f..d835f778f 100644 --- a/.github/file-filters.yml +++ b/.github/file-filters.yml @@ -1,4 +1,8 @@ # These file filter patterns are used by the action https://github.com/dorny/paths-filter admin_locales: &admin_locales - - 'admin/src/locales/**' \ No newline at end of file + - 'admin/src/locales/**' + +admin_stylelinting: &admin_stylelinting + - 'admin/{components,layouts,pages}/**/*.{scss,vue}' + - 'admin/.stylelintrc.js' diff --git a/.github/workflows/test-admin-interface.yml b/.github/workflows/test-admin-interface.yml index cfb888ff7..a0e81747b 100644 --- a/.github/workflows/test-admin-interface.yml +++ b/.github/workflows/test-admin-interface.yml @@ -12,6 +12,7 @@ jobs: runs-on: ubuntu-latest outputs: admin_locales: ${{ steps.changes.outputs.admin_locales }} + admin_stylelinting: ${{ steps.changes.outputs.admin_stylelinting }} steps: - uses: actions/checkout@v3.3.0 @@ -66,7 +67,9 @@ jobs: run: cd admin && yarn && yarn run lint stylelint_admin: + if: needs.files-changed.outputs.admin_stylelinting == 'true' name: Stylelint - Admin Interface + needs: admin_stylelinting runs-on: ubuntu-latest steps: - name: Checkout code From 84515a51132b35d4cb48885b0b0832fe92ca7c91 Mon Sep 17 00:00:00 2001 From: mahula Date: Tue, 21 Feb 2023 11:19:49 +0100 Subject: [PATCH 017/294] fix typo --- .github/workflows/test-admin-interface.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test-admin-interface.yml b/.github/workflows/test-admin-interface.yml index a0e81747b..0fcb1f549 100644 --- a/.github/workflows/test-admin-interface.yml +++ b/.github/workflows/test-admin-interface.yml @@ -69,7 +69,7 @@ jobs: stylelint_admin: if: needs.files-changed.outputs.admin_stylelinting == 'true' name: Stylelint - Admin Interface - needs: admin_stylelinting + needs: files-changed runs-on: ubuntu-latest steps: - name: Checkout code From 56485d2d75fba0ae6e9749b5a77ac4f55b71d0e1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Claus-Peter=20H=C3=BCbner?= Date: Wed, 22 Feb 2023 20:43:19 +0100 Subject: [PATCH 018/294] start adding federation to deployment scripts --- deployment/bare_metal/.env.dist | 2 ++ deployment/bare_metal/start.sh | 28 ++++++++++++++++++++++++++++ 2 files changed, 30 insertions(+) diff --git a/deployment/bare_metal/.env.dist b/deployment/bare_metal/.env.dist index 9c9c7ac82..80c1b36a1 100644 --- a/deployment/bare_metal/.env.dist +++ b/deployment/bare_metal/.env.dist @@ -61,6 +61,8 @@ WEBHOOK_ELOPAGE_SECRET=secret # on an hash created from this topic # FEDERATION_DHT_TOPIC=GRADIDO_HUB # FEDERATION_DHT_SEED=64ebcb0e3ad547848fef4197c6e2332f +FEDERATION_CONFIG_VERSION=v1.2023-01-09 +FEDERATION_API=1_0 # database DATABASE_CONFIG_VERSION=v1.2022-03-18 diff --git a/deployment/bare_metal/start.sh b/deployment/bare_metal/start.sh index 95b89241f..ae98c7e87 100755 --- a/deployment/bare_metal/start.sh +++ b/deployment/bare_metal/start.sh @@ -1,5 +1,18 @@ #!/bin/bash +echo "Before getopt" +for i +do + echo $i +done +args=`getopt b:p: $*` +set -- $args +echo "After getopt" +for i +do + echo "-->$i" +done + # Find current directory & configure paths set -o allexport SCRIPT_PATH=$(realpath $0) @@ -93,10 +106,12 @@ cp -f $PROJECT_ROOT/database/.env $PROJECT_ROOT/database/.env.bak cp -f $PROJECT_ROOT/backend/.env $PROJECT_ROOT/backend/.env.bak cp -f $PROJECT_ROOT/frontend/.env $PROJECT_ROOT/frontend/.env.bak cp -f $PROJECT_ROOT/admin/.env $PROJECT_ROOT/admin/.env.bak +cp -f $PROJECT_ROOT/federation/.env $PROJECT_ROOT/federation/.env.bak envsubst "$(env | sed -e 's/=.*//' -e 's/^/\$/g')" < $PROJECT_ROOT/database/.env.template > $PROJECT_ROOT/database/.env envsubst "$(env | sed -e 's/=.*//' -e 's/^/\$/g')" < $PROJECT_ROOT/backend/.env.template > $PROJECT_ROOT/backend/.env envsubst "$(env | sed -e 's/=.*//' -e 's/^/\$/g')" < $PROJECT_ROOT/frontend/.env.template > $PROJECT_ROOT/frontend/.env envsubst "$(env | sed -e 's/=.*//' -e 's/^/\$/g')" < $PROJECT_ROOT/admin/.env.template > $PROJECT_ROOT/admin/.env +envsubst "$(env | sed -e 's/=.*//' -e 's/^/\$/g')" < $PROJECT_ROOT/federation/.env.template > $PROJECT_ROOT/federation/.env # Install & build database echo 'Updating database' >> $UPDATE_HTML @@ -152,6 +167,19 @@ pm2 delete gradido-admin pm2 start --name gradido-admin "yarn --cwd $PROJECT_ROOT/admin start" -l $GRADIDO_LOG_PATH/pm2.admin.$TODAY.log --log-date-format 'YYYY-MM-DD HH:mm:ss.SSS' pm2 save +# Install & build federation +echo 'Updating federation' >> $UPDATE_HTML +cd $PROJECT_ROOT/federation +# TODO maybe handle this differently? +unset NODE_ENV +yarn install +yarn build +# TODO maybe handle this differently? +export NODE_ENV=production +pm2 delete gradido-federation +pm2 start --name gradido-federation "yarn --cwd $PROJECT_ROOT/federation start" -l $GRADIDO_LOG_PATH/pm2.federation.$TODAY.log --log-date-format 'YYYY-MM-DD HH:mm:ss.SSS' +pm2 save + # let nginx showing gradido echo 'Configuring nginx to serve gradido again' >> $UPDATE_HTML ln -s /etc/nginx/sites-available/gradido.conf /etc/nginx/sites-enabled/ From c9df716eb38bde05f60a9a2115ceb07e5fc85fe9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Claus-Peter=20H=C3=BCbner?= Date: Wed, 22 Feb 2023 22:42:18 +0100 Subject: [PATCH 019/294] add federation-module to deployment script --- deployment/bare_metal/start.sh | 39 +++++++++++++++++++++++----------- federation/src/config/index.ts | 2 +- 2 files changed, 28 insertions(+), 13 deletions(-) diff --git a/deployment/bare_metal/start.sh b/deployment/bare_metal/start.sh index ae98c7e87..8ec4cfc48 100755 --- a/deployment/bare_metal/start.sh +++ b/deployment/bare_metal/start.sh @@ -1,18 +1,25 @@ #!/bin/bash -echo "Before getopt" -for i -do - echo $i -done -args=`getopt b:p: $*` -set -- $args -echo "After getopt" -for i -do - echo "-->$i" +while [ "$#" -gt 0 ]; do + case "$1" in + -a) ARG_API="${2:-1_0}"; shift 2;; + -b) ARG_BRANCH="${2:-master}"; shift 2;; + + --api-version=*) ARG_API="${1#*=}"; shift 1;; + --branch=*) ARG_BRANCH="${1#*=}"; shift 1;; + --api-version|--branch) echo "$1 requires an argument" >&2; exit 1;; + + -*) echo "unknown option: $1" >&2; exit 1;; + *) handle_argument "$1"; shift 1;; + esac done +echo "==================================================" +echo "Arguments:" +echo " -api-version = $ARG_API" +echo " -branch = $ARG_BRANCH" +echo "==================================================" + # Find current directory & configure paths set -o allexport SCRIPT_PATH=$(realpath $0) @@ -76,7 +83,8 @@ echo 'Stopping all Gradido services' >> $UPDATE_HTML pm2 stop all # git -BRANCH=${1:-master} +# BRANCH=${1:-master} +BRANCH=$ARG_BRANCH echo "Starting with git pull - branch:$BRANCH" >> $UPDATE_HTML cd $PROJECT_ROOT # TODO: this overfetches alot, but ensures we can use start.sh with tags @@ -177,6 +185,13 @@ yarn build # TODO maybe handle this differently? export NODE_ENV=production pm2 delete gradido-federation +# set FEDERATION_PORT from ARG_API +port=${ARG_API//_/} +FEDERATION_PORT=$(($FEDERATION_PORT + $port)) +export FEDERATION_PORT +echo "====================================================" +echo " start federation listening on port=$FEDERATION_PORT +echo "====================================================" pm2 start --name gradido-federation "yarn --cwd $PROJECT_ROOT/federation start" -l $GRADIDO_LOG_PATH/pm2.federation.$TODAY.log --log-date-format 'YYYY-MM-DD HH:mm:ss.SSS' pm2 save diff --git a/federation/src/config/index.ts b/federation/src/config/index.ts index c8a841315..82011a6bc 100644 --- a/federation/src/config/index.ts +++ b/federation/src/config/index.ts @@ -73,7 +73,7 @@ if ( const federation = { // FEDERATION_DHT_TOPIC: process.env.FEDERATION_DHT_TOPIC || null, // FEDERATION_DHT_SEED: process.env.FEDERATION_DHT_SEED || null, - FEDERATION_PORT: process.env.FEDERATION_PORT || 5010, + FEDERATION_PORT: process.env.FEDERATION_PORT || 5000, FEDERATION_API: process.env.FEDERATION_API || '1_0', FEDERATION_COMMUNITY_URL: process.env.FEDERATION_COMMUNITY_URL || null, } From 8ab39765420a14a0487cba153d49e460e07dff3c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Claus-Peter=20H=C3=BCbner?= Date: Wed, 22 Feb 2023 22:57:10 +0100 Subject: [PATCH 020/294] pm2 delete handle case of error as optional --- deployment/bare_metal/start.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/deployment/bare_metal/start.sh b/deployment/bare_metal/start.sh index 8ec4cfc48..746701206 100755 --- a/deployment/bare_metal/start.sh +++ b/deployment/bare_metal/start.sh @@ -184,7 +184,7 @@ yarn install yarn build # TODO maybe handle this differently? export NODE_ENV=production -pm2 delete gradido-federation +pm2 delete gradido-federation || : # set FEDERATION_PORT from ARG_API port=${ARG_API//_/} FEDERATION_PORT=$(($FEDERATION_PORT + $port)) From 3d7d3ffdeef4b7e3af7f2e4e5f9bd41b4dd763f0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Claus-Peter=20H=C3=BCbner?= Date: Wed, 22 Feb 2023 23:03:29 +0100 Subject: [PATCH 021/294] next try for pm2 delete handling error --- 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 746701206..a7ffbd036 100755 --- a/deployment/bare_metal/start.sh +++ b/deployment/bare_metal/start.sh @@ -184,7 +184,6 @@ yarn install yarn build # TODO maybe handle this differently? export NODE_ENV=production -pm2 delete gradido-federation || : # set FEDERATION_PORT from ARG_API port=${ARG_API//_/} FEDERATION_PORT=$(($FEDERATION_PORT + $port)) @@ -192,7 +191,7 @@ export FEDERATION_PORT echo "====================================================" echo " start federation listening on port=$FEDERATION_PORT echo "====================================================" -pm2 start --name gradido-federation "yarn --cwd $PROJECT_ROOT/federation start" -l $GRADIDO_LOG_PATH/pm2.federation.$TODAY.log --log-date-format 'YYYY-MM-DD HH:mm:ss.SSS' +pm2 delete gradido-federation || : && pm2 start --name gradido-federation "yarn --cwd $PROJECT_ROOT/federation start" -l $GRADIDO_LOG_PATH/pm2.federation.$TODAY.log --log-date-format 'YYYY-MM-DD HH:mm:ss.SSS' pm2 save # let nginx showing gradido From 3425e5998a84aa35c8e2b0848bf2e6f99bba6359 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Claus-Peter=20H=C3=BCbner?= Date: Wed, 22 Feb 2023 23:16:07 +0100 Subject: [PATCH 022/294] change federation port settings --- deployment/bare_metal/.env.dist | 1 + deployment/bare_metal/start.sh | 6 ++++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/deployment/bare_metal/.env.dist b/deployment/bare_metal/.env.dist index 80c1b36a1..0e3f2d995 100644 --- a/deployment/bare_metal/.env.dist +++ b/deployment/bare_metal/.env.dist @@ -62,6 +62,7 @@ WEBHOOK_ELOPAGE_SECRET=secret # FEDERATION_DHT_TOPIC=GRADIDO_HUB # FEDERATION_DHT_SEED=64ebcb0e3ad547848fef4197c6e2332f FEDERATION_CONFIG_VERSION=v1.2023-01-09 +FEDERATION_PORT=5000 FEDERATION_API=1_0 # database diff --git a/deployment/bare_metal/start.sh b/deployment/bare_metal/start.sh index a7ffbd036..19d1d8852 100755 --- a/deployment/bare_metal/start.sh +++ b/deployment/bare_metal/start.sh @@ -184,14 +184,16 @@ yarn install yarn build # TODO maybe handle this differently? export NODE_ENV=production +pm2 delete gradido-federation # set FEDERATION_PORT from ARG_API port=${ARG_API//_/} +FEDERATION_PORT=${FEDERATION_PORT:-5000} FEDERATION_PORT=$(($FEDERATION_PORT + $port)) export FEDERATION_PORT echo "====================================================" -echo " start federation listening on port=$FEDERATION_PORT +echo " start federation listening on port=$FEDERATION_PORT" echo "====================================================" -pm2 delete gradido-federation || : && pm2 start --name gradido-federation "yarn --cwd $PROJECT_ROOT/federation start" -l $GRADIDO_LOG_PATH/pm2.federation.$TODAY.log --log-date-format 'YYYY-MM-DD HH:mm:ss.SSS' +pm2 start --name gradido-federation "yarn --cwd $PROJECT_ROOT/federation start" -l $GRADIDO_LOG_PATH/pm2.federation.$TODAY.log --log-date-format 'YYYY-MM-DD HH:mm:ss.SSS' pm2 save # let nginx showing gradido From cc4acd4378fe539106ac0810cebd05a4928ae0b9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Claus-Peter=20H=C3=BCbner?= Date: Wed, 22 Feb 2023 23:52:18 +0100 Subject: [PATCH 023/294] change commandline arg handling --- deployment/bare_metal/start.sh | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/deployment/bare_metal/start.sh b/deployment/bare_metal/start.sh index 19d1d8852..2a2f7b4ea 100755 --- a/deployment/bare_metal/start.sh +++ b/deployment/bare_metal/start.sh @@ -1,9 +1,16 @@ #!/bin/bash +#================================================== +# Commandline Arguments: +# -a value short arg: api-version (default=1_0) +# -b value short arg: branch (default=master) +# --api-version=value arg: api-version (default=1_0) +# --branch=value arg: branch (default=master) +#================================================== while [ "$#" -gt 0 ]; do case "$1" in - -a) ARG_API="${2:-1_0}"; shift 2;; - -b) ARG_BRANCH="${2:-master}"; shift 2;; + -a) ARG_API="$2"; shift 2;; + -b) ARG_BRANCH="$2"; shift 2;; --api-version=*) ARG_API="${1#*=}"; shift 1;; --branch=*) ARG_BRANCH="${1#*=}"; shift 1;; @@ -13,7 +20,13 @@ while [ "$#" -gt 0 ]; do *) handle_argument "$1"; shift 1;; esac done - +if [ -z $ARG_API ]; then + ARG_API="1_0" +fi +if [ -z $ARG_BRANCH ]; then + ARG_BRANCH="master" +fi + echo "==================================================" echo "Arguments:" echo " -api-version = $ARG_API" From fd37107da3da67b565f845b2e9e8073a07ef904e Mon Sep 17 00:00:00 2001 From: mahula Date: Thu, 23 Feb 2023 08:36:29 +0100 Subject: [PATCH 024/294] set allother test workflows tonot run while working in this branch --- .github/workflows/test.yml | 2 +- .github/workflows/test_dht-node.yml | 6 ++++-- .github/workflows/test_federation.yml | 5 ++++- 3 files changed, 9 insertions(+), 4 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 722bef1c1..a435c7425 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -3,7 +3,7 @@ name: gradido test CI on: push: branches: - - separate-admin-interface-workflow + - none jobs: ############################################################################## diff --git a/.github/workflows/test_dht-node.yml b/.github/workflows/test_dht-node.yml index 5b3a65a70..35d9bca7d 100644 --- a/.github/workflows/test_dht-node.yml +++ b/.github/workflows/test_dht-node.yml @@ -1,7 +1,9 @@ name: gradido test_dht-node CI -on: push - +on: + push: + branches: + - none jobs: ############################################################################## # JOB: DOCKER BUILD TEST ##################################################### diff --git a/.github/workflows/test_federation.yml b/.github/workflows/test_federation.yml index 2da78758e..b49473af2 100644 --- a/.github/workflows/test_federation.yml +++ b/.github/workflows/test_federation.yml @@ -1,6 +1,9 @@ name: gradido test_federation CI -on: push +on: + push: + branches: + - none jobs: ############################################################################## From 287659af0695fb06ae3254603c6dfb87f951f329 Mon Sep 17 00:00:00 2001 From: mahula Date: Thu, 23 Feb 2023 08:54:33 +0100 Subject: [PATCH 025/294] add file change check for linting to test admin workflow --- .github/file-filters.yml | 6 ++++++ .github/workflows/test-admin-interface.yml | 3 +++ 2 files changed, 9 insertions(+) diff --git a/.github/file-filters.yml b/.github/file-filters.yml index d835f778f..81f44a157 100644 --- a/.github/file-filters.yml +++ b/.github/file-filters.yml @@ -6,3 +6,9 @@ admin_locales: &admin_locales admin_stylelinting: &admin_stylelinting - 'admin/{components,layouts,pages}/**/*.{scss,vue}' - 'admin/.stylelintrc.js' + +admin_linting: &admin_linting + - 'admin/.eslint*' + - 'admin/babel.config.js' + - 'admin/package.json' + - 'admin/**/*.{js,vue}' \ No newline at end of file diff --git a/.github/workflows/test-admin-interface.yml b/.github/workflows/test-admin-interface.yml index 0fcb1f549..4faa60550 100644 --- a/.github/workflows/test-admin-interface.yml +++ b/.github/workflows/test-admin-interface.yml @@ -11,6 +11,7 @@ jobs: name: Detect File Changes - Admin Interface runs-on: ubuntu-latest outputs: + admin_linting: ${{ steps.changes.outputs.admin_linting }} admin_locales: ${{ steps.changes.outputs.admin_locales }} admin_stylelinting: ${{ steps.changes.outputs.admin_stylelinting }} steps: @@ -57,7 +58,9 @@ jobs: token: ${{ github.token }} lint_admin: + if: needs.files-changed.outputs.admin_linting == 'true' name: Lint - Admin Interface + needs:files-changed runs-on: ubuntu-latest steps: - name: Checkout code From 6b4579454d5e7b5e660da09a5f19e0613395d582 Mon Sep 17 00:00:00 2001 From: mahula Date: Thu, 23 Feb 2023 08:56:34 +0100 Subject: [PATCH 026/294] add sortscriptsto admin locales file filter --- .github/file-filters.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/file-filters.yml b/.github/file-filters.yml index 81f44a157..99cc32d3e 100644 --- a/.github/file-filters.yml +++ b/.github/file-filters.yml @@ -2,6 +2,7 @@ admin_locales: &admin_locales - 'admin/src/locales/**' + - 'admin/scripts/sort*' admin_stylelinting: &admin_stylelinting - 'admin/{components,layouts,pages}/**/*.{scss,vue}' From af6b08bfd7c4aabeb49d74c8dcdee5d8ad194a35 Mon Sep 17 00:00:00 2001 From: mahula Date: Thu, 23 Feb 2023 08:58:27 +0100 Subject: [PATCH 027/294] fix typo --- .github/workflows/test-admin-interface.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test-admin-interface.yml b/.github/workflows/test-admin-interface.yml index 4faa60550..a721be8fd 100644 --- a/.github/workflows/test-admin-interface.yml +++ b/.github/workflows/test-admin-interface.yml @@ -60,7 +60,7 @@ jobs: lint_admin: if: needs.files-changed.outputs.admin_linting == 'true' name: Lint - Admin Interface - needs:files-changed + needs: files-changed runs-on: ubuntu-latest steps: - name: Checkout code From 964bdebbda36085f75340a9556c42e291765fae5 Mon Sep 17 00:00:00 2001 From: mahula Date: Thu, 23 Feb 2023 09:54:13 +0100 Subject: [PATCH 028/294] add locales filter to linting filter --- .github/file-filters.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.github/file-filters.yml b/.github/file-filters.yml index 99cc32d3e..b55174526 100644 --- a/.github/file-filters.yml +++ b/.github/file-filters.yml @@ -11,5 +11,10 @@ admin_stylelinting: &admin_stylelinting admin_linting: &admin_linting - 'admin/.eslint*' - 'admin/babel.config.js' + - 'admin/package.json' + - 'admin/**/*.{js,vue}' + - *admin_locales + +admin_unit_testing: &admin_unit_testing - 'admin/package.json' - 'admin/**/*.{js,vue}' \ No newline at end of file From 72511fb14e83acca3547cfec01ccaabffcb336dd Mon Sep 17 00:00:00 2001 From: mahula Date: Thu, 23 Feb 2023 10:44:49 +0100 Subject: [PATCH 029/294] add file change check for unit tests to test admin workflow --- .github/file-filters.yml | 3 ++- .github/workflows/test-admin-interface.yml | 3 +++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/.github/file-filters.yml b/.github/file-filters.yml index b55174526..96bcbd7c8 100644 --- a/.github/file-filters.yml +++ b/.github/file-filters.yml @@ -17,4 +17,5 @@ admin_linting: &admin_linting admin_unit_testing: &admin_unit_testing - 'admin/package.json' - - 'admin/**/*.{js,vue}' \ No newline at end of file + - 'admin/{jest,vue}.config.js' + - 'admin/{public,run,src,test}/**/*' diff --git a/.github/workflows/test-admin-interface.yml b/.github/workflows/test-admin-interface.yml index a721be8fd..4809059cd 100644 --- a/.github/workflows/test-admin-interface.yml +++ b/.github/workflows/test-admin-interface.yml @@ -14,6 +14,7 @@ jobs: admin_linting: ${{ steps.changes.outputs.admin_linting }} admin_locales: ${{ steps.changes.outputs.admin_locales }} admin_stylelinting: ${{ steps.changes.outputs.admin_stylelinting }} + admin_unit_testing: ${{ steps.changes.outputs.admin_unit_testing }} steps: - uses: actions/checkout@v3.3.0 @@ -37,7 +38,9 @@ jobs: run: docker build --target test -t "gradido/admin:test" admin/ --build-arg NODE_ENV="test" unit_test_admin: + if: needs.files-changed.outputs.admin_unit_testing == 'true' name: Unit Tests - Admin Interface + needs: files-changed runs-on: ubuntu-latest steps: - name: Checkout code From 4d6854463ad9f235d74a3e171239c9f02f3424df Mon Sep 17 00:00:00 2001 From: mahula Date: Thu, 23 Feb 2023 11:10:48 +0100 Subject: [PATCH 030/294] add file change check for building test to test admin workflow --- .github/file-filters.yml | 5 +++++ .github/workflows/test-admin-interface.yml | 3 +++ 2 files changed, 8 insertions(+) diff --git a/.github/file-filters.yml b/.github/file-filters.yml index 96bcbd7c8..fa00c33fb 100644 --- a/.github/file-filters.yml +++ b/.github/file-filters.yml @@ -19,3 +19,8 @@ admin_unit_testing: &admin_unit_testing - 'admin/package.json' - 'admin/{jest,vue}.config.js' - 'admin/{public,run,src,test}/**/*' + +admin_docker_building: &admin_docker_building + - 'admin/.dockerignore' + - 'admin/Dockerfile' + - *admin_unit_testing \ No newline at end of file diff --git a/.github/workflows/test-admin-interface.yml b/.github/workflows/test-admin-interface.yml index 4809059cd..44316040b 100644 --- a/.github/workflows/test-admin-interface.yml +++ b/.github/workflows/test-admin-interface.yml @@ -11,6 +11,7 @@ jobs: name: Detect File Changes - Admin Interface runs-on: ubuntu-latest outputs: + admin_docker_building: ${{ steps.changes.outputs.admin_docker_building }} admin_linting: ${{ steps.changes.outputs.admin_linting }} admin_locales: ${{ steps.changes.outputs.admin_locales }} admin_stylelinting: ${{ steps.changes.outputs.admin_stylelinting }} @@ -27,7 +28,9 @@ jobs: list-files: shell build_test_admin: + if: needs.files-changed.outputs.admin_docker_building == 'true' name: Docker Build Test - Admin Interface + needs: files-changed runs-on: ubuntu-latest steps: From 10bbf6dfbd487552c07a4b490032b78ee2c4b8b1 Mon Sep 17 00:00:00 2001 From: mahula Date: Thu, 23 Feb 2023 11:16:33 +0100 Subject: [PATCH 031/294] add file change check for building test to test admin workflow --- .github/workflows/test-admin-interface.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test-admin-interface.yml b/.github/workflows/test-admin-interface.yml index 44316040b..60e22b5cd 100644 --- a/.github/workflows/test-admin-interface.yml +++ b/.github/workflows/test-admin-interface.yml @@ -28,7 +28,7 @@ jobs: list-files: shell build_test_admin: - if: needs.files-changed.outputs.admin_docker_building == 'true' + if: needs.files-changed.outputs.admin_docker_building == 'true' name: Docker Build Test - Admin Interface needs: files-changed runs-on: ubuntu-latest From c7d467759895ece24ca260c01fc1b84a3053f7b0 Mon Sep 17 00:00:00 2001 From: mahula Date: Thu, 23 Feb 2023 11:18:46 +0100 Subject: [PATCH 032/294] test change in locaes --- admin/src/locales/de.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/admin/src/locales/de.json b/admin/src/locales/de.json index 00eef1812..14088fe92 100644 --- a/admin/src/locales/de.json +++ b/admin/src/locales/de.json @@ -13,7 +13,7 @@ "deleted": "Automatische Schöpfung gelöscht!", "deleteNow": "Automatische Creations '{name}' wirklich löschen?", "maxPerCycle": "Wiederholungen", - "memo": "Nachricht", + "memo": "NachrichtTEST", "name": "Name", "newContributionLink": "Neuer Beitragslink", "noContributionLinks": "Es sind keine Beitragslinks angelegt.", From fdb975fe4f78543b1650672e39d5184d6c86042b Mon Sep 17 00:00:00 2001 From: mahula Date: Thu, 23 Feb 2023 11:26:57 +0100 Subject: [PATCH 033/294] exclude locales files from filter for unit tests --- .github/file-filters.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/file-filters.yml b/.github/file-filters.yml index fa00c33fb..9f6ab116a 100644 --- a/.github/file-filters.yml +++ b/.github/file-filters.yml @@ -18,7 +18,7 @@ admin_linting: &admin_linting admin_unit_testing: &admin_unit_testing - 'admin/package.json' - 'admin/{jest,vue}.config.js' - - 'admin/{public,run,src,test}/**/*' + - 'admin/{public,run,src!(locales),test}/**/*' admin_docker_building: &admin_docker_building - 'admin/.dockerignore' From 06174a8082ff8f19f2bacc970b2836642ef61f87 Mon Sep 17 00:00:00 2001 From: mahula Date: Thu, 23 Feb 2023 11:26:57 +0100 Subject: [PATCH 034/294] exclude locales files from filter for unit tests --- .github/file-filters.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/file-filters.yml b/.github/file-filters.yml index 9f6ab116a..ff8451785 100644 --- a/.github/file-filters.yml +++ b/.github/file-filters.yml @@ -18,7 +18,8 @@ admin_linting: &admin_linting admin_unit_testing: &admin_unit_testing - 'admin/package.json' - 'admin/{jest,vue}.config.js' - - 'admin/{public,run,src!(locales),test}/**/*' + - 'admin/{public,run,test}/**/*' + - 'admin/src/!(locales)/**/*' admin_docker_building: &admin_docker_building - 'admin/.dockerignore' From 83491184033e2b6848599da8bbbf1fa73628728f Mon Sep 17 00:00:00 2001 From: mahula Date: Thu, 23 Feb 2023 11:52:11 +0100 Subject: [PATCH 035/294] test changes --- admin/Dockerfile | 2 +- admin/src/locales/de.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/admin/Dockerfile b/admin/Dockerfile index ed0623a63..6b2e4d9d9 100644 --- a/admin/Dockerfile +++ b/admin/Dockerfile @@ -1,5 +1,5 @@ ################################################################################## -# BASE ########################################################################### +# BASE #######################################################################TEST ################################################################################## FROM node:14.17.0-alpine3.10 as base diff --git a/admin/src/locales/de.json b/admin/src/locales/de.json index 14088fe92..00eef1812 100644 --- a/admin/src/locales/de.json +++ b/admin/src/locales/de.json @@ -13,7 +13,7 @@ "deleted": "Automatische Schöpfung gelöscht!", "deleteNow": "Automatische Creations '{name}' wirklich löschen?", "maxPerCycle": "Wiederholungen", - "memo": "NachrichtTEST", + "memo": "Nachricht", "name": "Name", "newContributionLink": "Neuer Beitragslink", "noContributionLinks": "Es sind keine Beitragslinks angelegt.", From 1181c4b85d73899a36066915c57f05e9de776e8a Mon Sep 17 00:00:00 2001 From: mahula Date: Thu, 23 Feb 2023 11:58:33 +0100 Subject: [PATCH 036/294] test changes --- admin/Dockerfile | 2 +- admin/src/graphql/adminCreateContribution.js | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/admin/Dockerfile b/admin/Dockerfile index 6b2e4d9d9..ed0623a63 100644 --- a/admin/Dockerfile +++ b/admin/Dockerfile @@ -1,5 +1,5 @@ ################################################################################## -# BASE #######################################################################TEST +# BASE ########################################################################### ################################################################################## FROM node:14.17.0-alpine3.10 as base diff --git a/admin/src/graphql/adminCreateContribution.js b/admin/src/graphql/adminCreateContribution.js index 5ee409c67..1c40f3ff1 100644 --- a/admin/src/graphql/adminCreateContribution.js +++ b/admin/src/graphql/adminCreateContribution.js @@ -1,5 +1,6 @@ import gql from 'graphql-tag' +// TEST export const adminCreateContribution = gql` mutation ($email: String!, $amount: Decimal!, $memo: String!, $creationDate: String!) { adminCreateContribution( From e326e874b8d1d745d31e3ddf44f1f2c29922507d Mon Sep 17 00:00:00 2001 From: mahula Date: Thu, 23 Feb 2023 12:17:29 +0100 Subject: [PATCH 037/294] undo test changes --- admin/src/graphql/adminCreateContribution.js | 1 - 1 file changed, 1 deletion(-) diff --git a/admin/src/graphql/adminCreateContribution.js b/admin/src/graphql/adminCreateContribution.js index 1c40f3ff1..5ee409c67 100644 --- a/admin/src/graphql/adminCreateContribution.js +++ b/admin/src/graphql/adminCreateContribution.js @@ -1,6 +1,5 @@ import gql from 'graphql-tag' -// TEST export const adminCreateContribution = gql` mutation ($email: String!, $amount: Decimal!, $memo: String!, $creationDate: String!) { adminCreateContribution( From 949887fe009657db0af9c58df7ba14c0fc714c0b Mon Sep 17 00:00:00 2001 From: mahula Date: Thu, 23 Feb 2023 13:49:41 +0100 Subject: [PATCH 038/294] set test.yml to be triggered by push to this current branch --- .github/workflows/test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index a435c7425..722bef1c1 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -3,7 +3,7 @@ name: gradido test CI on: push: branches: - - none + - separate-admin-interface-workflow jobs: ############################################################################## From c7559b8606dffc73ad51a550a8b138908d5b6311 Mon Sep 17 00:00:00 2001 From: mahula Date: Thu, 23 Feb 2023 13:56:05 +0100 Subject: [PATCH 039/294] add shortdocumentation to filechange job --- .github/workflows/test-admin-interface.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/test-admin-interface.yml b/.github/workflows/test-admin-interface.yml index 60e22b5cd..9f589efce 100644 --- a/.github/workflows/test-admin-interface.yml +++ b/.github/workflows/test-admin-interface.yml @@ -6,7 +6,8 @@ on: - separate-admin-interface-workflow jobs: - # + # only (but most important) job from this workflow required for pull requests + # check results serve as run conditions for all other jobs here files-changed: name: Detect File Changes - Admin Interface runs-on: ubuntu-latest From 28c4abc7e9bc2838bda73f26464f02ba9b88ad87 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Claus-Peter=20H=C3=BCbner?= Date: Fri, 24 Feb 2023 00:54:57 +0100 Subject: [PATCH 040/294] start several federation moduls base on FEDERATION_COMMUNITY_APIS --- deployment/bare_metal/.env.dist | 7 ++-- deployment/bare_metal/start.sh | 69 +++++++++++---------------------- federation/src/config/index.ts | 4 +- federation/src/index.ts | 2 +- 4 files changed, 30 insertions(+), 52 deletions(-) diff --git a/deployment/bare_metal/.env.dist b/deployment/bare_metal/.env.dist index 7028966bf..0a4a2db4d 100644 --- a/deployment/bare_metal/.env.dist +++ b/deployment/bare_metal/.env.dist @@ -61,14 +61,13 @@ FEDERATION_DHT_CONFIG_VERSION=v2.2023-02-07 # 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 # FEDERATION_DHT_TOPIC=GRADIDO_HUB # FEDERATION_DHT_SEED=64ebcb0e3ad547848fef4197c6e2332f - -FEDERATION_CONFIG_VERSION=v1.2023-01-09 -FEDERATION_PORT=5000 -FEDERATION_API=1_0 FEDERATION_COMMUNITY_URL=http://stage1.gradido.net # the api port is the baseport, which will be added with the api-version, e.g. 1_0 = 5010 FEDERATION_COMMUNITY_API_PORT=5000 +FEDERATION_CONFIG_VERSION=v1.2023-01-09 +FEDERATION_COMMUNITY_APIS=1_0,1_1,2_0 + # database DATABASE_CONFIG_VERSION=v1.2022-03-18 diff --git a/deployment/bare_metal/start.sh b/deployment/bare_metal/start.sh index 39491d699..63c912b55 100755 --- a/deployment/bare_metal/start.sh +++ b/deployment/bare_metal/start.sh @@ -1,38 +1,5 @@ #!/bin/bash -#================================================== -# Commandline Arguments: -# -a value short arg: api-version (default=1_0) -# -b value short arg: branch (default=master) -# --api-version=value arg: api-version (default=1_0) -# --branch=value arg: branch (default=master) -#================================================== -while [ "$#" -gt 0 ]; do - case "$1" in - -a) ARG_API="$2"; shift 2;; - -b) ARG_BRANCH="$2"; shift 2;; - - --api-version=*) ARG_API="${1#*=}"; shift 1;; - --branch=*) ARG_BRANCH="${1#*=}"; shift 1;; - --api-version|--branch) echo "$1 requires an argument" >&2; exit 1;; - - -*) echo "unknown option: $1" >&2; exit 1;; - *) handle_argument "$1"; shift 1;; - esac -done -if [ -z $ARG_API ]; then - ARG_API="1_0" -fi -if [ -z $ARG_BRANCH ]; then - ARG_BRANCH="master" -fi - -echo "==================================================" -echo "Arguments:" -echo " -api-version = $ARG_API" -echo " -branch = $ARG_BRANCH" -echo "==================================================" - # Find current directory & configure paths set -o allexport SCRIPT_PATH=$(realpath $0) @@ -96,8 +63,7 @@ echo 'Stopping all Gradido services' >> $UPDATE_HTML pm2 stop all # git -# BRANCH=${1:-master} -BRANCH=$ARG_BRANCH +BRANCH=${1:-master} echo "Starting with git pull - branch:$BRANCH" >> $UPDATE_HTML cd $PROJECT_ROOT # TODO: this overfetches alot, but ensures we can use start.sh with tags @@ -219,17 +185,28 @@ yarn install yarn build # TODO maybe handle this differently? export NODE_ENV=production -pm2 delete gradido-federation -# set FEDERATION_PORT from ARG_API -port=${ARG_API//_/} -FEDERATION_PORT=${FEDERATION_PORT:-5000} -FEDERATION_PORT=$(($FEDERATION_PORT + $port)) -export FEDERATION_PORT -echo "====================================================" -echo " start federation listening on port=$FEDERATION_PORT" -echo "====================================================" -pm2 start --name gradido-federation "yarn --cwd $PROJECT_ROOT/federation start" -l $GRADIDO_LOG_PATH/pm2.federation.$TODAY.log --log-date-format 'YYYY-MM-DD HH:mm:ss.SSS' -pm2 save +# set FEDERATION_PORT from FEDERATION_COMMUNITY_APIS +IFS="," read -a API_ARRAY <<< $FEDERATION_COMMUNITY_APIS +for api in "${API_ARRAY[@]}" +do + FEDERATION_API=$api + export FEDERATION_API + modulname=gradido-federation-$api + # calculate port by remove '_' and add value of api to baseport + port=${api//_/} + FEDERATION_PORT=${FEDERATION_COMMUNITY_API_PORT:-5000} + FEDERATION_PORT=$(($FEDERATION_PORT + $port)) + export FEDERATION_PORT + echo "====================================================" + echo " start $modulename listening on port=$FEDERATION_PORT" + echo "====================================================" + pm2 delete $modulename + pm2 start --name $modulename "yarn --cwd $PROJECT_ROOT/federation start" -l $GRADIDO_LOG_PATH/pm2.$modulename.$TODAY.log --log-date-format 'YYYY-MM-DD HH:mm:ss.SSS' + pm2 save +done + + + # let nginx showing gradido echo 'Configuring nginx to serve gradido again' >> $UPDATE_HTML diff --git a/federation/src/config/index.ts b/federation/src/config/index.ts index 82011a6bc..de474f517 100644 --- a/federation/src/config/index.ts +++ b/federation/src/config/index.ts @@ -73,8 +73,10 @@ if ( const federation = { // FEDERATION_DHT_TOPIC: process.env.FEDERATION_DHT_TOPIC || null, // FEDERATION_DHT_SEED: process.env.FEDERATION_DHT_SEED || null, - FEDERATION_PORT: process.env.FEDERATION_PORT || 5000, + FEDERATION_COMMUNITY_API_PORT: + process.env.FEDERATION_COMMUNITY_API_PORT || 5000, FEDERATION_API: process.env.FEDERATION_API || '1_0', + FEDERATION_PORT: process.env.FEDERATION_PORT || 5010, FEDERATION_COMMUNITY_URL: process.env.FEDERATION_COMMUNITY_URL || null, } diff --git a/federation/src/index.ts b/federation/src/index.ts index 9096cb260..daf9bfa56 100644 --- a/federation/src/index.ts +++ b/federation/src/index.ts @@ -20,7 +20,7 @@ async function main() { if (CONFIG.GRAPHIQL) { // eslint-disable-next-line no-console console.log( - `GraphIQL available at http://localhost:${CONFIG.FEDERATION_PORT}` + `GraphIQL available at ${CONFIG.FEDERATION_COMMUNITY_URL}:${CONFIG.FEDERATION_PORT}/api` ) } }) From ed010a50f94102f985105c91c11bf220ba8aa9b8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Claus-Peter=20H=C3=BCbner?= Date: Fri, 24 Feb 2023 01:08:02 +0100 Subject: [PATCH 041/294] =?UTF-8?q?correct=20modul-name=C3=ADng=20in=20loo?= =?UTF-8?q?p?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- deployment/bare_metal/start.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/deployment/bare_metal/start.sh b/deployment/bare_metal/start.sh index 63c912b55..1db9daf4a 100755 --- a/deployment/bare_metal/start.sh +++ b/deployment/bare_metal/start.sh @@ -189,9 +189,9 @@ export NODE_ENV=production IFS="," read -a API_ARRAY <<< $FEDERATION_COMMUNITY_APIS for api in "${API_ARRAY[@]}" do - FEDERATION_API=$api + FEDERATION_API="$api" export FEDERATION_API - modulname=gradido-federation-$api + modulname="gradido-federation-$api" # calculate port by remove '_' and add value of api to baseport port=${api//_/} FEDERATION_PORT=${FEDERATION_COMMUNITY_API_PORT:-5000} From f570c8416857d47028ca85283d8827216d2043a8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Claus-Peter=20H=C3=BCbner?= Date: Fri, 24 Feb 2023 01:17:37 +0100 Subject: [PATCH 042/294] next try to correct modulname in loop --- deployment/bare_metal/start.sh | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/deployment/bare_metal/start.sh b/deployment/bare_metal/start.sh index 1db9daf4a..a86e1be3e 100755 --- a/deployment/bare_metal/start.sh +++ b/deployment/bare_metal/start.sh @@ -189,19 +189,20 @@ export NODE_ENV=production IFS="," read -a API_ARRAY <<< $FEDERATION_COMMUNITY_APIS for api in "${API_ARRAY[@]}" do - FEDERATION_API="$api" - export FEDERATION_API - modulname="gradido-federation-$api" + export FEDERATION_API=$api + echo "FEDERATION_API=$FEDERATION_API" + export MODULENAME=gradido-federation-$api + echo "MODULENAME=$MODULENAME" # calculate port by remove '_' and add value of api to baseport port=${api//_/} FEDERATION_PORT=${FEDERATION_COMMUNITY_API_PORT:-5000} FEDERATION_PORT=$(($FEDERATION_PORT + $port)) export FEDERATION_PORT echo "====================================================" - echo " start $modulename listening on port=$FEDERATION_PORT" + echo " start $MODULENAME listening on port=$FEDERATION_PORT" echo "====================================================" - pm2 delete $modulename - pm2 start --name $modulename "yarn --cwd $PROJECT_ROOT/federation start" -l $GRADIDO_LOG_PATH/pm2.$modulename.$TODAY.log --log-date-format 'YYYY-MM-DD HH:mm:ss.SSS' + pm2 delete $MODULENAME + pm2 start --name $MODULENAME "yarn --cwd $PROJECT_ROOT/federation start" -l $GRADIDO_LOG_PATH/pm2.$MODULENAME.$TODAY.log --log-date-format 'YYYY-MM-DD HH:mm:ss.SSS' pm2 save done From 132f92956b7e5662c925a8510b9ac84c2458b0f6 Mon Sep 17 00:00:00 2001 From: mahula Date: Fri, 24 Feb 2023 08:23:18 +0100 Subject: [PATCH 043/294] set file change filter for admin test workflow to main directory --- .github/file-filters.yml | 5 ++++- .github/workflows/test-admin-interface.yml | 16 ++++++---------- 2 files changed, 10 insertions(+), 11 deletions(-) diff --git a/.github/file-filters.yml b/.github/file-filters.yml index ff8451785..12832aaca 100644 --- a/.github/file-filters.yml +++ b/.github/file-filters.yml @@ -24,4 +24,7 @@ admin_unit_testing: &admin_unit_testing admin_docker_building: &admin_docker_building - 'admin/.dockerignore' - 'admin/Dockerfile' - - *admin_unit_testing \ No newline at end of file + - *admin_unit_testing + +admin_main: &admin_main + - 'admin/**/*' \ No newline at end of file diff --git a/.github/workflows/test-admin-interface.yml b/.github/workflows/test-admin-interface.yml index 9f589efce..7bdfa84cf 100644 --- a/.github/workflows/test-admin-interface.yml +++ b/.github/workflows/test-admin-interface.yml @@ -12,11 +12,7 @@ jobs: name: Detect File Changes - Admin Interface runs-on: ubuntu-latest outputs: - admin_docker_building: ${{ steps.changes.outputs.admin_docker_building }} - admin_linting: ${{ steps.changes.outputs.admin_linting }} - admin_locales: ${{ steps.changes.outputs.admin_locales }} - admin_stylelinting: ${{ steps.changes.outputs.admin_stylelinting }} - admin_unit_testing: ${{ steps.changes.outputs.admin_unit_testing }} + admin_main: ${{ steps.changes.outputs.admin_main }} steps: - uses: actions/checkout@v3.3.0 @@ -29,7 +25,7 @@ jobs: list-files: shell build_test_admin: - if: needs.files-changed.outputs.admin_docker_building == 'true' + if: needs.files-changed.outputs.admin_main == 'true' name: Docker Build Test - Admin Interface needs: files-changed runs-on: ubuntu-latest @@ -42,7 +38,7 @@ jobs: run: docker build --target test -t "gradido/admin:test" admin/ --build-arg NODE_ENV="test" unit_test_admin: - if: needs.files-changed.outputs.admin_unit_testing == 'true' + if: needs.files-changed.outputs.admin_main == 'true' name: Unit Tests - Admin Interface needs: files-changed runs-on: ubuntu-latest @@ -65,7 +61,7 @@ jobs: token: ${{ github.token }} lint_admin: - if: needs.files-changed.outputs.admin_linting == 'true' + if: needs.files-changed.outputs.admin_main == 'true' name: Lint - Admin Interface needs: files-changed runs-on: ubuntu-latest @@ -77,7 +73,7 @@ jobs: run: cd admin && yarn && yarn run lint stylelint_admin: - if: needs.files-changed.outputs.admin_stylelinting == 'true' + if: needs.files-changed.outputs.admin_main == 'true' name: Stylelint - Admin Interface needs: files-changed runs-on: ubuntu-latest @@ -89,7 +85,7 @@ jobs: run: cd admin && yarn && yarn run stylelint locales_admin: - if: needs.files-changed.outputs.admin_locales == 'true' + if: needs.files-changed.outputs.admin_main == 'true' name: Locales - Admin Interface needs: files-changed runs-on: ubuntu-latest From adea7c1c155c3d35cc26cfe8db8f4870baf0ac39 Mon Sep 17 00:00:00 2001 From: mahula Date: Fri, 24 Feb 2023 12:22:53 +0100 Subject: [PATCH 044/294] rename admit test workflow jobs --- .github/workflows/test-admin-interface.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/test-admin-interface.yml b/.github/workflows/test-admin-interface.yml index 7bdfa84cf..53bd85ca5 100644 --- a/.github/workflows/test-admin-interface.yml +++ b/.github/workflows/test-admin-interface.yml @@ -24,7 +24,7 @@ jobs: filters: .github/file-filters.yml list-files: shell - build_test_admin: + build_test: if: needs.files-changed.outputs.admin_main == 'true' name: Docker Build Test - Admin Interface needs: files-changed @@ -37,7 +37,7 @@ jobs: - name: Admin Interface | Build 'test' image run: docker build --target test -t "gradido/admin:test" admin/ --build-arg NODE_ENV="test" - unit_test_admin: + unit_test: if: needs.files-changed.outputs.admin_main == 'true' name: Unit Tests - Admin Interface needs: files-changed @@ -60,7 +60,7 @@ jobs: min_coverage: 97 token: ${{ github.token }} - lint_admin: + lint: if: needs.files-changed.outputs.admin_main == 'true' name: Lint - Admin Interface needs: files-changed @@ -72,7 +72,7 @@ jobs: - name: Admin Interface | Lint run: cd admin && yarn && yarn run lint - stylelint_admin: + stylelint: if: needs.files-changed.outputs.admin_main == 'true' name: Stylelint - Admin Interface needs: files-changed @@ -84,7 +84,7 @@ jobs: - name: Admin Interface | Stylelint run: cd admin && yarn && yarn run stylelint - locales_admin: + locales: if: needs.files-changed.outputs.admin_main == 'true' name: Locales - Admin Interface needs: files-changed From 289ed452d1d99bf25dce05dd8163c8585673190b Mon Sep 17 00:00:00 2001 From: mahula Date: Fri, 24 Feb 2023 13:03:04 +0100 Subject: [PATCH 045/294] rename file filter for admin test workflow --- .github/file-filters.yml | 2 +- .github/workflows/test-admin-interface.yml | 12 ++++++------ 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/.github/file-filters.yml b/.github/file-filters.yml index 12832aaca..d6c53c0c8 100644 --- a/.github/file-filters.yml +++ b/.github/file-filters.yml @@ -26,5 +26,5 @@ admin_docker_building: &admin_docker_building - 'admin/Dockerfile' - *admin_unit_testing -admin_main: &admin_main +admin: &admin - 'admin/**/*' \ No newline at end of file diff --git a/.github/workflows/test-admin-interface.yml b/.github/workflows/test-admin-interface.yml index 53bd85ca5..1d152a898 100644 --- a/.github/workflows/test-admin-interface.yml +++ b/.github/workflows/test-admin-interface.yml @@ -12,7 +12,7 @@ jobs: name: Detect File Changes - Admin Interface runs-on: ubuntu-latest outputs: - admin_main: ${{ steps.changes.outputs.admin_main }} + admin: ${{ steps.changes.outputs.admin }} steps: - uses: actions/checkout@v3.3.0 @@ -25,7 +25,7 @@ jobs: list-files: shell build_test: - if: needs.files-changed.outputs.admin_main == 'true' + if: needs.files-changed.outputs.admin == 'true' name: Docker Build Test - Admin Interface needs: files-changed runs-on: ubuntu-latest @@ -38,7 +38,7 @@ jobs: run: docker build --target test -t "gradido/admin:test" admin/ --build-arg NODE_ENV="test" unit_test: - if: needs.files-changed.outputs.admin_main == 'true' + if: needs.files-changed.outputs.admin == 'true' name: Unit Tests - Admin Interface needs: files-changed runs-on: ubuntu-latest @@ -61,7 +61,7 @@ jobs: token: ${{ github.token }} lint: - if: needs.files-changed.outputs.admin_main == 'true' + if: needs.files-changed.outputs.admin == 'true' name: Lint - Admin Interface needs: files-changed runs-on: ubuntu-latest @@ -73,7 +73,7 @@ jobs: run: cd admin && yarn && yarn run lint stylelint: - if: needs.files-changed.outputs.admin_main == 'true' + if: needs.files-changed.outputs.admin == 'true' name: Stylelint - Admin Interface needs: files-changed runs-on: ubuntu-latest @@ -85,7 +85,7 @@ jobs: run: cd admin && yarn && yarn run stylelint locales: - if: needs.files-changed.outputs.admin_main == 'true' + if: needs.files-changed.outputs.admin == 'true' name: Locales - Admin Interface needs: files-changed runs-on: ubuntu-latest From 1473e01331df6089786491acb2409360b8931df6 Mon Sep 17 00:00:00 2001 From: mahula Date: Fri, 24 Feb 2023 13:16:14 +0100 Subject: [PATCH 046/294] test admin file filter with change to admin/Dockerfile --- admin/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/admin/Dockerfile b/admin/Dockerfile index ed0623a63..6b2e4d9d9 100644 --- a/admin/Dockerfile +++ b/admin/Dockerfile @@ -1,5 +1,5 @@ ################################################################################## -# BASE ########################################################################### +# BASE #######################################################################TEST ################################################################################## FROM node:14.17.0-alpine3.10 as base From 2d51d6b581fca47ee3bb78b22b03c05cccae9050 Mon Sep 17 00:00:00 2001 From: mahula Date: Fri, 24 Feb 2023 13:26:52 +0100 Subject: [PATCH 047/294] test admin file filter with change to admin/public --- admin/Dockerfile | 2 +- admin/{public => public_TEST}/favicon.png | Bin .../img/brand/gradido_logo_w.png | Bin admin/{public => public_TEST}/img/brand/green.png | Bin .../{public => public_TEST}/img/elopage_favicon.png | Bin admin/{public => public_TEST}/img/gdd-coin.png | Bin admin/{public => public_TEST}/index.html | 0 7 files changed, 1 insertion(+), 1 deletion(-) rename admin/{public => public_TEST}/favicon.png (100%) rename admin/{public => public_TEST}/img/brand/gradido_logo_w.png (100%) rename admin/{public => public_TEST}/img/brand/green.png (100%) rename admin/{public => public_TEST}/img/elopage_favicon.png (100%) rename admin/{public => public_TEST}/img/gdd-coin.png (100%) rename admin/{public => public_TEST}/index.html (100%) diff --git a/admin/Dockerfile b/admin/Dockerfile index 6b2e4d9d9..ed0623a63 100644 --- a/admin/Dockerfile +++ b/admin/Dockerfile @@ -1,5 +1,5 @@ ################################################################################## -# BASE #######################################################################TEST +# BASE ########################################################################### ################################################################################## FROM node:14.17.0-alpine3.10 as base diff --git a/admin/public/favicon.png b/admin/public_TEST/favicon.png similarity index 100% rename from admin/public/favicon.png rename to admin/public_TEST/favicon.png diff --git a/admin/public/img/brand/gradido_logo_w.png b/admin/public_TEST/img/brand/gradido_logo_w.png similarity index 100% rename from admin/public/img/brand/gradido_logo_w.png rename to admin/public_TEST/img/brand/gradido_logo_w.png diff --git a/admin/public/img/brand/green.png b/admin/public_TEST/img/brand/green.png similarity index 100% rename from admin/public/img/brand/green.png rename to admin/public_TEST/img/brand/green.png diff --git a/admin/public/img/elopage_favicon.png b/admin/public_TEST/img/elopage_favicon.png similarity index 100% rename from admin/public/img/elopage_favicon.png rename to admin/public_TEST/img/elopage_favicon.png diff --git a/admin/public/img/gdd-coin.png b/admin/public_TEST/img/gdd-coin.png similarity index 100% rename from admin/public/img/gdd-coin.png rename to admin/public_TEST/img/gdd-coin.png diff --git a/admin/public/index.html b/admin/public_TEST/index.html similarity index 100% rename from admin/public/index.html rename to admin/public_TEST/index.html From d8a786c55b49afad4471d45b9a7fca1bf064ad46 Mon Sep 17 00:00:00 2001 From: mahula Date: Fri, 24 Feb 2023 13:37:31 +0100 Subject: [PATCH 048/294] undo change to admin/public --- admin/{public_TEST => public}/favicon.png | Bin .../img/brand/gradido_logo_w.png | Bin admin/{public_TEST => public}/img/brand/green.png | Bin .../{public_TEST => public}/img/elopage_favicon.png | Bin admin/{public_TEST => public}/img/gdd-coin.png | Bin admin/{public_TEST => public}/index.html | 0 6 files changed, 0 insertions(+), 0 deletions(-) rename admin/{public_TEST => public}/favicon.png (100%) rename admin/{public_TEST => public}/img/brand/gradido_logo_w.png (100%) rename admin/{public_TEST => public}/img/brand/green.png (100%) rename admin/{public_TEST => public}/img/elopage_favicon.png (100%) rename admin/{public_TEST => public}/img/gdd-coin.png (100%) rename admin/{public_TEST => public}/index.html (100%) diff --git a/admin/public_TEST/favicon.png b/admin/public/favicon.png similarity index 100% rename from admin/public_TEST/favicon.png rename to admin/public/favicon.png diff --git a/admin/public_TEST/img/brand/gradido_logo_w.png b/admin/public/img/brand/gradido_logo_w.png similarity index 100% rename from admin/public_TEST/img/brand/gradido_logo_w.png rename to admin/public/img/brand/gradido_logo_w.png diff --git a/admin/public_TEST/img/brand/green.png b/admin/public/img/brand/green.png similarity index 100% rename from admin/public_TEST/img/brand/green.png rename to admin/public/img/brand/green.png diff --git a/admin/public_TEST/img/elopage_favicon.png b/admin/public/img/elopage_favicon.png similarity index 100% rename from admin/public_TEST/img/elopage_favicon.png rename to admin/public/img/elopage_favicon.png diff --git a/admin/public_TEST/img/gdd-coin.png b/admin/public/img/gdd-coin.png similarity index 100% rename from admin/public_TEST/img/gdd-coin.png rename to admin/public/img/gdd-coin.png diff --git a/admin/public_TEST/index.html b/admin/public/index.html similarity index 100% rename from admin/public_TEST/index.html rename to admin/public/index.html From 1f98fa562147eaa5e84995ecd13d0480d4bd9dd4 Mon Sep 17 00:00:00 2001 From: mahula Date: Fri, 24 Feb 2023 13:39:08 +0100 Subject: [PATCH 049/294] test admin file filter with change to admin/src/components/ContributionMessages/slots/ContributionMessagesListItem.vue --- .../slots/ContributionMessagesListItem.vue | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/admin/src/components/ContributionMessages/slots/ContributionMessagesListItem.vue b/admin/src/components/ContributionMessages/slots/ContributionMessagesListItem.vue index 53006cff5..20cdfd5e6 100644 --- a/admin/src/components/ContributionMessages/slots/ContributionMessagesListItem.vue +++ b/admin/src/components/ContributionMessages/slots/ContributionMessagesListItem.vue @@ -1,15 +1,17 @@