mirror of
				https://github.com/samply/bridgehead.git
				synced 2025-11-04 01:20:17 +01:00 
			
		
		
		
	Generate passwords only if modules are enabled
This commit is contained in:
		@@ -1,13 +1,13 @@
 | 
			
		||||
#!/bin/bash
 | 
			
		||||
 | 
			
		||||
if [ "$ENABLE_DATASHIELD" == true ];then
 | 
			
		||||
if [ "$ENABLE_DATASHIELD" == true ]; then
 | 
			
		||||
  log INFO "DataSHIELD setup detected -- will start DataSHIELD services."
 | 
			
		||||
  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/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
 | 
			
		||||
  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/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
 | 
			
		||||
fi
 | 
			
		||||
 
 | 
			
		||||
@@ -1,8 +1,8 @@
 | 
			
		||||
#!/bin/bash
 | 
			
		||||
 | 
			
		||||
if [ -n "$ENABLE_EXPORTER" ];then
 | 
			
		||||
if [ -n "$ENABLE_EXPORTER" ]; then
 | 
			
		||||
  log INFO "Exporter setup detected -- will start Exporter service."
 | 
			
		||||
  OVERRIDE+=" -f ./$PROJECT/modules/exporter-compose.yml"
 | 
			
		||||
  # TODO: Generate password in another way so that not all passwords are the same?
 | 
			
		||||
  EXPORTER_DB_PASSWORD="$(echo \"This is a salt string to generate one consistent password for the exporter. It is not required to be secret.\" | openssl rsautl -sign -inkey /etc/bridgehead/pki/${SITE_ID}.priv.pem | base64 | head -c 30)"
 | 
			
		||||
fi
 | 
			
		||||
# TODO: Generate password in another way so that not all passwords are the same?
 | 
			
		||||
EXPORTER_DB_PASSWORD="$(echo \"This is a salt string to generate one consistent password for the exporter. It is not required to be secret.\" | openssl rsautl -sign -inkey /etc/bridgehead/pki/${SITE_ID}.priv.pem | base64 | head -c 30)"
 | 
			
		||||
 
 | 
			
		||||
@@ -1,7 +1,7 @@
 | 
			
		||||
#!/bin/bash
 | 
			
		||||
 | 
			
		||||
if [ "$ENABLE_LOGIN" == true ];then
 | 
			
		||||
if [ "$ENABLE_LOGIN" == true ]; then
 | 
			
		||||
  log INFO "Login setup detected -- will start Login services."
 | 
			
		||||
  OVERRIDE+=" -f ./$PROJECT/modules/login-compose.yml"
 | 
			
		||||
  KEYCLOAK_DB_PASSWORD="$(echo \"This is a salt string to generate one consistent password for Keycloak. It is not required to be secret.\" | openssl rsautl -sign -inkey /etc/bridgehead/pki/${SITE_ID}.priv.pem | base64 | head -c 30)"
 | 
			
		||||
fi
 | 
			
		||||
KEYCLOAK_DB_PASSWORD="$(echo \"This is a salt string to generate one consistent password for Keycloak. It is not required to be secret.\" | openssl rsautl -sign -inkey /etc/bridgehead/pki/${SITE_ID}.priv.pem | base64 | head -c 30)"
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user