Last active
June 15, 2017 07:51
-
-
Save ninsuo/edc400d85de8c160b5ff3e598d8f46af to your computer and use it in GitHub Desktop.
auto renewing cerificates generated from lets-encrypt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/dgr/bin/busybox sh | |
# copied from https://github.com/n0rad/rkt-images/blob/master/aci/arch/aci-arch-nginx-certbot/templates/start.tmpl.sh | |
set -e | |
. /dgr/bin/functions.sh | |
isLevelEnabled "debug" && set -x | |
## Create certif | |
# certbot certonly --email [email protected] --webroot -w /var/lib/letsencrypt/ -d domain.tld,sub.domain.tld | |
mkdir -p /var/lib/letsencrypt/.well-known | |
chgrp http /var/lib/letsencrypt | |
chmod g+s /var/lib/letsencrypt | |
nginx -g "daemon on;" | |
while true; do | |
# renew | |
certbot renew --agree-tos | |
# update nginx | |
nginx -s reload | |
sleep 86400 # 1d | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment