Commit Graph

1507 Commits

Author SHA1 Message Date
Francis Lavoie
2ad19885b5 rewrite: Add option to force modifying the query 2026-03-01 16:11:03 -05:00
Pavel Siomachkin
f145bce553 tls: Add tls_resolvers global option for DNS challenge configuration (#7297)
Co-authored-by: Francis Lavoie <lavofr@gmail.com>
2026-03-01 15:32:04 -05:00
Matt Holt
174fa2ddb9 caddyhttp: Evaluate tls.client placeholders more accurately (fix #7530) (#7534) 2026-02-28 22:03:18 -07:00
Matthew Holt
06a05e383c Revert "encode: Implement Flush for legacy compatibility"
This reverts commit bdcdaf77ba.
2026-02-27 14:14:19 -07:00
Matthew Holt
eac02ee98f caddyhttp: Limit empty Host check to HTTP/1.1 2026-02-27 10:22:39 -07:00
Oleksandr Redko
72eaf2583a chore: Enable modernize linter (#7519) 2026-02-26 14:01:35 -07:00
Fardjad Davari
9798f6964d caddyhttp: Avoid nil pointer dereference in proxyWrapper (#7521) 2026-02-25 04:08:41 -05:00
Francis Lavoie
9873752978 logging: Support zstd roll compression (#7515) 2026-02-23 16:04:45 -07:00
Dean Ruina
294dfff443 logging: add DirMode options and propagate FileMode to rotations (#7335)
Co-authored-by: Francis Lavoie <lavofr@gmail.com>
2026-02-23 07:27:27 +00:00
Paulo Henrique
76b198f586 http: Sort auto-HTTPS redirect routes by host specificity (fixes #7390) (#7502) 2026-02-21 21:42:40 -05:00
Mohammed Al Sahaf
d7b21c6104 reverseproxy: fix tls dialing w/ proxy protocol (#7508) 2026-02-21 21:37:10 -05:00
Matthew Holt
cb436f0a0e fileserver: Fix tests on Windows 2026-02-20 11:46:45 -07:00
Matt Holt
a1081194bf Merge commit from fork
Necessary as otherwise the early-bail in `until =
strings.IndexByte(remaining, nextCh) ... if until == -1` can cause a
case-insensitive mismatch

Co-authored-by: Asim Viladi Oglu Manizada <manizada@users.noreply.github.com>
2026-02-20 10:54:50 -07:00
Asim Viladi Oglu Manizada
eec32a0bb5 Merge commit from fork
Normalize exact hosts at provisioning and reqHost in the fast path so case-different Host variants can’t bypass host-gated routes.

Co-authored-by: Asim Viladi Oglu Manizada <manizada@users.noreply.github.com>
2026-02-20 10:19:42 -07:00
Matthew Holt
a2825c5dd9 fileserver: Replace \ with \\ in file matcher paths 2026-02-19 13:18:14 -07:00
Matt Holt
95941a71e8 chore: Add nolints to work around haywire linters (#7493)
* chore: Add nolints to work around haywire linters

* More lint wrangling
2026-02-17 16:52:54 -07:00
Matthew Holt
bdcdaf77ba encode: Implement Flush for legacy compatibility
(By sponsor request)
2026-02-16 15:59:10 -07:00
Francis Lavoie
9fe694c79c caddytls: Enable debug logging for DNSManager (#7491) 2026-02-16 15:38:56 -07:00
wangjingcun
b8b00d9160 chore: fix some comments to improve readability (#7395)
Co-authored-by: Francis Lavoie <lavofr@gmail.com>
2026-02-16 19:41:21 +00:00
zjumathcode
68d50020ee refactor: use strings.Builder to improve performance (#7364)
* refactor: use strings.Builder to improve performance

Signed-off-by: zjumathcode <pai314159@2980.com>

* refactor: small builder improvements per review (WriteByte / split writes)

also revert builder change in client_test.go

refactor(logging): build IP mask output via join of parts (more efficient)

---------

Signed-off-by: zjumathcode <pai314159@2980.com>
Co-authored-by: Francis Lavoie <lavofr@gmail.com>
2026-02-16 19:30:44 +00:00
Mohammed Al Sahaf
23d07ac89d dep: upgrade cel-go (#7478)
* dep: upgrade cel-go

Signed-off-by: Mohammed Al Sahaf <msaa1990@gmail.com>

* Try handling `map[any]any`, fix error messages

---------

Signed-off-by: Mohammed Al Sahaf <msaa1990@gmail.com>
Co-authored-by: Francis Lavoie <lavofr@gmail.com>
2026-02-16 18:25:49 +00:00
Francis Lavoie
d64c7e67a4 caddyhttp: Option to disable 0-RTT (#7485) 2026-02-16 10:20:47 -07:00
Francis Lavoie
ff4f79aebe chore: Remove obsolete comment in ech.go (#7487) 2026-02-16 10:17:01 -07:00
Amirhf
affbb99275 pki: add per-CA configurable maintenance_interval and renewal_window_ratio (#7479)
* pki: add per-CA configurable maintenance_interval and renewal_window_ratio

- Add MaintenanceInterval and RenewalWindowRatio to CA struct (JSON + Caddyfile).
- Run one maintenance goroutine per CA using its own interval.
- needsRenewal uses per-CA RenewalWindowRatio; invalid/zero ratio falls back to defaults.
- Caddyfile: maintenance_interval duration, renewal_window_ratio <0-1>.
- Tests: TestCA_needsRenewal, TestParsePKIApp for new options.

Fixes #7475

* fix codestyle
2026-02-15 09:10:12 -05:00
moscowchill
d42d39b4bc caddytls: Return errors instead of nil in client auth provisioning (#7464)
Two error returns in ClientAuthentication.provision() were
returning nil instead of the actual error, silently swallowing
failures when converting PEM files to DER and when provisioning
the CA pool. This could cause mTLS client authentication to
silently fall back to the system trust store, accepting any
client certificate signed by a public CA instead of restricting
to the configured trust anchors.
2026-02-12 08:42:54 -07:00
Oleh Konko | trust infra security audit & contribution | deterministic ai-augmented pipeline · human-verified
0188ef2e62 acmeserver: warn when policy rules unset (#7469) 2026-02-11 11:54:51 -07:00
WeidiDeng
47f3e8f8dc use math/rand/v2 instead of math/rand (#7413) 2026-02-11 09:15:51 -07:00
XYenon
03e6e439dd reverseproxy: fix X-Forwarded-* headers for Unix socket requests (#7463)
When a request arrives via a Unix domain socket (RemoteAddr == "@"),
net.SplitHostPort fails, causing addForwardedHeaders to strip all
X-Forwarded-* headers even when the connection is trusted via
trusted_proxies_unix.

Handle Unix socket connections before parsing RemoteAddr: if untrusted,
strip headers for security; if trusted, let clientIP remain empty (no
peer IP for a Unix socket hop) and fall through to the shared header
logic, preserving the existing XFF chain without appending a spurious
entry.

Amp-Thread-ID: https://ampcode.com/threads/T-019c4225-a0ad-7283-ac56-e2c01eae1103

Co-authored-by: Amp <amp@ampcode.com>
2026-02-10 13:00:20 -07:00
Kévin Dunglas
7c28c0c07a Merge commit from fork
* fix: FastCGI split SCRIPT_NAME/PATH_INFO confusion

* fix comment
2026-02-10 11:52:36 -07:00
Matthew Holt
1f43e8566b caddyhttp: Use case-insensitive comparison for large Host lists 2026-02-09 14:18:55 -07:00
Matthew Holt
bd374ca9d7 caddyhttp: Lowercase comparison when matching with escape sequence 2026-02-09 13:12:00 -07:00
Francis Lavoie
2ae0f7af69 reverseproxy: Set Host to {upstream_hostport} automatically if TLS (#7454) 2026-02-09 13:06:19 -07:00
Matthew Holt
e0f8d9b204 caddytls: Check type assertion
Fix https://github.com/mholt/caddy-l4/issues/378
2026-02-03 13:59:53 -07:00
Matthew Holt
3bb22672f9 reverseproxy: Customizable dial network for SRV upstreams
By request of a sponsor
2026-02-02 11:25:51 -07:00
Matthew Holt
935b09de83 caddtls: Skip .ts.net domains for ECH (#6971)
As it is also a special case in our automatic HTTPS.
2026-01-30 12:24:59 -07:00
Matthew Holt
7d24124430 caddyhttp: Reject invalid Host header (fix #7449) 2026-01-30 12:24:16 -07:00
Paulo Henrique
565c1c3054 autohttps: deterministic logic and strict bind checking on Linux (#7435)
* http: fix non-deterministic auto-https and improve Linux bind matching

* docs: restore historical context about Linux bind behavior
2026-01-16 08:51:23 -07:00
Mohammed Al Sahaf
e40bd019ff caddyfile: add observe_catchall_hosts option (#7434)
* caddyfile: add `observe_catchall_hosts` option

Signed-off-by: Mohammed Al Sahaf <msaa1990@gmail.com>

* correct JSON field name and doc comment

Signed-off-by: Mohammed Al Sahaf <msaa1990@gmail.com>

---------

Signed-off-by: Mohammed Al Sahaf <msaa1990@gmail.com>
2026-01-14 00:06:16 +00:00
Paulo Henrique
62134d65af reverseproxy: fix error when remote address is not an IP (#7429) 2026-01-13 19:52:56 +00:00
Francis Lavoie
90972fbebc chore: Dumb prealloc lint fix (#7430) 2026-01-13 14:13:43 -05:00
Tom Paulus
6a57142896 headers: Make ApplyTo nil-safe (#7426) 2026-01-06 17:39:58 -05:00
WeidiDeng
80f2ae92cd reverseproxy: make error chan bigger when reverse proxying websocket (#7419) 2026-01-06 04:55:47 -05:00
Felix Hildén
1f1be3f4fe tracing: Add span attributes to tracing module (#7269)
* WIP tracing span attributes

* better test

* only write attributes after other middleware (and request)

* Fix test to use header response placeholders
2025-12-31 11:33:18 -07:00
Francis Lavoie
decc8a4d6f logging: log_append Early option, Supports {http.response.body} (#7368)
* logging: `log_append` early option

* logging: `log_append` supports `{http.response.body}`

* Convenience auto-early for request body
2025-12-16 23:42:42 -05:00
Francis Lavoie
4037d05760 caddyhttp: {http.request.body_base64} placeholder (#7367) 2025-12-13 21:01:12 -07:00
Paul B
6a4296b1a4 caddytls: panic when using tls.ca_pool.source.http -> tls.ca (#7393) 2025-12-11 19:27:15 +00:00
Matt Holt
3c9c67e804 caddytls: ECH key rotation (#7356)
* caddytls: ECH key rotation

* Stop rotation goroutine on config unload

* Publish ECH keys after rotating
2025-12-10 11:50:35 -07:00
okrc
374b7a637f caddytls: fix preferred chains options by appending values instead of replacing (#7387) 2025-12-07 16:19:01 +00:00
WeidiDeng
6e0cbd0fa0 caddyhttp: create a placeholder for and log ech status (#7328)
Co-authored-by: Francis Lavoie <lavofr@gmail.com>
2025-12-07 16:01:58 +00:00
Steffen Busch
bfdb04912d docs: add maybe template function documentation (#7388) 2025-12-06 06:51:28 -05:00