Skip to content

Commit

Permalink
Tweaks script to renew ssl cert
Browse files Browse the repository at this point in the history
  • Loading branch information
davidmerfield committed Mar 28, 2022
1 parent d1d45e2 commit f255d02
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 0 deletions.
4 changes: 4 additions & 0 deletions config/environment.sh
Expand Up @@ -74,6 +74,10 @@ export BLOT_YOUTUBE_SECRET=
export BLOT_AWS_KEY=
export BLOT_AWS_SECRET=

# AWS for controlling route 53 for wildcard SSL certficate
export AWS_ACCESS_KEY_ID=
export AWS_SECRET_ACCESS_KEY=

# Mailgun for sending emails to customers
export BLOT_MAILGUN_KEY=

Expand Down
18 changes: 18 additions & 0 deletions scripts/production/renew-wildcard-ssl.sh
@@ -0,0 +1,18 @@
#!/bin/sh
set -e
set -x

ACME=/usr/local/bin/acme-nginx
LOGFILE=/var/log/letsencrypt.log

# Sources the environment variables required
. /etc/blot/environment.sh

# This is required to allow the cron script to work correctly
alias nginx='/usr/local/openresty/bin/openresty'

echo "[`date -u +%Y-%m-%dT%T.%3NZ`] Beginning attempt to renew wildcard certificate" >> $LOGFILE

$ACME --dns-provider route53 -d "*.$BLOT_HOST" -d "$BLOT_HOST" >> $LOGFILE 2>&1

echo "[`date -u +%Y-%m-%dT%T.%3NZ`] Finished attempt to renew wildcard certificate" >> $LOGFILE

0 comments on commit f255d02

Please sign in to comment.