From 21fff6d74c987b04417db5857cb248a5bd22911c Mon Sep 17 00:00:00 2001 From: Torben Brenner Date: Fri, 4 Feb 2022 16:40:07 +0100 Subject: [PATCH 01/10] fix: Reflected Changes in MagicPL Classpath to Config --- internal-configuration/magicpl.xml | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/internal-configuration/magicpl.xml b/internal-configuration/magicpl.xml index 7208e34..7d5d4d4 100644 --- a/internal-configuration/magicpl.xml +++ b/internal-configuration/magicpl.xml @@ -40,7 +40,7 @@ - + consented @@ -79,7 +79,7 @@ - de.mainzelliste.paths.processor.PathClient + de.pseudonymisierung.magicpl.processor.PathClient getDktkId @@ -95,7 +95,7 @@ - de.mainzelliste.paths.processor.MainzellisteClient + de.pseudonymisierung.magicpl.processor.MainzellisteClient mapIdStringToExternalId @@ -108,7 +108,7 @@ - de.mainzelliste.paths.processor.InputMapperProcessor + de.pseudonymisierung.magicpl.processor.InputMapperProcessor getLocalTKTExternalId @@ -128,7 +128,7 @@ - de.mainzelliste.paths.processor.MainzellisteKNTicketClient + de.pseudonymisierung.magicpl.processor.MainzellisteKNTicketClient generateLocalIdExternalId @@ -146,7 +146,7 @@ - de.mainzelliste.paths.processor.MainzellisteClient + de.pseudonymisierung.magicpl.processor.MainzellisteClient @@ -178,7 +178,7 @@ - de.mainzelliste.paths.processor.MainzellisteKNTicketClient + de.pseudonymisierung.magicpl.processor.MainzellisteKNTicketClient generateLocalId @@ -195,7 +195,7 @@ - de.mainzelliste.paths.processor.MainzellisteClient + de.pseudonymisierung.magicpl.processor.MainzellisteClient @@ -223,7 +223,7 @@ - + MDS_\*_G-ID resultIds @@ -255,7 +255,7 @@ - de.mainzelliste.paths.processor.MainzellisteReadTokenClient + de.pseudonymisierung.magicpl.processor.MainzellisteReadTokenClient resolveReadTokenCentral @@ -269,7 +269,7 @@ - de.mainzelliste.paths.processor.MainzellisteReadClient + de.pseudonymisierung.magicpl.processor.MainzellisteReadClient @@ -299,7 +299,7 @@ - de.mainzelliste.paths.processor.MainzellisteReadTokenClient + de.pseudonymisierung.magicpl.processor.MainzellisteReadTokenClient resolveReadToken @@ -313,7 +313,7 @@ - de.mainzelliste.paths.processor.MainzellisteReadClient + de.pseudonymisierung.magicpl.processor.MainzellisteReadClient From b2ae3d64584f55208759e1b2b1a07e819410802a Mon Sep 17 00:00:00 2001 From: Torben Brenner Date: Fri, 4 Feb 2022 16:40:50 +0100 Subject: [PATCH 02/10] fix: Insertion of ID-Generator Seeds --- internal-configuration/mainzelliste.conf | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/internal-configuration/mainzelliste.conf b/internal-configuration/mainzelliste.conf index 9a5e99c..d123a5a 100644 --- a/internal-configuration/mainzelliste.conf +++ b/internal-configuration/mainzelliste.conf @@ -181,47 +181,47 @@ crypto.encryption.mdsIdEncryption.type = RSA_ENCRYPT # Configuration for project DKTK000001985 idgenerator.DKTK000001985_ML_SITE_L-ID = PIDGenerator idgenerator.DKTK000001985_ML_SITE_L-ID.k1 = ML_DKTK000001985_IDGENERATOR_RANDOM_1 -idgenerator.DKTK000001985_ML_SITE_L-ID.k2 = ML_DKTK000001985_IDGENERATOR_RANDOM_1 -idgenerator.DKTK000001985_ML_SITE_L-ID.k3 = ML_DKTK000001985_IDGENERATOR_RANDOM_1 +idgenerator.DKTK000001985_ML_SITE_L-ID.k2 = ML_DKTK000001985_IDGENERATOR_RANDOM_2 +idgenerator.DKTK000001985_ML_SITE_L-ID.k3 = ML_DKTK000001985_IDGENERATOR_RANDOM_3 idgenerator.DKTK000001985_ML_SITE_G-ID = ExternalIDGenerator # Configuration for project DKTK000001986 idgenerator.DKTK000001986_ML_SITE_L-ID = PIDGenerator idgenerator.DKTK000001986_ML_SITE_L-ID.k1 = ML_DKTK000001986_IDGENERATOR_RANDOM_1 -idgenerator.DKTK000001986_ML_SITE_L-ID.k2 = ML_DKTK000001986_IDGENERATOR_RANDOM_1 -idgenerator.DKTK000001986_ML_SITE_L-ID.k3 = ML_DKTK000001986_IDGENERATOR_RANDOM_1 +idgenerator.DKTK000001986_ML_SITE_L-ID.k2 = ML_DKTK000001986_IDGENERATOR_RANDOM_2 +idgenerator.DKTK000001986_ML_SITE_L-ID.k3 = ML_DKTK000001986_IDGENERATOR_RANDOM_3 idgenerator.DKTK000001986_ML_SITE_G-ID = ExternalIDGenerator # Configuration for project DKTK000001950 idgenerator.DKTK000001950_ML_SITE_L-ID = PIDGenerator idgenerator.DKTK000001950_ML_SITE_L-ID.k1 = ML_DKTK000001950_IDGENERATOR_RANDOM_1 -idgenerator.DKTK000001950_ML_SITE_L-ID.k2 = ML_DKTK000001950_IDGENERATOR_RANDOM_1 -idgenerator.DKTK000001950_ML_SITE_L-ID.k3 = ML_DKTK000001950_IDGENERATOR_RANDOM_1 +idgenerator.DKTK000001950_ML_SITE_L-ID.k2 = ML_DKTK000001950_IDGENERATOR_RANDOM_2 +idgenerator.DKTK000001950_ML_SITE_L-ID.k3 = ML_DKTK000001950_IDGENERATOR_RANDOM_3 idgenerator.DKTK000001950_ML_SITE_G-ID = ExternalIDGenerator # Configuration for project DKTK000001951 idgenerator.DKTK000001951_ML_SITE_L-ID = PIDGenerator idgenerator.DKTK000001951_ML_SITE_L-ID.k1 = ML_DKTK000001951_IDGENERATOR_RANDOM_1 -idgenerator.DKTK000001951_ML_SITE_L-ID.k2 = ML_DKTK000001951_IDGENERATOR_RANDOM_1 -idgenerator.DKTK000001951_ML_SITE_L-ID.k3 = ML_DKTK000001951_IDGENERATOR_RANDOM_1 +idgenerator.DKTK000001951_ML_SITE_L-ID.k2 = ML_DKTK000001951_IDGENERATOR_RANDOM_2 +idgenerator.DKTK000001951_ML_SITE_L-ID.k3 = ML_DKTK000001951_IDGENERATOR_RANDOM_3 idgenerator.DKTK000001951_ML_SITE_G-ID = ExternalIDGenerator # Configuration for project DKTK999999999 idgenerator.DKTK999999999_ML_SITE_L-ID = PIDGenerator idgenerator.DKTK999999999_ML_SITE_L-ID.k1 = ML_DKTK999999999_IDGENERATOR_RANDOM_1 -idgenerator.DKTK999999999_ML_SITE_L-ID.k2 = ML_DKTK999999999_IDGENERATOR_RANDOM_1 -idgenerator.DKTK999999999_ML_SITE_L-ID.k3 = ML_DKTK999999999_IDGENERATOR_RANDOM_1 +idgenerator.DKTK999999999_ML_SITE_L-ID.k2 = ML_DKTK999999999_IDGENERATOR_RANDOM_2 +idgenerator.DKTK999999999_ML_SITE_L-ID.k3 = ML_DKTK999999999_IDGENERATOR_RANDOM_3 idgenerator.DKTK999999999_ML_SITE_G-ID = ExternalIDGenerator # Configuration for project DKTK000002089 idgenerator.DKTK000002089_ML_SITE_L-ID = PIDGenerator idgenerator.DKTK000002089_ML_SITE_L-ID.k1 = ML_DKTK000002089_IDGENERATOR_RANDOM_1 -idgenerator.DKTK000002089_ML_SITE_L-ID.k2 = ML_DKTK000002089_IDGENERATOR_RANDOM_1 -idgenerator.DKTK000002089_ML_SITE_L-ID.k3 = ML_DKTK000002089_IDGENERATOR_RANDOM_1 +idgenerator.DKTK000002089_ML_SITE_L-ID.k2 = ML_DKTK000002089_IDGENERATOR_RANDOM_2 +idgenerator.DKTK000002089_ML_SITE_L-ID.k3 = ML_DKTK000002089_IDGENERATOR_RANDOM_3 idgenerator.DKTK000002089_ML_SITE_G-ID = ExternalIDGenerator From 24856376b909cf28cb8a9fbdcdc024f91da6bd6a Mon Sep 17 00:00:00 2001 From: Torben Brenner Date: Fri, 4 Feb 2022 16:41:49 +0100 Subject: [PATCH 03/10] fix: Corrected Address of Patientlist for ID-manager --- dktk/internal.env | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/dktk/internal.env b/dktk/internal.env index c2cab6d..06ed21c 100644 --- a/dktk/internal.env +++ b/dktk/internal.env @@ -53,11 +53,10 @@ ML_DB_DRIVER=org.postgresql.Driver ML_DB_TYPE=postgresql ML_LOG_LEVEL=warning -ML_SITE=BRIDGEHEAD_DKTK_TEST TZ=Europe/Berlin -MAGICPL_SITE=adt MAGICPL_LOG_LEVEL=info +MAGICPL_MAINZELLISTE_URL=http://patientlist:8080/patientlist MAGICPL_MAINZELLISTE_CENTRAL_URL=http://e260-serv-03/central/mainzelliste MAGICPL_CENTRAL_URL=http://e260-serv-03/central/api MAGICPL_OIDC_PROVIDER=https://auth-test.ccp-it.dktk.dkfz.de From 87f345ca315171138c862256941ee28c73ed8c77 Mon Sep 17 00:00:00 2001 From: Torben Brenner Date: Fri, 4 Feb 2022 16:42:58 +0100 Subject: [PATCH 04/10] fix: Routing and ReverseProxy Settings for ID-Manager and Patientlist --- dktk/docker-compose.yml | 18 +++++++++--------- dktk/internal.env | 8 +------- 2 files changed, 10 insertions(+), 16 deletions(-) diff --git a/dktk/docker-compose.yml b/dktk/docker-compose.yml index c8b748a..eeb0029 100644 --- a/dktk/docker-compose.yml +++ b/dktk/docker-compose.yml @@ -54,6 +54,8 @@ services: container_name: bridgehead_dktk_connector image: "samply/share-client:dktk-7" environment: + TOMCAT_REVERSEPROXY_FQDN: ${HOST}/dktk-connector + DEPLOYMENT_CONTEXT: dktk-connector STORE_URL: ${STORE_URL} POSTGRES_HOST: ${CONNECTOR_DB_HOST} POSTGRES_PASS: ${CONNECTOR_POSTGRES_PASS} @@ -87,7 +89,9 @@ services: container_name: bridgehead_id-manager image: docker.verbis.dkfz.de/pseudonymisierung/magicpl:release-0.2.0 environment: - TOMCAT_REVERSEPROXY_FQDN: ${HOST}/id-manager + TOMCAT_REVERSEPROXY_FQDN: ${HOST} + DEPLOYMENT_CONTEXT: id-manager + MAGICPL_SITE: ${SITEID} MAGICPL_MAINZELLISTE_API_KEY: ${MAGICPL_MAINZELLISTE_API_KEY} MAGICPL_API_KEY: ${MAGICPL_API_KEY} MAGICPL_API_KEY_CONNECTOR: ${MAGICPL_API_KEY_CONNECTOR} @@ -107,9 +111,6 @@ services: - patientlist labels: - "traefik.http.routers.idmanager.rule=PathPrefix(`/id-manager`)" - - "traefik.http.middlewares.idmanager_strip.stripprefix.prefixes=/id-mana\ - ger" - - "traefik.http.routers.idmanager.middlewares=idmanager_strip" - "traefik.http.services.idmanager.loadbalancer.server.port=8080" env_file: ###TODO: Move into Image @@ -121,7 +122,9 @@ services: environment: ML_DB_PASS: ${ML_DB_PASS} ML_API_KEY: ${ML_API_KEY} - TOMCAT_REVERSEPROXY_FQDN: ${HOST}/patientlist + ML_SITE: ${SITEID} + TOMCAT_REVERSEPROXY_FQDN: ${HOST} + DEPLOYMENT_CONTEXT: patientlist env_file: - ../site-config/patientlist.env - internal.env @@ -132,9 +135,6 @@ services: - centralSearchPublicKey labels: - "traefik.http.routers.patientlist.rule=PathPrefix(`/patientlist`)" - - "traefik.http.middlewares.patientlist_strip.stripprefix.prefixes=/patie\ - ntlist" - - "traefik.http.routers.patientlist.middlewares=patientlist_strip" - "traefik.http.services.patientlist.loadbalancer.server.port=8080" depends_on: - patientlist_db @@ -148,4 +148,4 @@ services: - "patientlist_db_data:/var/lib/postgresql/data" env_file: ###TODO: Move into Image - - internal.env \ No newline at end of file + - internal.env diff --git a/dktk/internal.env b/dktk/internal.env index 06ed21c..239a649 100644 --- a/dktk/internal.env +++ b/dktk/internal.env @@ -1,14 +1,8 @@ -SITE=bridgehead_dktk_test -SITEID=BRIDGEHEAD_DKTK_TEST - -CONNECTOR_SHARE_URL="http://${HOST}:8080" +CONNECTOR_SHARE_URL="http://${HOST}:8080" CONNECTOR_ENABLE_METRICS=false CONNECTOR_MONITOR_INTERVAL= CONNECTOR_UPDATE_SERVER= -TOMCAT_REVERSEPROXY_FQDN=${HOST}/dktk-connector -DEPLOYMENT_CONTEXT=dktk-connector - POSTGRES_PORT=5432 POSTGRES_DB=samply.connector POSTGRES_USER=samply.connector From ee61ac3a0356785dbd92a91130fcb0f9c1659235 Mon Sep 17 00:00:00 2001 From: Torben Brenner Date: Wed, 23 Feb 2022 19:31:57 +0100 Subject: [PATCH 05/10] refactor: Resorted environment and prepared special images for dktk --- c4/docker-compose.yml | 92 ++-- c4/internal.env | 57 --- dktk/docker-compose.yml | 115 ++--- dktk/internal.env | 56 --- gbn/docker-compose.yml | 10 +- gbn/internal.env | 28 -- init-dev-environment.sh | 40 ++ internal-configuration/bridgehead-common.xml | 13 - .../centralSearchPublicKey.der | Bin 294 -> 0 bytes internal-configuration/magicpl.xml | 444 ------------------ internal-configuration/mainzelliste.conf | 227 --------- internal-configuration/proxy.xml | 21 - site.dev.conf | 20 - 13 files changed, 138 insertions(+), 985 deletions(-) delete mode 100644 c4/internal.env delete mode 100644 dktk/internal.env delete mode 100644 gbn/internal.env create mode 100755 init-dev-environment.sh delete mode 100644 internal-configuration/bridgehead-common.xml delete mode 100644 internal-configuration/centralSearchPublicKey.der delete mode 100644 internal-configuration/magicpl.xml delete mode 100644 internal-configuration/mainzelliste.conf delete mode 100644 internal-configuration/proxy.xml delete mode 100644 site.dev.conf diff --git a/c4/docker-compose.yml b/c4/docker-compose.yml index 0359daa..31ad1f0 100644 --- a/c4/docker-compose.yml +++ b/c4/docker-compose.yml @@ -7,21 +7,10 @@ volumes: idmanager_logs: store_db_data: store_logs: -secrets: - mainzelliste.docker.conf: - file: ../internal-configuration/mainzelliste.conf - magicpl.docker.xml: - file: ../internal-configuration/magicpl.xml - dktk_bridgehead_info.docker.xml: - file: ../internal-configuration/bridgehead-common.xml - centralSearchPublicKey: - file: ../internal-configuration/centralSearchPublicKey.der - proxy.docker.xml: - file: ../internal-configuration/proxy.xml services: traefik: - container_name: bridgehead_traefik + container_name: traefik image: traefik:2.4 command: - --api.insecure=true @@ -41,7 +30,7 @@ services: - /var/run/docker.sock:/var/run/docker.sock:ro landing: - container_name: bridgehead_landingpage + container_name: landingpage image: nginx:stable volumes: - ../landing/:/usr/share/nginx/html @@ -51,15 +40,12 @@ services: - "traefik.http.services.landing.loadbalancer.server.port=80" connector: - container_name: bridgehead_c4_connector - image: docker.verbis.dkfz.de/ccp/connector:3 + container_name: c4-connector + image: "samply/share-client:c4-feature-environmentPreconfigurationTorben" environment: - STORE_URL: http://bridgehead_c4_store:8080 - LDM_URL: http://bridgehead_c4_store:8080 - POSTGRES_HOST: ${CONNECTOR_DB_HOST} + STORE_URL: http://store:8080 + LDM_URL: http://store:8080 POSTGRES_PASSWORD: ${CONNECTOR_POSTGRES_PASS} - NNGM_PASSWORD: ${NNGM_PASSWORD} - NNGM_MAINZELLISTE_APIKEY: ${NNGM_MAINZELLISTE_APIKEY} volumes: - "connector_logs:/usr/local/tomcat/logs" labels: @@ -67,53 +53,69 @@ services: - "traefik.http.routers.c4_connector.rule=PathPrefix(`/c4-connector`)" - "traefik.http.services.c4_connector.loadbalancer.server.port=8080" depends_on: - - connector_db + - connector-db restart: always - env_file: - ###TODO: Move into Image - - internal.env - connector_db: - container_name: bridgehead_c4_connector_db + connector-db: + container_name: connector-db image: postgres:10.17 environment: - POSTGRES_HOST: ${CONNECTOR_DB_HOST} + POSTGRES_DB: "share_v2" + POSTGRES_USER: "samplyweb" POSTGRES_PASSWORD: ${CONNECTOR_POSTGRES_PASS} volumes: - "connector_db_data:/var/lib/postgresql/data" restart: always - env_file: - ###TODO: Move into Image - - internal.env idmanager: - container_name: bridgehead_idmanager - image: docker.verbis.dkfz.de/ccp/idmanager:deploy-c4 + container_name: idmanager + image: docker.verbis.dkfz.de/ccp/idmanager:bridgehead-develop environment: - TOMCAT_REVERSEPROXY_FQDN: ${HOST}/id-manager + TOMCAT_REVERSEPROXY_FQDN: ${HOST} + MAGICPL_SITE: ${SITE} MAGICPL_MAINZELLISTE_API_KEY: ${MAGICPL_MAINZELLISTE_API_KEY} MAGICPL_API_KEY: ${MAGICPL_API_KEY} MAGICPL_API_KEY_CONNECTOR: ${MAGICPL_API_KEY_CONNECTOR} - MAGICPL_PASSPHRASE: ${MAGICPL_PASSPHRASE} MAGICPL_MAINZELLISTE_CENTRAL_API_KEY: ${MAGICPL_MAINZELLISTE_CENTRAL_API_KEY} MAGICPL_CENTRAL_API_KEY: ${MAGICPL_CENTRAL_API_KEY} MAGICPL_OIDC_CLIENT_ID: ${MAGICPL_OIDC_CLIENT_ID} MAGICPL_OIDC_CLIENT_SECRET: ${MAGICPL_OIDC_CLIENT_SECRET} volumes: - "idmanager_logs:/usr/local/tomcat/logs" - secrets: - - magicpl.docker.xml - - dktk_bridgehead_info.docker.xml - - proxy.docker.xml + depends_on: + - patientlist labels: - - "traefik.http.routers.idmanager.rule=PathPrefix(`/id-manager`)" - - "traefik.http.middlewares.idmanager_strip.stripprefix.prefixes=/id-mana\ - ger" - - "traefik.http.routers.idmanager.middlewares=idmanager_strip" + - "traefik.http.routers.idmanager.rule=PathPrefix(`/ID-Manager`)" - "traefik.http.services.idmanager.loadbalancer.server.port=8080" + + patientlist: + container_name: patientlist + image: docker.verbis.dkfz.de/ccp/patientlist:bridgehead-develop + environment: + ML_SITE: ${SITE} + ML_API_KEY: ${ML_API_KEY} + TOMCAT_REVERSEPROXY_FQDN: ${HOST} env_file: - ###TODO: Move into Image - - internal.env + # TODO: Implement automatic seed generation in mainzelliste + - ../site-config/patientlist.env + volumes: + - "patientlist_logs:/usr/local/tomcat/logs" + labels: + - "traefik.http.routers.patientlist.rule=PathPrefix(`/Patientlist`)" + - "traefik.http.services.patientlist.loadbalancer.server.port=8080" + depends_on: + - patientlist-db + + patientlist-db: + container_name: patientlist-db + image: postgres:13.1-alpine + environment: + POSTGRES_DB: mainzelliste + POSTGRES_USER: mainzelliste + POSTGRES_PASSWORD: ${ML_DB_PASS} + TZ: "Europe/Berlin" + volumes: + - "patientlist_db_data:/var/lib/postgresql/data" store: container_name: bridgehead_c4_store @@ -152,4 +154,4 @@ services: restart: always env_file: ###TODO: Move into Image - - internal.env \ No newline at end of file + - internal.env diff --git a/c4/internal.env b/c4/internal.env deleted file mode 100644 index edb04ef..0000000 --- a/c4/internal.env +++ /dev/null @@ -1,57 +0,0 @@ -SITE=bridgehead_test -SITEID=BRIDGEHEAD_TEST - -TOMCAT_REVERSEPROXY_FQDN=${HOST}/c4-connector -DEPLOYMENT_CONTEXT=c4-connector - -CONNECTOR_SHARE_URL="http://${HOST}:8080" -CONNECTOR_ENABLE_METRICS=false -CONNECTOR_MONITOR_INTERVAL= -CONNECTOR_UPDATE_SERVER= - -POSTGRES_PORT=5432 -POSTGRES_DB=samply.connector -POSTGRES_USER=samply.connector - -HTTP_PROXY_HOST=${PROXY_URL} -HTTP_PROXY_USER= -HTTP_PROXY_PASSWORD= -HTTPS_PROXY_HOST=${PROXY_URL} -HTTPS_PROXY_USER= -HTTPS_PROXY_PASSWORD= -HTTP_PROXY=${PROXY_URL} -HTTPS_PROXY=${PROXY_URL} -http_proxy=${PROXY_URL} -https_proxy=${PROXY_URL} - -CCP_CENTRALSEARCH_URL=https://centralsearch-test.dktk.dkfz.de/ -CENTRAL_SEARCH=https://centralsearch-test.dktk.dkfz.de/ -CCP_DECENTRALSEARCH_URL=https://decentralsearch-test.ccp-it.dktk.dkfz.de/ -DECENTRAL_SEARCH=https://decentralsearch-test.ccp-it.dktk.dkfz.de/ - -CCP_MDR_URL=https://mdr.ccp-it.dktk.dkfz.de/v3/api/mdr -MDR_URL=https://mdr.ccp-it.dktk.dkfz.de/v3/api/mdr -CCP_MONITOR_URL= -MONITOR_OPTOUT= - -## nNGM -#NNGM_URL=http://bridgeheadstore:8080 -#NNGM_PROFILE=http://uk-koeln.de/fhir/StructureDefinition/Patient/nNGM/pseudonymisiert -#NNGM_MAINZELLISTE_URL=https://test.verbis.dkfz.de/mpl - -##MDR -MDR_NAMESPACE=adt,dktk,marker -#MDR_MAP= -MDR_VALIDATION=false - -ML_DB_NAME=mainzelliste -ML_DB_PORT=5432 -ML_DB_USER=mainzelliste - -CENTRAL_CONTROL_NUMBER_GENERATPR_URL=http://e260-serv-03/central/api -GLOBAL_ID=DKTK -MAINZELLISTE_URL=https://patientlist-test.ccpit.dktk.dkfz.de/mainzelliste - -NNGM_URL=https://test.anforderung.nngm.de/trial/nNGMv09/import-fb -NNGM_PROFILE=http://uk-koeln.de/fhir/StructureDefinition/Patient/nNGM/pseudonymisiert -NNGM_MAINZELLISTE_URL=https://test.verbis.dkfz.de/mpl diff --git a/dktk/docker-compose.yml b/dktk/docker-compose.yml index eeb0029..21e96c9 100644 --- a/dktk/docker-compose.yml +++ b/dktk/docker-compose.yml @@ -7,32 +7,16 @@ volumes: idmanager_logs: store_db_data: store_logs: -secrets: - mainzelliste.docker.conf: - file: ../internal-configuration/mainzelliste.conf - magicpl.docker.xml: - file: ../internal-configuration/magicpl.xml - dktk_bridgehead_info.docker.xml: - file: ../internal-configuration/bridgehead-common.xml - centralSearchPublicKey: - file: ../internal-configuration/centralSearchPublicKey.der - proxy.docker.xml: - file: ../internal-configuration/proxy.xml services: traefik: - container_name: bridgehead_traefik + container_name: traefik image: traefik:2.4 command: - --api.insecure=true - --entrypoints.web.address=:80 - --entrypoints.web-secure.address=:443 - --providers.docker=true - environment: - http_proxy: "" - HTTP_PROXY: "" - https_proxy: "" - HTTPS_PROXY: "" ports: - 80:80 - 443:443 @@ -41,7 +25,7 @@ services: - /var/run/docker.sock:/var/run/docker.sock:ro landing: - container_name: bridgehead_landingpage + container_name: landingpage image: nginx:stable volumes: - ../landing/:/usr/share/nginx/html @@ -51,101 +35,94 @@ services: - "traefik.http.services.landing.loadbalancer.server.port=80" connector: - container_name: bridgehead_dktk_connector - image: "samply/share-client:dktk-7" + image: "samply/share-client:dktk-feature-environmentPreconfigurationTorben" environment: - TOMCAT_REVERSEPROXY_FQDN: ${HOST}/dktk-connector - DEPLOYMENT_CONTEXT: dktk-connector - STORE_URL: ${STORE_URL} - POSTGRES_HOST: ${CONNECTOR_DB_HOST} - POSTGRES_PASS: ${CONNECTOR_POSTGRES_PASS} + ID_MANAGER_APIKEY: ${MAGICPL_API_KEY_CONNECTOR} + POSTGRES_PASSWORD: ${CONNECTOR_POSTGRES_PASS} + HTTP_PROXY_USER: ${HTTP_PROXY_USER} + HTTP_PROXY_PASSWORD: ${HTTP_PROXY_PASSWORD} + HTTPS_PROXY_USER: ${HTTPS_PROXY_USER} + HTTPS_PROXY_PASSWORD: ${HTTPS_PROXY_PASSWORD} + env_file: + - ../site-config/dktk.env + # Necessary for the connector to successful check the status of other components on the same host + extra_hosts: + - "host.docker.internal:host-gateway" + - "${HOST}:${HOSTIP}" volumes: - "connector_logs:/usr/local/tomcat/logs" depends_on: - - connector_db + - connector-db restart: always labels: - "traefik.enable=true" - "traefik.http.routers.dktk_connector.rule=PathPrefix(`/dktk-connector`)" - "traefik.http.services.dktk_connector.loadbalancer.server.port=8080" - env_file: - ###TODO: Move into Image - - internal.env - connector_db: - container_name: bridgehead_dktk_connector_db + connector-db: image: postgres:10.17 environment: - POSTGRES_HOST: ${CONNECTOR_DB_HOST} + POSTGRES_DB: "share_v2" + POSTGRES_USER: "samplyweb" POSTGRES_PASSWORD: ${CONNECTOR_POSTGRES_PASS} volumes: - "connector_db_data:/var/lib/postgresql/data" restart: always - env_file: - ###TODO: Move into Image - - internal.env - idmanager: - container_name: bridgehead_id-manager - image: docker.verbis.dkfz.de/pseudonymisierung/magicpl:release-0.2.0 + id-manager: + container_name: id-manager + image: docker.verbis.dkfz.de/ccp/idmanager:bridgehead-develop environment: - TOMCAT_REVERSEPROXY_FQDN: ${HOST} - DEPLOYMENT_CONTEXT: id-manager - MAGICPL_SITE: ${SITEID} + MAGICPL_SITE: ${SITE} MAGICPL_MAINZELLISTE_API_KEY: ${MAGICPL_MAINZELLISTE_API_KEY} MAGICPL_API_KEY: ${MAGICPL_API_KEY} MAGICPL_API_KEY_CONNECTOR: ${MAGICPL_API_KEY_CONNECTOR} - MAGICPL_PASSPHRASE: ${MAGICPL_PASSPHRASE} MAGICPL_MAINZELLISTE_CENTRAL_API_KEY: ${MAGICPL_MAINZELLISTE_CENTRAL_API_KEY} MAGICPL_CENTRAL_API_KEY: ${MAGICPL_CENTRAL_API_KEY} MAGICPL_OIDC_CLIENT_ID: ${MAGICPL_OIDC_CLIENT_ID} MAGICPL_OIDC_CLIENT_SECRET: ${MAGICPL_OIDC_CLIENT_SECRET} - TZ: Europe/Berlin + TOMCAT_REVERSEPROXY_FQDN: "${PROTOCOL}://${HOST}:${PORT}" + HTTP_PROXY_USER: ${HTTP_PROXY_USER} + HTTP_PROXY_PASSWORD: ${HTTP_PROXY_PASSWORD} + HTTPS_PROXY_USER: ${HTTPS_PROXY_USER} + HTTPS_PROXY_PASSWORD: ${HTTPS_PROXY_PASSWORD} + env_file: + - ../site-config/dktk.env volumes: - "idmanager_logs:/usr/local/tomcat/logs" - secrets: - - magicpl.docker.xml - - dktk_bridgehead_info.docker.xml - - proxy.docker.xml depends_on: - patientlist labels: - - "traefik.http.routers.idmanager.rule=PathPrefix(`/id-manager`)" - - "traefik.http.services.idmanager.loadbalancer.server.port=8080" - env_file: - ###TODO: Move into Image - - internal.env + - "traefik.http.routers.id-manager.rule=PathPrefix(`/ID-Manager`)" + - "traefik.http.services.id-manager.loadbalancer.server.port=8080" patientlist: - container_name: bridgehead_patientlist - image: medicalinformatics/mainzelliste:develop + container_name: patientlist + image: docker.verbis.dkfz.de/ccp/patientlist:bridgehead-develop environment: + ML_SITE: ${SITE} + ML_API_KEY: ${MAGICPL_MAINZELLISTE_API_KEY} ML_DB_PASS: ${ML_DB_PASS} - ML_API_KEY: ${ML_API_KEY} - ML_SITE: ${SITEID} - TOMCAT_REVERSEPROXY_FQDN: ${HOST} - DEPLOYMENT_CONTEXT: patientlist + TOMCAT_REVERSEPROXY_FQDN: "${PROTOCOL}://${HOST}:${PORT}" env_file: + - ../site-config/dktk.env + # TODO: Implement automatic seed generation in mainzelliste - ../site-config/patientlist.env - - internal.env volumes: - "patientlist_logs:/usr/local/tomcat/logs" - secrets: - - mainzelliste.docker.conf - - centralSearchPublicKey labels: - - "traefik.http.routers.patientlist.rule=PathPrefix(`/patientlist`)" + - "traefik.http.routers.patientlist.rule=PathPrefix(`/Patientlist`)" - "traefik.http.services.patientlist.loadbalancer.server.port=8080" depends_on: - - patientlist_db + - patientlist-db - patientlist_db: - container_name: bridgehead_dktk_patientlist_db + patientlist-db: + container_name: patientlist-db image: postgres:13.1-alpine environment: + POSTGRES_DB: mainzelliste + POSTGRES_USER: mainzelliste POSTGRES_PASSWORD: ${ML_DB_PASS} + TZ: "Europe/Berlin" volumes: - "patientlist_db_data:/var/lib/postgresql/data" - env_file: - ###TODO: Move into Image - - internal.env diff --git a/dktk/internal.env b/dktk/internal.env deleted file mode 100644 index 239a649..0000000 --- a/dktk/internal.env +++ /dev/null @@ -1,56 +0,0 @@ -CONNECTOR_SHARE_URL="http://${HOST}:8080" -CONNECTOR_ENABLE_METRICS=false -CONNECTOR_MONITOR_INTERVAL= -CONNECTOR_UPDATE_SERVER= - -POSTGRES_PORT=5432 -POSTGRES_DB=samply.connector -POSTGRES_USER=samply.connector - -HTTP_PROXY_HOST=${PROXY_URL} -HTTP_PROXY_USER= -HTTP_PROXY_PASSWORD= -HTTPS_PROXY_HOST=${PROXY_URL} -HTTPS_PROXY_USER= -HTTPS_PROXY_PASSWORD= -HTTP_PROXY=${PROXY_URL} -HTTPS_PROXY=${PROXY_URL} -http_proxy=${PROXY_URL} -https_proxy=${PROXY_URL} - -CCP_CENTRALSEARCH_URL=https://centralsearch-test.dktk.dkfz.de/ -CCP_DECENTRALSEARCH_URL=https://decentralsearch-test.ccp-it.dktk.dkfz.de/ - -CCP_MDR_URL=https://mdr.ccp-it.dktk.dkfz.de/v3/api/mdr -CCP_MONITOR_URL= -MONITOR_OPTOUT= - -## nNGM -#NNGM_URL=http://bridgeheadstore:8080 -#NNGM_PROFILE=http://uk-koeln.de/fhir/StructureDefinition/Patient/nNGM/pseudonymisiert -#NNGM_MAINZELLISTE_URL=https://test.verbis.dkfz.de/mpl - -##MDR -MDR_NAMESPACE=adt,dktk,marker -#MDR_MAP= -MDR_VALIDATION=false - -ML_DB_HOST=bridgehead_dktk_patientlist_db -ML_DB_NAME=samply.connector -ML_DB_PORT=5432 -ML_DB_USER=samply.connector - -CENTRAL_CONTROL_NUMBER_GENERATPR_URL=http://e260-serv-03/central/api -GLOBAL_ID=DKTK -MAINZELLISTE_URL=https://patientlist-test.ccpit.dktk.dkfz.de/mainzelliste -ML_DB_DRIVER=org.postgresql.Driver -ML_DB_TYPE=postgresql - -ML_LOG_LEVEL=warning -TZ=Europe/Berlin - -MAGICPL_LOG_LEVEL=info -MAGICPL_MAINZELLISTE_URL=http://patientlist:8080/patientlist -MAGICPL_MAINZELLISTE_CENTRAL_URL=http://e260-serv-03/central/mainzelliste -MAGICPL_CENTRAL_URL=http://e260-serv-03/central/api -MAGICPL_OIDC_PROVIDER=https://auth-test.ccp-it.dktk.dkfz.de diff --git a/gbn/docker-compose.yml b/gbn/docker-compose.yml index e3b7b54..ce56861 100644 --- a/gbn/docker-compose.yml +++ b/gbn/docker-compose.yml @@ -8,7 +8,7 @@ volumes: services: traefik: - container_name: bridgehead_traefik + container_name: traefik image: traefik:2.4 command: - --api.insecure=true @@ -28,7 +28,7 @@ services: - /var/run/docker.sock:/var/run/docker.sock:ro landing: - container_name: bridgehead_landingpage + container_name: landingpage image: nginx:stable volumes: - ../landing/:/usr/share/nginx/html @@ -56,8 +56,8 @@ services: restart: "always" connector: - container_name: "bridgehead_gbn_connector" - image: "samply/share-client:gbn-7" + container_name: connector + image: "samply/share-client:gbn-feature-environmentPreconfigurationTorben" environment: POSTGRES_HOST: "bridgehead_gbn_connector_db" POSTGRES_PASS: ${CONNECTOR_POSTGRES_PASS} @@ -85,4 +85,4 @@ services: restart: "always" env_file: ###TODO: Move into Image - - internal.env \ No newline at end of file + - internal.env diff --git a/gbn/internal.env b/gbn/internal.env deleted file mode 100644 index 57806f0..0000000 --- a/gbn/internal.env +++ /dev/null @@ -1,28 +0,0 @@ -POSTGRES_DB=samply.connector -POSTGRES_USER=samply -QUERY_LANGUAGE=CQL -CONNECTOR_SHARE_URL="http://${HOST}:8080" -MDR_URL="https://mdr.germanbiobanknode.de/v3/api/mdr" -MONITOR_URL=https://ccpit.dktk.dkfz.de/dktk.monitor/rest/info -no_proxy=bridgehead_gbn_connector,bridgehead_gbn_blaze_store,bridgehead_gbn_connector_db -TOMCAT_REVERSEPROXY_FQDN=${HOST}/gbn-connector -DEPLOYMENT_CONTEXT=gbn-connector -CONNECTOR_MONITOR_INTERVAL= -CONNECTOR_UPDATE_SERVER= -feature_BBMRI_DIRECTORY_SYNC=false -feature_DKTK_CENTRAL_SEARCH=false -feature_NNGM_CTS=false -LOG_LEVEL=info - -HTTP_PROXY_HOST=${PROXY_URL} -HTTP_PROXY_USER= -HTTP_PROXY_PASSWORD= -HTTPS_PROXY_HOST=${PROXY_URL} -HTTPS_PROXY_USER= -HTTPS_PROXY_PASSWORD= -HTTP_PROXY=${PROXY_URL} -HTTPS_PROXY=${PROXY_URL} -http_proxy=${PROXY_URL} -https_proxy=${PROXY_URL} - -CONNECTOR_ENABLE_METRICS=false diff --git a/init-dev-environment.sh b/init-dev-environment.sh new file mode 100755 index 0000000..13385b7 --- /dev/null +++ b/init-dev-environment.sh @@ -0,0 +1,40 @@ +#!/bin/bash +### This configuration file is intended for fast setup of a developers testenvironment. +### The settings made here are normally placed in the system units configuration. +### Refer to the readme on how to do this. +### On long term we want to move those to a zero knowledge passwort manager like bitwarden. + +### Configuration for Network Properties +# needed by the connector to resolve hosts address for ui-links and service status checks +export HOSTIP=$(MSYS_NO_PATHCONV=1 docker run --rm --add-host=host.docker.internal:host-gateway ubuntu cat /etc/hosts | grep 'host.docker.internal' | awk '{print $1}'); +# needed for the reverse proxy configuration of the services +export HOST=$(hostname) +# additional information about the local proxy if necessary +export HTTP_PROXY_USER="" +export HTTP_PROXY_PASSWORD="" +export HTTPS_PROXY_USER="" +export HTTPS_PROXY_PASSWORD="" + +### Configuration for Connector Secrets +# the password of database connector-db +export CONNECTOR_POSTGRES_PASS=pleaseChangeThis1 + +### Configuration for ID-Management Secrets +# the password of database patientlist-db +export ML_DB_PASS=pleaseChangeThis2 + +# the apikey of the localdatamanagement for the patientlist +export MAGICPL_API_KEY=pleaseChangeThis3 +# the apikey of the id-manager for the patientlist +export MAGICPL_MAINZELLISTE_API_KEY=pleaseChangeThis4 +# the apikey of the connector for the patientlist +export MAGICPL_API_KEY_CONNECTOR=pleaseChangeThis5 + +# the apikey of the id-manager for the central patientlist +export MAGICPL_MAINZELLISTE_CENTRAL_API_KEY=dktk[CentralS3cr3tKey]KNE; +# the apikey of the id-manager for the controlnumbergenerator +export MAGICPL_CENTRAL_API_KEY=dguQJ5IoqUrxCF8fNl6fOl2YvsZAVB1Y; +# client-id used for autheticating users in central ccp-authentication service +export MAGICPL_OIDC_CLIENT_ID=bridgehead-developers; +# client-secret used for autheticating users in central ccp-authentication service +export MAGICPL_OIDC_CLIENT_SECRET=1de49kn2j36qom15n7vkrve0g7pgh1f5p7v945pkl2hesak74bgek657tgi6or1hu5ji3m9lfrbhfa0g3haq18ebe205al4uoig9ii5; diff --git a/internal-configuration/bridgehead-common.xml b/internal-configuration/bridgehead-common.xml deleted file mode 100644 index c210e42..0000000 --- a/internal-configuration/bridgehead-common.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - Brückenkopf - DKTK Brückenkopf Teststandort - MAGICPL_SITE - NOT_USED - string -NOT_USED - NOT_USED - string - QUERY - diff --git a/internal-configuration/centralSearchPublicKey.der b/internal-configuration/centralSearchPublicKey.der deleted file mode 100644 index 8f3e74cb1f1a3780313895517e190d465636b49c..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 294 zcmV+>0ondAf&n5h4F(A+hDe6@4FLfG1potr0S^E$f&mHwf&l>l@nLuEK#1N)Tv!M;ba;%H@9S5r3T59 zZ_11@v(S6%IBCaiW85SP_OXWRX>sPubk){4 - - - - - - - - - -]> - - - - getId - - - - - - - - - - - - - getRequestedId - - - - - - - - - - - - - - - consented - - - - - - getDktkIdWithIdat - - - - - - - - - - - - - - getIdToken - - - ¢ralKNEUrl;/paths/getIdToken - POST - ¢ralKNEApiKey; - BK_&site;_L-ID - locallyUniqueId - - - - - - - - - - de.pseudonymisierung.magicpl.processor.PathClient - - - getDktkId - - ¢ralPatientListUrl; - ¢ralPatientListApiKey; - 3.2 - - - - - - - - - de.pseudonymisierung.magicpl.processor.MainzellisteClient - - - mapIdStringToExternalId - - ids->extIDs - - - - - - - - de.pseudonymisierung.magicpl.processor.InputMapperProcessor - - - getLocalTKTExternalId - - &localPatientListUrl; - &localPatientlistApiKey; - plain - - - - - - - - - - - - - de.pseudonymisierung.magicpl.processor.MainzellisteKNTicketClient - - - generateLocalIdExternalId - - &localPatientListUrl; - &localPatientlistApiKey; - 3.2 - BK_&site;_L-ID - - - - - - - - - - de.pseudonymisierung.magicpl.processor.MainzellisteClient - - - - - - getLocalIdWithIDAT - - - - - - - - - - - getTKT - - &localPatientListUrl; - &localPatientlistApiKey; - plain - - - - - - - - - - - de.pseudonymisierung.magicpl.processor.MainzellisteKNTicketClient - - - generateLocalId - - &localPatientListUrl; - &localPatientlistApiKey; - 3.2 - BK_&site;_L-ID - - - - - - - - - de.pseudonymisierung.magicpl.processor.MainzellisteClient - - - - - - - - readPatients - - - - - - - - - - DecideLocalOrCentralRequest - - - - - - - - - - - - MDS_\*_G-ID - resultIds - - - - - readPatientsCentrally - - - - - - - - - - createReadTokenCentral - - ¢ralPatientListUrl; - ¢ralPatientListApiKey; - true - - - - - - - - - - de.pseudonymisierung.magicpl.processor.MainzellisteReadTokenClient - - - resolveReadTokenCentral - - ¢ralPatientListUrl; - ¢ralPatientListApiKey; - - - - - - - - de.pseudonymisierung.magicpl.processor.MainzellisteReadClient - - - - - - readPatientsLocally - - - - - - - - - - createReadToken - - &localPatientListUrl; - &localPatientlistApiKey; - true - - - - - - - - - - de.pseudonymisierung.magicpl.processor.MainzellisteReadTokenClient - - - resolveReadToken - - &localPatientListUrl; - &localPatientlistApiKey; - - - - - - - - de.pseudonymisierung.magicpl.processor.MainzellisteReadClient - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - getId - - - - - DKTK000001950_&site;_L-ID - DKTK000001950_&site;_G-ID - - - - - DKTK000001950_USER - - - getId - - - - - DKTK000001951_&site;_L-ID - DKTK000001951_&site;_G-ID - - - - - DKTK000001951_USER - - - getId - - - - - DKTK000001985_&site;_L-ID - DKTK000001985_&site;_G-ID - - - - - DKTK000001985_USER - - - getId - - - - - DKTK000001986_&site;_L-ID - DKTK000001986_&site;_G-ID - - - - - DKTK000001986_USER - - - getId - - - - - DKTK999999999_&site;_L-ID - DKTK999999999_&site;_G-ID - - - - - DKTK999999999_USER - - - getId - - - - - DKTK000002089_&site;_L-ID - DKTK000002089_&site;_G-ID - - - - - DKTK000002089_USER - - - getId - &magicplApiKey; - - - readPatients - &magicplApiKeyConnector; - - - diff --git a/internal-configuration/mainzelliste.conf b/internal-configuration/mainzelliste.conf deleted file mode 100644 index d123a5a..0000000 --- a/internal-configuration/mainzelliste.conf +++ /dev/null @@ -1,227 +0,0 @@ -# For a comprehensive documentation of configuration parameters see the configuration manual -# ("Konfigurationshandbuch"). - -# debug mode: If set to true, token handling is disabled (i.e. no tokens are necessary). -debug = false - -# Name of this mainzelliste distribution instance. -dist = Lokale Patientenliste der CCP-IT am Standort ML_SITE - -# Database setup -db.driver = ML_DB_DRIVER -db.url = jdbc:ML_DB_TYPE://ML_DB_HOST:ML_DB_PORT/ML_DB_NAME -db.username = ML_DB_USER -db.password = ML_DB_PASS - -# Logging -# By default, logs are written to stdout -gcp.audittrail = true - -# Field definitions -field.Vorname.type = PlainTextField -field.Nachname.type = PlainTextField -field.Fruehere_Namen.type = PlainTextField -field.Geburtstag.type = IntegerField -field.Geburtsmonat.type = IntegerField -field.Geburtsjahr.type = IntegerField -field.Staatsangehoerigkeit.type = PlainTextField -field.Geschlecht.type = PlainTextField -field.locallyUniqueId.type = PlainTextField - -# Server-side validation -validator.field.Vorname.required = true -validator.field.Nachname.required = true -validator.field.Geburtstag.required = true -validator.field.Geburtsmonat.required = true -validator.field.Geburtsjahr.required = true - -validator.field.Vorname.format = [A-Za-zäÄöÖüÜß\\.\\-' ]*[A-Za-zäÄöÖüÜß]+[A-Za-zäÄöÖüÜß\\.\\-' ]* -validator.field.Nachname.format = [A-Za-zäÄöÖüÜß\\.\\-' ]*[A-Za-zäÄöÖüÜß]+[A-Za-zäÄöÖüÜß\\.\\-' ]* -validator.field.Fruehere_Namen.format = [A-Za-zäÄöÖüÜß\\.\\-' ]*[A-Za-zäÄöÖüÜß]+[A-Za-zäÄöÖüÜß\\.\\-' ]* - -# Date validation: -validator.date.0.fields = Geburtstag, Geburtsmonat, Geburtsjahr -validator.date.0.format = ddMMyyyy - -# Exchange groups -# An exchange group denotes a set of fields whose values are considered interchangeable. -# The matcher (currently only EpilinkMatcher) compares the fields in each exchange group to -# all of its permutations and uses the best matching combination for final decision. -exchangeGroup.0 = Vorname, Nachname, Fruehere_Namen - -# Field transformations -# -# Transformations for a field {fieldname} are defined by -# field.{fieldname}.transformers = {transformerlist}, where -# transformerlist is a comma-separated list of names of subclasses of FieldTransformer. -field.Vorname.transformers = StringNormalizer, FirstNameDecomposer -field.Nachname.transformers = StringNormalizer, GermanLastNameDecomposer -field.Fruehere_Namen.transformers = StringNormalizer, GermanLastNameDecomposer - -# field comparators -field.Vorname.comparator = NGramComparator -field.Nachname.comparator = NGramComparator -field.Fruehere_Namen.comparator = NGramComparator - -field.Geburtstag.comparator = BinaryFieldComparator -field.Geburtsmonat.comparator = BinaryFieldComparator -field.Geburtsjahr.comparator = BinaryFieldComparator - -field.Staatsangehoerigkeit.comparator = BinaryFieldComparator -field.Geschlecht.comparator = BinaryFieldComparator - -# Matcher definition -# Property matcher defines the class name of the matcher to use, which must be a subclass -# of Matcher. Currently only EpilinkMatcher and NullMatcher are supported. -matcher = EpilinkMatcher - -# Config for Epilink Matcher -# -# matcher.epilink.{fieldname}.frequency: Defines the assumed mean frequency of values -# for field {fieldname}. This corresponds to the u-probability in the Fellegi-Sunter-Model -# and can be estimated by the reciprocal of the number of distinct values (i.e. the -# frequency of "month" is 1 / 12). -matcher.epilink.Vorname.frequency = 0.000235 -matcher.epilink.Nachname.frequency = 0.0000271 -matcher.epilink.Fruehere_Namen.frequency = 0.0000271 - -# 1 / 30 (approximate average number of days in a month) -matcher.epilink.Geburtstag.frequency = 0.0333 -# 1 / 12 -matcher.epilink.Geburtsmonat.frequency = 0.0833 -# example value: birth years for an age range of 35 years (40 - 75). -matcher.epilink.Geburtsjahr.frequency = 0.0286 - -# Berechnungsgrundlage: 193 anerkannte + 13 umstrittene Staaten (Quelle: Wikipedia) -> ca. 1 / 200 -matcher.epilink.Staatsangehoerigkeit.frequency = 0.005 -matcher.epilink.Geschlecht.frequency = 0.5 - -# matcher.epilink.{fieldname}.error_rate defines the assumed error_rate for -# field {fieldname} (1 - m-probability) -# -# The supplied number stem from the evaluation of a German cancer registry -matcher.epilink.Vorname.errorRate = 0.01 -matcher.epilink.Nachname.errorRate = 0.008 -matcher.epilink.Fruehere_Namen.errorRate = 0.008 -matcher.epilink.Geburtstag.errorRate = 0.005 -matcher.epilink.Geburtsmonat.errorRate = 0.002 -matcher.epilink.Geburtsjahr.errorRate = 0.004 -matcher.epilink.Staatsangehoerigkeit.errorRate = 0.04 -matcher.epilink.Geschlecht.errorRate = 0.04 - -# matcher.epilink.threshold.match: Defines the minimum weight (in the interval [0,1]) -# for which a pair of records is considered a definite match. -# -# matcher.epilink.threshold_non_match: Defines the weight (in the interval [0,1]) -# below which a pair of records is considered a definite non-match. Must be less than or equal -# to matcher.epilink.threshold_match. -# -# Record pairs with a weight w with threshold_non_match <= w < threshold_match are -# considered possible matches and lead to a tentative PID. -matcher.epilink.threshold_match = 0.95 -matcher.epilink.threshold_non_match = 0.65 - -# Blocking -# The blocking strategy choice depends on the field types after the transformation. -# If compound fields are passed to the blocker, whether created by a field transformation or as input fields, -# the type of the subfields is the one that is relevant for the blocking. -# If exchange groups are used, only one of the fieldnames should be given here. The blocker is applied to -# the other fields as well. - -# Use Soundex for PlainText fields -blocking.soundex.type = Soundex -blocking.soundex.fields = Vorname, Nachname, Fruehere_Namen - -# Use FieldEquality e.g. for birthday based blocking -# This can be combined with Soundex blocking. -blocking.dob.type = FieldEquality -blocking.dob.fields = Geburtstag, Geburtsmonat, Geburtsjahr - -# Servers (apiKey and permission definition) -servers.0.apiKey = ML_API_KEY -servers.0.permissions = createSession;showSessionIds;deleteAllPatients;createToken;tt_addPatient;tt_readPatients;tt_editPatient;readConfiguration -# TODO: Reduce to bridgeheads ip -servers.0.allowedRemoteAdresses = 0.0.0.0/0 - -# Allowed format of the callback -callback.allowedFormat = https://.* -callback.allowSelfsigned = false - -# IdGenerators -idgenerators = BK_ML_SITE_L-ID, MDS_ML_SITE_L-ID, BK_ML_SITE_G-ID, locallyUniqueId, DKTK000001985_ML_SITE_L-ID, DKTK000001985_ML_SITE_G-ID, DKTK000001986_ML_SITE_L-ID, DKTK000001986_ML_SITE_G-ID, DKTK000001950_ML_SITE_L-ID, DKTK000001950_ML_SITE_G-ID, DKTK000001951_ML_SITE_L-ID, DKTK000001951_ML_SITE_G-ID, DKTK999999999_ML_SITE_L-ID, DKTK999999999_ML_SITE_G-ID, DKTK000002089_ML_SITE_L-ID, DKTK000002089_ML_SITE_G-ID - -idgenerators.eagerGeneration = false - -# Configuration of the local and global BK Pseudonymes -idgenerator.BK_ML_SITE_L-ID = PIDGenerator -idgenerator.BK_ML_SITE_L-ID.k1 = ML_BK_IDGENERATOR_RANDOM_1 -idgenerator.BK_ML_SITE_L-ID.k2 = ML_BK_IDGENERATOR_RANDOM_2 -idgenerator.BK_ML_SITE_L-ID.k3 = ML_BK_IDGENERATOR_RANDOM_3 - -idgenerator.BK_ML_SITE_G-ID = ExternalIDGenerator - -# The unique id from the local datawarehouse -idgenerator.locallyUniqueId = ExternalIDGenerator - -# Configuration for the local mds-id -idgenerator.MDS_ML_SITE_L-ID = PIDGenerator -idgenerator.MDS_ML_SITE_L-ID.k1 = ML_MDS_IDGENERATOR_RANDOM_1 -idgenerator.MDS_ML_SITE_L-ID.k2 = ML_MDS_IDGENERATOR_RANDOM_2 -idgenerator.MDS_ML_SITE_L-ID.k3 = ML_MDS_IDGENERATOR_RANDOM_3 -idgenerator.MDS_ML_SITE_L-ID.eager = * -idgenerator.MDS_ML_SITE_L-ID.exportEncryption = mdsIdEncryption -# Encryption for export of mds -crypto.key.mdsIdPublicKey.type = RSA_PUBLIC -crypto.key.mdsIdPublicKey.uri = file:///run/secrets/centralSearchPublicKey -crypto.encryption.mdsIdEncryption.key = mdsIdPublicKey -crypto.encryption.mdsIdEncryption.type = RSA_ENCRYPT - -# Configuration of the study specific id-generators - -# Configuration for project DKTK000001985 -idgenerator.DKTK000001985_ML_SITE_L-ID = PIDGenerator -idgenerator.DKTK000001985_ML_SITE_L-ID.k1 = ML_DKTK000001985_IDGENERATOR_RANDOM_1 -idgenerator.DKTK000001985_ML_SITE_L-ID.k2 = ML_DKTK000001985_IDGENERATOR_RANDOM_2 -idgenerator.DKTK000001985_ML_SITE_L-ID.k3 = ML_DKTK000001985_IDGENERATOR_RANDOM_3 - -idgenerator.DKTK000001985_ML_SITE_G-ID = ExternalIDGenerator - -# Configuration for project DKTK000001986 -idgenerator.DKTK000001986_ML_SITE_L-ID = PIDGenerator -idgenerator.DKTK000001986_ML_SITE_L-ID.k1 = ML_DKTK000001986_IDGENERATOR_RANDOM_1 -idgenerator.DKTK000001986_ML_SITE_L-ID.k2 = ML_DKTK000001986_IDGENERATOR_RANDOM_2 -idgenerator.DKTK000001986_ML_SITE_L-ID.k3 = ML_DKTK000001986_IDGENERATOR_RANDOM_3 - -idgenerator.DKTK000001986_ML_SITE_G-ID = ExternalIDGenerator - -# Configuration for project DKTK000001950 -idgenerator.DKTK000001950_ML_SITE_L-ID = PIDGenerator -idgenerator.DKTK000001950_ML_SITE_L-ID.k1 = ML_DKTK000001950_IDGENERATOR_RANDOM_1 -idgenerator.DKTK000001950_ML_SITE_L-ID.k2 = ML_DKTK000001950_IDGENERATOR_RANDOM_2 -idgenerator.DKTK000001950_ML_SITE_L-ID.k3 = ML_DKTK000001950_IDGENERATOR_RANDOM_3 - -idgenerator.DKTK000001950_ML_SITE_G-ID = ExternalIDGenerator - -# Configuration for project DKTK000001951 -idgenerator.DKTK000001951_ML_SITE_L-ID = PIDGenerator -idgenerator.DKTK000001951_ML_SITE_L-ID.k1 = ML_DKTK000001951_IDGENERATOR_RANDOM_1 -idgenerator.DKTK000001951_ML_SITE_L-ID.k2 = ML_DKTK000001951_IDGENERATOR_RANDOM_2 -idgenerator.DKTK000001951_ML_SITE_L-ID.k3 = ML_DKTK000001951_IDGENERATOR_RANDOM_3 - -idgenerator.DKTK000001951_ML_SITE_G-ID = ExternalIDGenerator - -# Configuration for project DKTK999999999 -idgenerator.DKTK999999999_ML_SITE_L-ID = PIDGenerator -idgenerator.DKTK999999999_ML_SITE_L-ID.k1 = ML_DKTK999999999_IDGENERATOR_RANDOM_1 -idgenerator.DKTK999999999_ML_SITE_L-ID.k2 = ML_DKTK999999999_IDGENERATOR_RANDOM_2 -idgenerator.DKTK999999999_ML_SITE_L-ID.k3 = ML_DKTK999999999_IDGENERATOR_RANDOM_3 - -idgenerator.DKTK999999999_ML_SITE_G-ID = ExternalIDGenerator - -# Configuration for project DKTK000002089 -idgenerator.DKTK000002089_ML_SITE_L-ID = PIDGenerator -idgenerator.DKTK000002089_ML_SITE_L-ID.k1 = ML_DKTK000002089_IDGENERATOR_RANDOM_1 -idgenerator.DKTK000002089_ML_SITE_L-ID.k2 = ML_DKTK000002089_IDGENERATOR_RANDOM_2 -idgenerator.DKTK000002089_ML_SITE_L-ID.k3 = ML_DKTK000002089_IDGENERATOR_RANDOM_3 - -idgenerator.DKTK000002089_ML_SITE_G-ID = ExternalIDGenerator diff --git a/internal-configuration/proxy.xml b/internal-configuration/proxy.xml deleted file mode 100644 index 7c0ba23..0000000 --- a/internal-configuration/proxy.xml +++ /dev/null @@ -1,21 +0,0 @@ - - - - - HTTP_PROXY_URL - HTTP_PROXY_USERNAME - HTTP_PROXY_PASSWORD - - - HTTPS_PROXY_URL - HTTPS_PROXY_USERNAME - HTTPS_PROXY_PASSWORD - - - NO_PROXY_HOSTS - - - - \ No newline at end of file diff --git a/site.dev.conf b/site.dev.conf deleted file mode 100644 index 662c644..0000000 --- a/site.dev.conf +++ /dev/null @@ -1,20 +0,0 @@ -#!/bin/bash -### This is the configuration file for secrets, only your site should know - -##Setting Network properties -export HOSTIP=$(MSYS_NO_PATHCONV=1 docker run --rm --add-host=host.docker.internal:host-gateway ubuntu cat /etc/hosts | grep 'host.docker.internal' | awk '{print $1}'); -export HOST= -export PROXY_URL= - -export site_name= -### Write the Project you want to start with the brigdehead -##Exmaple project=gbn -project= - -###secrets -## Connector Password -export CONNECTOR_POSTGRES_PASS= - -##ID-Manager -#This needs to be set if the project is either c4 or dktk -export \ No newline at end of file From 26b7e272bf411197196cbd2373238fb048bb1b60 Mon Sep 17 00:00:00 2001 From: Torben Brenner Date: Thu, 24 Feb 2022 13:01:05 +0100 Subject: [PATCH 06/10] refactor: renamed containers based on projects Using the flag "-p bridgehead" with docker-compose to deploy all bridgeheads on one system --- c4/docker-compose.yml | 109 +++++++++++++++++++++------------------- dktk/docker-compose.yml | 31 ++++++------ gbn/docker-compose.yml | 89 ++++++++++++++++---------------- init-dev-environment.sh | 5 ++ 4 files changed, 122 insertions(+), 112 deletions(-) diff --git a/c4/docker-compose.yml b/c4/docker-compose.yml index 31ad1f0..52d389c 100644 --- a/c4/docker-compose.yml +++ b/c4/docker-compose.yml @@ -1,12 +1,12 @@ version: "3.7" volumes: - connector_db_data: - connector_logs: - patientlist_db_data: - patientlist_logs: - idmanager_logs: - store_db_data: - store_logs: + c4-connector-db-data: + c4-connector-logs: + patientlist-db-data: + patientlist-logs: + id-manager-logs: + c4-store-db-data: + c4-store-logs: services: traefik: @@ -17,11 +17,6 @@ services: - --entrypoints.web.address=:80 - --entrypoints.web-secure.address=:443 - --providers.docker=true - environment: - http_proxy: "" - HTTP_PROXY: "" - https_proxy: "" - HTTPS_PROXY: "" ports: - 80:80 - 443:443 @@ -39,39 +34,48 @@ services: - "traefik.http.routers.landing.rule=PathPrefix(`/`)" - "traefik.http.services.landing.loadbalancer.server.port=80" - connector: - container_name: c4-connector + c4-connector: image: "samply/share-client:c4-feature-environmentPreconfigurationTorben" environment: - STORE_URL: http://store:8080 - LDM_URL: http://store:8080 + POSTGRES_HOST: "c4-connector-db" + ID_MANAGER_APIKEY: ${MAGICPL_API_KEY_CONNECTOR} POSTGRES_PASSWORD: ${CONNECTOR_POSTGRES_PASS} + HTTP_PROXY_USER: ${HTTP_PROXY_USER} + HTTP_PROXY_PASSWORD: ${HTTP_PROXY_PASSWORD} + HTTPS_PROXY_USER: ${HTTPS_PROXY_USER} + HTTPS_PROXY_PASSWORD: ${HTTPS_PROXY_PASSWORD} + LDM_URL: "${PROTOCOL}://${HOST}/c4-localdatamanagement" + POSTGRES_PASSWORD: ${CONNECTOR_POSTGRES_PASS} + env_file: + - ../site-config/c4.env + # Necessary for the connector to successful check the status of other components on the same host + extra_hosts: + - "host.docker.internal:host-gateway" + - "${HOST}:${HOSTIP}" volumes: - - "connector_logs:/usr/local/tomcat/logs" + - "c4-connector-logs:/usr/local/tomcat/logs" + depends_on: + - connector-db + restart: always labels: - "traefik.enable=true" - "traefik.http.routers.c4_connector.rule=PathPrefix(`/c4-connector`)" - "traefik.http.services.c4_connector.loadbalancer.server.port=8080" - depends_on: - - connector-db - restart: always - connector-db: - container_name: connector-db + c4-connector-db: image: postgres:10.17 environment: POSTGRES_DB: "share_v2" POSTGRES_USER: "samplyweb" POSTGRES_PASSWORD: ${CONNECTOR_POSTGRES_PASS} volumes: - - "connector_db_data:/var/lib/postgresql/data" + - "c4-connector-db-data:/var/lib/postgresql/data" restart: always - idmanager: - container_name: idmanager + id-manager: + container_name: id-manager image: docker.verbis.dkfz.de/ccp/idmanager:bridgehead-develop environment: - TOMCAT_REVERSEPROXY_FQDN: ${HOST} MAGICPL_SITE: ${SITE} MAGICPL_MAINZELLISTE_API_KEY: ${MAGICPL_MAINZELLISTE_API_KEY} MAGICPL_API_KEY: ${MAGICPL_API_KEY} @@ -80,8 +84,15 @@ services: MAGICPL_CENTRAL_API_KEY: ${MAGICPL_CENTRAL_API_KEY} MAGICPL_OIDC_CLIENT_ID: ${MAGICPL_OIDC_CLIENT_ID} MAGICPL_OIDC_CLIENT_SECRET: ${MAGICPL_OIDC_CLIENT_SECRET} + TOMCAT_REVERSEPROXY_FQDN: "${HOST}" + HTTP_PROXY_USER: ${HTTP_PROXY_USER} + HTTP_PROXY_PASSWORD: ${HTTP_PROXY_PASSWORD} + HTTPS_PROXY_USER: ${HTTPS_PROXY_USER} + HTTPS_PROXY_PASSWORD: ${HTTPS_PROXY_PASSWORD} + env_file: + - ../site-config/dktk.env volumes: - - "idmanager_logs:/usr/local/tomcat/logs" + - "id-manager-logs:/usr/local/tomcat/logs" depends_on: - patientlist labels: @@ -93,13 +104,15 @@ services: image: docker.verbis.dkfz.de/ccp/patientlist:bridgehead-develop environment: ML_SITE: ${SITE} - ML_API_KEY: ${ML_API_KEY} - TOMCAT_REVERSEPROXY_FQDN: ${HOST} + ML_API_KEY: ${MAGICPL_MAINZELLISTE_API_KEY} + ML_DB_PASS: ${ML_DB_PASS} + TOMCAT_REVERSEPROXY_FQDN: "${HOST}" env_file: + - ../site-config/dktk.env # TODO: Implement automatic seed generation in mainzelliste - ../site-config/patientlist.env volumes: - - "patientlist_logs:/usr/local/tomcat/logs" + - "patientlist-logs:/usr/local/tomcat/logs" labels: - "traefik.http.routers.patientlist.rule=PathPrefix(`/Patientlist`)" - "traefik.http.services.patientlist.loadbalancer.server.port=8080" @@ -115,43 +128,37 @@ services: POSTGRES_PASSWORD: ${ML_DB_PASS} TZ: "Europe/Berlin" volumes: - - "patientlist_db_data:/var/lib/postgresql/data" + - "patientlist-db-data:/var/lib/postgresql/data" - store: - container_name: bridgehead_c4_store + c4-store: image: docker.verbis.dkfz.de/ccp/samply.store:release-5.1.2 environment: - POSTGRES_HOST: bridgehead_c4_store_db + MDR_NAMESPACE: "adt,dktk,marker" + MDR_VALIDATION: false + DEPLOYMENT_CONTEXT: "c4-localdatamanagement" + POSTGRES_HOST: c4-store-db POSTGRES_PORT: 5432 POSTGRES_DB: samplystore POSTGRES_USER: samplystore - POSTGRES_PASSWORD: samplystore - TZ: Europe/Berlin + POSTGRES_PASSWORD: ${STORE_POSTGRES_PASS} + TZ: "Europe/Berlin" volumes: - - "store_logs:/usr/local/tomcat/logs" + - "c4-store-logs:/usr/local/tomcat/logs" labels: - "traefik.enable=true" - - "traefik.http.routers.store_c4.rule=PathPrefix(`/c4-loc\ - aldatamanagement`)" + - "traefik.http.routers.store_c4.rule=PathPrefix(`/c4-localdatamanagement`)" depends_on: - - store_db + - store-db restart: always - env_file: - ###TODO: Move into Image - - internal.env - store_db: - container_name: bridgehead_c4_store_db + c4-store-db: image: postgres:9.5-alpine command: postgres -c datestyle='iso, dmy' environment: - POSTGRES_PORT: 5432 + TZ: "Europe/Berlin" POSTGRES_DB: samplystore POSTGRES_USER: samplystore - POSTGRES_PASSWORD: samplystore + POSTGRES_PASSWORD: ${STORE_POSTGRES_PASS} volumes: - - "store_db_data:/var/lib/postgresql/data" + - "c4-store-db-data:/var/lib/postgresql/data" restart: always - env_file: - ###TODO: Move into Image - - internal.env diff --git a/dktk/docker-compose.yml b/dktk/docker-compose.yml index 21e96c9..df297b7 100644 --- a/dktk/docker-compose.yml +++ b/dktk/docker-compose.yml @@ -1,12 +1,10 @@ version: "3.7" volumes: - connector_db_data: - connector_logs: - patientlist_db_data: - patientlist_logs: - idmanager_logs: - store_db_data: - store_logs: + dktk-connector-db-data: + dktk-connector-logs: + patientlist-db-data: + patientlist-logs: + id-manager-logs: services: traefik: @@ -34,9 +32,10 @@ services: - "traefik.http.routers.landing.rule=PathPrefix(`/`)" - "traefik.http.services.landing.loadbalancer.server.port=80" - connector: + dktk-connector: image: "samply/share-client:dktk-feature-environmentPreconfigurationTorben" environment: + POSTGRES_HOST: "dktk-connector-db" ID_MANAGER_APIKEY: ${MAGICPL_API_KEY_CONNECTOR} POSTGRES_PASSWORD: ${CONNECTOR_POSTGRES_PASS} HTTP_PROXY_USER: ${HTTP_PROXY_USER} @@ -50,7 +49,7 @@ services: - "host.docker.internal:host-gateway" - "${HOST}:${HOSTIP}" volumes: - - "connector_logs:/usr/local/tomcat/logs" + - "dktk-connector-logs:/usr/local/tomcat/logs" depends_on: - connector-db restart: always @@ -59,14 +58,14 @@ services: - "traefik.http.routers.dktk_connector.rule=PathPrefix(`/dktk-connector`)" - "traefik.http.services.dktk_connector.loadbalancer.server.port=8080" - connector-db: + dktk-connector-db: image: postgres:10.17 environment: POSTGRES_DB: "share_v2" POSTGRES_USER: "samplyweb" POSTGRES_PASSWORD: ${CONNECTOR_POSTGRES_PASS} volumes: - - "connector_db_data:/var/lib/postgresql/data" + - "dktk-connector-db-data:/var/lib/postgresql/data" restart: always id-manager: @@ -81,7 +80,7 @@ services: MAGICPL_CENTRAL_API_KEY: ${MAGICPL_CENTRAL_API_KEY} MAGICPL_OIDC_CLIENT_ID: ${MAGICPL_OIDC_CLIENT_ID} MAGICPL_OIDC_CLIENT_SECRET: ${MAGICPL_OIDC_CLIENT_SECRET} - TOMCAT_REVERSEPROXY_FQDN: "${PROTOCOL}://${HOST}:${PORT}" + TOMCAT_REVERSEPROXY_FQDN: "${HOST}" HTTP_PROXY_USER: ${HTTP_PROXY_USER} HTTP_PROXY_PASSWORD: ${HTTP_PROXY_PASSWORD} HTTPS_PROXY_USER: ${HTTPS_PROXY_USER} @@ -89,7 +88,7 @@ services: env_file: - ../site-config/dktk.env volumes: - - "idmanager_logs:/usr/local/tomcat/logs" + - "id-manager-logs:/usr/local/tomcat/logs" depends_on: - patientlist labels: @@ -103,13 +102,13 @@ services: ML_SITE: ${SITE} ML_API_KEY: ${MAGICPL_MAINZELLISTE_API_KEY} ML_DB_PASS: ${ML_DB_PASS} - TOMCAT_REVERSEPROXY_FQDN: "${PROTOCOL}://${HOST}:${PORT}" + TOMCAT_REVERSEPROXY_FQDN: "${HOST}" env_file: - ../site-config/dktk.env # TODO: Implement automatic seed generation in mainzelliste - ../site-config/patientlist.env volumes: - - "patientlist_logs:/usr/local/tomcat/logs" + - "patientlist-logs:/usr/local/tomcat/logs" labels: - "traefik.http.routers.patientlist.rule=PathPrefix(`/Patientlist`)" - "traefik.http.services.patientlist.loadbalancer.server.port=8080" @@ -125,4 +124,4 @@ services: POSTGRES_PASSWORD: ${ML_DB_PASS} TZ: "Europe/Berlin" volumes: - - "patientlist_db_data:/var/lib/postgresql/data" + - "patientlist-db-data:/var/lib/postgresql/data" diff --git a/gbn/docker-compose.yml b/gbn/docker-compose.yml index ce56861..5809ae7 100644 --- a/gbn/docker-compose.yml +++ b/gbn/docker-compose.yml @@ -1,10 +1,9 @@ version: '3.4' volumes: - store-db-data: - name: "store-db-data" - connector-db-data: - name: "connector-db-data" + gbn-connector-logs: + gbn-connector-db-data: + gbn-store-db-data: services: traefik: @@ -15,11 +14,6 @@ services: - --entrypoints.web.address=:80 - --entrypoints.web-secure.address=:443 - --providers.docker=true - environment: - http_proxy: "" - HTTP_PROXY: "" - https_proxy: "" - HTTPS_PROXY: "" ports: - 80:80 - 443:443 @@ -37,14 +31,51 @@ services: - "traefik.http.routers.landing.rule=PathPrefix(`/`)" - "traefik.http.services.landing.loadbalancer.server.port=80" - store: - container_name: "bridgehead_gbn_blaze_store" + gbn-connector: + image: "samply/share-client:gbn-feature-environmentPreconfigurationTorben" + environment: + POSTGRES_HOST: "gbn-connector-db" + ID_MANAGER_APIKEY: ${MAGICPL_API_KEY_CONNECTOR} + POSTGRES_PASSWORD: ${CONNECTOR_POSTGRES_PASS} + HTTP_PROXY_USER: ${HTTP_PROXY_USER} + HTTP_PROXY_PASSWORD: ${HTTP_PROXY_PASSWORD} + HTTPS_PROXY_USER: ${HTTPS_PROXY_USER} + HTTPS_PROXY_PASSWORD: ${HTTPS_PROXY_PASSWORD} + LDM_URL: "${PROTOCOL}://${HOST}:${PORT}/fhir" + env_file: + - ../site-config/gbn.env + extra_hosts: + - "host.docker.internal:host-gateway" + - "${HOST}:${HOSTIP}" + volumes: + - "gbn-connector-logs:/usr/local/tomcat/logs" + labels: + - "traefik.enable=true" + - "traefik.http.routers.gbn_connector.rule=PathPrefix(`/gbn-connector`)" + - "traefik.http.services.gbn_connector.loadbalancer.server.port=8080" + depends_on: + - "gbn-connector-db" + restart: "always" + + gbn-connector-db: + image: "postgres:10.17" + environment: + POSTGRES_DB: "samply.connector" + POSTGRES_USER: "samply" + POSTGRES_PASSWORD: ${CONNECTOR_POSTGRES_PASS} + volumes: + - "gbn-connector-db-data:/var/lib/postgresql/data" + restart: "always" + + gbn-store: image: "samply/blaze:0.15" environment: - BASE_URL: "http://bridgehead_gbn_blaze_store:8080" + BASE_URL: "${PROTOCOL}://${HOST}:${PORT}" JAVA_TOOL_OPTIONS: "-Xmx4g" + env_file: + - ../site-config/gbn.env volumes: - - "store-db-data:/app/data" + - "gbn-store-db-data:/app/data" labels: - "traefik.enable=true" - "traefik.http.middlewares.test-auth.basicauth.users=user:$$apr1$$RjhTX8\ @@ -54,35 +85,3 @@ services: - "traefik.http.services.blaze_gbn.loadbalancer.server.port=8080" - "traefik.http.routers.blaze_gbn.middlewares=gbn_b_strip,test-auth" restart: "always" - - connector: - container_name: connector - image: "samply/share-client:gbn-feature-environmentPreconfigurationTorben" - environment: - POSTGRES_HOST: "bridgehead_gbn_connector_db" - POSTGRES_PASS: ${CONNECTOR_POSTGRES_PASS} - POSTGRES_PORT: 5432 - STORE_URL: "http://bridgehead_gbn_blaze_store:8080/fhir" - env_file: - ###TODO: Move into Image - - internal.env - labels: - - "traefik.enable=true" - - "traefik.http.routers.gbn_connector.rule=PathPrefix(`/gbn-connector`)" - - "traefik.http.services.gbn_connector.loadbalancer.server.port=8080" - depends_on: - - "connector-db" - restart: "always" - - connector-db: - container_name: "bridgehead_gbn_connector_db" - image: "postgres:10.17" - environment: - POSTGRES_PASSWORD: ${CONNECTOR_POSTGRES_PASS} - POSTGRES_PORT: 5432 - volumes: - - "connector-db-data:/var/lib/postgresql/data" - restart: "always" - env_file: - ###TODO: Move into Image - - internal.env diff --git a/init-dev-environment.sh b/init-dev-environment.sh index 13385b7..78113d3 100755 --- a/init-dev-environment.sh +++ b/init-dev-environment.sh @@ -19,6 +19,11 @@ export HTTPS_PROXY_PASSWORD="" # the password of database connector-db export CONNECTOR_POSTGRES_PASS=pleaseChangeThis1 + +### Configuration for Samply Store Secrets +# the password of database connector-db +export STORE_POSTGRES_PASS=pleaseChangeThis6 + ### Configuration for ID-Management Secrets # the password of database patientlist-db export ML_DB_PASS=pleaseChangeThis2 From d02170f266851df2e11be423c30d17f969c32153 Mon Sep 17 00:00:00 2001 From: Torben Brenner Date: Tue, 1 Mar 2022 08:51:42 +0100 Subject: [PATCH 07/10] refactor: Removed container_name from all services --- c4/docker-compose.yml | 5 ----- dktk/docker-compose.yml | 6 +----- gbn/docker-compose.yml | 3 --- 3 files changed, 1 insertion(+), 13 deletions(-) diff --git a/c4/docker-compose.yml b/c4/docker-compose.yml index 52d389c..1860f79 100644 --- a/c4/docker-compose.yml +++ b/c4/docker-compose.yml @@ -10,7 +10,6 @@ volumes: services: traefik: - container_name: traefik image: traefik:2.4 command: - --api.insecure=true @@ -25,7 +24,6 @@ services: - /var/run/docker.sock:/var/run/docker.sock:ro landing: - container_name: landingpage image: nginx:stable volumes: - ../landing/:/usr/share/nginx/html @@ -73,7 +71,6 @@ services: restart: always id-manager: - container_name: id-manager image: docker.verbis.dkfz.de/ccp/idmanager:bridgehead-develop environment: MAGICPL_SITE: ${SITE} @@ -100,7 +97,6 @@ services: - "traefik.http.services.idmanager.loadbalancer.server.port=8080" patientlist: - container_name: patientlist image: docker.verbis.dkfz.de/ccp/patientlist:bridgehead-develop environment: ML_SITE: ${SITE} @@ -120,7 +116,6 @@ services: - patientlist-db patientlist-db: - container_name: patientlist-db image: postgres:13.1-alpine environment: POSTGRES_DB: mainzelliste diff --git a/dktk/docker-compose.yml b/dktk/docker-compose.yml index df297b7..26600d1 100644 --- a/dktk/docker-compose.yml +++ b/dktk/docker-compose.yml @@ -1,3 +1,4 @@ +# TODO: Is there a reason why the docker-compose files are not at root level? e.g. docker-compose.(dktk|gbn|c4).yml version: "3.7" volumes: dktk-connector-db-data: @@ -8,7 +9,6 @@ volumes: services: traefik: - container_name: traefik image: traefik:2.4 command: - --api.insecure=true @@ -23,7 +23,6 @@ services: - /var/run/docker.sock:/var/run/docker.sock:ro landing: - container_name: landingpage image: nginx:stable volumes: - ../landing/:/usr/share/nginx/html @@ -69,7 +68,6 @@ services: restart: always id-manager: - container_name: id-manager image: docker.verbis.dkfz.de/ccp/idmanager:bridgehead-develop environment: MAGICPL_SITE: ${SITE} @@ -96,7 +94,6 @@ services: - "traefik.http.services.id-manager.loadbalancer.server.port=8080" patientlist: - container_name: patientlist image: docker.verbis.dkfz.de/ccp/patientlist:bridgehead-develop environment: ML_SITE: ${SITE} @@ -116,7 +113,6 @@ services: - patientlist-db patientlist-db: - container_name: patientlist-db image: postgres:13.1-alpine environment: POSTGRES_DB: mainzelliste diff --git a/gbn/docker-compose.yml b/gbn/docker-compose.yml index 5809ae7..10ed4cd 100644 --- a/gbn/docker-compose.yml +++ b/gbn/docker-compose.yml @@ -7,7 +7,6 @@ volumes: services: traefik: - container_name: traefik image: traefik:2.4 command: - --api.insecure=true @@ -22,7 +21,6 @@ services: - /var/run/docker.sock:/var/run/docker.sock:ro landing: - container_name: landingpage image: nginx:stable volumes: - ../landing/:/usr/share/nginx/html @@ -35,7 +33,6 @@ services: image: "samply/share-client:gbn-feature-environmentPreconfigurationTorben" environment: POSTGRES_HOST: "gbn-connector-db" - ID_MANAGER_APIKEY: ${MAGICPL_API_KEY_CONNECTOR} POSTGRES_PASSWORD: ${CONNECTOR_POSTGRES_PASS} HTTP_PROXY_USER: ${HTTP_PROXY_USER} HTTP_PROXY_PASSWORD: ${HTTP_PROXY_PASSWORD} From 17f57233c5ce5d203ebfb4a0d1d4cae9ae8df7ac Mon Sep 17 00:00:00 2001 From: Torben Brenner Date: Tue, 1 Mar 2022 09:11:00 +0100 Subject: [PATCH 08/10] docs: Added Command for correcting C4 Database --- README.md | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 432235d..dd05b1c 100644 --- a/README.md +++ b/README.md @@ -18,15 +18,19 @@ Each Project needs it own .env file where all the settings are located. Each Pro ### DKTK -For DKTK set in the site.conf the project to "dkkt". Also you need to set many settings in the env file. For the API keys for the psuenomisation you need to contact the Mainzelliste Team. +For DKTK set in the site.conf the project to "dktk". Also you need to set many settings in the env file. For the API keys for the psuenomisation you need to contact the Mainzelliste Team. ### GBA/BBMRI-ERIC -For an GBN/BBMRI-ERIC deployment set the project to gbn. When you already deployed a bridgehead you can reuse the env file for it. +For an GBN/BBMRI-ERIC deployment set the project to "gbn". When you already deployed a bridgehead you can reuse the env file for it. ### C4 -For C4 project it is similar to DKTK. Set the ldm_base_url in the configuration table to null. +For C4 project it is similar to DKTK. Set the "LDM_URL_BASE" setting in the configuration table to null: + +``` shell +docker exec bridgehead-c4-connector-db-1 bash -c 'psql -U $POSTGRES_USER $POSTGRES_DB -c "UPDATE samply.configuration SET setting=\'\' WHERE name=\'LDM_URL_BASE\'"'; +``` ### Git repository From 1f6ae18cfb652c888d8243d1fcfd22bd1b42aef1 Mon Sep 17 00:00:00 2001 From: Torben Brenner Date: Tue, 1 Mar 2022 11:14:04 +0100 Subject: [PATCH 09/10] docs: Updated Documentation about Configuration --- README.md | 221 +++++++++++++++++++++++++++++++++++++++++++++++++----- 1 file changed, 203 insertions(+), 18 deletions(-) diff --git a/README.md b/README.md index dd05b1c..4286c37 100644 --- a/README.md +++ b/README.md @@ -1,48 +1,233 @@ -# bridgehead +# Bridgehead -This repository contains all information and tools to deploy a bridgehead. If you have any questions about deploying a bridgehead, please contact us. +This repository contains all information and tools to deploy a bridgehead. If you have any questions about deploying a bridgehead, please [contact us](mailto:verbis-support@dkfz-heidelberg.de). -There are some prerequisites, which need to be meet befor starting a bridgehead. If you runnig a Windows or Mac OS maschine you should read starting a bridgehead. If you running a Linux maschine you can start or install a bridgehead. +TODO: Insert comprehensive feature list of the bridgehead? Why would anyone install it? +## Requirements +Before starting the installation process, please ensure that following software is available on your system: -## Setup +### [Git](https://git-scm.com/book/en/v2/Getting-Started-Installing-Git) +To check that you have a working git installation, please run +``` shell +cd ~/; +git clone https://github.com/octocat/Hello-World.git; +cat ~/Hello-World/README; +rm -rf Hello-World; +``` +If you see the output "Hello World!" your installation should be working. -Clone this repository to /srv/docker +### [Docker](https://docs.docker.com/get-docker/) +To check your docker installation, you can try to execute dockers "Hello World" Image. The command is: +``` shell +docker run --rm --name hello-world hello-world; +``` +Docker will now download the "hello-world" docker image and try to execute it. After the download you should see a message starting with "Hello from Docker!". -The first step is to copy the site.conf . It contains some configuration and secrets for your bridgehead. +> NOTE: If the download of the image fails (e.g with "connection timed out" message), ensure that you have correctly set the proxy for the docker daemon. Refer to ["Docker Daemon Proxy Configuration" in the "Pitfalls" section]() -With cp site.dev.conf site.conf you can clone the template. You need to set the project accoriding to the which bridgehead you want to start. It's either a GBN/BBMRI-ERIC, DKTK or C4 Bridgehead. +### [Docker Compose](https://docs.docker.com/compose/install/) +To check your docker-compose installation, please run the following command. It uses the "hello-world" image from the previous section: +``` shell +docker-compose -f - up < /srv/docker/bridgehead/site-config; +``` + +After this, you need to install the systemd units. This is currently done with the [install-bridgehead.sh script](./install-bridgehead.sh). + +You can execute it with +``` shell +sudo ./install-bridgehead.sh +``` + +Finally, you need to configure your sites secrets. These are places as configuration for each bridgeheads system unit. Refer to the section for your specific project: + +### DKTK/C4 + +You can create the site specific configuration with: + +``` shell +sudo systemctl edit bridgehead@dktk.service; +``` + +This will open your default editor allowing you to edit the docker system units configuration. Insert the following lines in the editor and define your machines secrets. You share some of the ID-Management secrets with the central patientlist (Mainz) and controlnumbergenerator (Frankfurt). Refer to the ["Configuration" section]() for this. + +``` conf +[Service] +Environment=HOSTIP= +Environment=HOST= +Environment=HTTP_PROXY_USER= +Environment=HTTP_PROXY_PASSWORD= +Environment=HTTPS_PROXY_USER= +Environment=HTTPS_PROXY_PASSWORD= +Environment=CONNECTOR_POSTGRES_PASS= +Environment=STORE_POSTGRES_PASS= +Environment=ML_DB_PASS= +Environment=MAGICPL_API_KEY= +Environment=MAGICPL_MAINZELLISTE_API_KEY= +Environment=MAGICPL_API_KEY_CONNECTOR= +Environment=MAGICPL_MAINZELLISTE_CENTRAL_API_KEY= +Environment=MAGICPL_CENTRAL_API_KEY= +Environment=MAGICPL_OIDC_CLIENT_ID= +Environment=MAGICPL_OIDC_CLIENT_SECRET= +``` + +For the C4 project, you need to additionally set the "LDM_URL_BASE" setting in the configuration table to null. You need to execute this after starting the bridgehead system unit for c4: ``` shell docker exec bridgehead-c4-connector-db-1 bash -c 'psql -U $POSTGRES_USER $POSTGRES_DB -c "UPDATE samply.configuration SET setting=\'\' WHERE name=\'LDM_URL_BASE\'"'; ``` -### Git repository +To make the configuration effective, you need to tell systemd to reload the configuration and restart the docker service: -If you already have a git config repositpory you can clone it with +``` shell +sudo systemctl daemon-reload; +sudo systemctl restart docker; +``` -git submodule add -f https://"$git_username":"$git_access_token"@code.mitro.dkfz.de/scm/bd/"$site_name_lowercase"-config.git ./site-config +### GBA/BBMRI-ERIC -## Starting your bridgehead +You can create the site specific configuration with: +``` shell +sudo systemctl edit bridgehead@dktk.service; +``` + +This will open your default editor allowing you to edit the docker system units configuration. Insert the following lines in the editor and define your machines secrets. + +``` conf +[Service] +Environment=HOSTIP= +Environment=HOST= +Environment=HTTP_PROXY_USER= +Environment=HTTP_PROXY_PASSWORD= +Environment=HTTPS_PROXY_USER= +Environment=HTTPS_PROXY_PASSWORD= +Environment=CONNECTOR_POSTGRES_PASS= +``` + +To make the configuration effective, you need to tell systemd to reload the configuration and restart the docker service: + +``` shell +sudo systemctl daemon-reload; +sudo systemctl restart docker; +``` + +### Developers +Because some developers machines doesn't support system units (e.g Windows Subsystem for Linux), we provide a dev environment [configuration script](./init-dev-environment.sh). +It is not recommended to use this script in production! + +## Configuration + +### Locally Managed Secrets +This section describes the secrets you need to configure locally through the configuration +|Name|Recommended Value|Description| +|HOSTIP|Compute with: `docker run --rm --add-host=host.docker.internal:host-gateway ubuntu cat /etc/hosts | grep 'host.docker.internal' | awk '{print $1}'`|The ip from which docker containers can reach your host system.| +|HOST|Compute with: `hostname`|The hostname from which all components will eventually be available| +|HTTP_PROXY_USER||Your local http proxy user| +|HTTP_PROXY_PASSWORD||Your local http proxy user's password| +|HTTPS_PROXY_USER||Your local https proxy user| +|HTTPS_PROXY_PASSWORD||Your local https proxy user's password| +|CONNECTOR_POSTGRES_PASS|Random String|The password for your project specific connector.| +|STORE_POSTGRES_PASS|Random String|The password for your local datamanagements database (only relevant in c4)| +|ML_DB_PASS|Random String|The password for your local patientlist database| +|MAGICPL_API_KEY|Random String|The apiKey used by the local datamanagement to create pseudonymes.| +|MAGICPL_MAINZELLISTE_API_KEY|Random String|The apiKey used by the local id-manager to communicate with the local patientlist| +|MAGICPL_API_KEY_CONNECTOR|Random String|The apiKey used by the connector to communicate with the local patientlist| +|MAGICPL_MAINZELLISTE_CENTRAL_API_KEY|You need to ask the central patientlists admin for this.|The apiKey for your machine to communicate with the central patientlist| +|MAGICPL_CENTRAL_API_KEY|You need to ask the central controlnumbergenerator admin for this.|The apiKey for your machine to communicate with the central controlnumbergenerator| +|MAGICPL_OIDC_CLIENT_ID||The client id used for your machine, to connect with the central authentication service| +|MAGICPL_OIDC_CLIENT_SECRET||The client secret used for your machine, to connect with the central authentication service| + +### Cooperatively Managed Secrets +> TODO: Describe secrets from site-config + +## Managing your Bridgehead + +> TODO: Rewrite this section (restart, stop, uninstall, manual updates) There two methods to start the bridgehead. For Windows, Linux and Mac OS you can use the start-bridgehead.sh to deploy it wit docker-compose. If will also check some other setting of your system. The second methods is using the systemd management tool you start, stop and update your bridgehead. Just run the install-bridgehead and thats it. +## Migration Guide +> TODO: How to transfer from windows/gbn + +## Pitfalls +### [Git Proxy Configuration](https://gist.github.com/evantoli/f8c23a37eb3558ab8765) +Unlike most other tools, git doesn't use the default proxy variables "http_proxy" and "https_proxy". To make git use a proxy, you will need to adjust the global git configuration: + +``` shell +git config --global http.proxy http://:; +git config --global https.proxy http://:; +``` +> NOTE: Some proxies may require user and password authentication. You can adjust the settings like this: "http://:@:". +> NOTE: It is also possible that a proxy requires https protocol, so you can replace this to. + +You can check that the updated configuration with + +``` shell +git config --global --list; +``` + +Please repeat this configuration for the root user to. Otherwise the update service won't be able to properly update the git repository. + +### Docker Daemon Proxy Configuration +Docker has a background daemon, responsible for downloading images and starting them. To configure the proxy for this daemon, use the systemctl command: + +``` shell +sudo systemctl edit docker +``` + +This will open your default editor allowing you to edit the docker system units configuration. Insert the following lines in the editor, replace and with the corresponding values for your machine and save the file: +``` conf +[Service] +Environment=HTTP_PROXY=http://: +Environment=HTTPS_PROXY=http://: +Environment=FTP_PROXY=http://: +``` +> NOTE: Some proxies may require user and password authentication. You can adjust the settings like this: "http://:@:". +> NOTE: It is also possible that a proxy requires https protocol, so you can replace this to. + +The file should now be at the location "/etc/systemd/system/docker.service.d/override.conf". You can proof check with +``` shell +cat /etc/systemd/system/docker.service.d/override.conf; +``` + +To make the configuration effective, you need to tell systemd to reload the configuration and restart the docker service: + +``` shell +sudo systemctl daemon-reload; +sudo systemctl restart docker; +``` From c53ae9173ce697b55ce5dd5e6334bc4444690d94 Mon Sep 17 00:00:00 2001 From: Torben Brenner Date: Tue, 1 Mar 2022 17:24:53 +0100 Subject: [PATCH 10/10] Result from Meeting with Patrick --- README.md | 183 +++++++++++++----- dktk/docker-compose.yml | 1 - .../init-test-environment.sh | 0 .../remove-bridgehead-units.sh | 0 .../setup-bridgehead-units.sh | 0 start-bridgehead.sh | 4 +- stop-bridgehead.sh | 4 +- 7 files changed, 139 insertions(+), 53 deletions(-) rename init-dev-environment.sh => lib/init-test-environment.sh (100%) rename uninstall-bridgehead.sh => lib/remove-bridgehead-units.sh (100%) rename install-bridgehead.sh => lib/setup-bridgehead-units.sh (100%) diff --git a/README.md b/README.md index 4286c37..be2aa67 100644 --- a/README.md +++ b/README.md @@ -4,6 +4,8 @@ This repository contains all information and tools to deploy a bridgehead. If yo TODO: Insert comprehensive feature list of the bridgehead? Why would anyone install it? +TODO: TOC + ## Requirements Before starting the installation process, please ensure that following software is available on your system: @@ -24,9 +26,15 @@ docker run --rm --name hello-world hello-world; ``` Docker will now download the "hello-world" docker image and try to execute it. After the download you should see a message starting with "Hello from Docker!". -> NOTE: If the download of the image fails (e.g with "connection timed out" message), ensure that you have correctly set the proxy for the docker daemon. Refer to ["Docker Daemon Proxy Configuration" in the "Pitfalls" section]() +> NOTE: If the download of the image fails (e.g with "connection timed out" message), ensure that you have correctly set the proxy for the docker daemon. Refer to ["Docker Daemon Proxy Configuration" in the "Pitfalls" section](#docker-daemon-proxy-configuration) -### [Docker Compose](https://docs.docker.com/compose/install/) +You should also check, that the version of docker installed by you is newer than "1.20". To check this, just run + +``` shell +docker --version +``` + +### [Docker Compose](https://docs.docker.com/compose/cli-command/#installing-compose-v2) To check your docker-compose installation, please run the following command. It uses the "hello-world" image from the previous section: ``` shell docker-compose -f - up < /srv/docker/bridgehead/site-config; +sudo git submodule add -f https://github.com/samply/bridgehead-config.git ./site-config; +``` +> NOTE: If you are part of the CCP-IT we will provide you another link for the configuration. + +You should now be able to run a bridgehead instance. To check if everything works, execute the following: +``` shell +sudo ./lib/init-test-environment.sh; +sudo ./start-bridgehead.sh ; ``` -After this, you need to install the systemd units. This is currently done with the [install-bridgehead.sh script](./install-bridgehead.sh). +You should now be able to access the landing page on your system, e.g "http:///" -You can execute it with +To remove the test-environment, run (make sure you don't have other docker services installed on this system, docker volume prune is destructive!) ``` shell -sudo ./install-bridgehead.sh +sudo ./stop-bridgehead.sh ; +sudo docker volume prune; +``` + +For a server, we highly recommend that you install the system units for managing the bridgehead, provided by us. . You can do this by executing the [setup-bridgehead-units.sh](./lib/setup-bridgehead-units.sh) script: +``` shell +sudo ./lib/setup-bridgehead-units.sh ``` Finally, you need to configure your sites secrets. These are places as configuration for each bridgeheads system unit. Refer to the section for your specific project: ### DKTK/C4 - You can create the site specific configuration with: ``` shell sudo systemctl edit bridgehead@dktk.service; ``` -This will open your default editor allowing you to edit the docker system units configuration. Insert the following lines in the editor and define your machines secrets. You share some of the ID-Management secrets with the central patientlist (Mainz) and controlnumbergenerator (Frankfurt). Refer to the ["Configuration" section]() for this. +This will open your default editor allowing you to edit the docker system units configuration. Insert the following lines in the editor and define your machines secrets. You share some of the ID-Management secrets with the central patientlist (Mainz) and controlnumbergenerator (Frankfurt). Refer to the ["Configuration" section](#configuration) for this. + +``` conf +[Service] +Environment=HOSTIP= +Environment=HOST= +Environment=HTTP_PROXY_USER= +Environment=HTTP_PROXY_PASSWORD= +Environment=HTTPS_PROXY_USER= +Environment=HTTPS_PROXY_PASSWORD= +Environment=CONNECTOR_POSTGRES_PASS= +Environment=ML_DB_PASS= +Environment=MAGICPL_API_KEY= +Environment=MAGICPL_MAINZELLISTE_API_KEY= +Environment=MAGICPL_API_KEY_CONNECTOR= +Environment=MAGICPL_MAINZELLISTE_CENTRAL_API_KEY= +Environment=MAGICPL_CENTRAL_API_KEY= +Environment=MAGICPL_OIDC_CLIENT_ID= +Environment=MAGICPL_OIDC_CLIENT_SECRET= +``` + +To make the configuration effective, you need to tell systemd to reload the configuration and restart the docker service: + +``` shell +sudo systemctl daemon-reload; +sudo systemctl bridgehead@dktk.service; +``` + +### C4 +You can create the site specific configuration with: + +``` shell +sudo systemctl edit bridgehead@c4.service; +``` + +This will open your default editor allowing you to edit the docker system units configuration. Insert the following lines in the editor and define your machines secrets. You share some of the ID-Management secrets with the central patientlist (Mainz) and controlnumbergenerator (Frankfurt). Refer to the ["Configuration" section](#configuration) for this. ``` conf [Service] @@ -102,25 +163,18 @@ Environment=MAGICPL_OIDC_CLIENT_ID= Environment=MAGICPL_OIDC_CLIENT_SECRET= ``` -For the C4 project, you need to additionally set the "LDM_URL_BASE" setting in the configuration table to null. You need to execute this after starting the bridgehead system unit for c4: - -``` shell -docker exec bridgehead-c4-connector-db-1 bash -c 'psql -U $POSTGRES_USER $POSTGRES_DB -c "UPDATE samply.configuration SET setting=\'\' WHERE name=\'LDM_URL_BASE\'"'; -``` - To make the configuration effective, you need to tell systemd to reload the configuration and restart the docker service: ``` shell sudo systemctl daemon-reload; -sudo systemctl restart docker; +sudo systemctl bridgehead@c4.service; ``` - ### GBA/BBMRI-ERIC You can create the site specific configuration with: ``` shell -sudo systemctl edit bridgehead@dktk.service; +sudo systemctl edit bridgehead@gbn.service; ``` This will open your default editor allowing you to edit the docker system units configuration. Insert the following lines in the editor and define your machines secrets. @@ -140,47 +194,82 @@ To make the configuration effective, you need to tell systemd to reload the conf ``` shell sudo systemctl daemon-reload; -sudo systemctl restart docker; +sudo systemctl bridgehead@gbn.service; ``` ### Developers -Because some developers machines doesn't support system units (e.g Windows Subsystem for Linux), we provide a dev environment [configuration script](./init-dev-environment.sh). +Because some developers machines doesn't support system units (e.g Windows Subsystem for Linux), we provide a dev environment [configuration script](./lib/init-test-environment.sh). It is not recommended to use this script in production! ## Configuration ### Locally Managed Secrets This section describes the secrets you need to configure locally through the configuration -|Name|Recommended Value|Description| -|HOSTIP|Compute with: `docker run --rm --add-host=host.docker.internal:host-gateway ubuntu cat /etc/hosts | grep 'host.docker.internal' | awk '{print $1}'`|The ip from which docker containers can reach your host system.| -|HOST|Compute with: `hostname`|The hostname from which all components will eventually be available| -|HTTP_PROXY_USER||Your local http proxy user| -|HTTP_PROXY_PASSWORD||Your local http proxy user's password| -|HTTPS_PROXY_USER||Your local https proxy user| -|HTTPS_PROXY_PASSWORD||Your local https proxy user's password| -|CONNECTOR_POSTGRES_PASS|Random String|The password for your project specific connector.| -|STORE_POSTGRES_PASS|Random String|The password for your local datamanagements database (only relevant in c4)| -|ML_DB_PASS|Random String|The password for your local patientlist database| -|MAGICPL_API_KEY|Random String|The apiKey used by the local datamanagement to create pseudonymes.| -|MAGICPL_MAINZELLISTE_API_KEY|Random String|The apiKey used by the local id-manager to communicate with the local patientlist| -|MAGICPL_API_KEY_CONNECTOR|Random String|The apiKey used by the connector to communicate with the local patientlist| -|MAGICPL_MAINZELLISTE_CENTRAL_API_KEY|You need to ask the central patientlists admin for this.|The apiKey for your machine to communicate with the central patientlist| -|MAGICPL_CENTRAL_API_KEY|You need to ask the central controlnumbergenerator admin for this.|The apiKey for your machine to communicate with the central controlnumbergenerator| -|MAGICPL_OIDC_CLIENT_ID||The client id used for your machine, to connect with the central authentication service| -|MAGICPL_OIDC_CLIENT_SECRET||The client secret used for your machine, to connect with the central authentication service| + +| Name | Recommended Value | Description | +|--------------------------------------|---------------------------------------------------------------------------------------------------| ----------- | +| HTTP_PROXY_USER | | Your local http proxy user | +| HOSTIP | Compute with: `docker run --rm --add-host=host.docker.internal:host-gateway ubuntu cat /etc/hosts | grep 'host.docker.internal' | awk '{print $1}'` | The ip from which docker containers can reach your host system. | +| HOST | Compute with: `hostname` |The hostname from which all components will eventually be available| +| HTTP_PROXY_PASSWORD | |Your local http proxy user's password| +| HTTPS_PROXY_USER | |Your local https proxy user| +| HTTPS_PROXY_PASSWORD || Your local https proxy user's password | +| CONNECTOR_POSTGRES_PASS | Random String |The password for your project specific connector.| +| STORE_POSTGRES_PASS | Random String |The password for your local datamanagements database (only relevant in c4)| +| ML_DB_PASS | Random String |The password for your local patientlist database| +| MAGICPL_API_KEY | Random String |The apiKey used by the local datamanagement to create pseudonymes.| +| MAGICPL_MAINZELLISTE_API_KEY | Random String |The apiKey used by the local id-manager to communicate with the local patientlist| +| MAGICPL_API_KEY_CONNECTOR | Random String |The apiKey used by the connector to communicate with the local patientlist| +| MAGICPL_MAINZELLISTE_CENTRAL_API_KEY | You need to ask the central patientlists admin for this. |The apiKey for your machine to communicate with the central patientlist| +| MAGICPL_CENTRAL_API_KEY | You need to ask the central controlnumbergenerator admin for this. |The apiKey for your machine to communicate with the central controlnumbergenerator| +| MAGICPL_OIDC_CLIENT_ID || The client id used for your machine, to connect with the central authentication service | +| MAGICPL_OIDC_CLIENT_SECRET || The client secret used for your machine, to connect with the central authentication service | ### Cooperatively Managed Secrets > TODO: Describe secrets from site-config ## Managing your Bridgehead - > TODO: Rewrite this section (restart, stop, uninstall, manual updates) -There two methods to start the bridgehead. For Windows, Linux and Mac OS you can use the start-bridgehead.sh to deploy it wit docker-compose. If will also check some other setting of your system. - -The second methods is using the systemd management tool you start, stop and update your bridgehead. - -Just run the install-bridgehead and thats it. +### On a Server +#### Start +This will start a not running bridgehead system unit: +``` shell +sudo systemctl start bridgehead@ +``` +#### Stop +This will stop a running bridgehead system unit: +``` shell +sudo systemctl stop bridgehead@ +``` +#### Update +This will update bridgehead system unit: +``` shell +sudo systemctl start bridgehead-update@ +``` +#### Remove the Bridgehead System Units +If, for some reason you want to remove the installed bridgehead units, we added a [script](./lib/remove-bridgehead-units.sh) you can execute: +``` shell +sudo ./lib/remove-bridgehead-units.sh +``` +### On Developers Machine +For developers, we provide additional scripts for starting and stopping the specif bridgehead: +#### Start +This shell script start a specified bridgehead. Choose between "dktk", "c4" and "gbn". +``` shell +./start-bridgehead +``` +#### Stop +This shell script stops a specified bridgehead. Choose between "dktk", "c4" and "gbn". +``` shell +./stop-bridgehead +``` +#### Update +This shell script updates the configuration for all bridgeheads installed on your system. +``` shell +./update-bridgehead +``` +> NOTE: If you want to regularly update your developing instance, you can create a CRON job that executes this script. ## Migration Guide > TODO: How to transfer from windows/gbn @@ -189,8 +278,8 @@ Just run the install-bridgehead and thats it. Unlike most other tools, git doesn't use the default proxy variables "http_proxy" and "https_proxy". To make git use a proxy, you will need to adjust the global git configuration: ``` shell -git config --global http.proxy http://:; -git config --global https.proxy http://:; +sudo git config --global http.proxy http://:; +sudo git config --global https.proxy http://:; ``` > NOTE: Some proxies may require user and password authentication. You can adjust the settings like this: "http://:@:". > NOTE: It is also possible that a proxy requires https protocol, so you can replace this to. @@ -198,11 +287,9 @@ git config --global https.proxy http://:; You can check that the updated configuration with ``` shell -git config --global --list; +sudo git config --global --list; ``` -Please repeat this configuration for the root user to. Otherwise the update service won't be able to properly update the git repository. - ### Docker Daemon Proxy Configuration Docker has a background daemon, responsible for downloading images and starting them. To configure the proxy for this daemon, use the systemctl command: diff --git a/dktk/docker-compose.yml b/dktk/docker-compose.yml index 26600d1..e229586 100644 --- a/dktk/docker-compose.yml +++ b/dktk/docker-compose.yml @@ -1,4 +1,3 @@ -# TODO: Is there a reason why the docker-compose files are not at root level? e.g. docker-compose.(dktk|gbn|c4).yml version: "3.7" volumes: dktk-connector-db-data: diff --git a/init-dev-environment.sh b/lib/init-test-environment.sh similarity index 100% rename from init-dev-environment.sh rename to lib/init-test-environment.sh diff --git a/uninstall-bridgehead.sh b/lib/remove-bridgehead-units.sh similarity index 100% rename from uninstall-bridgehead.sh rename to lib/remove-bridgehead-units.sh diff --git a/install-bridgehead.sh b/lib/setup-bridgehead-units.sh similarity index 100% rename from install-bridgehead.sh rename to lib/setup-bridgehead-units.sh diff --git a/start-bridgehead.sh b/start-bridgehead.sh index 0e7272d..418aa39 100755 --- a/start-bridgehead.sh +++ b/start-bridgehead.sh @@ -7,10 +7,10 @@ if ! lib/prerequisites.sh; then log "Prerequisites failed, exiting" exit fi -source site.conf log "Starting bridgehead" -docker-compose -f ${project}/docker-compose.yml --env-file site-config/${project}.env up -d +# TODO: Check $1 for proper values +docker-compose -f $1/docker-compose.yml --env-file bridgehead-config/$1.env up -d log "The bridgehead should be in online in a few seconds" diff --git a/stop-bridgehead.sh b/stop-bridgehead.sh index 6da0228..88f555d 100755 --- a/stop-bridgehead.sh +++ b/stop-bridgehead.sh @@ -1,8 +1,8 @@ #!/bin/bash -e source lib/functions.sh -source site.conf log "Stopping bridgehead" -docker-compose -f ${project}/docker-compose.yml --env-file site-config/${project}.env down +# TODO: Check $1 for proper values +docker-compose -f $1/docker-compose.yml --env-file bridgehead-config/$1.env down