Until an official Linode DNS plugin is available, here's a set of scripts that facilitate DNS-01 validation when used with Certbot's manual mode.
The DNS-01 challenge works by generating a validation string that must be placed in a specially named TXT record, i.e. _acme-challenge.example.com. These scripts use Linode's v4 API to add and remove TXT records for domains whose DNS is hosted by Linode.
It works like this:
pipenv install insideLINODE_ACCESS_TOKEN environment variable or paste your access token near the top of linode.pyAlternatively, there's a Docker image available based on the official Certbot image.
When running Certbot in manual mode, specify dns as the only preferred challenge, pipenv_auth.sh for the auth hook, and pipenv_cleanup.sh for the cleanup hook. For testing, add the --dry-run flag.
Example:
LINODE_ACCESS_TOKEN=mytoken certbot certonly \
--manual --preferred-challenges=dns \
--manual-auth-hook /path/to/pipenv_auth.sh \
--manual-cleanup-hook /path/to/pipenv_cleanup.sh \
-d secure.example.com
The two shell scripts are thin wrappers that run the Python scripts in the pipenv-created virtual environment. If you prefer not to use pipenv, you can directly specify auth.py and cleanup.py instead. They will use whatever /usr/bin/env python resolves to on your system. Remember to install requests globally as well.
Example with Docker (the image automatically adds the appropriate options):
docker run --rm -it -e LINODE_ACCESS_TOKEN=mytoken \
proog/certbot-linode-dns certonly -d secure.example.com
DNS is is black magic. The time it takes for DNS changes to propagate can vary wildly. If you find that validation is failing, try increasing the waiting period near the end of auth.py.
Note that due to the way Certbot processes output from hook scripts, the output will only be available after each script has finished. Because of this, the auth hook script may seem to hang with no output for the duration of the waiting period. This is expected behavior.
Content type
Image
Digest
Size
41.3 MB
Last updated
over 7 years ago
docker pull proog/certbot-linode-dns