Skip to main content

Gigahost DNS Authenticator plugin for Certbot

Project description

certbot-dns-gigahost

Gigahost DNS Authenticator plugin for Certbot.

This plugin automates the process of completing a dns-01 challenge by creating, and subsequently removing, TXT records using the Gigahost API.

Named Arguments

Argument Description
--dns-gigahost-credentials Gigahost credentials INI file. (required)
--dns-gigahost-propagation-seconds The number of seconds to wait for DNS to propagate before asking the ACME server to verify the DNS record. (Default: 120)

Installation

pip install certbot-dns-gigahost

Credentials

Use of this plugin requires a configuration file containing a Gigahost API key.

Create an API key in the Gigahost portal (Flux) with read/write access to DNS for the zones you want to manage. The key looks like flux_live_....

See the Gigahost API documentation for more information.

An example credentials.ini file:

dns_gigahost_api_token=flux_live_xxxxxxxxxxxxxxxxxxxxxxxx

The path to this file can be provided interactively or using the --dns-gigahost-credentials command-line argument. Certbot records the path to this file for use during renewal, but does not store the file's contents.

CAUTION: You should protect this API key as you would the password to your Gigahost account. Users who can read this file can use the key to issue arbitrary API calls on your behalf, scoped to the permissions granted to the key. Users who can cause Certbot to run using this key can complete a dns-01 challenge to acquire new certificates or revoke existing certificates for associated domains, even if those domains aren't being managed by this server.

Certbot will emit a warning if it detects that the credentials file can be accessed by other users on your system. The warning reads "Unsafe permissions on credentials configuration file", followed by the path to the credentials file. This warning will be emitted each time Certbot uses the credentials file, including for renewal, and cannot be silenced except by addressing the issue (e.g., by using a command like chmod 600 to restrict access to the file).

Examples

Acquire a certificate

To acquire a single certificate for both example.com and www.example.com, waiting 120 seconds (the default) for DNS propagation:

certbot certonly \
  --authenticator dns-gigahost \
  --dns-gigahost-credentials ~/.secrets/certbot/gigahost.ini \
  --dns-gigahost-propagation-seconds 120 \
  -d example.com \
  -d www.example.com

Wildcard certificate

certbot certonly \
  --authenticator dns-gigahost \
  --dns-gigahost-credentials ~/.secrets/certbot/gigahost.ini \
  -d example.com \
  -d "*.example.com"

Secure your credentials file

mkdir -p ~/.secrets/certbot
chmod 700 ~/.secrets/certbot

cat > ~/.secrets/certbot/gigahost.ini << EOF
dns_gigahost_api_token=flux_live_xxxxxxxxxxxxxxxxxxxxxxxx
EOF

chmod 600 ~/.secrets/certbot/gigahost.ini

Docker

A Docker image can be built from the included Dockerfile:

docker build -t certbot-dns-gigahost .

Example usage:

docker run --rm \
  -v /etc/letsencrypt:/etc/letsencrypt \
  -v /var/lib/letsencrypt:/var/lib/letsencrypt \
  certbot-dns-gigahost \
  certonly \
  --authenticator dns-gigahost \
  --dns-gigahost-credentials /etc/letsencrypt/gigahost.ini \
  --agree-tos \
  --email "email@example.com" \
  -d example.com

Automatic renewal

Certbot will automatically use the plugin and credentials file during renewal. No additional configuration is needed after the initial certificate issuance. You can test renewal with:

certbot renew --dry-run

How it works

  1. When Certbot needs to validate domain ownership, the plugin authenticates with the Gigahost API using your API key as a Bearer token.
  2. It looks up the DNS zone for the domain being validated.
  3. It creates a _acme-challenge TXT record with the validation token.
  4. After Certbot verifies the challenge, the plugin removes that specific TXT record.

Development

# Clone the repository
git clone https://github.com/gigahost/certbot-dns-gigahost.git
cd certbot-dns-gigahost

# Install in development mode
pip install -e .

# Verify the plugin is recognized by certbot
certbot plugins

License

Apache License 2.0. See LICENSE for details.

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_gigahost-0.1.1.tar.gz (9.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_gigahost-0.1.1-py3-none-any.whl (10.1 kB view details)

Uploaded Python 3

File details

Details for the file certbot_dns_gigahost-0.1.1.tar.gz.

File metadata

  • Download URL: certbot_dns_gigahost-0.1.1.tar.gz
  • Upload date:
  • Size: 9.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.3

File hashes

Hashes for certbot_dns_gigahost-0.1.1.tar.gz
Algorithm Hash digest
SHA256 84839646dc1dbc7748a1a59d5f14242e97d4887f6bb38d586a1d751ec7a28d82
MD5 1c204d7a401cce5b0d53a406c2a2710d
BLAKE2b-256 dfdbbbb1a5abdef7fab887355c0b7245649324a919d92654d53cdc5705ffd04c

See more details on using hashes here.

File details

Details for the file certbot_dns_gigahost-0.1.1-py3-none-any.whl.

File metadata

File hashes

Hashes for certbot_dns_gigahost-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 ec6cbf121b43b8971b66ab1eea0e657ed8d558fdfd5615e962e14d96f4de7a56
MD5 4d7e4e7228d6464493631c1837e0fbd7
BLAKE2b-256 9097a5eaff2ed1d1bcb05cae3ba98f3edbd8817dae1546f4a9f32d7e1c1af5bd

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