From 71fea9f098bc917bf0f2a5a732eeba071e8eabeb Mon Sep 17 00:00:00 2001 From: Tobias Kussel Date: Tue, 13 Jun 2023 06:16:00 +0000 Subject: [PATCH 01/26] Switch to new dktk broker url with new root cert --- ccp/root.crt.pem | 38 +++++++++++++++++++------------------- ccp/vars | 4 ++-- 2 files changed, 21 insertions(+), 21 deletions(-) diff --git a/ccp/root.crt.pem b/ccp/root.crt.pem index b561218..100011d 100644 --- a/ccp/root.crt.pem +++ b/ccp/root.crt.pem @@ -1,20 +1,20 @@ -----BEGIN CERTIFICATE----- -MIIDNTCCAh2gAwIBAgIUMeGRSrNPhRdQ1tU7uK5+lUa4f38wDQYJKoZIhvcNAQEL -BQAwFjEUMBIGA1UEAxMLQnJva2VyLVJvb3QwHhcNMjIwOTI5MTQxMjU1WhcNMzIw -OTI2MTQxMzI1WjAWMRQwEgYDVQQDEwtCcm9rZXItUm9vdDCCASIwDQYJKoZIhvcN -AQEBBQADggEPADCCAQoCggEBAMYyroOUeb27mYzClOrjCmgIceLalsFA0aVCh5mZ -KtP8+1U3oq/7exP30gXiJojxW7xoerfyQY9s0Sz5YYbxYbuskFOYEtyAILB/pxgd -+k+J3tlZKolpfmo7WT5tZiHxH/zjrtAYGnuB2xPHRMCWh/tHYrELgXQuilNol24y -GBa1plTlARy0aKEDUHp87WLhD2qH7B8sFlLgo0+gunE1UtR2HMSPF45w3VXszyG6 -fJNrAj0yPnKy3Dm1BMO3jDO2e0A9lCQ71a4j4TeKePfCk1xCArSu6PpiwiacKplF -c6CRR6KrWVm2g+8Y2hFcOBG/Py2xusm3PWbpylGq6vtFRkkCAwEAAaN7MHkwDgYD -VR0PAQH/BAQDAgEGMA8GA1UdEwEB/wQFMAMBAf8wHQYDVR0OBBYEFEFxD6BQwQO5 -xsJ+3cvZypsnh6dDMB8GA1UdIwQYMBaAFEFxD6BQwQO5xsJ+3cvZypsnh6dDMBYG -A1UdEQQPMA2CC0Jyb2tlci1Sb290MA0GCSqGSIb3DQEBCwUAA4IBAQB5zTeIhV/3 -3Am6O144EFtnIeaZ2w0D6aEHqHAZp50vJv3+uQfOliCOzgw7VDxI4Zz2JALjlR/i -uOYHsu3YIRMIOmPOjqrdDJa6auB0ufL4oUPfCRln7Fh0f3JVlz3BUoHsSDt949p4 -g0nnsciL2JHuzlqjn7Jyt3L7dAHrlFKulCcuidG5D3cqXrRCbF83f+k3TC/HRiNd -25oMi7I4MP/SOCdfQGUGIsHIf/0hSm3pNjDOrC/XuI/8gh2f5io+Y8V+hMwMBcm4 -JbH8bdyBB+EIhsNbTwf2MWntD5bmg47sf7hh23aNvKXI67Li1pTI2t1CqiGnFR0U -fCEpeaEAHs0k ------END CERTIFICATE----- +MIIDNTCCAh2gAwIBAgIUN7yzueIZzwpe8PaPEIMY8zoH+eMwDQYJKoZIhvcNAQEL +BQAwFjEUMBIGA1UEAxMLQnJva2VyLVJvb3QwHhcNMjMwNTIzMTAxNzIzWhcNMzMw +NTIwMTAxNzUzWjAWMRQwEgYDVQQDEwtCcm9rZXItUm9vdDCCASIwDQYJKoZIhvcN +AQEBBQADggEPADCCAQoCggEBAN5JAj+HydSGaxvA0AOcrXVTZ9FfsH0cMVBlQb72 +bGZgrRvkqtB011TNXZfsHl7rPxCY61DcsDJfFq3+8VHT+S9HE0qV1bEwP+oA3xc4 +Opq77av77cNNOqDC7h+jyPhHcUaE33iddmrH9Zn2ofWTSkKHHu3PAe5udCrc2QnD +4PLRF6gqiEY1mcGknJrXj1ff/X0nRY/m6cnHNXz0Cvh8oPOtbdfGgfZjID2/fJNP +fNoNKqN+5oJAZ+ZZ9id9rBvKj1ivW3F2EoGjZF268SgZzc5QrM/D1OpSBQf5SF/V +qUPcQTgt9ry3YR+SZYazLkfKMEOWEa0WsqJVgXdQ6FyergcCAwEAAaN7MHkwDgYD +VR0PAQH/BAQDAgEGMA8GA1UdEwEB/wQFMAMBAf8wHQYDVR0OBBYEFEa70kcseqU5 +bHx2zSt4bG21HokhMB8GA1UdIwQYMBaAFEa70kcseqU5bHx2zSt4bG21HokhMBYG +A1UdEQQPMA2CC0Jyb2tlci1Sb290MA0GCSqGSIb3DQEBCwUAA4IBAQCGmE7NXW4T +6J4mV3b132cGEMD7grx5JeiXK5EHMlswUS+Odz0NcBNzhUHdG4WVMbrilHbI5Ua+ +6jdKx5WwnqzjQvElP0MCw6sH/35gbokWgk1provOP99WOFRsQs+9Sm8M2XtMf9HZ +m3wABwU/O+dhZZ1OT1PjSZD0OKWKqH/KvlsoF5R6P888KpeYFiIWiUNS5z21Jm8A +ZcllJjiRJ60EmDwSUOQVJJSMOvtr6xTZDZLtAKSN8zN08lsNGzyrFwqjDwU0WTqp +scMXEGBsWQjlvxqDnXyljepR0oqRIjOvgrWaIgbxcnu98tK/OdBGwlAPKNUW7Crr +vO+eHxl9iqd4 +-----END CERTIFICATE----- \ No newline at end of file diff --git a/ccp/vars b/ccp/vars index 5172d24..d6304f3 100644 --- a/ccp/vars +++ b/ccp/vars @@ -1,4 +1,4 @@ -BROKER_ID=broker.dev.ccp-it.dktk.dkfz.de +BROKER_ID=broker.ccp-it.dktk.dkfz.de BROKER_URL=https://${BROKER_ID} PROXY_ID=${SITE_ID}.${BROKER_ID} SPOT_BEAM_SECRET_SHORT="$(cat /proc/sys/kernel/random/uuid | sed 's/[-]//g' | head -c 20)" @@ -16,4 +16,4 @@ source $PROJECT/nngm-setup.sh nngmSetup source $PROJECT/exliquid-setup.sh exliquidSetup -mtbaSetup \ No newline at end of file +mtbaSetup From 019304862e052b5b5636cf5464c89bf25baadd1a Mon Sep 17 00:00:00 2001 From: "p.delpy@dkfz-heidelberg.de" Date: Thu, 15 Jun 2023 11:02:59 +0200 Subject: [PATCH 02/26] make ID Management skippable for MTBA --- ccp/nngm-setup.sh | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/ccp/nngm-setup.sh b/ccp/nngm-setup.sh index bcc4cd1..f2cefa9 100644 --- a/ccp/nngm-setup.sh +++ b/ccp/nngm-setup.sh @@ -15,10 +15,10 @@ function mtbaSetup() { # TODO: Check if ID-Management Module is activated! if [ -n "$ENABLE_MTBA" ];then log INFO "MTBA setup detected -- will start MTBA Service and CBioPortal." - if [ ! -n "$IDMANAGER_UPLOAD_APIKEY" ]; then - log ERROR "Detected MTBA Module configuration but ID-Management Module seems not to be configured!" - exit 1; - fi +# if [ ! -n "$IDMANAGER_UPLOAD_APIKEY" ]; then +# log ERROR "Detected MTBA Module configuration but ID-Management Module seems not to be configured!" +# exit 1; +# fi OVERRIDE+=" -f ./$PROJECT/mtba-compose.yml" fi } From 149a550940ee5818d65c282a48414ee3de4ba217 Mon Sep 17 00:00:00 2001 From: Pierre Delpy Date: Mon, 19 Jun 2023 07:24:39 +0200 Subject: [PATCH 03/26] deactivate exliquid in freiburg --- ccp/exliquid-setup.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ccp/exliquid-setup.sh b/ccp/exliquid-setup.sh index 91909eb..353bac8 100644 --- a/ccp/exliquid-setup.sh +++ b/ccp/exliquid-setup.sh @@ -2,7 +2,7 @@ function exliquidSetup() { case ${SITE_ID} in - berlin|dresden|essen|frankfurt|freiburg|luebeck|mainz|muenchen-lmu|muenchen-tum|mannheim|tuebingen) + berlin|dresden|essen|frankfurt|luebeck|mainz|muenchen-lmu|muenchen-tum|mannheim|tuebingen) EXLIQUID=1 ;; dktk-test) From 188d8d109ec76b28552cae32c738e5f5d6e931a8 Mon Sep 17 00:00:00 2001 From: Martin Lablans Date: Mon, 19 Jun 2023 13:32:47 +0200 Subject: [PATCH 04/26] Change focus tag to main --- bbmri/docker-compose.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bbmri/docker-compose.yml b/bbmri/docker-compose.yml index 07658f4..e00ed67 100644 --- a/bbmri/docker-compose.yml +++ b/bbmri/docker-compose.yml @@ -72,7 +72,7 @@ services: - "traefik.http.routers.blaze_ccp.tls=true" focus: - image: docker.verbis.dkfz.de/cache/samply/focus:develop + image: docker.verbis.dkfz.de/cache/samply/focus:main container_name: bridgehead-focus environment: API_KEY: ${FOCUS_BEAM_SECRET_SHORT} From 097de416529e62fb29a19e54cd7b20c8add1a3a8 Mon Sep 17 00:00:00 2001 From: Martin Lablans Date: Mon, 19 Jun 2023 13:33:26 +0200 Subject: [PATCH 05/26] focus: Rename SECRET to API_KEY --- ccp/docker-compose.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ccp/docker-compose.yml b/ccp/docker-compose.yml index bc462f7..624766d 100644 --- a/ccp/docker-compose.yml +++ b/ccp/docker-compose.yml @@ -75,7 +75,7 @@ services: image: docker.verbis.dkfz.de/cache/samply/focus:main container_name: bridgehead-focus environment: - SECRET: ${FOCUS_BEAM_SECRET_SHORT} + API_KEY: ${FOCUS_BEAM_SECRET_SHORT} BEAM_APP_ID_LONG: focus.${PROXY_ID} PROXY_ID: ${PROXY_ID} BLAZE_URL: "http://bridgehead-ccp-blaze:8080/fhir/" From 21fce5a058fe247add77880cd6f6a4d5ca60a344 Mon Sep 17 00:00:00 2001 From: "p.delpy@dkfz-heidelberg.de" Date: Tue, 27 Jun 2023 10:29:29 +0200 Subject: [PATCH 06/26] beam enroll use docker cache --- bridgehead | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bridgehead b/bridgehead index 056d385..59287f4 100755 --- a/bridgehead +++ b/bridgehead @@ -97,7 +97,7 @@ case "$ACTION" in ;; enroll) loadVars - docker run --rm -ti -v /etc/bridgehead/pki:/etc/bridgehead/pki samply/beam-enroll:latest --output-file $PRIVATEKEYFILENAME --proxy-id $PROXY_ID --admin-email $SUPPORT_EMAIL + docker run --rm -ti -v /etc/bridgehead/pki:/etc/bridgehead/pki docker.verbis.dkfz.de/cache/samply/beam-enroll:latest --output-file $PRIVATEKEYFILENAME --proxy-id $PROXY_ID --admin-email $SUPPORT_EMAIL chmod 600 $PRIVATEKEYFILENAME ;; preRun | preUpdate) From 9f4523cf9ed27860770c6bd7e8f64c4c4a41078c Mon Sep 17 00:00:00 2001 From: Tobias Kussel Date: Wed, 28 Jun 2023 14:55:35 +0200 Subject: [PATCH 07/26] Absolute path for beam root cert --- bbmri/docker-compose.yml | 2 +- ccp/docker-compose.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/bbmri/docker-compose.yml b/bbmri/docker-compose.yml index 8ad8211..07f1a2f 100644 --- a/bbmri/docker-compose.yml +++ b/bbmri/docker-compose.yml @@ -50,7 +50,7 @@ services: - "forward_proxy" volumes: - /etc/bridgehead/trusted-ca-certs:/conf/trusted-ca-certs:ro - - ./root.crt.pem:/conf/root.crt.pem:ro + - /srv/docker/bridgehead/bbmri/root.crt.pem:/conf/root.crt.pem:ro volumes: blaze-data: diff --git a/ccp/docker-compose.yml b/ccp/docker-compose.yml index 7b7e129..786acc9 100644 --- a/ccp/docker-compose.yml +++ b/ccp/docker-compose.yml @@ -52,7 +52,7 @@ services: - "forward_proxy" volumes: - /etc/bridgehead/trusted-ca-certs:/conf/trusted-ca-certs:ro - - ./root.crt.pem:/conf/root.crt.pem:ro + - /srv/docker/bridgehead/ccp/root.crt.pem:/conf/root.crt.pem:ro volumes: From 3dec0a7178634d8bd9b38f616b18c5e163bde407 Mon Sep 17 00:00:00 2001 From: Patrick Skowronek Date: Fri, 30 Jun 2023 13:31:11 +0200 Subject: [PATCH 08/26] Remove EXLIQUID --- ccp/exliquid-compose.yml | 34 ---------------------------------- ccp/exliquid-setup.sh | 19 ------------------- ccp/vars | 4 ---- 3 files changed, 57 deletions(-) delete mode 100644 ccp/exliquid-compose.yml delete mode 100644 ccp/exliquid-setup.sh diff --git a/ccp/exliquid-compose.yml b/ccp/exliquid-compose.yml deleted file mode 100644 index becf99a..0000000 --- a/ccp/exliquid-compose.yml +++ /dev/null @@ -1,34 +0,0 @@ -version: "3.7" - -services: - exliquid-task-store: - image: docker.verbis.dkfz.de/cache/samply/blaze:0.20 - container_name: bridgehead-exliquid-task-store - environment: - BASE_URL: "http://bridgehead-exliquid-task-store:8080" - JAVA_TOOL_OPTIONS: "-Xmx1g" - volumes: - - "exliquid-task-store-data:/app/data" - labels: - - "traefik.enable=false" - - exliquid-report-hub: - image: docker.verbis.dkfz.de/cache/samply/report-hub:latest - container_name: bridgehead-exliquid-report-hub - environment: - SPRING_WEBFLUX_BASE_PATH: "/exliquid" - JAVA_TOOL_OPTIONS: "-Xmx1g" - APP_BEAM_APPID: "report-hub.${PROXY_ID}" - APP_BEAM_SECRET: ${REPORTHUB_BEAM_SECRET_SHORT} - APP_BEAM_PROXY_BASEURL: http://beam-proxy:8081 - APP_TASKSTORE_BASEURL: "http://bridgehead-exliquid-task-store:8080/fhir" - APP_DATASTORE_BASEURL: http://bridgehead-ccp-blaze:8080/fhir - restart: always - labels: - - "traefik.enable=true" - - "traefik.http.routers.report-ccp.rule=PathPrefix(`/exliquid`)" - - "traefik.http.services.report-ccp.loadbalancer.server.port=8080" - - "traefik.http.routers.report-ccp.tls=true" - -volumes: - exliquid-task-store-data: \ No newline at end of file diff --git a/ccp/exliquid-setup.sh b/ccp/exliquid-setup.sh deleted file mode 100644 index 353bac8..0000000 --- a/ccp/exliquid-setup.sh +++ /dev/null @@ -1,19 +0,0 @@ -#!/bin/bash - -function exliquidSetup() { - case ${SITE_ID} in - berlin|dresden|essen|frankfurt|luebeck|mainz|muenchen-lmu|muenchen-tum|mannheim|tuebingen) - EXLIQUID=1 - ;; - dktk-test) - EXLIQUID=1 - ;; - *) - EXLIQUID=0 - ;; - esac - if [[ $EXLIQUID -eq 1 ]]; then - log INFO "EXLIQUID setup detected -- will start Report-Hub." - OVERRIDE+=" -f ./$PROJECT/exliquid-compose.yml" - fi -} \ No newline at end of file diff --git a/ccp/vars b/ccp/vars index 412abf7..aee87b1 100644 --- a/ccp/vars +++ b/ccp/vars @@ -3,8 +3,6 @@ BROKER_URL=https://${BROKER_ID} PROXY_ID=${SITE_ID}.${BROKER_ID} FOCUS_BEAM_SECRET_SHORT="$(cat /proc/sys/kernel/random/uuid | sed 's/[-]//g' | head -c 20)" FOCUS_RETRY_COUNT=32 -REPORTHUB_BEAM_SECRET_SHORT="$(cat /proc/sys/kernel/random/uuid | sed 's/[-]//g' | head -c 20)" -REPORTHUB_BEAM_SECRET_LONG="ApiKey report-hub.${PROXY_ID} ${REPORTHUB_BEAM_SECRET_SHORT}" SUPPORT_EMAIL=support-ccp@dkfz-heidelberg.de PRIVATEKEYFILENAME=/etc/bridgehead/pki/${SITE_ID}.priv.pem @@ -15,8 +13,6 @@ idManagementSetup source $PROJECT/nngm-setup.sh nngmSetup -source $PROJECT/exliquid-setup.sh -exliquidSetup mtbaSetup for module in $PROJECT/modules/*.sh From 11db7e2be929697366d5ced52180d1f45030301a Mon Sep 17 00:00:00 2001 From: Patrick Skowronek Date: Fri, 30 Jun 2023 13:36:42 +0200 Subject: [PATCH 09/26] Remove ref to report-hub --- ccp/docker-compose.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/ccp/docker-compose.yml b/ccp/docker-compose.yml index 786acc9..1e5be26 100644 --- a/ccp/docker-compose.yml +++ b/ccp/docker-compose.yml @@ -41,7 +41,6 @@ services: BROKER_URL: ${BROKER_URL} PROXY_ID: ${PROXY_ID} APP_focus_KEY: ${FOCUS_BEAM_SECRET_SHORT} - APP_report-hub_KEY: ${REPORTHUB_BEAM_SECRET_SHORT} PRIVKEY_FILE: /run/secrets/proxy.pem ALL_PROXY: http://forward_proxy:3128 TLS_CA_CERTIFICATES_DIR: /conf/trusted-ca-certs From 3a4c7b2ecef15226eff463533e7f15beac6919f9 Mon Sep 17 00:00:00 2001 From: janskiba Date: Wed, 26 Jul 2023 12:26:37 +0000 Subject: [PATCH 10/26] dont require beam enroll to run interactively --- bridgehead | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bridgehead b/bridgehead index 2709f8c..e69c282 100755 --- a/bridgehead +++ b/bridgehead @@ -120,7 +120,7 @@ case "$ACTION" in EMAIL_PARAM="--admin-email $SUPPORT_EMAIL" fi - docker run --rm -ti -v /etc/bridgehead/pki:/etc/bridgehead/pki samply/beam-enroll:latest --output-file $PRIVATEKEYFILENAME --proxy-id $MANUAL_PROXY_ID $EMAIL_PARAM + docker run --rm -v /etc/bridgehead/pki:/etc/bridgehead/pki samply/beam-enroll:latest --output-file $PRIVATEKEYFILENAME --proxy-id $MANUAL_PROXY_ID $EMAIL_PARAM chmod 600 $PRIVATEKEYFILENAME ;; preRun | preUpdate) From 6ad91edefb25c95abfab6aae55446c9e0b466cfe Mon Sep 17 00:00:00 2001 From: Martin Lablans <6804500+lablans@users.noreply.github.com> Date: Thu, 27 Jul 2023 09:37:19 +0200 Subject: [PATCH 11/26] Don't run Blaze in debug mode --- ccp/docker-compose.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/ccp/docker-compose.yml b/ccp/docker-compose.yml index 1e5be26..5a0db06 100644 --- a/ccp/docker-compose.yml +++ b/ccp/docker-compose.yml @@ -7,7 +7,6 @@ services: environment: BASE_URL: "http://bridgehead-ccp-blaze:8080" JAVA_TOOL_OPTIONS: "-Xmx4g" - LOG_LEVEL: "debug" ENFORCE_REFERENTIAL_INTEGRITY: "false" volumes: - "blaze-data:/app/data" From 788e4ea9f76c936c1a79cf9afd06d015da144f37 Mon Sep 17 00:00:00 2001 From: "p.delpy@dkfz-heidelberg.de" Date: Tue, 25 Jul 2023 14:08:54 +0200 Subject: [PATCH 12/26] add generic bash function addBasicAuthUser --- bridgehead | 4 ++++ ccp/nngm-compose.yml | 7 ++++++- lib/functions.sh | 24 ++++++++++++++++++++++++ lib/install-bridgehead.sh | 2 +- lib/sitespecific-functions.sh | 7 +++++++ 5 files changed, 42 insertions(+), 2 deletions(-) create mode 100644 lib/sitespecific-functions.sh diff --git a/bridgehead b/bridgehead index 2709f8c..1a88973 100755 --- a/bridgehead +++ b/bridgehead @@ -103,6 +103,10 @@ case "$ACTION" in uninstall) exec ./lib/uninstall-bridgehead.sh $PROJECT ;; + addUser) + loadVars + exec ./lib/sitespecific-functions.sh $PROJECT + ;; enroll) loadVars diff --git a/ccp/nngm-compose.yml b/ccp/nngm-compose.yml index 47bfa70..18be977 100644 --- a/ccp/nngm-compose.yml +++ b/ccp/nngm-compose.yml @@ -18,7 +18,12 @@ services: - "traefik.http.middlewares.connector_strip.stripprefix.prefixes=/nngm-connector" - "traefik.http.services.connector.loadbalancer.server.port=8080" - "traefik.http.routers.connector.tls=true" - - "traefik.http.routers.connector.middlewares=connector_strip,auth" + - "traefik.http.routers.connector.middlewares=connector_strip,auth-nngm" volumes: - nngm-rest:/var/log + traefik: + labels: + - "traefik.http.middlewares.auth-nngm.basicauth.users=$NNGM_AUTH" + + diff --git a/lib/functions.sh b/lib/functions.sh index a243842..cd73186 100644 --- a/lib/functions.sh +++ b/lib/functions.sh @@ -183,3 +183,27 @@ function bk_is_running { ##Setting Network properties # currently not needed #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}'); +addBasicAuthUser() { + USER="${1}" + PASSWORD="${2}" + NAME="${3}" + PROJECT="${4}" + FILE="/etc/bridgehead/${PROJECT}.local.conf" + ENCRY_CREDENTIALS="$(docker run --rm docker.verbis.dkfz.de/cache/httpd:alpine htpasswd -nb $USER $PASSWORD | tr -d '\n' | tr -d '\r')" + if [ -f $FILE ] && grep -R -q "$NAME=" $FILE # if a basic auth user already exists: + then + sed -i "/$NAME/ s/$/,$ENCRY_CREDENTIALS/" $FILE + else + echo -e "\n## Basic Authentication Credentials for:\n$NAME=$ENCRY_CREDENTIALS" >> $FILE; + fi + read -p "Do you want to have your cleartext credentials saved in your $FILE: [y/n]" yn + case $yn in + [yYjJ] ) + echo "ok, variables are saved in $FILE" + echo -e "# User: $USER\n# Password: $PASSWORD" >> $FILE; + ;; + [nN] ) + echo "skip saving cleartext LDM credentials; make sure to save them somewhere else" + ;; + esac +} \ No newline at end of file diff --git a/lib/install-bridgehead.sh b/lib/install-bridgehead.sh index c42119f..906e4a1 100755 --- a/lib/install-bridgehead.sh +++ b/lib/install-bridgehead.sh @@ -34,7 +34,7 @@ if [ -z "$LDM_PASSWORD" ]; then generated_passwd="$(cat /proc/sys/kernel/random/uuid | sed 's/[-]//g' | head -c 32)" log "INFO" "Your generated credentials are:\n user: $PROJECT\n password: $generated_passwd" - echo -e "## Local Data Management Basic Authentication\n# User: $PROJECT\nLDM_PASSWORD=$generated_passwd" >> /etc/bridgehead/${PROJECT}.local.conf; + addBasicAuthUser $PROJECT $generated_passwd "LDM_LOGIN" $PROJECT fi log "INFO" "Registering system units for bridgehead and bridgehead-update" diff --git a/lib/sitespecific-functions.sh b/lib/sitespecific-functions.sh new file mode 100644 index 0000000..55c3142 --- /dev/null +++ b/lib/sitespecific-functions.sh @@ -0,0 +1,7 @@ +#!/bin/bash -e +source lib/functions.sh +PROJECT="ccp" +log "INFO" "Adding custom encrypted credentials in /etc/bridgehead/$PROJECT.local.conf" +read -p "Please enter custom user: " user +read -s -p "Please enter password (will not be echoed): "$'\n' password +addBasicAuthUser $user $password "NNGM_AUTH" $PROJECT \ No newline at end of file From dc0fc286b1fb356293934f30b90e4983e6b6974c Mon Sep 17 00:00:00 2001 From: "p.delpy@dkfz-heidelberg.de" Date: Thu, 27 Jul 2023 15:38:29 +0200 Subject: [PATCH 13/26] add generic bash function addBasicAuthUser --- bridgehead | 1 - ccp/nngm-compose.yml | 2 +- ccp/nngm-setup.sh | 4 ---- lib/functions.sh | 32 +++++++++----------------------- lib/install-bridgehead.sh | 12 ++++++++---- lib/sitespecific-functions.sh | 14 +++++++++----- minimal/docker-compose.yml | 2 +- 7 files changed, 28 insertions(+), 39 deletions(-) mode change 100644 => 100755 lib/sitespecific-functions.sh diff --git a/bridgehead b/bridgehead index 1a88973..5319620 100755 --- a/bridgehead +++ b/bridgehead @@ -73,7 +73,6 @@ case "$ACTION" in hc_send log "Bridgehead $PROJECT startup: Checking requirements ..." checkRequirements hc_send log "Bridgehead $PROJECT startup: Requirements checked out. Now starting bridgehead ..." - export LDM_LOGIN=$(getLdmPassword) exec $COMPOSE -p $PROJECT -f ./minimal/docker-compose.yml -f ./$PROJECT/docker-compose.yml $OVERRIDE up --abort-on-container-exit ;; stop) diff --git a/ccp/nngm-compose.yml b/ccp/nngm-compose.yml index 18be977..e61532d 100644 --- a/ccp/nngm-compose.yml +++ b/ccp/nngm-compose.yml @@ -24,6 +24,6 @@ services: traefik: labels: - - "traefik.http.middlewares.auth-nngm.basicauth.users=$NNGM_AUTH" + - "traefik.http.middlewares.auth-nngm.basicauth.users=${NNGM_AUTH}" diff --git a/ccp/nngm-setup.sh b/ccp/nngm-setup.sh index bcc4cd1..cb9590a 100644 --- a/ccp/nngm-setup.sh +++ b/ccp/nngm-setup.sh @@ -1,8 +1,4 @@ #!/bin/bash -##nNGM vars: -#NNGM_MAGICPL_APIKEY -#NNGM_CTS_APIKEY -#NNGM_CRYPTKEY function nngmSetup() { if [ -n "$NNGM_CTS_APIKEY" ]; then diff --git a/lib/functions.sh b/lib/functions.sh index cd73186..d6c1b85 100644 --- a/lib/functions.sh +++ b/lib/functions.sh @@ -9,14 +9,6 @@ detectCompose() { fi } -getLdmPassword() { - if [ -n "$LDM_PASSWORD" ]; then - docker run --rm docker.verbis.dkfz.de/cache/httpd:alpine htpasswd -nb $PROJECT $LDM_PASSWORD | tr -d '\n' | tr -d '\r' - else - echo -n "" - fi -} - exitIfNotRoot() { if [ "$EUID" -ne 0 ]; then log "ERROR" "Please run as root" @@ -34,7 +26,7 @@ checkOwner(){ } printUsage() { - echo "Usage: bridgehead start|stop|is-running|update|install|uninstall|enroll PROJECTNAME" + echo "Usage: bridgehead start|stop|is-running|update|install|uninstall|addUser|enroll PROJECTNAME" echo "PROJECTNAME should be one of ccp|bbmri" } @@ -183,27 +175,21 @@ function bk_is_running { ##Setting Network properties # currently not needed #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}'); -addBasicAuthUser() { + + +add_basic_auth_user() { USER="${1}" PASSWORD="${2}" NAME="${3}" PROJECT="${4}" FILE="/etc/bridgehead/${PROJECT}.local.conf" ENCRY_CREDENTIALS="$(docker run --rm docker.verbis.dkfz.de/cache/httpd:alpine htpasswd -nb $USER $PASSWORD | tr -d '\n' | tr -d '\r')" - if [ -f $FILE ] && grep -R -q "$NAME=" $FILE # if a basic auth user already exists: + if [ -f $FILE ] && grep -R -q "$NAME=" $FILE # if a specific basic auth user already exists: then - sed -i "/$NAME/ s/$/,$ENCRY_CREDENTIALS/" $FILE + sed -i "/$NAME/ s|='|='$ENCRY_CREDENTIALS,|" $FILE else - echo -e "\n## Basic Authentication Credentials for:\n$NAME=$ENCRY_CREDENTIALS" >> $FILE; + echo -e "\n## Basic Authentication Credentials for:\n$NAME='$ENCRY_CREDENTIALS'" >> $FILE; fi - read -p "Do you want to have your cleartext credentials saved in your $FILE: [y/n]" yn - case $yn in - [yYjJ] ) - echo "ok, variables are saved in $FILE" - echo -e "# User: $USER\n# Password: $PASSWORD" >> $FILE; - ;; - [nN] ) - echo "skip saving cleartext LDM credentials; make sure to save them somewhere else" - ;; - esac + log DEBUG "Saving clear text credentials in $FILE. If wanted, delete them manually." + sed -i "/^$NAME/ s|$|\n# User: $USER\n# Password: $PASSWORD|" $FILE } \ No newline at end of file diff --git a/lib/install-bridgehead.sh b/lib/install-bridgehead.sh index 906e4a1..d0e9964 100755 --- a/lib/install-bridgehead.sh +++ b/lib/install-bridgehead.sh @@ -29,12 +29,16 @@ bridgehead ALL= NOPASSWD: BRIDGEHEAD${PROJECT^^} EOF # TODO: Determine whether this should be located in setup-bridgehead (triggered through bridgehead install) or in update bridgehead (triggered every hour) -if [ -z "$LDM_PASSWORD" ]; then - log "INFO" "Now generating a password for the local data management. Please save the password for your ETL process!" +if [ -z "$LDM_AUTH" ]; then + log "INFO" "Now generating basic auth for the local data management (see addUser in bridgehead for more information). " generated_passwd="$(cat /proc/sys/kernel/random/uuid | sed 's/[-]//g' | head -c 32)" + add_basic_auth_user $PROJECT $generated_passwd "LDM_AUTH" $PROJECT +fi - log "INFO" "Your generated credentials are:\n user: $PROJECT\n password: $generated_passwd" - addBasicAuthUser $PROJECT $generated_passwd "LDM_LOGIN" $PROJECT +if [ -z "$NNGM_CTS_APIKEY" ] && [ -z "$NNGM_AUTH" ]; then + log "INFO" "Now generating basic auth for nNGM upload API (see addUser in bridgehead for more information). " + generated_passwd="$(cat /proc/sys/kernel/random/uuid | sed 's/[-]//g' | head -c 32)" + add_basic_auth_user "nngm" $generated_passwd "NNGM_AUTH" $PROJECT fi log "INFO" "Registering system units for bridgehead and bridgehead-update" diff --git a/lib/sitespecific-functions.sh b/lib/sitespecific-functions.sh old mode 100644 new mode 100755 index 55c3142..04db02e --- a/lib/sitespecific-functions.sh +++ b/lib/sitespecific-functions.sh @@ -1,7 +1,11 @@ #!/bin/bash -e + source lib/functions.sh -PROJECT="ccp" -log "INFO" "Adding custom encrypted credentials in /etc/bridgehead/$PROJECT.local.conf" -read -p "Please enter custom user: " user -read -s -p "Please enter password (will not be echoed): "$'\n' password -addBasicAuthUser $user $password "NNGM_AUTH" $PROJECT \ No newline at end of file + +PROJECT=$1 + +log "INFO" "Adding encrypted credentials in /etc/bridgehead/$PROJECT.local.conf" +read -p "Please choose the component (LDM_AUTH|NNGM_AUTH) you want to add a user to : " COMPONENT +read -p "Please enter a username: " USER +read -s -p "Please enter a password (will not be echoed): "$'\n' PASSWORD +add_basic_auth_user $USER $PASSWORD $COMPONENT $PROJECT \ No newline at end of file diff --git a/minimal/docker-compose.yml b/minimal/docker-compose.yml index cd4c2e5..055f683 100644 --- a/minimal/docker-compose.yml +++ b/minimal/docker-compose.yml @@ -21,7 +21,7 @@ services: - "traefik.http.routers.dashboard.service=api@internal" - "traefik.http.routers.dashboard.tls=true" - "traefik.http.routers.dashboard.middlewares=auth" - - "traefik.http.middlewares.auth.basicauth.users=${LDM_LOGIN}" + - "traefik.http.middlewares.auth.basicauth.users=${LDM_AUTH}" ports: - 80:80 - 443:443 From 3f43c32bd258f51be769ef645671694eb0aa5dad Mon Sep 17 00:00:00 2001 From: "p.delpy@dkfz-heidelberg.de" Date: Wed, 9 Aug 2023 09:10:20 +0200 Subject: [PATCH 14/26] refactor addUser code --- bridgehead | 6 +++++- lib/sitespecific-functions.sh | 11 ----------- 2 files changed, 5 insertions(+), 12 deletions(-) delete mode 100755 lib/sitespecific-functions.sh diff --git a/bridgehead b/bridgehead index 5319620..37e7e7b 100755 --- a/bridgehead +++ b/bridgehead @@ -104,7 +104,11 @@ case "$ACTION" in ;; addUser) loadVars - exec ./lib/sitespecific-functions.sh $PROJECT + log "INFO" "Adding encrypted credentials in /etc/bridgehead/$PROJECT.local.conf" + read -p "Please choose the component (LDM_AUTH|NNGM_AUTH) you want to add a user to : " COMPONENT + read -p "Please enter a username: " USER + read -s -p "Please enter a password (will not be echoed): "$'\n' PASSWORD + add_basic_auth_user $USER $PASSWORD $COMPONENT $PROJECT ;; enroll) loadVars diff --git a/lib/sitespecific-functions.sh b/lib/sitespecific-functions.sh deleted file mode 100755 index 04db02e..0000000 --- a/lib/sitespecific-functions.sh +++ /dev/null @@ -1,11 +0,0 @@ -#!/bin/bash -e - -source lib/functions.sh - -PROJECT=$1 - -log "INFO" "Adding encrypted credentials in /etc/bridgehead/$PROJECT.local.conf" -read -p "Please choose the component (LDM_AUTH|NNGM_AUTH) you want to add a user to : " COMPONENT -read -p "Please enter a username: " USER -read -s -p "Please enter a password (will not be echoed): "$'\n' PASSWORD -add_basic_auth_user $USER $PASSWORD $COMPONENT $PROJECT \ No newline at end of file From 2c7de6c8b40ad812be93f6daa947e4c7778cdf13 Mon Sep 17 00:00:00 2001 From: Pierre Delpy <75260699+PierreDelpy@users.noreply.github.com> Date: Wed, 9 Aug 2023 09:24:23 +0200 Subject: [PATCH 15/26] refactor strange formatting --- bridgehead | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/bridgehead b/bridgehead index 37e7e7b..4f023fa 100755 --- a/bridgehead +++ b/bridgehead @@ -105,10 +105,10 @@ case "$ACTION" in addUser) loadVars log "INFO" "Adding encrypted credentials in /etc/bridgehead/$PROJECT.local.conf" - read -p "Please choose the component (LDM_AUTH|NNGM_AUTH) you want to add a user to : " COMPONENT - read -p "Please enter a username: " USER - read -s -p "Please enter a password (will not be echoed): "$'\n' PASSWORD - add_basic_auth_user $USER $PASSWORD $COMPONENT $PROJECT + read -p "Please choose the component (LDM_AUTH|NNGM_AUTH) you want to add a user to : " COMPONENT + read -p "Please enter a username: " USER + read -s -p "Please enter a password (will not be echoed): "$'\n' PASSWORD + add_basic_auth_user $USER $PASSWORD $COMPONENT $PROJECT ;; enroll) loadVars From 4754eb282b68d0d60442eec03ab2cb6206251339 Mon Sep 17 00:00:00 2001 From: "p.delpy@dkfz-heidelberg.de" Date: Tue, 15 Aug 2023 13:55:07 +0200 Subject: [PATCH 16/26] add migration for old credentials --- lib/install-bridgehead.sh | 2 +- lib/update-bridgehead.sh | 7 +++++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/lib/install-bridgehead.sh b/lib/install-bridgehead.sh index d0e9964..784020e 100755 --- a/lib/install-bridgehead.sh +++ b/lib/install-bridgehead.sh @@ -35,7 +35,7 @@ if [ -z "$LDM_AUTH" ]; then add_basic_auth_user $PROJECT $generated_passwd "LDM_AUTH" $PROJECT fi -if [ -z "$NNGM_CTS_APIKEY" ] && [ -z "$NNGM_AUTH" ]; then +if [ ! -z "$NNGM_CTS_APIKEY" ] && [ -z "$NNGM_AUTH" ]; then log "INFO" "Now generating basic auth for nNGM upload API (see addUser in bridgehead for more information). " generated_passwd="$(cat /proc/sys/kernel/random/uuid | sed 's/[-]//g' | head -c 32)" add_basic_auth_user "nngm" $generated_passwd "NNGM_AUTH" $PROJECT diff --git a/lib/update-bridgehead.sh b/lib/update-bridgehead.sh index 89db369..0d985f7 100755 --- a/lib/update-bridgehead.sh +++ b/lib/update-bridgehead.sh @@ -139,6 +139,13 @@ else log WARN "Automated backups are disabled (variable AUTO_BACKUPS != \"true\")" fi +if [ ! -z "$LDM_PASSWORD" ]; then + FILE="/etc/bridgehead/$PROJECT.local.conf" + log "INFO" "Migrating LDM_PASSWORD to encrypted credentials in $FILE" + add_basic_auth_user $PROJECT $LDM_PASSWORD "LDM_AUTH" $PROJECT + sed -i "/LDM_PASSWORD/{d;}" $FILE +fi + exit 0 # TODO: Print last commit explicit From b58348328c91c06a102ac323f38df60239d4351b Mon Sep 17 00:00:00 2001 From: "p.delpy@dkfz-heidelberg.de" Date: Tue, 15 Aug 2023 15:34:49 +0200 Subject: [PATCH 17/26] fix nngm migration --- lib/update-bridgehead.sh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/update-bridgehead.sh b/lib/update-bridgehead.sh index 0d985f7..aea043a 100755 --- a/lib/update-bridgehead.sh +++ b/lib/update-bridgehead.sh @@ -139,10 +139,12 @@ else log WARN "Automated backups are disabled (variable AUTO_BACKUPS != \"true\")" fi +#TODO: the following block can be deleted after successful update at all sites if [ ! -z "$LDM_PASSWORD" ]; then FILE="/etc/bridgehead/$PROJECT.local.conf" log "INFO" "Migrating LDM_PASSWORD to encrypted credentials in $FILE" add_basic_auth_user $PROJECT $LDM_PASSWORD "LDM_AUTH" $PROJECT + add_basic_auth_user $PROJECT $LDM_PASSWORD "NNGM_AUTH" $PROJECT sed -i "/LDM_PASSWORD/{d;}" $FILE fi From af25df79e3f97cf6c181e28aea550ebf221934c8 Mon Sep 17 00:00:00 2001 From: "p.delpy@dkfz-heidelberg.de" Date: Tue, 15 Aug 2023 15:42:42 +0200 Subject: [PATCH 18/26] refactor addUser to adduser - lowercase --- bridgehead | 2 +- lib/functions.sh | 2 +- lib/install-bridgehead.sh | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/bridgehead b/bridgehead index 192cc0e..4665f5a 100755 --- a/bridgehead +++ b/bridgehead @@ -102,7 +102,7 @@ case "$ACTION" in uninstall) exec ./lib/uninstall-bridgehead.sh $PROJECT ;; - addUser) + adduser) loadVars log "INFO" "Adding encrypted credentials in /etc/bridgehead/$PROJECT.local.conf" read -p "Please choose the component (LDM_AUTH|NNGM_AUTH) you want to add a user to : " COMPONENT diff --git a/lib/functions.sh b/lib/functions.sh index 9173e86..ed0478e 100644 --- a/lib/functions.sh +++ b/lib/functions.sh @@ -26,7 +26,7 @@ checkOwner(){ } printUsage() { - echo "Usage: bridgehead start|stop|is-running|update|install|uninstall|addUser|enroll PROJECTNAME" + echo "Usage: bridgehead start|stop|is-running|update|install|uninstall|adduser|enroll PROJECTNAME" echo "PROJECTNAME should be one of ccp|bbmri" } diff --git a/lib/install-bridgehead.sh b/lib/install-bridgehead.sh index 784020e..38c3874 100755 --- a/lib/install-bridgehead.sh +++ b/lib/install-bridgehead.sh @@ -30,13 +30,13 @@ EOF # TODO: Determine whether this should be located in setup-bridgehead (triggered through bridgehead install) or in update bridgehead (triggered every hour) if [ -z "$LDM_AUTH" ]; then - log "INFO" "Now generating basic auth for the local data management (see addUser in bridgehead for more information). " + log "INFO" "Now generating basic auth for the local data management (see adduser in bridgehead for more information). " generated_passwd="$(cat /proc/sys/kernel/random/uuid | sed 's/[-]//g' | head -c 32)" add_basic_auth_user $PROJECT $generated_passwd "LDM_AUTH" $PROJECT fi if [ ! -z "$NNGM_CTS_APIKEY" ] && [ -z "$NNGM_AUTH" ]; then - log "INFO" "Now generating basic auth for nNGM upload API (see addUser in bridgehead for more information). " + log "INFO" "Now generating basic auth for nNGM upload API (see adduser in bridgehead for more information). " generated_passwd="$(cat /proc/sys/kernel/random/uuid | sed 's/[-]//g' | head -c 32)" add_basic_auth_user "nngm" $generated_passwd "NNGM_AUTH" $PROJECT fi From bbda5e917f25b04d436068c3c8e37057725f434d Mon Sep 17 00:00:00 2001 From: Patrick Skowronek Date: Wed, 16 Aug 2023 09:35:36 +0200 Subject: [PATCH 19/26] Cleanup --- .gitignore | 3 +++ ccp/{ => modules}/mtba-compose.yml | 0 ccp/modules/mtba-setup.sh | 13 +++++++++++++ ccp/{ => modules}/nngm-compose.yml | 0 ccp/modules/nngm-setup.sh | 8 ++++++++ ccp/nngm-setup.sh | 20 -------------------- ccp/vars | 12 ++++-------- 7 files changed, 28 insertions(+), 28 deletions(-) rename ccp/{ => modules}/mtba-compose.yml (100%) create mode 100644 ccp/modules/mtba-setup.sh rename ccp/{ => modules}/nngm-compose.yml (100%) create mode 100644 ccp/modules/nngm-setup.sh delete mode 100644 ccp/nngm-setup.sh diff --git a/.gitignore b/.gitignore index 2c4c7ec..a884b44 100644 --- a/.gitignore +++ b/.gitignore @@ -4,3 +4,6 @@ site-config/* ## Ignore site configuration */docker-compose.override.yml + +## MAC OS +.DS_Store diff --git a/ccp/mtba-compose.yml b/ccp/modules/mtba-compose.yml similarity index 100% rename from ccp/mtba-compose.yml rename to ccp/modules/mtba-compose.yml diff --git a/ccp/modules/mtba-setup.sh b/ccp/modules/mtba-setup.sh new file mode 100644 index 0000000..561e5be --- /dev/null +++ b/ccp/modules/mtba-setup.sh @@ -0,0 +1,13 @@ +#!/bin/bash + +function mtbaSetup() { + # TODO: Check if ID-Management Module is activated! + if [ -n "$ENABLE_MTBA" ];then + log INFO "MTBA setup detected -- will start MTBA Service and CBioPortal." + if [ ! -n "$IDMANAGER_UPLOAD_APIKEY" ]; then + log ERROR "Detected MTBA Module configuration but ID-Management Module seems not to be configured!" + exit 1; + fi + OVERRIDE+=" -f ./$PROJECT/mtba-compose.yml" + fi +} \ No newline at end of file diff --git a/ccp/nngm-compose.yml b/ccp/modules/nngm-compose.yml similarity index 100% rename from ccp/nngm-compose.yml rename to ccp/modules/nngm-compose.yml diff --git a/ccp/modules/nngm-setup.sh b/ccp/modules/nngm-setup.sh new file mode 100644 index 0000000..3e31f59 --- /dev/null +++ b/ccp/modules/nngm-setup.sh @@ -0,0 +1,8 @@ +#!/bin/bash + +function nngmSetup() { + if [ -n "$NNGM_CTS_APIKEY" ]; then + log INFO "nNGM setup detected -- will start nNGM Connector." + OVERRIDE+=" -f ./$PROJECT/modules/nngm-compose.yml" + fi + } diff --git a/ccp/nngm-setup.sh b/ccp/nngm-setup.sh deleted file mode 100644 index f9f1e70..0000000 --- a/ccp/nngm-setup.sh +++ /dev/null @@ -1,20 +0,0 @@ -#!/bin/bash - -function nngmSetup() { - if [ -n "$NNGM_CTS_APIKEY" ]; then - log INFO "nNGM setup detected -- will start nNGM Connector." - OVERRIDE+=" -f ./$PROJECT/nngm-compose.yml" - fi - } - -function mtbaSetup() { - # TODO: Check if ID-Management Module is activated! - if [ -n "$ENABLE_MTBA" ];then - log INFO "MTBA setup detected -- will start MTBA Service and CBioPortal." -# if [ ! -n "$IDMANAGER_UPLOAD_APIKEY" ]; then -# log ERROR "Detected MTBA Module configuration but ID-Management Module seems not to be configured!" -# exit 1; -# fi - OVERRIDE+=" -f ./$PROJECT/mtba-compose.yml" - fi -} diff --git a/ccp/vars b/ccp/vars index 161b04e..0c80e8a 100644 --- a/ccp/vars +++ b/ccp/vars @@ -8,17 +8,13 @@ PRIVATEKEYFILENAME=/etc/bridgehead/pki/${SITE_ID}.priv.pem BROKER_URL_FOR_PREREQ=$BROKER_URL -# This will load id-management setup. Effective only if id-management configuration is defined. -source $PROJECT/modules/id-management-setup.sh -idManagementSetup -# This will load nngm setup. Effective only if nngm configuration is defined. -source $PROJECT/nngm-setup.sh -nngmSetup - -mtbaSetup for module in $PROJECT/modules/*.sh do log DEBUG "sourcing $module" source $module done + +idManagementSetup +nngmSetup +mtbaSetup \ No newline at end of file From fa973e2cfa73d417cee79ed3c19aa018f1642cd2 Mon Sep 17 00:00:00 2001 From: Patrick Skowronek Date: Wed, 16 Aug 2023 09:37:30 +0200 Subject: [PATCH 20/26] fix: path in mtba setup --- ccp/modules/mtba-setup.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ccp/modules/mtba-setup.sh b/ccp/modules/mtba-setup.sh index 561e5be..c0834b9 100644 --- a/ccp/modules/mtba-setup.sh +++ b/ccp/modules/mtba-setup.sh @@ -8,6 +8,6 @@ function mtbaSetup() { log ERROR "Detected MTBA Module configuration but ID-Management Module seems not to be configured!" exit 1; fi - OVERRIDE+=" -f ./$PROJECT/mtba-compose.yml" + OVERRIDE+=" -f ./$PROJECT/modules/mtba-compose.yml" fi } \ No newline at end of file From 6cfa7453855589d8719ec711127df929fae02703 Mon Sep 17 00:00:00 2001 From: janskiba Date: Thu, 17 Aug 2023 11:21:20 +0000 Subject: [PATCH 21/26] Remove -it from docker run --- lib/functions.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/functions.sh b/lib/functions.sh index ed0478e..97b75f8 100644 --- a/lib/functions.sh +++ b/lib/functions.sh @@ -188,7 +188,7 @@ function do_enroll_inner { PARAMS+="--admin-email $SUPPORT_EMAIL" fi - docker run --rm -ti -v /etc/bridgehead/pki:/etc/bridgehead/pki samply/beam-enroll:latest --output-file $PRIVATEKEYFILENAME --proxy-id $MANUAL_PROXY_ID $PARAMS + docker run --rm -v /etc/bridgehead/pki:/etc/bridgehead/pki samply/beam-enroll:latest --output-file $PRIVATEKEYFILENAME --proxy-id $MANUAL_PROXY_ID $PARAMS chmod 600 $PRIVATEKEYFILENAME } @@ -211,4 +211,4 @@ add_basic_auth_user() { fi log DEBUG "Saving clear text credentials in $FILE. If wanted, delete them manually." sed -i "/^$NAME/ s|$|\n# User: $USER\n# Password: $PASSWORD|" $FILE -} \ No newline at end of file +} From bba8a03f9f376f46f0e8cfea4f06d0c7035690c1 Mon Sep 17 00:00:00 2001 From: Tobias Kussel Date: Thu, 24 Aug 2023 12:22:43 +0000 Subject: [PATCH 22/26] Use beam-connect:develop for DNPM --- bbmri/modules/dnpm-compose.yml | 3 ++- ccp/modules/dnpm-compose.yml | 3 ++- minimal/modules/dnpm-compose.yml | 3 ++- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/bbmri/modules/dnpm-compose.yml b/bbmri/modules/dnpm-compose.yml index d7a253e..ce0e5de 100644 --- a/bbmri/modules/dnpm-compose.yml +++ b/bbmri/modules/dnpm-compose.yml @@ -22,7 +22,7 @@ services: dnpm-beam-connect: depends_on: [ dnpm-beam-proxy ] - image: docker.verbis.dkfz.de/cache/samply/beam-connect:dnpm + image: docker.verbis.dkfz.de/cache/samply/beam-connect:develop container_name: bridgehead-dnpm-beam-connect environment: PROXY_URL: http://dnpm-beam-proxy:8081 @@ -34,6 +34,7 @@ services: HTTPS_PROXY: http://forward_proxy:3128 NO_PROXY: dnpm-beam-proxy,dnpm-backend RUST_LOG: ${RUST_LOG:-info} + NO_AUTH: true volumes: - /etc/bridgehead/dnpm/local_targets.json:/conf/connect_targets.json:ro - /etc/bridgehead/dnpm/central_targets.json:/conf/central_targets.json:ro diff --git a/ccp/modules/dnpm-compose.yml b/ccp/modules/dnpm-compose.yml index 336ae1c..720267b 100644 --- a/ccp/modules/dnpm-compose.yml +++ b/ccp/modules/dnpm-compose.yml @@ -6,7 +6,7 @@ services: APP_dnpm-connect_KEY: ${DNPM_BEAM_SECRET_SHORT} dnpm-beam-connect: depends_on: [ beam-proxy ] - image: docker.verbis.dkfz.de/cache/samply/beam-connect:dnpm + image: docker.verbis.dkfz.de/cache/samply/beam-connect:develop container_name: bridgehead-dnpm-beam-connect environment: PROXY_URL: http://beam-proxy:8081 @@ -18,6 +18,7 @@ services: HTTPS_PROXY: "http://forward_proxy:3128" NO_PROXY: beam-proxy,dnpm-backend RUST_LOG: ${RUST_LOG:-info} + NO_AUTH: true volumes: - /etc/bridgehead/dnpm/local_targets.json:/conf/connect_targets.json:ro - /etc/bridgehead/dnpm/central_targets.json:/conf/central_targets.json:ro diff --git a/minimal/modules/dnpm-compose.yml b/minimal/modules/dnpm-compose.yml index 549ed91..34796a2 100644 --- a/minimal/modules/dnpm-compose.yml +++ b/minimal/modules/dnpm-compose.yml @@ -22,7 +22,7 @@ services: dnpm-beam-connect: depends_on: [ dnpm-beam-proxy ] - image: docker.verbis.dkfz.de/cache/samply/beam-connect:dnpm + image: docker.verbis.dkfz.de/cache/samply/beam-connect:develop container_name: bridgehead-dnpm-beam-connect environment: PROXY_URL: http://dnpm-beam-proxy:8081 @@ -34,6 +34,7 @@ services: HTTPS_PROXY: http://forward_proxy:3128 NO_PROXY: dnpm-beam-proxy,dnpm-backend RUST_LOG: ${RUST_LOG:-info} + NO_AUTH: true volumes: - /etc/bridgehead/dnpm/local_targets.json:/conf/connect_targets.json:ro - /etc/bridgehead/dnpm/central_targets.json:/conf/central_targets.json:ro From eeba6bce39ed9f32b96e20a427a539d26921933b Mon Sep 17 00:00:00 2001 From: Croft Date: Mon, 28 Aug 2023 10:15:19 +0200 Subject: [PATCH 23/26] Added info about git and Docker proxy to documenation. --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index 99f1157..5c02d66 100644 --- a/README.md +++ b/README.md @@ -56,6 +56,8 @@ We recommend to install Docker(-compose) from its official sources as described Note for Ubuntu: Please note that snap versions of Docker are not supported. +Note for git and Docker: if you have a local proxy, you will need to adjust your setup appropriately, see [git proxy](https://gist.github.com/evantoli/f8c23a37eb3558ab8765) and [https://docs.docker.com/network/proxy/](docker proxy). + ### Network A running Bridgehead requires an outgoing HTTPS proxy to communicate with the central components. From 66deff38a27c8319d38d4680af8d4a63500cc7a0 Mon Sep 17 00:00:00 2001 From: Croft Date: Mon, 28 Aug 2023 10:24:18 +0200 Subject: [PATCH 24/26] Corrected Docker link --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 5c02d66..6f95739 100644 --- a/README.md +++ b/README.md @@ -56,7 +56,7 @@ We recommend to install Docker(-compose) from its official sources as described Note for Ubuntu: Please note that snap versions of Docker are not supported. -Note for git and Docker: if you have a local proxy, you will need to adjust your setup appropriately, see [git proxy](https://gist.github.com/evantoli/f8c23a37eb3558ab8765) and [https://docs.docker.com/network/proxy/](docker proxy). +Note for git and Docker: if you have a local proxy, you will need to adjust your setup appropriately, see [git proxy](https://gist.github.com/evantoli/f8c23a37eb3558ab8765) and [docker proxy](https://docs.docker.com/network/proxy/). ### Network From 169ce2436fc5fdaf6a5d4ea25e45ce86ac27f3ae Mon Sep 17 00:00:00 2001 From: Tobias Kussel Date: Mon, 28 Aug 2023 17:21:52 +0000 Subject: [PATCH 25/26] fix dnpm connect env, from bool to string --- bbmri/modules/dnpm-compose.yml | 2 +- ccp/modules/dnpm-compose.yml | 2 +- minimal/modules/dnpm-compose.yml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/bbmri/modules/dnpm-compose.yml b/bbmri/modules/dnpm-compose.yml index ce0e5de..90f0c07 100644 --- a/bbmri/modules/dnpm-compose.yml +++ b/bbmri/modules/dnpm-compose.yml @@ -34,7 +34,7 @@ services: HTTPS_PROXY: http://forward_proxy:3128 NO_PROXY: dnpm-beam-proxy,dnpm-backend RUST_LOG: ${RUST_LOG:-info} - NO_AUTH: true + NO_AUTH: "true" volumes: - /etc/bridgehead/dnpm/local_targets.json:/conf/connect_targets.json:ro - /etc/bridgehead/dnpm/central_targets.json:/conf/central_targets.json:ro diff --git a/ccp/modules/dnpm-compose.yml b/ccp/modules/dnpm-compose.yml index 720267b..87f2744 100644 --- a/ccp/modules/dnpm-compose.yml +++ b/ccp/modules/dnpm-compose.yml @@ -18,7 +18,7 @@ services: HTTPS_PROXY: "http://forward_proxy:3128" NO_PROXY: beam-proxy,dnpm-backend RUST_LOG: ${RUST_LOG:-info} - NO_AUTH: true + NO_AUTH: "true" volumes: - /etc/bridgehead/dnpm/local_targets.json:/conf/connect_targets.json:ro - /etc/bridgehead/dnpm/central_targets.json:/conf/central_targets.json:ro diff --git a/minimal/modules/dnpm-compose.yml b/minimal/modules/dnpm-compose.yml index 34796a2..adf04a4 100644 --- a/minimal/modules/dnpm-compose.yml +++ b/minimal/modules/dnpm-compose.yml @@ -34,7 +34,7 @@ services: HTTPS_PROXY: http://forward_proxy:3128 NO_PROXY: dnpm-beam-proxy,dnpm-backend RUST_LOG: ${RUST_LOG:-info} - NO_AUTH: true + NO_AUTH: "true" volumes: - /etc/bridgehead/dnpm/local_targets.json:/conf/connect_targets.json:ro - /etc/bridgehead/dnpm/central_targets.json:/conf/central_targets.json:ro From dddbf0efd013ad87d3ad712e6095c926eaf2a218 Mon Sep 17 00:00:00 2001 From: Croft Date: Tue, 29 Aug 2023 10:41:25 +0200 Subject: [PATCH 26/26] Zdenkas updates for Directory and Collection usage This updates documentatin only. --- README.md | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 6f95739..6059c3d 100644 --- a/README.md +++ b/README.md @@ -249,28 +249,29 @@ All of the Bridgehead's outgoing connections are secured by transport encryption Your Bridgehead's actual data is not stored in the above directories, but in named docker volumes, see `docker volume ls` and `docker volume inspect `. -### BBMRI-ERIC Directory +### BBMRI-ERIC Directory entry needed -If you run a biobank, you should register with the [Directory](https://directory.bbmri-eric.eu), a BBMRI-ERIC project that catalogs biobanks. +If you run a biobank, you should be listed together with your collections with in the [Directory](https://directory.bbmri-eric.eu), a BBMRI-ERIC project that catalogs biobanks. To do this, contact the BBMRI-ERIC national node for the country where your biobank is based, see [the list of nodes](http://www.bbmri-eric.eu/national-nodes/). -Once you have registered, **you should choose one of your sample collections as a default collection for your biobank**. This is the collection that will be automatically used to label any samples that have not been assigned a collection ID in your ETL process. Make a note of this ID, you will need it later on in the installation process. +Once you have added your biobank to the Directory you got persistent identifier (PID) for your biobank and unique identifiers (IDs) for your collections. The collection IDs are necessary for the biospecimens assigning to the collections and later in the data flows between BBMRI-ERIC tools. In case you cannot distribute all your biospecimens within collections via assigning the collection IDs, **you should choose one of your sample collections as a default collection for your biobank**. This collection will be automatically used to label any samples that have not been assigned a collection ID in your ETL process. Make a note of this default collection ID, you will need it later on in the installation process. -The Bridgehead's **Directory Sync** is an optional feature that keeps the Directory up to date with your local data, e.g. number of samples. Conversely, it also updates the local FHIR store with the latest contact details etc. from the Directory. You must explicitly set your country specific directory url, username and password to enable this feature. +### Directory sync tool + +The Bridgehead's **Directory Sync** is an optional feature that keeps the Directory up to date with your local data, e.g. number of samples. Conversely, it also updates the local FHIR store with the latest contact details etc. from the Directory. You must explicitly set your country specific directory URL, username and password to enable this feature. Full details can be found in [directory_sync_service](https://github.com/samply/directory_sync_service). To enable it, you will need to set these variables to the ```bbmri.conf``` file of your GitLab repository. Here is an example config: ``` -### Directory sync service DS_DIRECTORY_URL=https://directory.bbmri-eric.eu DS_DIRECTORY_USER_NAME=your_directory_username DS_DIRECTORY_USER_PASS=qwdnqwswdvqHBVGFR9887 DS_TIMER_CRON="0 22 * * *" ``` -You must contact the Directory for your national node to find the URL, and to register as a user. +You must contact the Directory team for your national node to find the URL, and to register as a user. Additionally, you should choose when you want Directory sync to run. In the example above, this is set to happen at 10 pm every evening. You can modify this to suit your requirements. The timer specification should follow the [cron](https://crontab.guru) convention.