Commit Graph

74 Commits

Author SHA1 Message Date
Mohammed Al Sahaf b892bd2acf resolve failure on tempdir cleanup
Signed-off-by: Mohammed Al Sahaf <msaa1990@gmail.com>
2025-08-04 01:20:45 +03:00
Mohammed Al Sahaf 3bcfeee97a r/strings\.Replace/strings\.ReplaceAll/
Signed-off-by: Mohammed Al Sahaf <msaa1990@gmail.com>
2025-08-04 00:53:51 +03:00
Mohammed Al Sahaf ed9afb05d8 file names with colons aren't valid on Windows
Well, Windows has special semantics around that known as streams, but they aren't applicable here.

Signed-off-by: Mohammed Al Sahaf <msaa1990@gmail.com>
2025-08-04 00:50:52 +03:00
Mohammed Al Sahaf 7668108b5d add mutex for the listener to resolve data race
Signed-off-by: Mohammed Al Sahaf <msaa1990@gmail.com>
2025-08-04 00:40:52 +03:00
Mohammed Al Sahaf e6d44851b1 fix race in TestNetWriter_ConnectionRetry
Signed-off-by: Mohammed Al Sahaf <msaa1990@gmail.com>
2025-08-04 00:26:21 +03:00
Mohammed Al Sahaf f7d16df78e fix another race
Signed-off-by: Mohammed Al Sahaf <msaa1990@gmail.com>
2025-08-03 04:30:47 +03:00
Mohammed Al Sahaf 7ac7ca3ff4 fix race condition
Signed-off-by: Mohammed Al Sahaf <msaa1990@gmail.com>
2025-08-03 04:21:22 +03:00
Mohammed Al Sahaf 9f586657e8 fmt
Signed-off-by: Mohammed Al Sahaf <msaa1990@gmail.com>
2025-08-03 03:54:48 +03:00
Mohammed Al Sahaf 07ad9534fb complete WAL implementation
Signed-off-by: Mohammed Al Sahaf <msaa1990@gmail.com>
2025-08-03 03:50:14 +03:00
Mohammed Al Sahaf da8322bc6e Merge branch 'master' into net-wal 2025-06-25 23:39:22 +03:00
Mohammed Al Sahaf e039a5bb5c chore: upgrade .golangci.yml and workflow to v2 (#6924)
* chore: upgrade .golangci.yml and workflow to v2

run `golangci-lint fmt`

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

* run `golangci-lint run --fix`

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

* more lint fixes

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

* bring back comments to .golangci.yml

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

* appease the linter some more

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

* oops

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

* use embedded structs

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

* use embedded structs where they were used before

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

* disable rule  `-QF1006`

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

* missed a spot

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

---------

Signed-off-by: Mohammed Al Sahaf <msaa1990@gmail.com>
2025-06-03 02:24:32 +03:00
Mohammed Al Sahaf 6cc2f7b581 lint
Signed-off-by: Mohammed Al Sahaf <msaa1990@gmail.com>
2025-06-02 20:07:20 +03:00
Mohammed Al Sahaf 9d3e9e7826 logging: implement WAL for the net writer
Signed-off-by: Mohammed Al Sahaf <msaa1990@gmail.com>
2025-06-02 19:46:26 +03:00
Mohammed Al Sahaf 50de66ce12 Merge branch 'master' into net-wal
Signed-off-by: Mohammed Al Sahaf <msaa1990@gmail.com>
2025-05-26 00:36:49 +03:00
Steffen Busch f4432a306a caddyfile: add error handling for unrecognized subdirective/options in various modules (#6884) 2025-03-08 23:45:05 +03:00
Matt Holt 1f927d6b07 log: Only chmod if permission bits differ; make log dir (#6761)
* log: Only chmod if permission bits differ

Follow-up to #6314 and https://caddy.community/t/caddy-2-9-0-breaking-change/27576/11

* Fix test

* Refactor FileWriter

* Ooooh octal... right...
2025-01-07 21:51:03 -07:00
Francis Lavoie 315715e90f core: Implement FastAbs to avoid repeated os.Getwd calls (#6687)
Tests / test (./cmd/caddy/caddy, ~1.22.3, ubuntu-latest, 0, 1.22, linux) (push) Failing after 2m28s
Tests / test (./cmd/caddy/caddy, ~1.23.0, ubuntu-latest, 0, 1.23, linux) (push) Failing after 1m14s
Tests / test (s390x on IBM Z) (push) Has been skipped
Tests / goreleaser-check (push) Has been skipped
Cross-Build / build (~1.22.3, 1.22, aix) (push) Successful in 1m24s
Cross-Build / build (~1.22.3, 1.22, darwin) (push) Successful in 1m28s
Cross-Build / build (~1.22.3, 1.22, dragonfly) (push) Successful in 1m26s
Cross-Build / build (~1.22.3, 1.22, freebsd) (push) Successful in 1m23s
Cross-Build / build (~1.22.3, 1.22, illumos) (push) Successful in 1m25s
Cross-Build / build (~1.22.3, 1.22, linux) (push) Successful in 1m26s
Cross-Build / build (~1.22.3, 1.22, netbsd) (push) Successful in 1m25s
Cross-Build / build (~1.22.3, 1.22, openbsd) (push) Successful in 1m23s
Cross-Build / build (~1.22.3, 1.22, solaris) (push) Successful in 1m24s
Cross-Build / build (~1.22.3, 1.22, windows) (push) Successful in 1m25s
Cross-Build / build (~1.23.0, 1.23, aix) (push) Successful in 2m13s
Cross-Build / build (~1.23.0, 1.23, darwin) (push) Successful in 1m17s
Cross-Build / build (~1.23.0, 1.23, dragonfly) (push) Successful in 1m15s
Cross-Build / build (~1.23.0, 1.23, freebsd) (push) Successful in 1m16s
Cross-Build / build (~1.23.0, 1.23, illumos) (push) Successful in 1m18s
Cross-Build / build (~1.23.0, 1.23, linux) (push) Successful in 1m17s
Cross-Build / build (~1.23.0, 1.23, netbsd) (push) Successful in 1m17s
Cross-Build / build (~1.23.0, 1.23, openbsd) (push) Successful in 1m15s
Cross-Build / build (~1.23.0, 1.23, solaris) (push) Successful in 1m15s
Cross-Build / build (~1.23.0, 1.23, windows) (push) Successful in 1m16s
Lint / lint (ubuntu-latest, linux) (push) Successful in 1m53s
Lint / govulncheck (push) Successful in 1m44s
Tests / test (./cmd/caddy/caddy, ~1.22.3, macos-14, 0, 1.22, mac) (push) Has been cancelled
Tests / test (./cmd/caddy/caddy, ~1.23.0, macos-14, 0, 1.23, mac) (push) Has been cancelled
Tests / test (./cmd/caddy/caddy.exe, ~1.22.3, windows-latest, True, 1.22, windows) (push) Has been cancelled
Tests / test (./cmd/caddy/caddy.exe, ~1.23.0, windows-latest, True, 1.23, windows) (push) Has been cancelled
Lint / lint (macos-14, mac) (push) Has been cancelled
Lint / lint (windows-latest, windows) (push) Has been cancelled
* core: Implement FastAbs to avoid repeated os.Getwd calls

* Lint

* Rename files
2024-11-13 03:55:51 -05:00
Ririsoft 8e0d3e1ec5 logging: set file mode when the file already exist (#6391)
101d3e7 introduced a configuration option to set the log file mode.
This option was not taken into account if the file already exists,
making users having to delete their logs to have new logs created
with the right mode.
2024-06-12 15:17:46 -06:00
Omar Ramadan d85cc2ec10 logging: Customizable zap cores (#6381) 2024-06-10 09:03:24 -06:00
Ririsoft 0bc27e5fb1 logging: fix file mode configuration parsing (#6383)
Commit 101d3e7 introduced file mode setting,
but was missing a JSON Marshaller so that
CaddyFile can be converted to JSON safely.
2024-06-08 11:34:18 -06:00
Ririsoft 101d3e7407 logging: Customize log file permissions (#6314)
Adding a "mode" option to overwrite the default logfile permissions.
Default remains "0600" which is the one currently used by lumberjack.
2024-06-06 08:33:34 -06:00
Mohammed Al Sahaf 61d163217f log: implement WAL for net writer (WIP) 2024-04-15 20:47:30 +03:00
Mohammed Al Sahaf 0c01547037 logging: support ms duration format and add docs (#6187) 2024-03-21 22:17:09 -04:00
Francis Lavoie 01d5568b20 logging: Implement append encoder, allow flatter filters config (#6069)
* logging: Implement `add` encoder

* Allow flatter config structure for `filter` & `add`

* Rename to append

* govulncheck was unhappy
2024-03-05 16:24:32 -07:00
Francis Lavoie 91ec75441a logging: Inline Caddyfile syntax for ip_mask filter (#6094) 2024-02-12 17:15:35 +00:00
Francis Lavoie b9c40e7111 logging: Automatic wrap default for filter encoder (#5980)
Co-authored-by: Kévin Dunglas <kevin@dunglas.fr>
2024-01-25 04:00:22 +00:00
Francis Lavoie 750d0b8331 caddyfile: Normalize & flatten all unmarshalers (#6037) 2024-01-23 19:36:59 -05:00
Paul Jeannot 1b73e3862d logging: query filter for array of strings (#5779)
Co-authored-by: Matt Holt <mholt@users.noreply.github.com>
Co-authored-by: Francis Lavoie <lavofr@gmail.com>
2023-08-29 22:59:43 +00:00
Francis Lavoie c46ec3b500 logging: Clone array on log filters, prevent side-effects (#5786)
Fixes https://caddy.community/t/is-caddy-mutating-header-content-from-logging-settings/20947
2023-08-29 11:41:39 -06:00
Jacob Gadikian d6f86cccf5 ci: use gci linter (#5708)
* 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-14 09:41:15 -06:00
Jacob Gadikian b32f265eca ci: Use gofumpt to format code (#5707) 2023-08-07 19:40:31 +00:00
Matthew Holt cdce452edc logging: Actually honor the SoftStart parameter 2023-05-04 16:30:34 -06:00
Matthew Holt f3e8b9d95f logging: Soft start for net writer (close #5520)
If enabled and there is an error when opening the net writer, ignore the
error and report it along with subsequent logs to stderr.
2023-05-04 16:29:03 -06:00
Francis Lavoie ee7c92ec9b reverseproxy: Mask the WS close message when we're the client (#5199)
* reverseproxy: Mask the WS close message when we're the client

* weakrand

* Bump golangci-lint version so path ignores work on Windows

* gofmt

* ugh, gofmt everything, I guess
2022-11-14 09:38:02 -07:00
Francis Lavoie ea58d51907 logging: Perform filtering on arrays of strings (where possible) (#5101)
* logging: Perform filtering on arrays of strings (where possible)

* Add test for ip_mask filter

* Oops, need to continue when it's not an IP

* Test for invalid IPs
2022-10-04 23:21:23 -06:00
Francis Lavoie 9e1d964bd6 logging: Add time_local option to use local time instead of UTC (#5108) 2022-10-05 00:23:14 -04:00
Francis Lavoie 01e192edc9 logging: Better console encoder defaults (#5109)
This is something that has bothered me for a while, so I figured I'd do something about it now since I'm playing in the logging code lately.

The `console` encoder doesn't actually match the defaults that zap's default logger uses. This makes it match better with the rest of the logs when using the `console` encoder alongside somekind of filter, which requires you to configure an encoder to wrap.
2022-10-04 21:18:48 -06:00
Francis Lavoie fe61209df2 logging: Fix cookie filter (#4943) 2022-08-08 19:11:02 -06:00
Francis Lavoie 141872ed80 chore: Bump up to Go 1.19, minimum 1.18 (#4925) 2022-08-02 16:39:09 -04:00
Francis Lavoie 0be3d99543 logging: Implement rename filter, changes field key names (#4745) 2022-04-28 11:38:44 -04:00
Francis Lavoie 7d229665ed logging: Caddyfile support for duration_format (#4684)
Somehow, this was missed. Oops!
2022-04-07 11:23:28 -06:00
Francis Lavoie c921e08296 logging: Add roll_local_time Caddyfile option (#4583) 2022-02-19 15:12:28 -07:00
Francis Lavoie 249adc1c87 logging: Support turning off roll compression via Caddyfile (#4505) 2022-01-04 12:11:27 -07:00
Kévin Dunglas a1b417c832 logging: add support for hashing data (#4434)
* logging: add support for hashing data

* Update modules/logging/filters.go

Co-authored-by: wiese <wiese@users.noreply.github.com>

* Update modules/logging/filters.go

Co-authored-by: wiese <wiese@users.noreply.github.com>

Co-authored-by: wiese <wiese@users.noreply.github.com>
2021-12-02 13:51:37 -07:00
Matt Holt 0eb0b60f47 logging: Remove common_log field and single_field encoder (#4149) (#4282) 2021-11-29 01:08:52 -05:00
Kévin Dunglas 789efa5dee logging: add a regexp filter (#4426) 2021-11-23 10:00:20 -07:00
Kévin Dunglas 8887adb027 logging: add a filter for cookies (#4425)
* feat(logging): add a filter for cookies

* Improve godoc and add validation
2021-11-23 09:40:20 -07:00
Kévin Dunglas bcac2beee7 logging: add a filter for query parameters (#4424)
Co-authored-by: Matt Holt <mholt@users.noreply.github.com>
Co-authored-by: Francis Lavoie <lavofr@gmail.com>
2021-11-23 04:01:43 -05:00
Matthew Holt 8a974a4f8f logging: Warn for deprecated single_field encoder 2021-08-17 10:51:26 -06:00
Francis Lavoie 124ba1ba71 logging: Prep for common_log removal (#4149)
See https://github.com/caddyserver/caddy/issues/4148#issuecomment-833207811
2021-07-14 11:07:38 -06:00