Skip to content

Instantly share code, notes, and snippets.

@lbt
Last active September 6, 2024 10:15
Show Gist options
  • Save lbt/dbe56493011ca6db9063072d891cb206 to your computer and use it in GitHub Desktop.
Save lbt/dbe56493011ca6db9063072d891cb206 to your computer and use it in GitHub Desktop.
LE subdomain for Cloudflare hosted DNS
certbot -v -n certonly --manual --force-renewal -d "*.local.example.com" \
--preferred-challenges dns --agree-tos --email [email protected] \
--logs-dir ~/letsencrypt/logs \
--config-dir ~/letsencrypt/etc \
--work-dir ~/letsencrypt/work/. \
--manual-auth-hook ~/letsencrypt/manual-local-hook.sh
#!/bin/bash
# Needs the Cloudflare cli4 installed in a venv:
~/venv-letsencrypt/bin/cli4 --patch content="$CERTBOT_VALIDATION" /zones/:example.com/dns_records/:_acme-challenge.local.example.com
echo changed to:
echo "_acme-challenge.local.example.com. 60 IN TXT \"$CERTBOT_VALIDATION\""
echo waiting...
sleep 10
echo dig says
dig @1.1.1.1 _acme-challenge.local.example.com -t txt | grep -i txt | grep -v \;
exit 0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment