diff --git a/.gitignore b/.gitignore index d6c86b5..2c4c7ec 100644 --- a/.gitignore +++ b/.gitignore @@ -3,10 +3,4 @@ site-config/* ## Ignore site configuration -config/**/* -!config/**/*.default -landing/* -docker-compose.override.yml -site.conf -auth/* -certs/* +*/docker-compose.override.yml diff --git a/bridgehead b/bridgehead index 5c7d121..5548a7d 100755 --- a/bridgehead +++ b/bridgehead @@ -77,6 +77,14 @@ case "$ACTION" in uninstall) exec ./lib/remove-bridgehead-units.sh $PROJECT ;; + enroll) + if [ -e $PRIVATEKEYFILENAME ]; then + echo "Private key already exists at $PRIVATEKEYFILENAME. Please delete first to proceed." + exit 1 + fi + 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 + chmod 600 $PRIVATEKEYFILENAME + ;; preRun | preUpdate) fixPermissions ;; diff --git a/ccp/docker-compose.yml b/ccp/docker-compose.yml index bc8fdf2..cd6baf0 100644 --- a/ccp/docker-compose.yml +++ b/ccp/docker-compose.yml @@ -25,7 +25,7 @@ services: - 80:80 - 443:443 volumes: - - ../certs:/tools/certs:ro + - /etc/bridgehead/traefik-tls:/certs:ro - ../lib/traefik-configuration/:/configuration:ro - /var/run/docker.sock:/var/run/docker.sock:ro diff --git a/ccp/vars b/ccp/vars index 4152fa4..ce12d1a 100644 --- a/ccp/vars +++ b/ccp/vars @@ -5,3 +5,5 @@ SPOT_BEAM_SECRET_SHORT="$(cat /proc/sys/kernel/random/uuid | sed 's/[-]//g' | he SPOT_BEAM_SECRET_LONG="ApiKey spot.${PROXY_ID} ${SPOT_BEAM_SECRET_SHORT}" 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 diff --git a/lib/functions.sh b/lib/functions.sh index ded0cd9..5059829 100755 --- a/lib/functions.sh +++ b/lib/functions.sh @@ -19,7 +19,7 @@ checkOwner(){ } printUsage() { - echo "Usage: bridgehead start|stop|update|install|uninstall PROJECTNAME" + echo "Usage: bridgehead start|stop|update|install|uninstall|enroll PROJECTNAME" echo "PROJECTNAME should be one of ccp|nngm|gbn" } diff --git a/lib/generate.sh b/lib/generate.sh deleted file mode 100755 index 9673055..0000000 --- a/lib/generate.sh +++ /dev/null @@ -1,116 +0,0 @@ -#!/bin/bash - -if [ ! -d ./landing ] -then - mkdir landing -fi - -if [ ! -f ./landing/index.html ] -then - touch index.html -fi - -CENTRAL_SERVICES=" - CCP-IT - Monitoring Service - " - -LOCAL_SERVICES=" - Bridgehead - Reverse Proxy Traefik - " - -if [ "$project" = "dktk" ] || [ "$project" = "c4" ] || [ "$project" = "dktk-fed" ] -then - CENTRAL_SERVICES+=" - CCP-IT - Zentrale Patientenliste - - - CCP-IT - Dezentrale Suche - - - CCP-IT - Zentrale Suche - - - CCP-IT - Deployment-Server - - - CCP-IT - Zentraler Kontrollnummernerzeuger - - " -fi - -if [ "$project" = "dktk-fed" ] -then - LOCAL_SERVICES+=" - DKTK - Blaze - - " -fi - -cat > ./landing/index.html < - - - - - - Bridgehead Overview - - - - - - - - - -