You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Allow using a custom/internal ACME server (e.g. step-ca) via
CERTPROVIDER=custom and CERTPROVIDERURL=<acme directory url>.
- ACMECABUNDLE (file path or base64 PEM) is written to
/config/cabundle.pem and trusted via REQUESTS_CA_BUNDLE for both
initial issuance and renewals (le-renew.sh).
- Optional External Account Binding via EAB_KID/EAB_HMAC_KEY for
servers that require it; both must be set or neither.
- Custom provider is tracked for change-detection and revocation, so
switching servers re-issues against the correct ACME server.
Closes#186
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Copy file name to clipboardExpand all lines: readme-vars.yml
+6-1Lines changed: 6 additions & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -31,7 +31,11 @@ cap_add_param_vars:
31
31
opt_param_usage_include_env: true
32
32
opt_param_env_vars:
33
33
- {env_var: "SUBDOMAINS", env_value: "www,", desc: "Subdomains you'd like the cert to cover (comma separated, no spaces) ie. `www,ftp,cloud`. For a wildcard cert, set this *exactly* to `wildcard` (wildcard cert is available via `dns` validation only)"}
34
-
- {env_var: "CERTPROVIDER", env_value: "", desc: "Optionally define the cert provider. Set to `zerossl` for ZeroSSL certs (requires existing [ZeroSSL account](https://app.zerossl.com/signup) and the e-mail address entered in `EMAIL` env var). Otherwise defaults to Let's Encrypt."}
34
+
- {env_var: "CERTPROVIDER", env_value: "", desc: "Optionally define the cert provider. Set to `zerossl` for ZeroSSL certs (requires existing [ZeroSSL account](https://app.zerossl.com/signup) and the e-mail address entered in `EMAIL` env var). Set to `custom` to use a custom/internal ACME server (e.g. [step-ca](https://smallstep.com/docs/step-ca/)), which requires `CERTPROVIDERURL` (see below). Otherwise defaults to Let's Encrypt."}
35
+
- {env_var: "CERTPROVIDERURL", env_value: "", desc: "Only used when `CERTPROVIDER=custom`. The ACME directory URL of your custom ACME server, ie. `https://ca.example.com/acme/acme/directory`."}
36
+
- {env_var: "ACMECABUNDLE", env_value: "", desc: "Only used when `CERTPROVIDER=custom`. Trust an internal CA so SWAG can connect to your ACME server over TLS. Either a path to a CA bundle PEM file mounted into the container, or the base64-encoded contents of that PEM."}
37
+
- {env_var: "EAB_KID", env_value: "", desc: "Only used when `CERTPROVIDER=custom`. External Account Binding key identifier, if your custom ACME server requires EAB. Must be set together with `EAB_HMAC_KEY`."}
38
+
- {env_var: "EAB_HMAC_KEY", env_value: "", desc: "Only used when `CERTPROVIDER=custom`. External Account Binding HMAC key, if your custom ACME server requires EAB. Must be set together with `EAB_KID`."}
35
39
- {env_var: "CERT_PROFILE", env_value: "", desc: "Optionally define a cert profile to use for cert generation. This is useful if you want to use a custom cert profile instead of the default one. Currently only supported for Let's Encrypt. See https://letsencrypt.org/docs/profiles/ "}
36
40
- {env_var: "DNSPLUGIN", env_value: "cloudflare", desc: "Required if `VALIDATION` is set to `dns`. Options are `acmedns`, `aliyun`, `azure`, `bunny`, `cloudflare`, `cpanel`, `desec`, `digitalocean`, `directadmin`, `dnsimple`, `dnsmadeeasy`, `dnspod`, `do`, `domeneshop`, `dreamhost`, `duckdns`, `dynu`, `freedns`, `gandi`, `gehirn`, `glesys`, `godaddy`, `google`, `he`, `hetzner`, `hetzner-cloud`, `infomaniak`, `inwx`, `ionos`, `linode`, `loopia`, `luadns`, `mijn-host`, `namecheap`, `netcup`, `njalla`, `nsone`, `ovh`, `porkbun`, `rfc2136`, `route53`, `sakuracloud`, `standalone`, `transip`, and `vultr`. Also need to enter the credentials into the corresponding ini (or json for some plugins) file under `/config/dns-conf`."}
37
41
- {env_var: "PROPAGATION", env_value: "", desc: "Optionally override (in seconds) the default propagation time for the dns plugins."}
@@ -220,6 +224,7 @@ init_diagram: |
220
224
"swag:latest" <- Base Images
221
225
# changelog
222
226
changelogs:
227
+
- {date: "11.07.26:", desc: "Add support for custom/internal ACME servers via `CERTPROVIDER=custom` with `CERTPROVIDERURL`, optional `ACMECABUNDLE` for internal CA trust, and optional `EAB_KID`/`EAB_HMAC_KEY` for External Account Binding."}
223
228
- {date: "10.07.26:", desc: "Add support for Let's Encrypt cert profiles. Run certbot twice daily with a random delay."}
224
229
- {date: "19.06.26:", desc: "Add support for mijn.host dns validation."}
225
230
- {date: "01.06.26:", desc: "Remove obsolete old cert check logic."}
[[ ! "${CERT_PROFILE}" = "${ORIGCERT_PROFILE}" ]]; then
192
200
echo "Different validation parameters entered than what was used before. Revoking and deleting existing certificate, and an updated one will be created"
193
-
if [[ "${ORIGCERTPROVIDER}" = "zerossl" ]]; then
201
+
if [[ "${ORIGCERTPROVIDER}" = "custom" ]]; then
202
+
REV_ACMESERVER=("${ORIGCERTPROVIDERURL}")
203
+
elif [[ "${ORIGCERTPROVIDER}" = "zerossl" ]]; then
# if zerossl is selected or staging is set to true, use the relevant server
212
227
if [[ "${CERTPROVIDER}" = "zerossl" ]] && [[ "${STAGING}" = "true" ]]; then
213
228
echo "ZeroSSL does not support staging mode, ignoring STAGING variable"
214
229
fi
215
-
if [[ "${CERTPROVIDER}" = "zerossl" ]] && [[ -n "${EMAIL}" ]]; then
230
+
if [[ "${CERTPROVIDER}" = "custom" ]]; then
231
+
if [[ -z "${CERTPROVIDERURL}" ]]; then
232
+
echo "CERTPROVIDER is set to custom, but CERTPROVIDERURL is not set. Please set CERTPROVIDERURL to the ACME directory URL of your custom ACME server (e.g. https://ca.example.com/acme/acme/directory). Sleeping."
233
+
sleep infinity
234
+
fi
235
+
echo "Using custom ACME server as the cert provider: ${CERTPROVIDERURL}"
236
+
if [[ "${STAGING}" = "true" ]]; then
237
+
echo "STAGING has no effect with a custom ACME server, ignoring STAGING variable"
238
+
fi
239
+
ACMESERVER="${CERTPROVIDERURL}"
240
+
# Trust a custom/internal CA so certbot can reach the ACME server over TLS.
241
+
# ACMECABUNDLE may be a path to a mounted PEM file or a base64-encoded PEM.
0 commit comments