Autogenerate maps for Opal's beam-connect. To be completed by @Threated with a map-generator in the script.

This commit is contained in:
lablans 2023-09-15 08:12:16 +00:00 committed by juarez
parent 76d05a2d3b
commit d809474ce5
2 changed files with 9 additions and 8 deletions

View File

@ -84,7 +84,7 @@ services:
depends_on:
- beam-proxy
volumes:
- /etc/bridgehead/datashield-connect/:/map:ro
- /tmp/bridgehead/opal-map/:/map/:ro
beam-proxy:
environment:
@ -102,6 +102,6 @@ services:
secrets:
opal-cert.pem:
file: /etc/bridgehead/trusted-ca-certs/opal-cert.pem
file: /tmp/bridgehead/opal-cert.pem
opal-key.pem:
file: /etc/bridgehead/trusted-ca-certs/opal-key.pem
file: /tmp/bridgehead/opal-key.pem

View File

@ -5,10 +5,11 @@ if [ "$ENABLE_DATASHIELD" == true ]; then
OVERRIDE+=" -f ./$PROJECT/modules/datashield-compose.yml"
OPAL_DB_PASSWORD="$(echo \"This is a salt string to generate one consistent password for Opal. It is not required to be secret.\" | openssl rsautl -sign -inkey /etc/bridgehead/pki/${SITE_ID}.priv.pem | base64 | head -c 30)"
DATASHIELD_CONNECT_SECRET="$(echo \"This is a salt string to generate one consistent password as the DataShield Connect secret. It is not required to be secret.\" | openssl rsautl -sign -inkey /etc/bridgehead/pki/${SITE_ID}.priv.pem | base64 | head -c 30)"
if [ ! -e "/etc/bridgehead/trusted-ca-certs/opal-cert.pem" ]; then
openssl req -x509 -newkey rsa:4096 -nodes -keyout /etc/bridgehead/trusted-ca-certs/opal-key.pem -out /etc/bridgehead/trusted-ca-certs/opal-cert.pem -days 3650 -subj "/CN=${HOST:-opal}/C=DE"
chmod g+r /etc/bridgehead/trusted-ca-certs/opal-key.pem
chown bridgehead:docker /etc/bridgehead/trusted-ca-certs/opal-key.pem
chown bridgehead:docker /etc/bridgehead/trusted-ca-certs/opal-cert.pem
if [ ! -e /tmp/bridgehead/opal-cert.pem ]; then
mkdir -p /tmp/bridgehead/
chown -R bridgehead:docker /tmp/bridgehead/
openssl req -x509 -newkey rsa:4096 -nodes -keyout /tmp/bridgehead/opal-key.pem -out /tmp/bridgehead/opal-cert.pem -days 3650 -subj "/CN=${HOST:-opal}/C=DE"
chown -R bridgehead:docker /tmp/bridgehead/
chmod g+r /tmp/bridgehead/opal-key.pem
fi
fi