Initial commit

This commit is contained in:
William Brawner 2021-10-30 00:05:59 +00:00
commit c3ec2b9291
3 changed files with 41 additions and 0 deletions

6
Dockerfile Normal file
View file

@ -0,0 +1,6 @@
FROM certbot/dns-digitalocean:latest
COPY new-domain /usr/bin/new-domain
ENTRYPOINT /usr/sbin/crond -f

13
README.md Normal file
View file

@ -0,0 +1,13 @@
# Certbot DigitalOcean
This container wraps the dns-digitalocean 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
`/root/digitalocean.ini`|Needed for authentication with DO

22
new-domain Executable file
View file

@ -0,0 +1,22 @@
#!/usr/bin/env python3
from os.path import exists
import sys
import subprocess
ini_file = '/root/digitalocean.ini'
if not exists(ini_file):
print("ERROR: digitalocean credentials not present at " + ini_file)
cmd = ['certbot', 'certonly',
'--dns-digitalocean',
'--dns-digitalocean-credentials',
ini_file,
'--dns-digitalocean-propagation-seconds',
'90',
]
for domain in sys.argv[1:]:
cmd.extend(['-d', domain])
print(run(cmd, stdout=PIPE, stderr=PIPE).stdout.decode('utf=8'))