Francis Lavoie
0665a86eb7
fastcgi: Ensure leading slash, omit SERVER_PORT if empty for compliance ( #3570 )
See https://tools.ietf.org/html/rfc3875#section-4.1.13 for SCRIPT_NAME requiring leading slash
See https://tools.ietf.org/html/rfc3875#section-4.1.15 for SERVER_PORT requiring omission if empty
5 years ago
Francis Lavoie
3fdaf50785
fastcgi: Fill REMOTE_USER with http.auth.user.id placeholder ( #3577 )
Completing a TODO!
5 years ago
Francis Lavoie
19cc2bd3c3
reverseproxy: Fix Caddyfile parsing for empty non-http transports ( #3576 )
* reverseproxy: Fix Caddyfile parsing for empty non-http transports
* Update modules/caddyhttp/reverseproxy/caddyfile.go
Co-authored-by: Matt Holt <mholt@users.noreply.github.com>
* Rename empty transport test
Co-authored-by: Matt Holt <mholt@users.noreply.github.com>
5 years ago
Matthew Holt
8a0fff58aa
caddyauth: hash-password: Set bcrypt cost to 14 ( #3580 )
5 years ago
Matthew Holt
6f0f159ba5
caddyhttp: Add {http.request.body} placeholder
5 years ago
Matthew Holt
eda54c22a6
logging: ⚠️ Deprecate logfmt encoder
It is essentially broken because it occludes many log fields.
See: https://github.com/caddyserver/caddy/issues/3575
5 years ago
Matthew Holt
2c71fb116b
chore: Rename file to be consistent
5 years ago
snu-ceyda
735c86658d
fileserver: Enable browse pagination with offset parameter ( #3542 )
* Update browse.go
* Update browselisting.go
* Update browsetpl.go
* fix linter err
* Update modules/caddyhttp/fileserver/browse.go
Co-authored-by: Matt Holt <mholt@users.noreply.github.com>
* Update modules/caddyhttp/fileserver/browselisting.go
Co-authored-by: Matt Holt <mholt@users.noreply.github.com>
* Update browsetpl.go
change from -> offset
* Update browse.go
* Update browselisting.go
Co-authored-by: Matt Holt <mholt@users.noreply.github.com>
5 years ago
Matthew Holt
a2dae1d43f
templates: Fix front matter closing fence search
This makes it choose first matching closing fence instead of last one,
which could appear in document body.
5 years ago
Matthew Holt
efc0cc5e85
caddytls: Move initial storage clean op into goroutine
Sometimes this operation can take a while (we observed 7 minutes
recently, with a large, globally-distributed storage backend).
5 years ago
Matthew Holt
0bf2565c37
caddyhttp: Reorder some access log fields; add host matcher test case
This field order reads a little more naturally.
5 years ago
Greg Anders
c35820012b
templates: Disable hard wraps in Markdown rendering ( #3553 )
5 years ago
Mohammed Al Sahaf
d7dbf85525
cel: fix validation of expression result type ( #3526 )
* cel: fix validation of expression result type
The earlier code used the proto.Equals from github.com/gogo/protobuf, which failed to compare two messages of the same type for some reason. Switching to proto.Equal from the canonical github.com/golang/protobuf fixes the issue.
* deps: remove deprecated github.com/golang/protobuf in favor of google.golang.org/protobuf
* downgrade github.com/smallstep/nosql to resolve warning pb.proto warning
5 years ago
Matthew Holt
77f233a484
caddyhttp: Corrected host label index check ( fix #3502 )
5 years ago
James Birtles
ddd690de4c
caddyhttp: Support placeholders in query matcher ( #3521 )
5 years ago
Mark Sargent
6004d3f779
caddyhttp: Add 'map' handler ( #3199 )
* inital map implementation
* resolve the value during middleware execution
* use regex instead
* pr feedback
* renamed mmap to maphandler
* refactored GetString implementation
* fixed mispelling
* additional feedback
5 years ago
Matt Holt
21c00a3cd2
caddyhttp: Better host matching for logger names ( fix #3488 ) ( #3522 )
First try an exact lookup like before, but if it fails, strip the port
and try again. example.com:1234 should still use a logger keyed for
example.com if there is no key example.com:1234.
5 years ago
Francis Lavoie
b1480eb52f
fastcgi: Fix php_fastcgi matcher regression ( #3512 )
5 years ago
Xiuming Chen
5bc4777be9
chore: Fix typo in reverse-proxy subcommand help message ( #3513 )
5 years ago
Matthew Holt
3af15c0725
caddyhttp: Empty, not nil, query matcher matches empty query string
5 years ago
Matthew Holt
6db3615547
caddyhttp: Enable matching empty query string
Caddyfile syntax: query ""
Or a nil matcher in the JSON should also match an empty query string.
See https://caddy.community/t/v2-match-empty-query/8708?u=matt
5 years ago
Francis Lavoie
003403ecbc
templates: Add support for dots to close yaml frontmatter ( #3498 )
* templates: Add support for dots to close yaml frontmatter
* templates: Fix regression in body output
5 years ago
Wynn Wolf Arbor
fa4cdde7d8
fastcgi: Make sure splitPos handles empty SplitPath correctly ( #3491 )
In commit f2ce81c
, support for multiple path splitters was added. The
type of SplitPath changed from string to []string, and splitPos was
changed to loop through all values in SplitPath.
Before that commit, if SplitPath was empty, strings.Index returned 0 and
PATH_INFO was set correctly in buildEnv.
Currently, however, splitPos returns -1 for empty values of SplitPath,
behaving as if a split position could not be found at all. PATH_INFO is
then never set in buildEnv and remains empty.
Restore the old behaviour by explicitly checking whether SplitPath is
empty and returning 0 in splitPos.
Closes #3490
5 years ago
Matthew Holt
d55c3b31eb
caddyhttp: Add client cert SAN placeholders
5 years ago
Matthew Holt
6d03fb48f9
caddytls: Don't decode HMAC
https://caddy.community/t/trouble-with-external-account-hmac/8600?u=matt
5 years ago
Matthew Holt
b3bff13f7d
reverseproxy: Close websocket conn if req context cancels
This is a recent patch in the Go standard library
5 years ago
Matthew Holt
4b10ae5ce6
reverseproxy: Add Caddyfile support for ClientCertificateAutomate
5 years ago
NWHirschfeld
1dfb11486e
httpcaddyfile: Add client_auth options to tls directive ( #3335 )
* reading client certificate config from Caddyfile
Signed-off-by: NWHirschfeld <Niclas@NWHirschfeld.de>
* Update caddyconfig/httpcaddyfile/builtins.go
Co-authored-by: Francis Lavoie <lavofr@gmail.com>
* added adapt test for parsing client certificate configuration from Caddyfile
Signed-off-by: NWHirschfeld <Niclas@NWHirschfeld.de>
* read client ca and leaf certificates from file https://github.com/caddyserver/caddy/pull/3335#discussion_r421633844
Signed-off-by: NWHirschfeld <Niclas@NWHirschfeld.de>
* Update modules/caddytls/connpolicy.go
* Make review adjustments
Co-authored-by: Francis Lavoie <lavofr@gmail.com>
Co-authored-by: Matt Holt <mholt@users.noreply.github.com>
5 years ago
Matthew Holt
11a132d48b
caddytls: Configurable cache size limit
5 years ago
Matthew Holt
7a99835dab
reverseproxy: Enable changing only the status code ( close #2920 )
5 years ago
Matthew Holt
7b0962ba4d
caddyhttp: Default to error status if found in context
This is just a convenience if using a static_response handler in an
error route, by setting the default status code to the same one as
the error status.
5 years ago
Matthew Holt
2d1f7b9da8
caddyhttp: Auto-redirects from all bind addresses ( fix #3443 )
5 years ago
Matthew Holt
a285fe4129
caddypki: Add 'acme_server' Caddyfile directive
5 years ago
Matthew Holt
e18c373064
caddytls: Actually use configured test CA
5 years ago
Matt Holt
9a7756c6e4
caddyauth: Cache basicauth results ( fixes #3462 ) ( #3465 )
Cache capacity is currently hard-coded at 1000 with random eviction.
It is enabled by default from Caddyfile configurations because I assume
this is the most common preference.
5 years ago
Matthew Holt
d5d7fb5954
go.mod: Update dependencies
5 years ago
Matthew Holt
6c051cd27d
caddyconfig: Minor internal and godoc tweaks
5 years ago
Matt Holt
9415feca7c
logging: Net writer redials if write fails ( #3453 )
* logging: Net writer redials if write fails
https://caddy.community/t/v2-log-output-net-does-not-reconnect-after-lost-connection/8386?u=matt
* Only replace connection if redial succeeds
* Fix error handling
5 years ago
Matthew Holt
881b826fb5
reverseproxy: Pool copy buffers (minor optimization)
5 years ago
Matthew Holt
538ddb8587
reverseproxy: Enable response interception ( #1447 , #2920 )
It's a raw, low-level implementation for now, but it's very flexible.
More sugar-coating can be added after error handling is more developed.
5 years ago
Matthew Holt
e5bbed1046
caddyhttp: Refactor header matching
This allows response matchers to benefit from the same matching logic
as the request header matchers (mainly prefix/suffix wildcards).
5 years ago
Matthew Holt
294910c68c
caddyhttp: Add client.public_key(_sha256) placeholders
5 years ago
Francis Lavoie
8c5d00b2bc
httpcaddyfile: New `handle_path` directive ( #3281 )
* caddyconfig: WIP implementation of handle_path
* caddyconfig: Complete the implementation - h.NewRoute was key
* caddyconfig: Add handle_path integration test
* caddyhttp: Use the path matcher as-is, strip the trailing *, update test
5 years ago
Rui Lopes
aa20878887
cmd: file-server: add --access-log flag ( #3454 )
5 years ago
Francis Lavoie
c1e5c09294
reverseproxy: Improve error message when using scheme+placeholder ( #3393 )
* reverseproxy: Improve error message when using scheme+placeholder
* reverseproxy: Simplify error message
Co-authored-by: Matt Holt <mholt@users.noreply.github.com>
Co-authored-by: Matt Holt <mholt@users.noreply.github.com>
5 years ago
AndyBan
22055c5e0f
reverseproxy: Fix https active health checks #3450 ( #3451 )
5 years ago
Mohammed Al Sahaf
dfe802aed3
chore: forego the use of deprecated cel func NewIdent in favor of NewVar ( #3444 )
5 years ago
Matthew Holt
0cbf467b3f
caddyhttp: Add time.now placeholder and update cel-go ( closes #2594 )
5 years ago
Francis Lavoie
bb67e19d7b
cmd: hash-password: Fix broken terminal state on SIGINT ( #3416 )
* caddyauth: Fix hash-password broken terminal state on SIGINT
* caddycmd: Move TrapSignals calls to only subcommands that run long
5 years ago
Matthew Holt
2a8a198568
reverseproxy: Don't overwrite existing X-Forwarded-Proto header
Correct behavior is not well defined because this is a non-standard
header field. This could be a "hop-by-hop" field much like
X-Forwarded-For is, but even our X-Forwarded-For implementation
preserves prior entries. Or, it could be best to preserve the original
value from the first hop, representing the protocol as facing the
client.
Let's try it the other way for a bit and see how it goes.
See https://caddy.community/t/caddy2-w-wordpress-behind-nginx-reverse-proxy/8174/3?u=matt
5 years ago