Commit graph

412 commits

Author SHA1 Message Date
Francis Lavoie
2faeac0a10
chore: Use slices package where possible ()
* chore: Use slices package where possible

* More, mostly using ContainsFunc

* Even more slice operations
2024-09-25 14:30:56 -06:00
Kévin Dunglas
2028da4e74
ci: build and test with Go 1.23 ()
* chore: build and test with Go 1.23

* ci: bump golangci-lint to v1.60

* fix: make properly wrap errors

* ci: remove Go 1.21
2024-08-23 11:01:28 -06:00
a
aca4002fd8
caddyfile: Pass blocks to import for snippets ()
* a

* a

* a

* a

* a

* a
2024-06-14 11:27:51 -06:00
Omar Ramadan
d85cc2ec10
logging: Customizable zap cores () 2024-06-10 09:03:24 -06:00
Francis Lavoie
f6d2c293e7
caddyfile: Reject global request matchers earlier () 2024-05-23 20:06:16 -06:00
Matt Holt
9ba999141b
caddyhttp: Trace individual middleware handlers ()
* caddyhttp: Trace individual middleware handlers

* Fix typo
2024-05-18 14:48:42 -06:00
Kévin Dunglas
fb63e2e40c
caddyhttp: New experimental handler for intercepting responses ()
* feat: add generic response interceptors

* fix: cs

* rename intercept

* add some docs

* @francislavoie review (first round)

* Update modules/caddyhttp/intercept/intercept.go

Co-authored-by: Francis Lavoie <lavofr@gmail.com>

* shorthands: ir to resp

* mark exported symbols as experimental

---------

Co-authored-by: Francis Lavoie <lavofr@gmail.com>
2024-05-13 17:38:18 +00:00
Matthew Holt
583c585c81 httpcaddyfile: Set challenge ports when http_port or https_port are used 2024-05-11 21:39:56 -06:00
Aziz Rmadi
4356635d12
logging: Add support for additional logger filters other than hostname ()
Co-authored-by: Francis Lavoie <lavofr@gmail.com>
2024-05-11 13:31:44 +00:00
Francis Lavoie
feeb6af403
httpcaddyfile: Fix expression matcher shortcut in snippets () 2024-05-01 07:43:05 -04:00
Mohammed Al Sahaf
87c7127c28
chore: add warn logs when using deprecated fields () 2024-04-27 15:51:00 -04:00
Mohammed Al Sahaf
c6eb186064
run golangci-lint run --fix --fast () 2024-04-24 15:17:23 -06:00
clauverjat
76c4cf5a56
caddytls: Option to configure certificate lifetime ()
* Add option to configure certificate lifetime

* Bump CertMagic dep to latest master commit

* Apply suggestions and ran go mod tidy

* Update modules/caddytls/acmeissuer.go

Co-authored-by: Matt Holt <mholt@users.noreply.github.com>

---------

Co-authored-by: Matt Holt <mholt@users.noreply.github.com>
2024-04-24 14:35:14 -06:00
Matthew Holt
d404005339
Quell linter (false positive) 2024-04-23 11:55:37 -06:00
Matthew Holt
6a02999054
caddytls: Add Caddyfile support for on-demand permission module (close ) 2024-04-22 15:47:09 -06:00
Matthew Holt
3efda6fb3a httpcaddyfile: Skip automate loader if disable_certs is specified (fix ) 2024-04-17 12:26:03 -06:00
Francis Lavoie
9cd472c031
caddyfile: Populate regexp matcher names by default ()
* caddyfile: Populate regexp matcher names by default

* Some lint cleanup that my VSCode complained about

* Pass down matcher name through expression matcher

* Compat with : fix adapt test, set both styles in replacer
2024-04-17 12:19:14 -06:00
Francis Lavoie
70953e873a
caddyhttp: Support multiple logger names per host ()
* caddyhttp: Support multiple logger names per host

* Lint

* Add adapt test

* Implement "string or array" parsing, keep original `logger_names`

* Rewrite adapter test to be more representative of the usecase
2024-04-16 22:26:18 +00:00
Matt Holt
81413caea2
caddytls: Upgrade ACMEz to v2; support ZeroSSL API; various fixes ()
* WIP: acmez v2, CertMagic, and ZeroSSL issuer upgrades

* caddytls: ZeroSSLIssuer now uses ZeroSSL API instead of ACME

* Fix go.mod

* caddytls: Fix automation related to managers (fix )

* Fix typo (appease linter)

* Fix HTTP validation with ZeroSSL API
2024-04-13 21:31:43 -04:00
danish-mehmood
f4840cfeb8
caddyconfig: Use empty struct instead of bool in map (close ) () 2024-04-08 17:12:35 -06:00
Francis Lavoie
1c4a807667
chore: Upgrade some dependencies () 2024-04-04 18:27:52 -04:00
Steffen Busch
c27425ef5d
httpcaddyfile: Keep deprecated skip_log in directive order () 2024-03-07 14:34:01 -05:00
Francis Lavoie
258d906140
httpcaddyfile: Add RegisterDirectiveOrder function for plugin authors ()
* httpcaddyfile: Add `RegisterDirectiveOrder` function for plugin authors

* Set up Positional enum

* Linter doesn't like a switch on an enum with default

* Update caddyconfig/httpcaddyfile/directives.go

Co-authored-by: Matt Holt <mholt@users.noreply.github.com>

---------

Co-authored-by: Matt Holt <mholt@users.noreply.github.com>
2024-03-06 19:41:45 +00:00
Francis Lavoie
0d44e3ecba
logging: Implement log_append handler ()
* logging: Implement `extra_log` handler

* Rename to `log_append`

* Rename `skip_log` to `log_skip`

---------

Co-authored-by: Matt Holt <mholt@users.noreply.github.com>
2024-03-05 17:03:59 -07:00
Francis Lavoie
2a78c9c5e4
httpcaddyfile: Allow nameless regexp placeholder shorthand ()
Co-authored-by: Matt Holt <mholt@users.noreply.github.com>
2024-03-05 23:37:14 +00:00
bbaa
8bbf8ec629
caddyfile: Assert having a space after heredoc marker to simply check () 2024-02-20 12:29:20 +00:00
Aziz Rmadi
b893c8c5f8
caddyfile: Reject directives in the place of site addresses ()
Co-authored-by: Francis Lavoie <lavofr@gmail.com>
2024-02-19 00:22:48 +00:00
Mohammed Al Sahaf
21744b6c4c
Revert "caddyfile: Reject long heredoc markers ()" ()
This reverts commit e7a534d0a3.
2024-02-12 18:06:22 +00:00
Francis Lavoie
f9e11158bc
caddyauth: Rename basicauth to basic_auth () 2024-02-12 17:34:23 +00:00
Francis Lavoie
e7a534d0a3
caddyfile: Reject long heredoc markers ()
Co-authored-by: Mohammed Al Sahaf <msaa1990@gmail.com>
2024-02-11 13:30:14 -05:00
Matt Holt
57c5b921a4
caddytls: Make on-demand 'ask' permission modular ()
* 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 <lavofr@gmail.com>
2024-01-30 16:11:29 -07:00
Yolan Romailler
2fe69a828f
chore: enabling a few more linters ()
Co-authored-by: Francis Lavoie <lavofr@gmail.com>
2024-01-25 15:24:58 +00:00
bbaa
c369df5c37
caddyfile: Correctly close the heredoc when the closing marker appears immediately () 2024-01-25 14:55:00 +00:00
bbaa
7c48b5fdbb
caddyfile: Switch to slices.Equal for better performance () 2024-01-25 14:46:08 +00:00
Mohammed Al Sahaf
e965b111cd
tls: modularize trusted CA providers ()
* 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 <lavofr@gmail.com>

* add client_auth caddyfile tests

* add caddyfile unmarshalling tests

* fix and add missed adapt tests

* fix rebase issue

---------

Co-authored-by: Francis Lavoie <lavofr@gmail.com>
2024-01-25 11:44:41 +03:00
Francis Lavoie
750d0b8331
caddyfile: Normalize & flatten all unmarshalers () 2024-01-23 19:36:59 -05:00
bbaa
c0273f1f04
caddyfile: Add heredoc support to fmt command () 2024-01-22 02:24:49 +00:00
Aziz Rmadi
d9aded016c
caddyfile: Allow heredoc blank lines () 2024-01-18 22:57:18 -05:00
Aziz Rmadi
4181c79a81
httpcaddyfile: Add optional status code argument to handle_errors directive ()
Co-authored-by: Aziz Rmadi <azizrmadi@Azizs-MacBook-Air.local>
2024-01-16 01:24:17 -05:00
Francis Lavoie
5e2f1b5ced
httpcaddyfile: Rewrite root and rewrite parsing to allow omitting matcher () 2024-01-15 09:57:08 -07:00
Nebez Briefkani
cc0c0cf03e
caddyhttp: Security enhancements for client IP parsing ()
Co-authored-by: Francis Lavoie <lavofr@gmail.com>
2024-01-13 20:46:37 +00:00
a
c839a98ff5
filesystem: Globally declared filesystems, fs directive () 2024-01-13 20:12:43 +00:00
Subhaditya Nath
c2d889f85e
httpcaddyfile: Fix redir <to> html () 2024-01-10 12:24:47 +00:00
Zach Galvin
cb86319bd5
httpcaddyfile: Support client auth verifiers ()
* Added verifier case

Update author

* Update verifier to match struct tag

* gci run
2024-01-09 23:14:51 +00:00
Rithvik Vibhu
ed41c924cf
tls: add reuse_private_keys () 2024-01-09 16:00:31 -07:00
Francis Lavoie
f976c84d9e
httpcaddyfile: Fix cert file decoding to load multiple PEM in one file () 2023-12-20 08:37:21 -07:00
Francis Lavoie
da7d8cb26d
httpcaddyfile: Sort skip_hosts for deterministic JSON ()
* httpcaddyfile: Sort skip_hosts for deterministic JSON

* Update caddyconfig/httpcaddyfile/httptype.go

Co-authored-by: Mohammed Al Sahaf <msaa1990@gmail.com>

* Fix test

* Bah

---------

Co-authored-by: Mohammed Al Sahaf <msaa1990@gmail.com>
2023-12-18 12:54:52 -07:00
Francis Lavoie
3d7d60f7cf
caddyhttp: Add uuid to access logs when used () 2023-12-13 15:40:15 -07:00
Francis Lavoie
ac1f20b9e4
httpcaddyfile: Remove port from logger names ()
Co-authored-by: Matt Holt <mholt@users.noreply.github.com>
2023-10-16 23:57:03 -06:00
Francis Lavoie
7984e6f6fd
httpcaddyfile: Fix TLS automation policy merging with get_certificate () 2023-10-14 14:23:50 -06:00