commit bd92ae0776c9d0bcdab2ed617bbccc2c6cf92cd4 Author: William Brawner Date: Wed Nov 24 10:01:49 2021 -0700 Initial commit diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..b7c6d5a --- /dev/null +++ b/Dockerfile @@ -0,0 +1,7 @@ +FROM certbot/certbot:latest + +COPY new-domain /usr/bin/new-domain +COPY renew /etc/periodic/monthly/renew + +ENTRYPOINT /usr/sbin/crond -f + diff --git a/README.md b/README.md new file mode 100644 index 0000000..abed29e --- /dev/null +++ b/README.md @@ -0,0 +1,13 @@ +# Certbot + +This container wraps the certbot container with an additional script to help +with requesting new domains: [new-domain](./new-domain). + +When using, make sure to mount the following folders: + +Mount|Note +---|--- +`/etc/letsencrypt`|Used to store requested certs +`/var/lib/letsencrypt`|Needed by LE +`/var/www/html/.well-known`|Needed for domain verification, needs to be the same directory as served by the web server + diff --git a/new-domain b/new-domain new file mode 100755 index 0000000..a7f6eff --- /dev/null +++ b/new-domain @@ -0,0 +1,9 @@ +#!/osr/bin/env sh + +CMD="certbot certonly --webroot -w /var/www/html" + +for domain in "$@"; do + CMD="$CMD -d $domain" +done + +eval $CMD diff --git a/renew b/renew new file mode 100644 index 0000000..96845ad --- /dev/null +++ b/renew @@ -0,0 +1,4 @@ +#!/usr/bin/env sh + +/usr/local/bin/certbot renew +