Adding experimental letsencrypt support

This commit is contained in:
Ric Harvey
2016-07-22 15:43:36 +01:00
parent 9bd2dd0732
commit 4b3ce4b402
3 changed files with 47 additions and 4 deletions

13
scripts/letsencrypt-renew Executable file
View File

@@ -0,0 +1,13 @@
#!/bin/bash
# Lets Encrypt
if [ -z "$DOMAIN" ]; then
echo "You need to have \$DOMAIN set"
else
if [ -f /etc/letsencrypt/live/${DOMAIN}/fullchain.pem ]; then
cerbot renew
supervisorctl restart nginx
else
echo "There is no cert to renew"
fi
fi

14
scripts/letsencrypt-setup Executable file
View File

@@ -0,0 +1,14 @@
#!/bin/bash
# Lets Encrypt
if [ -z "$WEBROOT" ] || [ -z "$GIT_EMAIL" ] || [ -z "$DOMAIN" ]; then
echo "You need the \$WEBROOT, \$GIT_EMAIL and the \$DOMAIN Variables"
else
certbot certonly --webroot -w $WEBROOT -d $DOMAIN --email $GIT_EMAIL --agree-tos
ln -s /etc/nginx/sites-available/default-ssl.conf /etc/nginx/sites-enabled/
sed -i "s/##DOMAIN##/${DOMAIN}/g" /etc/nginx/sites-enabled/default-ssl.conf
supervisorctl restart nginx
fi