From 1f9733aa4d3749d801689cc62a566ddfecc75040 Mon Sep 17 00:00:00 2001 From: janskiba Date: Fri, 15 Sep 2023 09:45:28 +0000 Subject: [PATCH] Auto generate mappings --- ccp/modules/datashield-mappings.json | 17 +++++++++++++++++ ccp/modules/datashield-setup.sh | 8 ++++++++ 2 files changed, 25 insertions(+) create mode 100644 ccp/modules/datashield-mappings.json diff --git a/ccp/modules/datashield-mappings.json b/ccp/modules/datashield-mappings.json new file mode 100644 index 0000000..b6d3f37 --- /dev/null +++ b/ccp/modules/datashield-mappings.json @@ -0,0 +1,17 @@ + +{ + "sites": [ + { + "id": "$SITE_ID", + "name": "$SITE_ID", + "virtualhost": "opal-$SITE_ID", + "beamconnect": "datashield-connect.$SITE_ID.broker.ccp-it.dktk.dkfz.de" + }, + { + "id": "$SITE_ID", + "name": "$SITE_ID", + "virtualhost": "opal-$SITE_ID", + "beamconnect": "datashield-connect.$SITE_ID.broker.ccp-it.dktk.dkfz.de" + } + ] +} diff --git a/ccp/modules/datashield-setup.sh b/ccp/modules/datashield-setup.sh index 8652431..c48a112 100644 --- a/ccp/modules/datashield-setup.sh +++ b/ccp/modules/datashield-setup.sh @@ -12,4 +12,12 @@ if [ "$ENABLE_DATASHIELD" == true ]; then chown -R bridgehead:docker /tmp/bridgehead/ chmod g+r /tmp/bridgehead/opal-key.pem fi + mkdir -p /tmp/bridgehead/opal-map + jq -n --argfile input ./$PROJECT/modules/datashield-mappings.json ' + { + "external": "opal-'"$SITE_ID"'", + "internal": "opal:8080", + "allowed": [$input.sites[].id | "datashield-connect.\(.).broker.ccp-it.dktk.dkfz.de"] + }' > /tmp/bridgehead/opal-map/local.json + cp ./$PROJECT/modules/datashield-mappings.json /tmp/bridgehead/opal-map/central.json fi