Skip to main content

Automate dns-01 challenge completion using Leaseweb Domains API.

Project description

certbot-dns-leaseweb

A certbot plugin that automates the process of completing a dns-01 challenge using Leaseweb's Domain API.

Install

certbot-dns-leaseweb should be installed via pip, in the same python environment in which certbot is installed:

pip install certbot-dns-leaseweb

Usage

Use the following flags to certbot to use and control this plugin:

Option Description
--authenticator dns-leaseweb required, enable and use this plugin.
--dns-leaseweb-credentials required, Leaseweb API credentials INI file.
--dns-leaseweb-propagation-seconds optional, seconds to wait for DNS records to propagate.
--dns-leaseweb-override-domain optional, Override Leaseweb domain name (to support DNS delegation).

Credentials

A suitable API token can be generated from https://secure.leaseweb.com/api-client-management/.

The token should then be stored in an INI file:

dns_leaseweb_api_token = notarealtoken

CAUTION: These API credentials should be carefully protected from exposure and unauthorised access.

They could be used to complete DNS challenges, allowing potentially unauthorised parties to obtain or revoke certificates for your domains.

Examples

Obtain a wildcard certificate for example.com:

certbot certonly \
  --authenticator dns-leaseweb \
  --dns-leaseweb-credentials leaseweb.ini \
  -d '*.example.com'

Obtain a wildcard certificate for example.com, with extra time for propagation:

certbot certonly \
  --authenticator dns-leaseweb \
  --dns-leaseweb-credentials leaseweb.ini \
  --dns-leaseweb-propagation-seconds 600 \
  -d '*.example.com'

Obtain a wildcard certificate for example.com using the domain example.net:

This assumes a CNAME record exists from _acme-challenge.example.com to _acme-challenge.example.net

certbot certonly \
  --authenticator dns-leaseweb \
  --dns-leaseweb-credentials leaseweb.ini \
  --dns-leaseweb-override-domain example.net \
  -d '*.example.com'

Docker

If you prefer to run certbot with the dns-leaseweb plugin in docker, you can build a suitable image with make image.

The image comes with a partially-completed CLI as its entrypoint:

/usr/local/bin/certbot \
  --authenticator=dns-leaseweb \
  --dns-leaseweb-credentials=/etc/letsencrypt/credentials/leaseweb.ini

You will need to create a suitable credentials file for the plugin at /etc/letsencrypt/credentials/leaseweb.ini for the instructions below to work.

You can then use it as:

docker run --rm -ti \
  --volume "/etc/letsencrypt:/etc/letsencrypt" \
  --volume "/var/lib/letsencrypt:/var/lib/letsencrypt" \
  certbot-dns-leaseweb:latest \
    certonly \
      --dns-leaseweb-propagation-seconds 600 \
      -d '*.example.com'

Issues and development

Please report any issues (or improvement suggestions) at https://gitlab.com/iwaseatenbyagrue/certbot-dns-leaseweb/-/issues.

If you want to hack on this project, please make sure you run tests and linting on your code:

task lint test

Thanks

To Letsencrypt, and the EFF for certbot.

This plugin is adapted from https://github.com/ctrlaltcoop/certbot-dns-hetzner, whose README was also the template for this file.

https://github.com/m42e/certbot-dns-ispconfig was also consulted during development of this plugin.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

certbot_dns_leaseweb-1.0.3.tar.gz (17.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

certbot_dns_leaseweb-1.0.3-py3-none-any.whl (11.6 kB view details)

Uploaded Python 3

File details

Details for the file certbot_dns_leaseweb-1.0.3.tar.gz.

File metadata

  • Download URL: certbot_dns_leaseweb-1.0.3.tar.gz
  • Upload date:
  • Size: 17.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.0

File hashes

Hashes for certbot_dns_leaseweb-1.0.3.tar.gz
Algorithm Hash digest
SHA256 492b91b8ac12af1cd69ffcdbb7c4e9d3d30218e1ec27555aa609f6931083a2e6
MD5 d3976fb30155ded60bd2b444ab1df3ce
BLAKE2b-256 c2f68e8d111ffe15e64132668b2359bcc5ec5fd62b5392dab94fed45b7191229

See more details on using hashes here.

File details

Details for the file certbot_dns_leaseweb-1.0.3-py3-none-any.whl.

File metadata

File hashes

Hashes for certbot_dns_leaseweb-1.0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 d9e0f6f9abaca730069ad8cbf8ae5c8aa92070d0a557bcb7d0f91d2e9b6a7288
MD5 8501e8cfb90356a6eb622235f4233c92
BLAKE2b-256 f4dd85d0e6514cb80d1a7f505508dde20790415984b3a155d22515ab5c048034

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page