diff --git a/README.md b/README.md index 5acb5f0..c8aad18 100644 --- a/README.md +++ b/README.md @@ -242,6 +242,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 `. +### Directory sync + +This is an optional feature for bbmri projects. It keeps the [BBMRI Directory](https://directory.bbmri-eric.eu/) up to date with your local data eg. number of samples. 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. + +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. + +Once you edited the gitlab config. The bridgehead will autoupdate the config with the values and will sync the data. + +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. + ## Things you should know ### Auto-Updates diff --git a/bbmri/directory-sync-compose.yml b/bbmri/directory-sync-compose.yml new file mode 100644 index 0000000..9776ecb --- /dev/null +++ b/bbmri/directory-sync-compose.yml @@ -0,0 +1,8 @@ +services: + directory_sync_service: + image: "docker.verbis.dkfz.de/cache/samply/directory_sync_service" + environment: + DS_DIRECTORY_URL: ${DS_DIRECTORY_URL} + DS_DIRECTORY_USER_NAME: ${DS_DIRECTORY_USER_NAME} + DS_DIRECTORY_PASS_CODE: ${DS_DIRECTORY_PASS_CODE} + DS_TIMER_CRON: ${DS_TIMER_CRON} diff --git a/bbmri/directory-sync.sh b/bbmri/directory-sync.sh new file mode 100755 index 0000000..2eeef4a --- /dev/null +++ b/bbmri/directory-sync.sh @@ -0,0 +1,8 @@ +#!/bin/bash + +function dirSetup() { + if [ -n "$DS_DIRECTORY_USER_NAME" ]; then + log INFO "Directory sync setup detected -- will start directory sync service." + OVERRIDE+=" -f ./$PROJECT/directory-sync-compose.yml" + fi +} diff --git a/bbmri/vars b/bbmri/vars index 0f99eb1..2afc97f 100644 --- a/bbmri/vars +++ b/bbmri/vars @@ -5,3 +5,7 @@ FOCUS_BEAM_SECRET_SHORT="$(cat /proc/sys/kernel/random/uuid | sed 's/[-]//g' | h FOCUS_RETRY_COUNT=32 SUPPORT_EMAIL=bridgehead@helpdesk.bbmri-eric.eu PRIVATEKEYFILENAME=/etc/bridgehead/pki/${SITE_ID}.priv.pem + +# This will load directory-sync setup. +source $PROJECT/directory-sync.sh +dirSetup