Skip to content

Commit

Permalink
Handle Base64
Browse files Browse the repository at this point in the history
  • Loading branch information
gsteinLTU committed Jun 28, 2024
1 parent 0325176 commit 9ac146c
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions update_caddyfile.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,9 @@ sed -i -e "s/DASH_IP/$DASH_IP/" Caddyfile

# Check if CERT and KEY environment variables are set
if [[ -n "$CERT" && -n "$KEY" ]]; then
# Write the CERT and KEY to files
echo "$CERT" > cert.pem
echo "$KEY" > key.pem

# Decode and write the CERT and KEY to files
echo "$CERT" | base64 -d > cert.pem
echo "$KEY" | base64 -d > key.pem

# Replace the placeholder with TLS configuration
sed -i -e "s/EXTRA/tls cert.pem key.pem/" Caddyfile
Expand Down

0 comments on commit 9ac146c

Please sign in to comment.