From bd92ae0776c9d0bcdab2ed617bbccc2c6cf92cd4 Mon Sep 17 00:00:00 2001 From: William Brawner Date: Wed, 24 Nov 2021 10:01:49 -0700 Subject: [PATCH] Initial commit --- Dockerfile | 7 +++++++ README.md | 13 +++++++++++++ new-domain | 9 +++++++++ renew | 4 ++++ 4 files changed, 33 insertions(+) create mode 100644 Dockerfile create mode 100644 README.md create mode 100755 new-domain create mode 100644 renew 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 +