diff --git a/ccp/modules/datashield-setup.sh b/ccp/modules/datashield-setup.sh index 5020f73..ed725ee 100644 --- a/ccp/modules/datashield-setup.sh +++ b/ccp/modules/datashield-setup.sh @@ -6,7 +6,7 @@ if [ "$ENABLE_DATASHIELD" == true ]; then echo "The ENABLE_EXPORTER variable is either not set or not set to 'true'." fi OAUTH2_CALLBACK=/oauth2/callback - OAUTH2_PROXY_SECRET="$(echo \"This is a salt string to generate one consistent encryption key for the oauth2_proxy. It is not required to be secret.\" | openssl rsautl -sign -inkey /etc/bridgehead/pki/${SITE_ID}.priv.pem | base64 | head -c 32)" + OAUTH2_PROXY_SECRET="$(echo \"This is a salt string to generate one consistent encryption key for the oauth2_proxy. It is not required to be secret.\" | sha1sum | openssl pkeyutl -sign -inkey /etc/bridgehead/pki/${SITE_ID}.priv.pem | base64 | head -c 32)" add_private_oidc_redirect_url "${OAUTH2_CALLBACK}" log INFO "DataSHIELD setup detected -- will start DataSHIELD services." diff --git a/ccp/modules/exporter-setup.sh b/ccp/modules/exporter-setup.sh index e33978c..9b947a6 100644 --- a/ccp/modules/exporter-setup.sh +++ b/ccp/modules/exporter-setup.sh @@ -3,6 +3,6 @@ if [ "$ENABLE_EXPORTER" == true ]; then log INFO "Exporter setup detected -- will start Exporter service." OVERRIDE+=" -f ./$PROJECT/modules/exporter-compose.yml" - 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)" - EXPORTER_API_KEY="$(echo \"This is a salt string to generate one consistent API KEY for the exporter. It is not required to be secret.\" | openssl rsautl -sign -inkey /etc/bridgehead/pki/${SITE_ID}.priv.pem | base64 | head -c 64)" + EXPORTER_DB_PASSWORD="$(echo \"This is a salt string to generate one consistent password for the exporter. It is not required to be secret.\" | sha1sum | openssl pkeyutl -sign -inkey /etc/bridgehead/pki/${SITE_ID}.priv.pem | base64 | head -c 30)" + EXPORTER_API_KEY="$(echo \"This is a salt string to generate one consistent API KEY for the exporter. It is not required to be secret.\" | sha1sum | openssl pkeyutl -sign -inkey /etc/bridgehead/pki/${SITE_ID}.priv.pem | base64 | head -c 64)" fi diff --git a/lib/functions.sh b/lib/functions.sh index 3d20729..1d6bfe9 100644 --- a/lib/functions.sh +++ b/lib/functions.sh @@ -343,7 +343,7 @@ generate_password(){ generate_simple_password(){ local seed_text="$1" local combined_text="This is a salt string to generate one consistent password for ${seed_text}. It is not required to be secret." - echo "${combined_text}" | openssl rsautl -sign -inkey "/etc/bridgehead/pki/${SITE_ID}.priv.pem" 2> /dev/null | base64 | head -c 26 | sed 's/[+\/]/A/g' + echo "${combined_text}" | sha1sum | openssl pkeyutl -sign -inkey "/etc/bridgehead/pki/${SITE_ID}.priv.pem" 2> /dev/null | base64 | head -c 26 | sed 's/[+\/]/A/g' } docker_jq() {