|
| 1 | +# shimkit 0.13.0 |
| 2 | + |
| 3 | +`shimkit tls --method dns-cloudflare` — DNS-01 ACME challenge via |
| 4 | +Cloudflare. The path to wildcard certs (`*.example.com`). For the |
| 5 | +full machine-readable changelog, see |
| 6 | +[`CHANGELOG.md`](../../CHANGELOG.md). |
| 7 | + |
| 8 | +--- |
| 9 | + |
| 10 | +## TL;DR |
| 11 | + |
| 12 | +``` |
| 13 | +shimkit tls request --method dns-cloudflare --credentials FILE -d ... |
| 14 | +``` |
| 15 | + |
| 16 | +Uses `certbot/dns-cloudflare:v3.0.1` (auto-selected). Webroot |
| 17 | +method still uses `certbot/certbot:v3.0.1` — the two paths are |
| 18 | +independent and you can mix-and-match by domain. |
| 19 | + |
| 20 | +--- |
| 21 | + |
| 22 | +## Why DNS-01 |
| 23 | + |
| 24 | +The webroot (HTTP-01) method that shipped in v0.8.0 works for |
| 25 | +single hostnames you control via HTTP. But **wildcard certs |
| 26 | +(`*.example.com`) only work via DNS-01** — that's a Let's Encrypt |
| 27 | +constraint, not a shimkit one. |
| 28 | + |
| 29 | +DNS-01 also works for domains where you don't (or can't) terminate |
| 30 | +HTTP locally — internal-only services, mail hosts, anything behind |
| 31 | +a load balancer that doesn't forward `/.well-known/acme-challenge/`. |
| 32 | + |
| 33 | +--- |
| 34 | + |
| 35 | +## Setup |
| 36 | + |
| 37 | +1. **Create a Cloudflare API token** with `Zone:DNS:Edit` scope on |
| 38 | + the zone you're issuing for. <https://dash.cloudflare.com/profile/api-tokens>. |
| 39 | + (Don't use the legacy "Global API Key" — that's account-wide.) |
| 40 | + |
| 41 | +2. **Write the credentials file**: |
| 42 | + |
| 43 | + ```bash |
| 44 | + echo 'dns_cloudflare_api_token = YOUR-CLOUDFLARE-API-TOKEN' \ |
| 45 | + > ~/.secrets/cloudflare.ini |
| 46 | + chmod 600 ~/.secrets/cloudflare.ini |
| 47 | + ``` |
| 48 | + |
| 49 | + Mode 0600 is mandatory — both shimkit and certbot refuse the |
| 50 | + file if it's group- or world-readable. |
| 51 | + |
| 52 | +3. **Issue the cert** (staging first; production rate limits are |
| 53 | + punishing): |
| 54 | + |
| 55 | + ```bash |
| 56 | + shimkit tls request --yes --staging \ |
| 57 | + --email ops@example.com \ |
| 58 | + --method dns-cloudflare \ |
| 59 | + --credentials ~/.secrets/cloudflare.ini \ |
| 60 | + -d example.com -d '*.example.com' |
| 61 | + ``` |
| 62 | + |
| 63 | +4. Once staging works, drop `--staging` for the real cert. |
| 64 | + |
| 65 | +--- |
| 66 | + |
| 67 | +## How it works |
| 68 | + |
| 69 | +``` |
| 70 | +docker run --rm \ |
| 71 | + -v ~/.shimkit/data/tls/etc-letsencrypt:/etc/letsencrypt \ |
| 72 | + -v ~/.shimkit/data/tls/var-lib-letsencrypt:/var/lib/letsencrypt \ |
| 73 | + -v ~/.secrets:/credentials:ro \ |
| 74 | + certbot/dns-cloudflare:v3.0.1 \ |
| 75 | + certonly --non-interactive --agree-tos \ |
| 76 | + --email ops@example.com \ |
| 77 | + --dns-cloudflare \ |
| 78 | + --dns-cloudflare-credentials /credentials/cloudflare.ini \ |
| 79 | + --dns-cloudflare-propagation-seconds 60 \ |
| 80 | + -d example.com -d '*.example.com' |
| 81 | +``` |
| 82 | + |
| 83 | +The parent directory of the credentials file gets mounted at |
| 84 | +`/credentials` inside the container, so |
| 85 | +`~/.secrets/cloudflare.ini` on the host becomes |
| 86 | +`/credentials/cloudflare.ini` inside. |
| 87 | + |
| 88 | +Cloudflare's plugin uses the API token to write the |
| 89 | +`_acme-challenge.<domain>` TXT record, waits the configured |
| 90 | +propagation seconds (default 60), then asks the ACME CA to |
| 91 | +validate. |
| 92 | + |
| 93 | +--- |
| 94 | + |
| 95 | +## What's new |
| 96 | + |
| 97 | +| | | |
| 98 | +|---|---| |
| 99 | +| `--method webroot` | (default) HTTP-01 via local webserver | |
| 100 | +| `--method dns-cloudflare` | DNS-01 via Cloudflare API | |
| 101 | +| `--credentials PATH` | Cloudflare creds file (mode 0600 required) | |
| 102 | +| `tools.tls.cloudflare_propagation_seconds` | Default `60`, range `[0, 600]` | |
| 103 | +| `tools.tls.certbot_dns_cloudflare_image` | Pinned `certbot/dns-cloudflare:v3.0.1` | |
| 104 | + |
| 105 | +Wildcards (`*.example.com`) now validate in shimkit's domain check |
| 106 | +— previously only single-label-then-dot patterns were accepted. |
| 107 | + |
| 108 | +--- |
| 109 | + |
| 110 | +## Renewal |
| 111 | + |
| 112 | +DNS-01 certs renew the same way as webroot certs: |
| 113 | + |
| 114 | +```bash |
| 115 | +shimkit tls renew --yes |
| 116 | +``` |
| 117 | + |
| 118 | +The `renew` command doesn't need `--method`, `--credentials`, or |
| 119 | +`--webroot` — certbot reads each cert's renewal config from |
| 120 | +`/etc/letsencrypt/renewal/<domain>.conf` (written at issuance |
| 121 | +time) and reuses the same method. |
| 122 | + |
| 123 | +The daily renewal cron from v0.8.0 covers both methods. |
| 124 | + |
| 125 | +--- |
| 126 | + |
| 127 | +## Limits |
| 128 | + |
| 129 | +- **Cloudflare-only today.** Other DNS providers (Route53, |
| 130 | + DigitalOcean, Hurricane Electric, etc.) each need their own |
| 131 | + credential surface and a different `certbot/dns-<provider>` |
| 132 | + image. Opt-in extras in a future release. |
| 133 | +- **Token, not key.** Use a scoped API token (`Zone:DNS:Edit` on |
| 134 | + the zone), not the legacy Global API Key. The Global API Key is |
| 135 | + account-wide and gives the credentials file far more power than |
| 136 | + cert issuance needs. |
| 137 | + |
| 138 | +--- |
| 139 | + |
| 140 | +## Stats |
| 141 | + |
| 142 | +- Tests: 1027 → 1044 (+17) |
| 143 | +- Gates: pytest, ruff, mypy strict — all green |
| 144 | +- New optional extras: 0 |
| 145 | + |
| 146 | +--- |
| 147 | + |
| 148 | +## Upgrading |
| 149 | + |
| 150 | +```bash |
| 151 | +uv tool upgrade shimkit |
| 152 | +pipx upgrade shimkit |
| 153 | +``` |
| 154 | + |
| 155 | +Existing webroot users see no behavioural change. To start using |
| 156 | +DNS-01, add the credentials file + pass `--method dns-cloudflare |
| 157 | +--credentials`. |
0 commit comments