Add an httpreq endpoint for lego and Traefik

jarld can now answer lego's httpreq DNS provider
(POST /api/v1/acme/httpreq/present and /cleanup), so lego and Traefik
publish DNS-01 challenges with only environment variables, without the
jarl CLI. lego's username and API token arrive as HTTP Basic auth,
accepted on these routes only.

The endpoint is off by default (acme.httpreq.enabled) and HTTPS-only by
default: jarld's own TLS, or a trusted proxy that says so with
X-Forwarded-Proto or Forwarded (the last value counts). Plain HTTP can be
allowed from loopback only or everywhere. GET /api/v1/acme/httpreq shows
how jarld sees a request, to check a proxy setup.

jarl acme and the endpoint share their code in internal/acme. Documented
in docs/acme.md, configuration.md, api.md and permissions.md.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
abrown38andClaude Opus 5.5 committed 2026-10-08 13:48:47 +00:00
1 parent 0221c78c8a
commit 6b44b92975
18 files changed
+1106 -73

No files matched your search

+14
View File
@@ -24,6 +24,20 @@ The first version, to be released as 0.1.0.
the web UI. Networks smaller than a /24 explain that they belong in the
enclosing /24's zone.
- docs/operations.md: setting up a secondary server with its own jarld.
- An endpoint for lego's `httpreq` DNS provider
(`/api/v1/acme/httpreq/present` and `/cleanup`), so lego and Traefik can
publish DNS-01 challenges with only environment variables, without the
jarl CLI. lego's username and API token arrive as HTTP Basic auth, which
is accepted on these routes only. Off by default
(`acme.httpreq.enabled`), and HTTPS-only by default: jarld's own TLS, or a
trusted proxy that says so with `X-Forwarded-Proto` or `Forwarded`.
Plain HTTP can be allowed from loopback only (`allow_loopback_http`) or
everywhere (`require_https: false`). `GET /api/v1/acme/httpreq` shows how
jarld sees a request, to check a proxy setup. `jarl acme` and the endpoint
share their code (`internal/acme`).
- Trusted proxies may also send the standard `Forwarded: proto=https`
header. When a proxy header lists several values, the last one (added by
the nearest proxy) counts.
- lego support: `contrib/lego/jarl-lego.sh` is a program for lego's `exec`
DNS provider that publishes DNS-01 challenges through `jarl acme`,
including challenge names reached through a CNAME (docs/acme.md).