aboutsummaryrefslogtreecommitdiffhomepage
path: root/caddytest
AgeCommit message (Collapse)Author
2024-03-27caddyhttp: add http.request.local{,.host,.port} placeholder (#6182)Emily
* caddyhttp: add `http.request.local{,.host,.port}` placeholder This is the counterpart of `http.request.remote{,.host,.port}`. `http.request.remote` operates on the remote client's address, while `http.request.local` operates on the address the connection arrived on. Take the following example: - Caddy serving on `203.0.113.1:80` - Client on `203.0.113.2` `http.request.remote.host` would return `203.0.113.2` (client IP) `http.request.local.host` would return `203.0.113.1` (server IP) `http.request.local.port` would return `80` (server port) I find this helpful for debugging setups with multiple servers and/or multiple network paths (multiple IPs, AnyIP, Anycast). Co-authored-by: networkException <[email protected]> * caddyhttp: add unit test for `http.request.local{,.host,.port}` * caddyhttp: add integration test for `http.request.local.port` * caddyhttp: fix `http.request.local.host` placeholder handling with unix sockets The implementation matches the one of `http.request.remote.host` now and returns the unix socket path (just like `http.request.local` already did) instead of an empty string. --------- Co-authored-by: networkException <[email protected]>
2024-03-22rewrite: `uri query` replace operation (#6165)Aziz Rmadi
* Implemented query replace oeration * Modified replace operation to use regexes in caddyfile * Added more tests to uri query operations
2024-03-20reverseproxy: configurable active health_passes and health_fails (#6154)Sam Ottenhoff
* reverseproxy: active health check allows configurable health_passes and health_fails * Need to reset counters after recovery * rename methods to be more clear that these are coming from active health checks * do not export methods
2024-03-06rewrite: Implement `uri query` operations (#6120)Aziz Rmadi
* Implemented basic uri query operations * Added support for query operations block * Applied Replacer on all query keys and values * Implemented rename query key opration * Rewrite struct: Changed QueryOperations field to Query and comments cleanup * Cleaned up comments, changed the order of operations and added more tests * Changed order of fields in queryOps struct to match the operations order
2024-03-05logging: Implement `log_append` handler (#6066)Francis Lavoie
* logging: Implement `extra_log` handler * Rename to `log_append` * Rename `skip_log` to `log_skip` --------- Co-authored-by: Matt Holt <[email protected]>
2024-03-05httpcaddyfile: Allow nameless regexp placeholder shorthand (#6113)Francis Lavoie
Co-authored-by: Matt Holt <[email protected]>
2024-03-05logging: Implement `append` encoder, allow flatter filters config (#6069)Francis Lavoie
* logging: Implement `add` encoder * Allow flatter config structure for `filter` & `add` * Rename to append * govulncheck was unhappy
2024-03-06ci: fix the integration test `TestLeafCertLoaders` (#6149)Mohammed Al Sahaf
2024-03-05caddytls: clientauth: leaf verifier: make trusted leaf certs source ↵Aziz Rmadi
pluggable (#6050) * Made trusted leaf certificates pluggable into the tls.client_auth.leaf module * Added leaf loaders modules: file, folder, pem aand storage * Cleaned implementation of leaf cert loader modules * Added tests for leaf certs file and folder loaders * cmd: fix the output of the `Usage` section (#6138) * core: OnExit hooks (#6128) * core: OnExit callbacks * core: Process-global OnExit callbacks * ci: bump golangci/golangci-lint-action from 3 to 4 (#6141) Bumps [golangci/golangci-lint-action](https://github.com/golangci/golangci-lint-action) from 3 to 4. - [Release notes](https://github.com/golangci/golangci-lint-action/releases) - [Commits](https://github.com/golangci/golangci-lint-action/compare/v3...v4) --- updated-dependencies: - dependency-name: golangci/golangci-lint-action dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Added more leaf certificate loaders tests and cleaned up code * Modified leaf cert loaders json field names and cleaned up storage loader comment * Update modules/caddytls/leaffileloader.go * Update LeafStorageLoader certificates field name * Upgraded protobuf version --------- Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: Mohammed Al Sahaf <[email protected]> Co-authored-by: Matt Holt <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-02-26caddytls: verifier: caddyfile: re-add Caddyfile support (#6127)Mohammed Al Sahaf
* caddytls: verifier: caddyfile: re-add Caddyfile support * appease the linter * caddytls: client_auth: verifier: change namespace to `tls.client_auth.verifier`
2024-02-24acmeserver: add policy field to define allow/deny rules (#5796)Mohammed Al Sahaf
* acmeserver: support specifying the allowed challenge types * add caddyfile adapt tests * acmeserver: add `policy` field to define allow/deny rules * allow `omitempty` to work * add caddyfile support for `policy` * remove "uri domain" policy * fmt the files * add docs * do not support `CommonName`; the field is deprecated * r/DNSDomains/Domains/g * Caddyfile docs * add tests * move `Policy` to top of file
2024-02-21caddytest: Rename adapt tests to `*.caddyfiletest` extension (#6119)Francis Lavoie
2024-02-20tests: uses testing.TB interface for helper to be able to use test server in ↵José Carlos Chávez
benchmarks. (#6103)
2024-02-19caddyfile: Reject directives in the place of site addresses (#6104)Aziz Rmadi
Co-authored-by: Francis Lavoie <[email protected]>
2024-02-12logging: Inline Caddyfile syntax for `ip_mask` filter (#6094)Francis Lavoie
2024-02-08acmeserver: support specifying the allowed challenge types (#5794)Mohammed Al Sahaf
* acmeserver: support specifying the allowed challenge types * add caddyfile adapt tests * introduce basic acme_server test * skip acme test on unsuitable environments * skip integration tests of ACME * documentation * add negative-scenario test for mismatched allowed challenges * a bit more docs * fix tests for ACME challenges * appease the linter * skip ACME tests on s390x * enable ACME challenge tests on all machines * Apply suggestions from code review Co-authored-by: Matt Holt <[email protected]> --------- Co-authored-by: Matt Holt <[email protected]>
2024-01-30caddytls: Make on-demand 'ask' permission modular (#6055)Matt Holt
* caddytls: Make on-demand 'ask' permission modular This makes the 'ask' endpoint a module, which means that developers can write custom plugins for granting permission for on-demand certificates. Kicking myself that we didn't do it this way at the beginning, but who coulda known... * Lint * Error on conflicting config * Fix bad merge --------- Co-authored-by: Francis Lavoie <[email protected]>
2024-01-25chore: enabling a few more linters (#5961)Yolan Romailler
Co-authored-by: Francis Lavoie <[email protected]>
2024-01-25tls: modularize trusted CA providers (#5784)Mohammed Al Sahaf
* tls: modularize client authentication trusted CA * add `omitempty` to `CARaw` * docs * initial caddyfile support * revert anything related to leaf cert validation The certs are used differently than the CA pool flow * complete caddyfile unmarshalling implementation * Caddyfile syntax documentation * enhance caddyfile parsing and documentation Apply suggestions from code review Co-authored-by: Francis Lavoie <[email protected]> * add client_auth caddyfile tests * add caddyfile unmarshalling tests * fix and add missed adapt tests * fix rebase issue --------- Co-authored-by: Francis Lavoie <[email protected]>
2024-01-25logging: Automatic `wrap` default for `filter` encoder (#5980)Francis Lavoie
Co-authored-by: Kévin Dunglas <[email protected]>
2024-01-23caddyfile: Normalize & flatten all unmarshalers (#6037)Francis Lavoie
2024-01-16httpcaddyfile: Add optional status code argument to `handle_errors` ↵Aziz Rmadi
directive (#5965) Co-authored-by: Aziz Rmadi <[email protected]>
2024-01-15httpcaddyfile: Rewrite `root` and `rewrite` parsing to allow omitting ↵Francis Lavoie
matcher (#5844)
2024-01-13replacer: Fix escaped closing braces (#5995)Aziz Rmadi
2024-01-13filesystem: Globally declared filesystems, `fs` directive (#5833)a
2024-01-02chore: check against errors of `io/fs` instead of `os` (#6011)Mohammed Al Sahaf
* chore: replace `os.ErrNotExist` with `fs.ErrNotExist` * check against permission error from `io/fs` package
2023-12-18httpcaddyfile: Sort skip_hosts for deterministic JSON (#5990)Francis Lavoie
* httpcaddyfile: Sort skip_hosts for deterministic JSON * Update caddyconfig/httpcaddyfile/httptype.go Co-authored-by: Mohammed Al Sahaf <[email protected]> * Fix test * Bah --------- Co-authored-by: Mohammed Al Sahaf <[email protected]>
2023-11-20httpredirectlistener: Only set read limit for when request is HTTP (#5917)WeidiDeng
2023-10-24test: acmeserver: add smoke test for the ACME server directory (#5914)Mohammed Al Sahaf
2023-10-16httpcaddyfile: Remove port from logger names (#5881)Francis Lavoie
Co-authored-by: Matt Holt <[email protected]>
2023-10-14httpcaddyfile: Fix TLS automation policy merging with get_certificate (#5896)Francis Lavoie
2023-10-11reverseproxy: Replace health header placeholders (#5861)Francis Lavoie
2023-10-11reverseproxy: fix parsing Caddyfile fails for unlimited request/response ↵Fred Cox
buffers (#5828)
2023-10-10httpcaddyfile: Enable TLS for catch-all site if `tls` directive is specified ↵Đỗ Trọng Hải
(#5808)
2023-10-10encode: Add `application/wasm*` to the default content types (#5869)Christoph
2023-10-02fix: caddytest.AssertResponseCode error message (#5853)Kévin Dunglas
2023-08-19httpcaddyfile: Stricter errors for site and upstream address schemes (#5757)Karun Agarwal
Co-authored-by: Mohammed Al Sahaf <[email protected]> Co-authored-by: Francis Lavoie <[email protected]>
2023-08-14ci: use gci linter (#5708)Jacob Gadikian
* use gofmput to format code * use gci to format imports * reconfigure gci * linter autofixes * rearrange imports a little * export GOOS=windows golangci-lint run ./... --fix
2023-08-09Fix testsMatthew Holt
I thought Go ordered JSON objects when marshaling, but I guess not.
2023-08-07ci: Use gofumpt to format code (#5707)Jacob Gadikian
2023-08-05reverseproxy: do not parse upstream address too early if it contains ↵Mohammed Al Sahaf
replaceble parts (#5695) * reverseproxy: do not parse upstream address too early if it contains replaceble parts * remove unused method * cleanup * accommodate partially replaceable port
2023-08-02caddyhttp: Make use of `http.ResponseController` (#5654)v2.7.0Francis Lavoie
* caddyhttp: Make use of http.ResponseController Also syncs the reverseproxy implementation with stdlib's which now uses ResponseController as well https://github.com/golang/go/commit/2449bbb5e614954ce9e99c8a481ea2ee73d72d61 * Enable full-duplex for HTTP/1.1 * Appease linter * Add warning for builds with Go 1.20, so it's less surprising to users * Improved godoc for EnableFullDuplex, copied text from stdlib * Only wrap in encode if not already wrapped
2023-08-02httpcaddyfile: Allow `hostnames` & logger name overrides for log directive ↵Francis Lavoie
(#5643) * httpcaddyfile: Allow `hostnames` override for log directive * Implement access logger name overrides * Fix panic & default logger clobbering edgecase
2023-06-20reverseproxy: weighted_round_robin load balancing policy (#5579)Saber Haj Rabiee
* added weighted round robin algorithm to load balancer * added an adapt integration test for wrr and fixed a typo * changed args format to Caddyfile args convention * added provisioner and validator for wrr * simplified the code and improved doc
2023-06-15headers: Allow `>` to defer shortcut for replacements (#5574)Francis Lavoie
2023-05-16caddyhttp: Implement named routes, `invoke` directive (#5107)v2.7.0-beta.1Francis Lavoie
* caddyhttp: Implement named routes, `invoke` directive * gofmt * Add experimental marker * Adjust route compile comments
2023-05-16headers: Add > Caddyfile shortcut for enabling defer (#5535)Francis Lavoie
2023-05-15reverseproxy: Expand port ranges to multiple upstreams in CLI + Caddyfile ↵Francis Lavoie
(#5494) * reverseproxy: Expand port ranges to multiple upstreams in CLI + Caddyfile * Add clarifying comment
2023-04-10reverseproxy: Remove deprecated `lookup_srv` (#5396)Francis Lavoie
2023-03-27caddyhttp: Determine real client IP if trusted proxies configured (#5104)Francis Lavoie
* caddyhttp: Determine real client IP if trusted proxies configured * Support customizing client IP header * Implement client_ip matcher, deprecate remote_ip's forwarded option