Skip to content

Commit

Permalink
fix: ini container fails on normal startup
Browse files Browse the repository at this point in the history
  • Loading branch information
tepene committed May 4, 2023
1 parent 717998b commit 258a1ce
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions minica/certificates.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,19 @@ if [ ! -f ${CERTIFICATE_DIRECTORY}/ssh/${SSH_KEY_NAME} ];
then
echo "uBlue Forge SSH key not present. Creating new key..."
mkdir ${CERTIFICATE_DIRECTORY}/ssh -p
mkdir ${CERTIFICATE_DIRECTORY}/tls -p
# Generate SSH key
ssh-keygen -o -a 100 -t ed25519 -f ${CERTIFICATE_DIRECTORY}/ssh/${SSH_KEY_NAME} -C "[email protected]"
else
echo "Existing uBlue Forge SSH key found. Nothing to do..."
fi

# Creating TLS certificates
echo "Creating / Updating TLS certificate..."
minica --domains "*.ublue.local,ublue.local,localhost" --ip-addresses 127.0.0.1 -ca-cert "${CERTIFICATE_DIRECTORY}/tls/${TLS_ROOT_CERTIFICATE_NAME}.pem" -ca-key "${CERTIFICATE_DIRECTORY}/tls/${TLS_ROOT_CERTIFICATE_NAME}-key.pem"
if [ ! -f ${CERTIFICATE_DIRECTORY}/tls/${TLS_ROOT_CERTIFICATE_NAME}.pem ];
then
echo "uBlue Forge TLS root not certificate present. Creating new certificates..."
mkdir ${CERTIFICATE_DIRECTORY}/tls -p
# Generate TLS certificates
minica --domains "*.ublue.local,ublue.local,localhost" --ip-addresses 127.0.0.1 -ca-cert "${CERTIFICATE_DIRECTORY}/tls/${TLS_ROOT_CERTIFICATE_NAME}.pem" -ca-key "${CERTIFICATE_DIRECTORY}/tls/${TLS_ROOT_CERTIFICATE_NAME}-key.pem"
else
echo "Existing uBlue Forge TLS root certificate found. Nothing to do..."
fi

0 comments on commit 258a1ce

Please sign in to comment.