Skip to content

Instantly share code, notes, and snippets.

@tehplague
tehplague / certbot-renew.sh
Last active September 30, 2023 11:37
Automatic Let's Encrypt certificate issuance for QNAP QTS. You need to have Container Station installed to have Docker available.
#!/bin/sh
DOMAIN=nas.domain.tld
[email protected]
BASEDIR=$(dirname $0)
test -d ${BASEDIR}/etc/letsencrypt || mkdir -p ${BASEDIR}/etc/letsencrypt
test -d ${BASEDIR}/var/log/letsencrypt || mkdir -p ${BASEDIR}/var/log/letsencrypt
docker run --rm -v "$(pwd)/etc/letsencrypt:/etc/letsencrypt" -v "$(pwd)/var/log/letsencrypt:/var/log/letsencrypt" certbot/dns-digitalocean:latest certonly -n --agree-tos -m ${CA_EMAIL} --dns-digitalocean --dns-digitalocean-credentials /etc/letsencrypt/digitalocean.ini --dns-digitalocean-propagation-seconds 60 -d ${DOMAIN}