DigitalOcean doctl

I use DigitalOcean for hosting and have recently started using doctl for managing domain records which is much faster than the gui. Has anyone intergrated letsencrypt-auto with doctl to create _acme-challenge TXT records? This would save time when adding domains to a certificate or creating a new certificate.

Regards
Paul Rigney

P.S.
I have created a script to clean up those _acme-challenge not very neat but is works and you still need to type y at the prompts

#!/bin/bash
for i in `doctl compute domain list | grep -v "^Domain" | awk '{print $1 }'`; do
	doctl compute domain records list $i | grep "_acme-challenge" | sed "s/^/$i /" | awk '{print "doctl compute domain records delete "  $1 " " $2 }' >> /tmp/ex.$$.sh
done
chmod +x /tmp/ex.$$.sh
/tmp/ex.$$.sh
rm /tmp/ex.$$.sh```

You can try https://certbot-dns-digitalocean.readthedocs.io/en/stable , which has the same convenience as doctl without having to script anything.

It will automatically create and clean up all required records.

3 Likes

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.