Skip to main content

Certbot plugin for authentication using Gandi LiveDNS - modern

Project description

Certbot plugin for authentication using Gandi LiveDNS - modern

This is a plugin for Certbot that uses the Gandi LiveDNS API to allow Gandi customers to prove control of a domain name.

This plugin is originally based on https://github.com/obynio/certbot-plugin-gandi by Yohann Leon. Due to some missing bugfixes I have forked and published this "modern" version of the plugin to make it usable again.

[!IMPORTANT]
In order to match the naming convention for certbot plugin, the plugin has been repackaged under a new name certbot-dns-plugin and legacy users of the previous package will receive the new package as a dependency.

Usage

  1. Obtain a Gandi API Personal Access Token (PAT) - see Gandi LiveDNS API > Authentication.

    Your Gandi personal access token requires minimum permissions in the Domains category to work with the plugin: See and renew domain names & Manage domain name technical configurations.

  2. Install the modern plugin and ensure the "non-modern" or "older package name" variants are not present:

    pip uninstall certbot-plugin-gandi certbot-plugin-gandi-modern
    pip install certbot-dns-gandi-modern>=1.6.2
    
  3. Create a /etc/letsencrypt/gandi.ini config file with the following contents:

    # Gandi personal access token
    dns_gandi_token=PERSONAL_ACCESS_TOKEN
    

    Replace PERSONAL_ACCESS_TOKEN with your Gandi personal access token. You can also use a Gandi LiveDNS API Key instead, see FAQ below.

  4. Ensure permissions are set to disallow access from other users, e.g., using chmod 0600 gandi.ini

  5. Run certbot and direct it to use the plugin for authentication with the config file:

    certbot certonly --authenticator dns-gandi --dns-gandi-credentials /etc/letsencrypt/gandi.ini -d example.com
    # or
    certbot renew --authenticator dns-gandi --dns-gandi-credentials /etc/letsencrypt/gandi.ini
    

For backwards-compatibility with the "non-modern" variant of the plugin, the modern variant uses the same authenticator and credentials CLI argument names. Make sure to uninstall any "non-modern" packages to avoid shadowing of CLI argument names.

Please note that this solution is usually not relevant if you're using Gandi's web hosting services as Gandi offers free automated certificates for all simplehosting plans having SSL in the admin interface.

Be aware that the plugin configuration must be provided by CLI, configuration for third-party plugins in cli.ini is not supported by certbot for the moment. Please refer to #4351, #6504 and #7681 for details.

Distribution

PyPI is currently the only distribution mechanism for this "modern" variant of the certbot-plugin-gandi-modern package.

Other channels, as well as the "non-modern" variants are not maintained by me.

pip uninstall certbot-plugin-gandi certbot-plugin-gandi-modern
pip install certbot-dns-gandi-modern>=1.6.2

Installing this plugin from PyPI using pip will also install a recent version of certbot itself, which may conflict with any other certbot already installed on your system. See the provided Dockerfile on how to containerize certbot + the plugin to run together.

Wildcard certificates

This plugin is particularly useful when you need to obtain a wildcard certificate using dns challenges:

certbot certonly --authenticator dns-gandi --dns-gandi-credentials /etc/letsencrypt/gandi.ini -d example.com -d \*.example.com

Automatic renewal

You can setup automatic renewal using crontab with the following job for weekly renewal attempts:

0 0 * * 0 certbot renew -q --authenticator dns-gandi --dns-gandi-credentials /etc/letsencrypt/gandi.ini

Reading material

Keep in mind that this blog post references the "non-modern" variant - so make to install and use the correct "modern" variant if needed.

FAQ

Make sure to uninstall and remove any trace of the "non-modern" or "older package name" variants certbot-plugin-gandi and certbot-plugin-gandi-modern package.

I don't have a personal access token, only a Gandi LiveDNS API Key

Live DNS API keys are deprecated and now unusable.

I have a warning telling me Plugin legacy name certbot-plugin-gandi:dns may be removed in a future version. Please use dns instead.

Certbot had moved to remove 3rd party plugins prefixes since v1.7.0. Please switch to the new configuration format and remove any used prefix-based configuration.

Why do you keep this plugin a third-party plugin ? Just merge it with certbot ?

This Gandi plugin is a third-party plugin mainly because this plugin is not officially backed by Gandi and because Certbot does not accept new plugin submissions.

no_submission

Credits

Huge thanks to Michael Porter for its original work !

Huge thanks to Yohann Leon for the continuation of this work !

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_gandi_modern-1.6.2.tar.gz (6.0 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_gandi_modern-1.6.2-py3-none-any.whl (7.4 kB view details)

Uploaded Python 3

File details

Details for the file certbot_dns_gandi_modern-1.6.2.tar.gz.

File metadata

  • Download URL: certbot_dns_gandi_modern-1.6.2.tar.gz
  • Upload date:
  • Size: 6.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.10.10 {"installer":{"name":"uv","version":"0.10.10","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for certbot_dns_gandi_modern-1.6.2.tar.gz
Algorithm Hash digest
SHA256 15fbe052ae17efd104535c103fde84e275eeb3830066a7a7cae0e9150a1cdd2c
MD5 96cef79822720c0ef91bc15d874c4877
BLAKE2b-256 0765da45066d7143c0c6f405b561d22e11a40aec2ae773a0c5a61e3947fc0d12

See more details on using hashes here.

File details

Details for the file certbot_dns_gandi_modern-1.6.2-py3-none-any.whl.

File metadata

  • Download URL: certbot_dns_gandi_modern-1.6.2-py3-none-any.whl
  • Upload date:
  • Size: 7.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.10.10 {"installer":{"name":"uv","version":"0.10.10","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for certbot_dns_gandi_modern-1.6.2-py3-none-any.whl
Algorithm Hash digest
SHA256 b40016f49c739b645855faaddf366af081e7d10b3374169d47790e1371cc3d50
MD5 5e4213f6c27fbf94f5c424bfdde07a63
BLAKE2b-256 79ec4e077b3811e222124141d956c75bacffd990c4100bc6455c1f01fced03b7

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