4
4
ACME=/usr/local/bin/acme-nginx
5
5
6
6
# Sources the environment variables required
7
- source /etc/blot/secrets. env
7
+ . /etc/blot/wildcard-ssl- env.sh
8
8
9
9
if [ -z " $BLOT_HOST " ]; then
10
10
echo " BLOT_HOST variable missing, pass the hostname of the blot instance as an argument to this script"
@@ -16,6 +16,16 @@ if [ -z "$BLOT_REDIS_HOST" ]; then
16
16
exit 1
17
17
fi
18
18
19
+ if [ -z " $AWS_ACCESS_KEY_ID " ]; then
20
+ echo " AWS_ACCESS_KEY_ID variable missing, pass the aws access key as an argument to this script"
21
+ exit 1
22
+ fi
23
+
24
+ if [ -z " $AWS_SECRET_ACCESS_KEY " ]; then
25
+ echo " AWS_SECRET_ACCESS_KEY variable missing, pass the aws access key as an argument to this script"
26
+ exit 1
27
+ fi
28
+
19
29
HASH_OF_KEY_BEFORE=$( cat /etc/ssl/private/letsencrypt-domain.key | openssl md5 | cut -d' ' -f2)
20
30
HASH_OF_PEM_BEFORE=$( cat /etc/ssl/private/letsencrypt-domain.pem | openssl md5 | cut -d' ' -f2)
21
31
@@ -39,7 +49,7 @@ if [ "$HASH_OF_PEM_BEFORE" = "$HASH_OF_PEM_AFTER" ]; then
39
49
echo " [` date -u +%Y-%m-%dT%T.%3NZ` ] Pem changed after renewal, hash after: $HASH_OF_PEM_AFTER hash before: $HASH_OF_PEM_BEFORE "
40
50
fi
41
51
42
- # We need to store the key and pem in redis so that the openresty reload script can fetch them
52
+ # We store the key and pem in redis so that the openresty reload script can fetch them
43
53
echo " [` date -u +%Y-%m-%dT%T.%3NZ` ] Beginning storage of key and pem in redis"
44
54
45
55
cat /etc/ssl/private/letsencrypt-domain.key | redis-cli -h $BLOT_REDIS_HOST -x set ' blot:openresty:ssl:key'
@@ -48,4 +58,4 @@ cat /etc/ssl/private/letsencrypt-domain.pem | redis-cli -h $BLOT_REDIS_HOST -x s
48
58
redis-cli -h $BLOT_REDIS_HOST set ' blot:openresty:ssl:updated' $( date -u +%s)
49
59
50
60
# Restart openresty to use the new cert
51
- sudo openresty -s reload
61
+ openresty -s reload
0 commit comments