From ed9afb05d88593b1cd3eb086f32e9988ab2a3fa0 Mon Sep 17 00:00:00 2001 From: Mohammed Al Sahaf Date: Mon, 4 Aug 2025 00:50:52 +0300 Subject: [PATCH] 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 --- modules/logging/netwriter.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/logging/netwriter.go b/modules/logging/netwriter.go index 7aa4c183e..37ff1d65f 100644 --- a/modules/logging/netwriter.go +++ b/modules/logging/netwriter.go @@ -23,6 +23,7 @@ import ( "net" "os" "path/filepath" + "strings" "sync" "time" @@ -128,8 +129,7 @@ func (nw *NetWriter) WriterKey() string { func (nw *NetWriter) OpenWriter() (io.WriteCloser, error) { // Set up WAL directory baseDir := caddy.AppDataDir() - - nw.walDir = filepath.Join(baseDir, "wal", "netwriter", nw.addr.String()) + nw.walDir = filepath.Join(baseDir, "wal", "netwriter", strings.Replace(nw.addr.String(), ":", "-", -1)) if err := os.MkdirAll(nw.walDir, 0o755); err != nil { return nil, fmt.Errorf("failed to create WAL directory: %v", err) }