Skip to content

Commit

Permalink
Write cert to file
Browse files Browse the repository at this point in the history
  • Loading branch information
gsteinLTU committed Jun 28, 2024
1 parent 9c3c966 commit 4bd15e1
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions update_caddyfile.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,12 @@ 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

# Append the TLS configuration to the Caddyfile
echo "
tls {
certificate \"$CERT\"
key \"$KEY\"
}
tls cert.pem key.pem
" >> Caddyfile
fi

0 comments on commit 4bd15e1

Please sign in to comment.