Change cert permission and location

This commit is contained in:
janskiba 2023-05-24 08:50:37 +00:00 committed by juarez
parent e9e1ce5a65
commit f2f48869af
1 changed files with 5 additions and 2 deletions

View File

@ -5,6 +5,9 @@ if [ "$ENABLE_DATASHIELD" == true ];then
OVERRIDE+=" -f ./$PROJECT/modules/datashield-compose.yml"
fi
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)"
if [ ! -e "/etc/bridgehead/traefik-tls/opal-cert.pem" ]; then
openssl req -x509 -newkey rsa:4096 -nodes -keyout /etc/bridgehead/traefik-tls/opal-key.pem -out /etc/bridgehead/traefik-tls/opal-cert.pem -days 3650 -subj "/CN=$HOST"
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
fi