mirror of
https://github.com/samply/bridgehead.git
synced 2025-06-16 20:40:15 +02:00
Compare commits
5 Commits
documentat
...
feature/co
Author | SHA1 | Date | |
---|---|---|---|
7837d3b542 | |||
d832cfdd43 | |||
4537617cd0 | |||
6fa587fe4f | |||
48d9a034c7 |
84
README.md
84
README.md
@ -22,7 +22,6 @@ This repository is the starting point for any information and tools you will nee
|
|||||||
- [TLS terminating proxies](#tls-terminating-proxies)
|
- [TLS terminating proxies](#tls-terminating-proxies)
|
||||||
- [File structure](#file-structure)
|
- [File structure](#file-structure)
|
||||||
- [BBMRI-ERIC Directory entry needed](#bbmri-eric-directory-entry-needed)
|
- [BBMRI-ERIC Directory entry needed](#bbmri-eric-directory-entry-needed)
|
||||||
- [Loading data](#loading-data)
|
|
||||||
4. [Things you should know](#things-you-should-know)
|
4. [Things you should know](#things-you-should-know)
|
||||||
- [Auto-Updates](#auto-updates)
|
- [Auto-Updates](#auto-updates)
|
||||||
- [Auto-Backups](#auto-backups)
|
- [Auto-Backups](#auto-backups)
|
||||||
@ -52,41 +51,24 @@ Ensure the following software (or newer) is installed:
|
|||||||
- docker >= 20.10.1
|
- docker >= 20.10.1
|
||||||
- docker-compose >= 2.xx (`docker-compose` and `docker compose` are both supported).
|
- docker-compose >= 2.xx (`docker-compose` and `docker compose` are both supported).
|
||||||
- systemd
|
- systemd
|
||||||
- curl
|
|
||||||
|
|
||||||
We recommend to install Docker(-compose) from its official sources as described on the [Docker website](https://docs.docker.com).
|
We recommend to install Docker(-compose) from its official sources as described on the [Docker website](https://docs.docker.com).
|
||||||
|
|
||||||
> 📝 Note for Ubuntu: Snap versions of Docker are not supported.
|
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 [docker proxy](https://docs.docker.com/network/proxy/).
|
||||||
|
|
||||||
### Network
|
### Network
|
||||||
|
|
||||||
A Bridgehead communicates to all central components via outgoing HTTPS connections.
|
A running Bridgehead requires an outgoing HTTPS proxy to communicate with the central components.
|
||||||
|
|
||||||
Your site might require an outgoing proxy (i.e. HTTPS forward proxy) to connect to external servers; you should discuss this with your local systems administration. In that case, you will need to note down the URL of the proxy. If the proxy requires authentication, you will also need to make a note of its username and password. This information will be used later on during the installation process. TLS terminating proxies are also supported, see [here](#tls-terminating-proxies). Apart from the Bridgehead itself, you may also need to configure the proxy server in [git](https://gist.github.com/evantoli/f8c23a37eb3558ab8765) and [docker](https://docs.docker.com/network/proxy/).
|
Additionally, your site might use its own proxy. You should discuss this with your local systems administration. If a proxy is being used, you will need to note down the URL of the proxy. If it is a secure proxy, then you will also need to make a note of its username and password. This information will be used later on during the installation process.
|
||||||
|
|
||||||
The following URLs need to be accessible (prefix with `https://`):
|
Note that git and Docker may also need to be configured to use this proxy. This is a job for your systems administrators.
|
||||||
* To fetch code and configuration from git repositories
|
|
||||||
* github.com
|
|
||||||
* git.verbis.dkfz.de
|
|
||||||
* To fetch docker images
|
|
||||||
* docker.verbis.dkfz.de
|
|
||||||
* Official Docker, Inc. URLs (subject to change, see [official list](https://docs.docker.com/desktop/all))
|
|
||||||
* hub.docker.com
|
|
||||||
* registry-1.docker.io
|
|
||||||
* production.cloudflare.docker.com
|
|
||||||
* To report bridgeheads operational status
|
|
||||||
* healthchecks.verbis.dkfz.de
|
|
||||||
* only for DKTK/CCP
|
|
||||||
* broker.ccp-it.dktk.dkfz.de
|
|
||||||
* only for BBMRI-ERIC
|
|
||||||
* broker.bbmri.samply.de
|
|
||||||
* gitlab.bbmri-eric.eu
|
|
||||||
* only for German Biobank Node
|
|
||||||
* broker.bbmri.de
|
|
||||||
|
|
||||||
> 📝 This URL list is subject to change. Instead of the individual names, we highly recommend whitelisting wildcard domains: *.dkfz.de, github.com, *.docker.com, *.docker.io, *.samply.de, *.bbmri.de.
|
If there is a site firewall, this needs to be configured so that outgoing calls to the following URLs are allowed: *.dkfz.de, github.com, docker.io, *.docker.io, *.samply.de.
|
||||||
|
|
||||||
> 📝 Ubuntu's pre-installed uncomplicated firewall (ufw) is known to conflict with Docker, more info [here](https://github.com/chaifeng/ufw-docker).
|
Note for Ubuntu: Please note that the uncomplicated firewall (ufw) is known to conflict with Docker [here](https://github.com/chaifeng/ufw-docker).
|
||||||
|
|
||||||
## Deployment
|
## Deployment
|
||||||
|
|
||||||
@ -119,7 +101,7 @@ Mention:
|
|||||||
We will set the repository up for you. We will then send you:
|
We will set the repository up for you. We will then send you:
|
||||||
|
|
||||||
- A Repository Short Name (RSN). Beware: this is distinct from your site name.
|
- A Repository Short Name (RSN). Beware: this is distinct from your site name.
|
||||||
- Repository URL containing the acces token eg. https://BH_Dummy:dummy_token@git.verbis.dkfz.de/<project>-bridgehead-configs/dummy.git
|
- Repository URL containing the acces token eg. https://BH_Dummy:dummy_token@git.verbis.dkfz.de/bbmri-bridgehead-configs/dummy.git
|
||||||
|
|
||||||
During the installation, your Bridgehead will download your site's configuration from GitLab and you can review the details provided to us by email.
|
During the installation, your Bridgehead will download your site's configuration from GitLab and you can review the details provided to us by email.
|
||||||
|
|
||||||
@ -312,32 +294,6 @@ Once you edited the gitlab config, the bridgehead will autoupdate the config wit
|
|||||||
|
|
||||||
There will be a delay before the effects of Directory sync become visible. First, you will need to wait until the time you have specified in ```TIMER_CRON```. Second, the information will then be synchronized from your national node with the central European Directory. This can take up to 24 hours.
|
There will be a delay before the effects of Directory sync become visible. First, you will need to wait until the time you have specified in ```TIMER_CRON```. Second, the information will then be synchronized from your national node with the central European Directory. This can take up to 24 hours.
|
||||||
|
|
||||||
### Loading data
|
|
||||||
|
|
||||||
The data accessed by the federated search is held in the Bridgehead in a FHIR store (we use Blaze).
|
|
||||||
|
|
||||||
You can load data into this store by using its FHIR API:
|
|
||||||
|
|
||||||
```
|
|
||||||
https://<Name of your server>/bbmri-localdatamanagement/fhir
|
|
||||||
```
|
|
||||||
The name of your server will generally be the full name of the VM that the Bridgehead runs on. You can alternatively supply an IP address.
|
|
||||||
|
|
||||||
The FHIR API uses basic auth. You can find the credentials in `/etc/bridgehead/<project>.local.conf`.
|
|
||||||
|
|
||||||
Note that if you don't have a DNS certificate for the Bridgehead, you will need to allow an insecure connection. E.g. with curl, use the `-k` flag.
|
|
||||||
|
|
||||||
The storage space on your hard drive will depend on the number of FHIR resources that you intend to generate. This will be the sum of the number of patients/subjects, the number of samples, the number of conditions/diseases and the number of observations. As a general rule of thumb, you can assume that each resource will consume about 2 kilobytes of disk space.
|
|
||||||
|
|
||||||
For more information on Blaze performance, please refer to [import performance](https://github.com/samply/blaze/blob/master/docs/performance/import.md).
|
|
||||||
|
|
||||||
#### ETL for BBMRI and GBA
|
|
||||||
|
|
||||||
Normally, you will need to build your own ETL to feed the Bridgehead. However, there is one case where a short cut might be available:
|
|
||||||
- If you are using CentraXX as a BIMS and you have a FHIR-Export License, then you can employ standard mapping scripts that access the CentraXX-internal data structures and map the data onto the BBMRI FHIR profile. It may be necessary to adjust a few parameters, but this is nonetheless significantly easier than writing your own ETL.
|
|
||||||
|
|
||||||
You can find the profiles for generating FHIR in [Simplifier](https://simplifier.net/bbmri.de/~resources?category=Profile).
|
|
||||||
|
|
||||||
## Things you should know
|
## Things you should know
|
||||||
|
|
||||||
### Auto-Updates
|
### Auto-Updates
|
||||||
@ -381,28 +337,8 @@ Installation under WSL ought to work, but we have not tested this.
|
|||||||
|
|
||||||
### Docker Daemon Proxy Configuration
|
### Docker Daemon Proxy Configuration
|
||||||
|
|
||||||
Docker has a background daemon, responsible for downloading images and starting them. Sometimes, proxy configuration from your system won't carry over and it will fail to download images. In that case, you'll need to configure the proxy inside the system unit of docker by creating the file `/etc/systemd/system/docker.service.d/proxy.conf` with the following content:
|
Docker has a background daemon, responsible for downloading images and starting them. Sometimes, proxy configuration from your system won't carry over and it will fail to download images. In that case, configure the proxy for this daemon as described in the [official documentation](https://docs.docker.com).
|
||||||
|
|
||||||
``` ini
|
|
||||||
[Service]
|
|
||||||
Environment="HTTP_PROXY=http://proxy.example.com:3128"
|
|
||||||
Environment="HTTPS_PROXY=https://proxy.example.com:3128"
|
|
||||||
Environment="NO_PROXY=localhost,127.0.0.1,some-local-docker-registry.example.com,.corp"
|
|
||||||
```
|
|
||||||
|
|
||||||
After saving the configuration file, you'll need to reload the system daemon for the changes to take effect:
|
|
||||||
|
|
||||||
``` shell
|
|
||||||
sudo systemctl daemon-reload
|
|
||||||
```
|
|
||||||
|
|
||||||
and restart the docker daemon:
|
|
||||||
|
|
||||||
``` shell
|
|
||||||
sudo systemctl restart docker
|
|
||||||
```
|
|
||||||
|
|
||||||
For more information, please consult the [official documentation](https://docs.docker.com/config/daemon/systemd/#httphttps-proxy).
|
|
||||||
|
|
||||||
### Monitoring
|
### Monitoring
|
||||||
|
|
||||||
|
@ -22,6 +22,7 @@ services:
|
|||||||
BROKER_URL: ${ERIC_BROKER_URL}
|
BROKER_URL: ${ERIC_BROKER_URL}
|
||||||
PROXY_ID: ${ERIC_PROXY_ID}
|
PROXY_ID: ${ERIC_PROXY_ID}
|
||||||
APP_focus_KEY: ${ERIC_FOCUS_BEAM_SECRET_SHORT}
|
APP_focus_KEY: ${ERIC_FOCUS_BEAM_SECRET_SHORT}
|
||||||
|
APP_monitoring_KEY: ${ERIC_MONITORING_BEAM_SECRET_SHORT}
|
||||||
PRIVKEY_FILE: /run/secrets/proxy.pem
|
PRIVKEY_FILE: /run/secrets/proxy.pem
|
||||||
ALL_PROXY: http://forward_proxy:3128
|
ALL_PROXY: http://forward_proxy:3128
|
||||||
TLS_CA_CERTIFICATES_DIR: /conf/trusted-ca-certs
|
TLS_CA_CERTIFICATES_DIR: /conf/trusted-ca-certs
|
||||||
@ -34,3 +35,12 @@ services:
|
|||||||
- /etc/bridgehead/trusted-ca-certs:/conf/trusted-ca-certs:ro
|
- /etc/bridgehead/trusted-ca-certs:/conf/trusted-ca-certs:ro
|
||||||
- /srv/docker/bridgehead/bbmri/modules/eric.root.crt.pem:/conf/root.crt.pem:ro
|
- /srv/docker/bridgehead/bbmri/modules/eric.root.crt.pem:/conf/root.crt.pem:ro
|
||||||
|
|
||||||
|
bridgehead-monitoring:
|
||||||
|
image: docker.verbis.dkfz.de/cache/samply/bridgehead-monitoring:latest
|
||||||
|
container_name: bridgehead-monitoring-eric
|
||||||
|
environment:
|
||||||
|
- BEAM_ID=monitoring.${ERIC_PROXY_ID}
|
||||||
|
- BEAM_API_KEY=${ERIC_MONITORING_BEAM_SECRET_SHORT}
|
||||||
|
- BEAM_PROXY_URL=http://beam-proxy-eric:8081
|
||||||
|
depends_on:
|
||||||
|
- beam-proxy-eric
|
||||||
|
@ -10,4 +10,7 @@ if [ "${ENABLE_ERIC}" == "true" ]; then
|
|||||||
ERIC_PROXY_ID=${SITE_ID}.${ERIC_BROKER_ID}
|
ERIC_PROXY_ID=${SITE_ID}.${ERIC_BROKER_ID}
|
||||||
ERIC_FOCUS_BEAM_SECRET_SHORT="$(cat /proc/sys/kernel/random/uuid | sed 's/[-]//g' | head -c 20)"
|
ERIC_FOCUS_BEAM_SECRET_SHORT="$(cat /proc/sys/kernel/random/uuid | sed 's/[-]//g' | head -c 20)"
|
||||||
ERIC_SUPPORT_EMAIL=bridgehead@helpdesk.bbmri-eric.eu
|
ERIC_SUPPORT_EMAIL=bridgehead@helpdesk.bbmri-eric.eu
|
||||||
|
|
||||||
|
#Monitoring
|
||||||
|
ERIC_MONITORING_BEAM_SECRET_SHORT="$(cat /proc/sys/kernel/random/uuid | sed 's/[-]//g' | head -c 20)"
|
||||||
fi
|
fi
|
||||||
|
@ -22,6 +22,7 @@ services:
|
|||||||
BROKER_URL: ${GBN_BROKER_URL}
|
BROKER_URL: ${GBN_BROKER_URL}
|
||||||
PROXY_ID: ${GBN_PROXY_ID}
|
PROXY_ID: ${GBN_PROXY_ID}
|
||||||
APP_focus_KEY: ${GBN_FOCUS_BEAM_SECRET_SHORT}
|
APP_focus_KEY: ${GBN_FOCUS_BEAM_SECRET_SHORT}
|
||||||
|
APP_monitoring_KEY: ${GBN_MONITORING_BEAM_SECRET_SHORT}
|
||||||
PRIVKEY_FILE: /run/secrets/proxy.pem
|
PRIVKEY_FILE: /run/secrets/proxy.pem
|
||||||
ALL_PROXY: http://forward_proxy:3128
|
ALL_PROXY: http://forward_proxy:3128
|
||||||
TLS_CA_CERTIFICATES_DIR: /conf/trusted-ca-certs
|
TLS_CA_CERTIFICATES_DIR: /conf/trusted-ca-certs
|
||||||
@ -34,3 +35,13 @@ services:
|
|||||||
- /etc/bridgehead/trusted-ca-certs:/conf/trusted-ca-certs:ro
|
- /etc/bridgehead/trusted-ca-certs:/conf/trusted-ca-certs:ro
|
||||||
- /srv/docker/bridgehead/bbmri/modules/gbn.root.crt.pem:/conf/root.crt.pem:ro
|
- /srv/docker/bridgehead/bbmri/modules/gbn.root.crt.pem:/conf/root.crt.pem:ro
|
||||||
|
|
||||||
|
bridgehead-monitoring:
|
||||||
|
image: docker.verbis.dkfz.de/cache/samply/bridgehead-monitoring:latest
|
||||||
|
container_name: bridgehead-monitoring-gbn
|
||||||
|
environment:
|
||||||
|
- BEAM_ID=monitoring.${GBN_PROXY_ID}
|
||||||
|
- BEAM_API_KEY=${GBN_MONITORING_BEAM_SECRET_SHORT}
|
||||||
|
- BEAM_PROXY_URL=http://beam-proxy-gbn:8081
|
||||||
|
depends_on:
|
||||||
|
- beam-proxy-gbn
|
||||||
|
|
||||||
|
@ -10,4 +10,7 @@ if [ "${ENABLE_GBN}" == "true" ]; then
|
|||||||
GBN_PROXY_ID=${SITE_ID}.${GBN_BROKER_ID}
|
GBN_PROXY_ID=${SITE_ID}.${GBN_BROKER_ID}
|
||||||
GBN_FOCUS_BEAM_SECRET_SHORT="$(cat /proc/sys/kernel/random/uuid | sed 's/[-]//g' | head -c 20)"
|
GBN_FOCUS_BEAM_SECRET_SHORT="$(cat /proc/sys/kernel/random/uuid | sed 's/[-]//g' | head -c 20)"
|
||||||
GBN_SUPPORT_EMAIL=feedback@germanbiobanknode.de
|
GBN_SUPPORT_EMAIL=feedback@germanbiobanknode.de
|
||||||
|
|
||||||
|
#Monitoring
|
||||||
|
GBN_MONITORING_BEAM_SECRET_SHORT="$(cat /proc/sys/kernel/random/uuid | sed 's/[-]//g' | head -c 20)"
|
||||||
fi
|
fi
|
||||||
|
@ -14,7 +14,7 @@ do
|
|||||||
done
|
done
|
||||||
|
|
||||||
SUPPORT_EMAIL=$ERIC_SUPPORT_EMAIL
|
SUPPORT_EMAIL=$ERIC_SUPPORT_EMAIL
|
||||||
BROKER_URL_FOR_PREREQ="${ERIC_BROKER_URL:-$GBN_BROKER_URL}"
|
BROKER_URL_FOR_PREREQ=$ERIC_BROKER_URL
|
||||||
|
|
||||||
if [ -n "$GBN_SUPPORT_EMAIL" ]; then
|
if [ -n "$GBN_SUPPORT_EMAIL" ]; then
|
||||||
SUPPORT_EMAIL=$GBN_SUPPORT_EMAIL
|
SUPPORT_EMAIL=$GBN_SUPPORT_EMAIL
|
||||||
@ -34,4 +34,4 @@ function do_enroll {
|
|||||||
echo
|
echo
|
||||||
echo "You just received $COUNT certificate signing requests (CSR). Please send $COUNT e-mails, with 1 CSR each, to the respective e-mail address."
|
echo "You just received $COUNT certificate signing requests (CSR). Please send $COUNT e-mails, with 1 CSR each, to the respective e-mail address."
|
||||||
fi
|
fi
|
||||||
}
|
}
|
@ -65,7 +65,6 @@ loadVars() {
|
|||||||
fi
|
fi
|
||||||
detectCompose
|
detectCompose
|
||||||
setHostname
|
setHostname
|
||||||
setupProxy
|
|
||||||
}
|
}
|
||||||
|
|
||||||
case "$ACTION" in
|
case "$ACTION" in
|
||||||
|
@ -28,7 +28,7 @@ services:
|
|||||||
BLAZE_URL: "http://bridgehead-ccp-blaze:8080/fhir/"
|
BLAZE_URL: "http://bridgehead-ccp-blaze:8080/fhir/"
|
||||||
BEAM_PROXY_URL: http://beam-proxy:8081
|
BEAM_PROXY_URL: http://beam-proxy:8081
|
||||||
RETRY_COUNT: ${FOCUS_RETRY_COUNT}
|
RETRY_COUNT: ${FOCUS_RETRY_COUNT}
|
||||||
EPSILON: 0.28
|
OBFUSCATE: "no"
|
||||||
depends_on:
|
depends_on:
|
||||||
- "beam-proxy"
|
- "beam-proxy"
|
||||||
- "blaze"
|
- "blaze"
|
||||||
@ -40,6 +40,7 @@ services:
|
|||||||
BROKER_URL: ${BROKER_URL}
|
BROKER_URL: ${BROKER_URL}
|
||||||
PROXY_ID: ${PROXY_ID}
|
PROXY_ID: ${PROXY_ID}
|
||||||
APP_focus_KEY: ${FOCUS_BEAM_SECRET_SHORT}
|
APP_focus_KEY: ${FOCUS_BEAM_SECRET_SHORT}
|
||||||
|
APP_monitoring_KEY: ${CCP_MONITORING_BEAM_SECRET_SHORT}
|
||||||
PRIVKEY_FILE: /run/secrets/proxy.pem
|
PRIVKEY_FILE: /run/secrets/proxy.pem
|
||||||
ALL_PROXY: http://forward_proxy:3128
|
ALL_PROXY: http://forward_proxy:3128
|
||||||
TLS_CA_CERTIFICATES_DIR: /conf/trusted-ca-certs
|
TLS_CA_CERTIFICATES_DIR: /conf/trusted-ca-certs
|
||||||
@ -51,6 +52,16 @@ services:
|
|||||||
volumes:
|
volumes:
|
||||||
- /etc/bridgehead/trusted-ca-certs:/conf/trusted-ca-certs:ro
|
- /etc/bridgehead/trusted-ca-certs:/conf/trusted-ca-certs:ro
|
||||||
- /srv/docker/bridgehead/ccp/root.crt.pem:/conf/root.crt.pem:ro
|
- /srv/docker/bridgehead/ccp/root.crt.pem:/conf/root.crt.pem:ro
|
||||||
|
|
||||||
|
bridgehead-monitoring:
|
||||||
|
image: docker.verbis.dkfz.de/cache/samply/bridgehead-monitoring:latest
|
||||||
|
container_name: bridgehead-monitoring-ccp
|
||||||
|
environment:
|
||||||
|
- BEAM_ID=monitoring.${PROXY_ID}
|
||||||
|
- BEAM_API_KEY=${CCP_MONITORING_BEAM_SECRET_SHORT}
|
||||||
|
- BEAM_PROXY_URL=http://beam-proxy:8081
|
||||||
|
depends_on:
|
||||||
|
- beam-proxy
|
||||||
|
|
||||||
|
|
||||||
volumes:
|
volumes:
|
||||||
|
@ -1,18 +0,0 @@
|
|||||||
version: "3.7"
|
|
||||||
|
|
||||||
services:
|
|
||||||
adt2fhir-rest:
|
|
||||||
container_name: bridgehead-adt2fhir-rest
|
|
||||||
image: docker.verbis.dkfz.de/ccp/adt2fhir-rest:main
|
|
||||||
environment:
|
|
||||||
IDTYPE: BK_${IDMANAGEMENT_FRIENDLY_ID}_L-ID
|
|
||||||
MAINZELLISTE_APIKEY: ${IDMANAGER_LOCAL_PATIENTLIST_APIKEY}
|
|
||||||
SALT: ${LOCAL_SALT}
|
|
||||||
restart: always
|
|
||||||
labels:
|
|
||||||
- "traefik.enable=true"
|
|
||||||
- "traefik.http.routers.adt2fhir-rest.rule=PathPrefix(`/adt2fhir-rest`)"
|
|
||||||
- "traefik.http.middlewares.adt2fhir-rest_strip.stripprefix.prefixes=/adt2fhir-rest"
|
|
||||||
- "traefik.http.services.adt2fhir-rest.loadbalancer.server.port=8080"
|
|
||||||
- "traefik.http.routers.adt2fhir-rest.tls=true"
|
|
||||||
- "traefik.http.routers.adt2fhir-rest.middlewares=adt2fhir-rest_strip,auth"
|
|
@ -1,13 +0,0 @@
|
|||||||
#!/bin/bash
|
|
||||||
|
|
||||||
function adt2fhirRestSetup() {
|
|
||||||
if [ -n "$ENABLE_ADT2FHIR_REST" ]; then
|
|
||||||
log INFO "ADT2FHIR-REST setup detected -- will start adt2fhir-rest API."
|
|
||||||
if [ ! -n "$IDMANAGER_LOCAL_PATIENTLIST_APIKEY" ]; then
|
|
||||||
log ERROR "Missing ID-Management Module! Fix this by setting up ID Management:"
|
|
||||||
exit 1;
|
|
||||||
fi
|
|
||||||
OVERRIDE+=" -f ./$PROJECT/modules/adt2fhir-rest-compose.yml"
|
|
||||||
LOCAL_SALT="$(echo \"local-random-salt\" | openssl pkeyutl -sign -inkey /etc/bridgehead/pki/${SITE_ID}.priv.pem | base64 | head -c 30)"
|
|
||||||
fi
|
|
||||||
}
|
|
2
ccp/modules/ccp-setup.sh
Normal file
2
ccp/modules/ccp-setup.sh
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
#Monitoring
|
||||||
|
CCP_MONITORING_BEAM_SECRET_SHORT="$(cat /proc/sys/kernel/random/uuid | sed 's/[-]//g' | head -c 20)"
|
@ -43,7 +43,7 @@ services:
|
|||||||
- patientlist-db
|
- patientlist-db
|
||||||
|
|
||||||
patientlist-db:
|
patientlist-db:
|
||||||
image: docker.verbis.dkfz.de/cache/postgres:15.4-alpine
|
image: docker.verbis.dkfz.de/cache/postgres:15.1-alpine
|
||||||
container_name: bridgehead-patientlist-db
|
container_name: bridgehead-patientlist-db
|
||||||
environment:
|
environment:
|
||||||
POSTGRES_USER: "mainzelliste"
|
POSTGRES_USER: "mainzelliste"
|
||||||
|
@ -39,7 +39,6 @@ function applySpecialCases() {
|
|||||||
result="$1";
|
result="$1";
|
||||||
result="${result/Lmu/LMU}";
|
result="${result/Lmu/LMU}";
|
||||||
result="${result/Tum/TUM}";
|
result="${result/Tum/TUM}";
|
||||||
result="${result/Dktk Test/Teststandort}";
|
|
||||||
echo "$result";
|
echo "$result";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2,7 +2,7 @@ version: "3.7"
|
|||||||
|
|
||||||
services:
|
services:
|
||||||
mtba:
|
mtba:
|
||||||
image: docker.verbis.dkfz.de/cache/samply/mtba:latest
|
image: docker.verbis.dkfz.de/cache/samply/mtba:develop
|
||||||
container_name: bridgehead-mtba
|
container_name: bridgehead-mtba
|
||||||
environment:
|
environment:
|
||||||
BLAZE_STORE_URL: http://blaze:8080
|
BLAZE_STORE_URL: http://blaze:8080
|
||||||
|
@ -1,12 +1,13 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
function mtbaSetup() {
|
function mtbaSetup() {
|
||||||
if [ -n "$ENABLE_MTBA" ];then
|
# TODO: Check if ID-Management Module is activated!
|
||||||
log INFO "MTBA setup detected -- will start MTBA Service and CBioPortal."
|
if [ -n "$ENABLE_MTBA" ];then
|
||||||
if [ ! -n "$IDMANAGER_UPLOAD_APIKEY" ]; then
|
log INFO "MTBA setup detected -- will start MTBA Service and CBioPortal."
|
||||||
log ERROR "Missing ID-Management Module! Fix this by setting up ID Management:"
|
if [ ! -n "$IDMANAGER_UPLOAD_APIKEY" ]; then
|
||||||
exit 1;
|
log ERROR "Detected MTBA Module configuration but ID-Management Module seems not to be configured!"
|
||||||
fi
|
exit 1;
|
||||||
OVERRIDE+=" -f ./$PROJECT/modules/mtba-compose.yml"
|
fi
|
||||||
fi
|
OVERRIDE+=" -f ./$PROJECT/modules/mtba-compose.yml"
|
||||||
|
fi
|
||||||
}
|
}
|
@ -1,6 +1,8 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
if [ -n "$NNGM_CTS_APIKEY" ]; then
|
function nngmSetup() {
|
||||||
log INFO "nNGM setup detected -- will start nNGM Connector."
|
if [ -n "$NNGM_CTS_APIKEY" ]; then
|
||||||
OVERRIDE+=" -f ./$PROJECT/modules/nngm-compose.yml"
|
log INFO "nNGM setup detected -- will start nNGM Connector."
|
||||||
fi
|
OVERRIDE+=" -f ./$PROJECT/modules/nngm-compose.yml"
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
4
ccp/vars
4
ccp/vars
@ -16,5 +16,5 @@ do
|
|||||||
done
|
done
|
||||||
|
|
||||||
idManagementSetup
|
idManagementSetup
|
||||||
mtbaSetup
|
nngmSetup
|
||||||
adt2fhirRestSetup
|
mtbaSetup
|
@ -9,33 +9,6 @@ detectCompose() {
|
|||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
setupProxy() {
|
|
||||||
### Note: As the current data protection concepts do not allow communication via HTTP,
|
|
||||||
### we are not setting a proxy for HTTP requests.
|
|
||||||
|
|
||||||
local http="no"
|
|
||||||
local https="no"
|
|
||||||
if [ $HTTPS_PROXY_URL ]; then
|
|
||||||
local proto="$(echo $HTTPS_PROXY_URL | grep :// | sed -e 's,^\(.*://\).*,\1,g')"
|
|
||||||
local fqdn="$(echo ${HTTPS_PROXY_URL/$proto/})"
|
|
||||||
local hostport=$(echo $HTTPS_PROXY_URL | sed -e "s,$proto,,g" | cut -d/ -f1)
|
|
||||||
HTTPS_PROXY_HOST="$(echo $hostport | sed -e 's,:.*,,g')"
|
|
||||||
HTTPS_PROXY_PORT="$(echo $hostport | sed -e 's,^.*:,:,g' -e 's,.*:\([0-9]*\).*,\1,g' -e 's,[^0-9],,g')"
|
|
||||||
if [[ ! -z "$HTTPS_PROXY_USERNAME" && ! -z "$HTTPS_PROXY_PASSWORD" ]]; then
|
|
||||||
local proto="$(echo $HTTPS_PROXY_URL | grep :// | sed -e 's,^\(.*://\).*,\1,g')"
|
|
||||||
local fqdn="$(echo ${HTTPS_PROXY_URL/$proto/})"
|
|
||||||
HTTPS_PROXY_FULL_URL="$(echo $proto$HTTPS_PROXY_USERNAME:$HTTPS_PROXY_PASSWORD@$fqdn)"
|
|
||||||
https="authenticated"
|
|
||||||
else
|
|
||||||
HTTPS_PROXY_FULL_URL=$HTTPS_PROXY_URL
|
|
||||||
https="unauthenticated"
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
|
|
||||||
log INFO "Configuring proxy servers: $http http proxy (we're not supporting unencrypted comms), $https https proxy"
|
|
||||||
export HTTPS_PROXY_HOST HTTPS_PROXY_PORT HTTPS_PROXY_FULL_URL
|
|
||||||
}
|
|
||||||
|
|
||||||
exitIfNotRoot() {
|
exitIfNotRoot() {
|
||||||
if [ "$EUID" -ne 0 ]; then
|
if [ "$EUID" -ne 0 ]; then
|
||||||
log "ERROR" "Please run as root"
|
log "ERROR" "Please run as root"
|
||||||
@ -76,7 +49,7 @@ fetchVarsFromVault() {
|
|||||||
|
|
||||||
set +e
|
set +e
|
||||||
|
|
||||||
PASS=$(BW_MASTERPASS="$BW_MASTERPASS" BW_CLIENTID="$BW_CLIENTID" BW_CLIENTSECRET="$BW_CLIENTSECRET" docker run --rm -e BW_MASTERPASS -e BW_CLIENTID -e BW_CLIENTSECRET -e http_proxy docker.verbis.dkfz.de/cache/samply/bridgehead-vaultfetcher:latest $@)
|
PASS=$(BW_MASTERPASS="$BW_MASTERPASS" BW_CLIENTID="$BW_CLIENTID" BW_CLIENTSECRET="$BW_CLIENTSECRET" docker run --rm -e BW_MASTERPASS -e BW_CLIENTID -e BW_CLIENTSECRET -e http_proxy samply/bridgehead-vaultfetcher $@)
|
||||||
RET=$?
|
RET=$?
|
||||||
|
|
||||||
if [ $RET -ne 0 ]; then
|
if [ $RET -ne 0 ]; then
|
||||||
@ -215,7 +188,7 @@ function do_enroll_inner {
|
|||||||
PARAMS+="--admin-email $SUPPORT_EMAIL"
|
PARAMS+="--admin-email $SUPPORT_EMAIL"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
docker run --rm -v /etc/bridgehead/pki:/etc/bridgehead/pki docker.verbis.dkfz.de/cache/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
|
chmod 600 $PRIVATEKEYFILENAME
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -47,8 +47,8 @@ function hc_send(){
|
|||||||
|
|
||||||
if [ -n "$2" ]; then
|
if [ -n "$2" ]; then
|
||||||
MSG="$2\n\nDocker stats:\n$UPTIME"
|
MSG="$2\n\nDocker stats:\n$UPTIME"
|
||||||
echo -e "$MSG" | https_proxy=$HTTPS_PROXY_FULL_URL curl --max-time 5 -A "$USER_AGENT" -s -o /dev/null -X POST --data-binary @- "$HCURL"/"$1" || log WARN "Monitoring failed: Unable to send data to $HCURL/$1"
|
echo -e "$MSG" | https_proxy=$HTTPS_PROXY_URL curl --max-time 5 -A "$USER_AGENT" -s -o /dev/null -X POST --data-binary @- "$HCURL"/"$1" || log WARN "Monitoring failed: Unable to send data to $HCURL/$1"
|
||||||
else
|
else
|
||||||
https_proxy=$HTTPS_PROXY_FULL_URL curl --max-time 5 -A "$USER_AGENT" -s -o /dev/null "$HCURL"/"$1" || log WARN "Monitoring failed: Unable to send data to $HCURL/$1"
|
https_proxy=$HTTPS_PROXY_URL curl --max-time 5 -A "$USER_AGENT" -s -o /dev/null "$HCURL"/"$1" || log WARN "Monitoring failed: Unable to send data to $HCURL/$1"
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
@ -14,7 +14,7 @@ checkOwner /etc/bridgehead bridgehead || exit 1
|
|||||||
|
|
||||||
## Check if user is a su
|
## Check if user is a su
|
||||||
log INFO "Checking if all prerequisites are met ..."
|
log INFO "Checking if all prerequisites are met ..."
|
||||||
prerequisites="git docker curl"
|
prerequisites="git docker"
|
||||||
for prerequisite in $prerequisites; do
|
for prerequisite in $prerequisites; do
|
||||||
$prerequisite --version 2>&1
|
$prerequisite --version 2>&1
|
||||||
is_available=$?
|
is_available=$?
|
||||||
@ -68,7 +68,7 @@ source /etc/bridgehead/${PROJECT}.conf
|
|||||||
source ${PROJECT}/vars
|
source ${PROJECT}/vars
|
||||||
|
|
||||||
set +e
|
set +e
|
||||||
SERVERTIME="$(https_proxy=$HTTPS_PROXY_FULL_URL curl -m 5 -s -I $BROKER_URL_FOR_PREREQ 2>&1 | grep -i -e '^Date: ' | sed -e 's/^Date: //i')"
|
SERVERTIME="$(https_proxy=$HTTPS_PROXY_URL curl -m 5 -s -I $BROKER_URL_FOR_PREREQ 2>&1 | grep -i -e '^Date: ' | sed -e 's/^Date: //i')"
|
||||||
RET=$?
|
RET=$?
|
||||||
set -e
|
set -e
|
||||||
if [ $RET -ne 0 ]; then
|
if [ $RET -ne 0 ]; then
|
||||||
|
@ -30,7 +30,7 @@ source $CONFFILE
|
|||||||
assertVarsNotEmpty SITE_ID || fail_and_report 1 "Update failed: SITE_ID empty"
|
assertVarsNotEmpty SITE_ID || fail_and_report 1 "Update failed: SITE_ID empty"
|
||||||
export SITE_ID
|
export SITE_ID
|
||||||
|
|
||||||
checkOwner /srv/docker/bridgehead bridgehead || fail_and_report 1 "Update failed: Wrong permissions in /srv/docker/bridgehead"
|
checkOwner . bridgehead || fail_and_report 1 "Update failed: Wrong permissions in $(pwd)"
|
||||||
checkOwner /etc/bridgehead bridgehead || fail_and_report 1 "Update failed: Wrong permissions in /etc/bridgehead"
|
checkOwner /etc/bridgehead bridgehead || fail_and_report 1 "Update failed: Wrong permissions in /etc/bridgehead"
|
||||||
|
|
||||||
CREDHELPER="/srv/docker/bridgehead/lib/gitpassword.sh"
|
CREDHELPER="/srv/docker/bridgehead/lib/gitpassword.sh"
|
||||||
@ -50,12 +50,12 @@ for DIR in /etc/bridgehead $(pwd); do
|
|||||||
git -C $DIR config credential.helper "$CREDHELPER"
|
git -C $DIR config credential.helper "$CREDHELPER"
|
||||||
fi
|
fi
|
||||||
old_git_hash="$(git -C $DIR rev-parse --verify HEAD)"
|
old_git_hash="$(git -C $DIR rev-parse --verify HEAD)"
|
||||||
if [ -z "$HTTPS_PROXY_FULL_URL" ]; then
|
if [ -z "$HTTP_PROXY_URL" ]; then
|
||||||
log "INFO" "Git is using no proxy!"
|
log "INFO" "Git is using no proxy!"
|
||||||
OUT=$(retry 5 git -C $DIR fetch 2>&1 && retry 5 git -C $DIR pull 2>&1)
|
OUT=$(retry 5 git -C $DIR fetch 2>&1 && retry 5 git -C $DIR pull 2>&1)
|
||||||
else
|
else
|
||||||
log "INFO" "Git is using proxy ${HTTPS_PROXY_URL} from ${CONFFILE}"
|
log "INFO" "Git is using proxy ${HTTP_PROXY_URL} from ${CONFFILE}"
|
||||||
OUT=$(retry 5 git -c http.proxy=$HTTPS_PROXY_FULL_URL -c https.proxy=$HTTPS_PROXY_FULL_URL -C $DIR fetch 2>&1 && retry 5 git -c http.proxy=$HTTPS_PROXY_FULL_URL -c https.proxy=$HTTPS_PROXY_FULL_URL -C $DIR pull 2>&1)
|
OUT=$(retry 5 git -c http.proxy=$HTTP_PROXY_URL -c https.proxy=$HTTPS_PROXY_URL -C $DIR fetch 2>&1 && retry 5 git -c http.proxy=$HTTP_PROXY_URL -c https.proxy=$HTTPS_PROXY_URL -C $DIR pull 2>&1)
|
||||||
fi
|
fi
|
||||||
if [ $? -ne 0 ]; then
|
if [ $? -ne 0 ]; then
|
||||||
report_error log "Unable to update git $DIR: $OUT"
|
report_error log "Unable to update git $DIR: $OUT"
|
||||||
@ -116,7 +116,7 @@ if [ -n "${BACKUP_DIRECTORY}" ]; then
|
|||||||
mkdir -p "$BACKUP_DIRECTORY"
|
mkdir -p "$BACKUP_DIRECTORY"
|
||||||
chown -R "$BACKUP_DIRECTORY" bridgehead;
|
chown -R "$BACKUP_DIRECTORY" bridgehead;
|
||||||
fi
|
fi
|
||||||
checkOwner "$BACKUP_DIRECTORY" bridgehead || fail_and_report 1 "Automatic maintenance failed: Wrong permissions for backup directory $BACKUP_DIRECTORY"
|
checkOwner "$BACKUP_DIRECTORY" bridgehead || fail_and_report 1 "Automatic maintenance failed: Wrong permissions for backup directory $(pwd)"
|
||||||
# Collect all container names that contain '-db'
|
# Collect all container names that contain '-db'
|
||||||
BACKUP_SERVICES="$(docker ps --filter name=-db --format "{{.Names}}" | tr "\n" "\ ")"
|
BACKUP_SERVICES="$(docker ps --filter name=-db --format "{{.Names}}" | tr "\n" "\ ")"
|
||||||
log INFO "Performing automatic maintenance: Creating Backups for $BACKUP_SERVICES";
|
log INFO "Performing automatic maintenance: Creating Backups for $BACKUP_SERVICES";
|
||||||
|
@ -35,8 +35,8 @@ services:
|
|||||||
image: docker.verbis.dkfz.de/cache/samply/bridgehead-forward-proxy:latest
|
image: docker.verbis.dkfz.de/cache/samply/bridgehead-forward-proxy:latest
|
||||||
environment:
|
environment:
|
||||||
HTTPS_PROXY: ${HTTPS_PROXY_URL}
|
HTTPS_PROXY: ${HTTPS_PROXY_URL}
|
||||||
HTTPS_PROXY_USERNAME: ${HTTPS_PROXY_USERNAME}
|
USERNAME: ${HTTPS_PROXY_USERNAME}
|
||||||
HTTPS_PROXY_PASSWORD: ${HTTPS_PROXY_PASSWORD}
|
PASSWORD: ${HTTPS_PROXY_PASSWORD}
|
||||||
tmpfs:
|
tmpfs:
|
||||||
- /var/log/squid
|
- /var/log/squid
|
||||||
- /var/spool/squid
|
- /var/spool/squid
|
||||||
@ -45,7 +45,7 @@ services:
|
|||||||
|
|
||||||
landing:
|
landing:
|
||||||
container_name: bridgehead-landingpage
|
container_name: bridgehead-landingpage
|
||||||
image: docker.verbis.dkfz.de/cache/samply/bridgehead-landingpage:main
|
image: docker.verbis.dkfz.de/cache/samply/bridgehead-landingpage:master
|
||||||
labels:
|
labels:
|
||||||
- "traefik.enable=true"
|
- "traefik.enable=true"
|
||||||
- "traefik.http.routers.landing.rule=PathPrefix(`/`)"
|
- "traefik.http.routers.landing.rule=PathPrefix(`/`)"
|
||||||
|
Reference in New Issue
Block a user