Merge pull request #3396 from KeyboardNerd/QUAY-1227

Mount SSL certs in config_app if given
This commit is contained in:
Sida Chen 2019-03-04 14:16:26 -05:00 committed by GitHub
commit 3edbd6caf6
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -4,9 +4,15 @@ QUAYPATH=${QUAYPATH:-"."}
QUAYCONF=${QUAYCONF:-"$QUAYPATH/conf"} QUAYCONF=${QUAYCONF:-"$QUAYPATH/conf"}
cd ${QUAYDIR:-"/"} cd ${QUAYDIR:-"/"}
echo 'Creating self-signed certs for quay-config app' if [ -f "$QUAYCONF/stack/ssl.key" ] && [ -f "$QUAYCONF/stack/ssl.cert" ]; then
echo 'Using mounted ssl certs for quay-config app'
cp $QUAYCONF/stack/ssl.key $QUAYDIR/config_app/quay-config.key
cp $QUAYCONF/stack/ssl.cert $QUAYDIR/config_app/quay-config.cert
else
echo 'Creating self-signed certs for quay-config app'
# Create certs to secure connections while uploading config for secrets # Create certs to secure connections while uploading config for secrets
echo '{"CN":"CA","key":{"algo":"rsa","size":2048}}' | cfssl gencert -initca - | cfssljson -bare quay-config echo '{"CN":"CA","key":{"algo":"rsa","size":2048}}' | cfssl gencert -initca - | cfssljson -bare quay-config
cp quay-config-key.pem $QUAYDIR/config_app/quay-config.key cp quay-config-key.pem $QUAYDIR/config_app/quay-config.key
cp quay-config.pem $QUAYDIR/config_app/quay-config.cert cp quay-config.pem $QUAYDIR/config_app/quay-config.cert
fi