From: William Lallemand Date: Tue, 24 Nov 2026 16:42:04 +0000 (+0000) Subject: EXAMPLES: acme: add a Lua Gandi DNS-01 configuration X-Git-Url: https://git.kaiwu.me/http/%7B@url%7D?a=commitdiff_plain;h=86c12f743f30deb3ec39560def6aa6326acb6039;p=haproxy.git EXAMPLES: acme: add a Lua Gandi DNS-01 configuration Add a configuration loading the Gandi LiveDNS Lua handler with an ACME section using Let's Encrypt staging and combined CLI/DNS readiness. Show the certificate store and TLS frontend using the managed certificate, and list the Lua, API-token and RRset ownership requirements. --- diff --git a/examples/acme-lua.cfg b/examples/acme-lua.cfg new file mode 100644 index 000000000..db16e621d --- /dev/null +++ b/examples/acme-lua.cfg @@ -0,0 +1,49 @@ +# Example: ACME dns-01 automation via Lua event callbacks +# +# The Lua script serializes Gandi LiveDNS TXT updates per certificate/domain +# and acknowledges each apex or wildcard authorization separately. +# Cleanup deletes the complete challenge RRset; use dedicated test names. +# +# Run from the repository root: +# haproxy -f examples/acme-lua.cfg +# +# Requirements: +# - HAProxy built with USE_SSL=1 USE_LUA=1 +# - OpenSSL >= 1.1.1 (HAVE_ACME) +# - GANDI_API_KEY environment variable with a Gandi Personal Access Token +# Use lua-load, not lua-load-per-thread: per-domain publication locks belong to +# one Lua state. Other DNS writers require external coordination. + +global + setenv GANDI_API_KEY myapikey + expose-experimental-directives + tune.lua.bool-sample-conversion normal + lua-load examples/lua/acme-gandi-livedns.lua + log stderr local0 + +# --------------------------------------------------------------------------- +# ACME section: describes the CA, the account and the challenge type. +# --------------------------------------------------------------------------- +acme letsencrypt + directory https://acme-staging-v02.api.letsencrypt.org/directory +# directory https://acme-v02.api.letsencrypt.org/directory + contact doe@example.com + account-key examples/acme-account.key + challenge dns-01 + challenge-ready cli,dns + +# --------------------------------------------------------------------------- +# crt-store: maps the certificate file to the ACME section and SANs. +# --------------------------------------------------------------------------- +crt-store + load crt examples/acme-example.com.pem acme letsencrypt domains *.example.com.example.com + +# --------------------------------------------------------------------------- +# Frontend: terminates TLS with the ACME-managed certificate. +# --------------------------------------------------------------------------- +frontend https + bind *:8443 ssl crt examples/acme-example.com.pem alpn h2,http/1.1 + default_backend webservers + +backend webservers + server web1 127.0.0.1:8080 check