HUB
Sign inSign up
lego-cloudflare-certgen logo

ljgonzalez/lego-cloudflare-certgen

By ljgonzalez

โ€ขUpdated about 3 hours ago

Lego Cloudflare Certificate Generator: github.com/ljgonzalez1/lego-cloudflare-ssl-certgen

Image
Networking
1

10K+

ljgonzalez/lego-cloudflare-certgen repository overview

โ ๐Ÿ” Lego Cloudflare Certgen

Project banner

GitHub repository and documentationโ 

Issue Let's Encrypt certificates with lego and Cloudflare DNS-01. Each group in domains.yaml produces one certificate for ordinary names and wildcards. Names with A, AAAA, or CNAME records use the same challenge. The container prints a certificate summary and exits.

โš ๏ธ Start in staging. Repeated production runs can hit Let's Encrypt's rate limit for the same set of names. Select Staging and confirm to try a live staging order. Let's Encrypt rate limitsโ 

โ ๐Ÿš€ Quick start with Docker

โ 1. Get the templates

Run these commands in a new working directory.

mkdir lego-certgen
cd lego-certgen
wget -O domains.yaml https://raw.githubusercontent.com/ljgonzalez1/lego-cloudflare-ssl-certgen/master/template.domains.yaml
wget -O .env https://raw.githubusercontent.com/ljgonzalez1/lego-cloudflare-ssl-certgen/master/template.env
chmod 600 .env
mkdir -p ssl-certs
โ 2. Set your token and names

Create a Cloudflare token with Zone DNS Edit and Zone Read for the zones you use. Fill in EMAIL and CLOUDFLARE_API_TOKEN in .env. Set ACCEPT_LEGO_TOS=true after reviewing the Let's Encrypt Terms of Serviceโ .

Replace the contents of domains.yaml with your own names. Keep wildcards quoted.

website:
  - example.com
  - www.example.com
  - "*.example.com"
โ 3. Run the container
docker run --rm -it --env-file .env \
  -v "$PWD/domains.yaml:/app/domains.yaml:ro" \
  -v "$PWD/ssl-certs:/ssl-certs" \
  ljgonzalez/lego-cloudflare-certgen:latest

Add --dry-run to preview the request. When staging works, choose Production and confirm it for trusted certificates. The files are saved under ssl-certs/. For a pinned deployment, replace latest with a version tag from the table below.

โŒ The live view reports definitive errors such as an invalid token, missing zone access or a rate limit. The failed group ends early and the other groups still run. Each certificate allows up to 100 names and has its own deadline of at most two hours. The run ends with the issued and failed counts.

โ ๐Ÿท๏ธ Tags and platforms

The current image supports ARMv6, ARMv7, ARM64, i386, and AMD64. Docker selects the platform when it pulls the image.

Full tag historyโ  ยท Docker Hub tagsโ  ยท MIT licenseโ 

Tag summary

Content type

Image

Digest

sha256:681048678โ€ฆ

Size

21.8 MB

Last updated

about 4 hours ago

docker pull ljgonzalez/lego-cloudflare-certgen