Removed stuff accumulated during testing phase

Most of the things added during testing were not necessary and they were
removed. This had the additional advantage that many files are now identical
to their equivalents in the develop branch, making the diff more manageable.
This commit is contained in:
Gerhard Salvini
2025-02-06 09:28:48 +01:00
parent 0169435074
commit 146235236b
8 changed files with 15 additions and 62 deletions

View File

@ -301,39 +301,21 @@ function sync_secrets() {
if [[ $secret_sync_args == "" ]]; then
return
fi
if [ "${ENABLE_ERIC}" == "true" ]; then
BROKER_ROOT_CERT=/srv/docker/bridgehead/bbmri/$ERIC_ROOT_CERT.crt.pem
PROXY_ID=$ERIC_PROXY_ID
BROKER_ID=$ERIC_BROKER_ID
elif [ "${ENABLE_GBN}" == "true" ]; then
BROKER_ROOT_CERT=/srv/docker/bridgehead/bbmri/$GBN_ROOT_CERT.crt.pem
PROXY_ID=$GBN_PROXY_ID
BROKER_ID=$GBN_BROKER_ID
# Modification needed for running in a test mode
elif [ "${PROJECT}" == "ccp" ]; then
BROKER_ROOT_CERT=/srv/docker/bridgehead/ccp/root.crt.pem
else
fail_and_report 1 "Could not start secret sync as the configuration does not seem to use beam"
fi
local broker_url="https://$BROKER_ID"
mkdir -p /var/cache/bridgehead/secrets/ || fail_and_report 1 "Failed to create '/var/cache/bridgehead/secrets/'. Please run sudo './bridgehead install $PROJECT' again."
touch /var/cache/bridgehead/secrets/oidc
# Modification needed for running in a test mode
# Commented out so that the Bridgehead can run without Beam.
# docker run --rm \
# -v /var/cache/bridgehead/secrets/oidc:/usr/local/cache \
# -v $PRIVATEKEYFILENAME:/run/secrets/privkey.pem:ro \
# -v $BROKER_ROOT_CERT:/run/secrets/root.crt.pem:ro \
# -v /etc/bridgehead/trusted-ca-certs:/conf/trusted-ca-certs:ro \
# -e TLS_CA_CERTIFICATES_DIR=/conf/trusted-ca-certs \
# -e NO_PROXY=localhost,127.0.0.1 \
# -e ALL_PROXY=$HTTPS_PROXY_FULL_URL \
# -e PROXY_ID=$PROXY_ID \
# -e BROKER_URL=$broker_url \
# -e OIDC_PROVIDER=secret-sync-central.oidc-client-enrollment.$BROKER_ID \
# -e SECRET_DEFINITIONS=$secret_sync_args \
# docker.verbis.dkfz.de/cache/samply/secret-sync-local:latest
docker run --rm \
-v /var/cache/bridgehead/secrets/oidc:/usr/local/cache \
-v $PRIVATEKEYFILENAME:/run/secrets/privkey.pem:ro \
-v /srv/docker/bridgehead/$PROJECT/root.crt.pem:/run/secrets/root.crt.pem:ro \
-v /etc/bridgehead/trusted-ca-certs:/conf/trusted-ca-certs:ro \
-e TLS_CA_CERTIFICATES_DIR=/conf/trusted-ca-certs \
-e NO_PROXY=localhost,127.0.0.1 \
-e ALL_PROXY=$HTTPS_PROXY_FULL_URL \
-e PROXY_ID=$PROXY_ID \
-e BROKER_URL=$BROKER_URL \
-e OIDC_PROVIDER=secret-sync-central.oidc-client-enrollment.$BROKER_ID \
-e SECRET_DEFINITIONS=$secret_sync_args \
docker.verbis.dkfz.de/cache/samply/secret-sync-local:latest
set -a # Export variables as environment variables
source /var/cache/bridgehead/secrets/oidc