From 3a48b0336961e43e6f6f062bde7cecaa11043941 Mon Sep 17 00:00:00 2001 From: vnxme <46669194+vnxme@users.noreply.github.com> Date: Mon, 12 Aug 2024 12:47:05 +0300 Subject: [PATCH 1/2] Move PrivateRangesCIDR() back: add a pass-through function (#6514) --- modules/caddyhttp/ip_range.go | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/modules/caddyhttp/ip_range.go b/modules/caddyhttp/ip_range.go index 7632e460c..bfd76c14c 100644 --- a/modules/caddyhttp/ip_range.go +++ b/modules/caddyhttp/ip_range.go @@ -128,3 +128,10 @@ var ( _ caddyfile.Unmarshaler = (*StaticIPRange)(nil) _ IPRangeSource = (*StaticIPRange)(nil) ) + +// PrivateRangesCIDR returns a list of private CIDR range +// strings, which can be used as a configuration shortcut. +// Note: this function is used at least by mholt/caddy-l4. +func PrivateRangesCIDR() []string { + return internal.PrivateRangesCIDR() +} From 9ddb78fadcdbec89a609127918604174121dcf42 Mon Sep 17 00:00:00 2001 From: WeidiDeng Date: Tue, 13 Aug 2024 10:26:20 +0800 Subject: [PATCH 2/2] cmd: ignore exec.ErrDot when starting caddy in background (#6512) Co-authored-by: Mohammed Al Sahaf --- cmd/commandfuncs.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/cmd/commandfuncs.go b/cmd/commandfuncs.go index 746cf3da6..49d0321ef 100644 --- a/cmd/commandfuncs.go +++ b/cmd/commandfuncs.go @@ -74,6 +74,10 @@ func cmdStart(fl Flags) (int, error) { // sure by giving it some random bytes and having it echo // them back to us) cmd := exec.Command(os.Args[0], "run", "--pingback", ln.Addr().String()) + // we should be able to run caddy in relative paths + if errors.Is(cmd.Err, exec.ErrDot) { + cmd.Err = nil + } if configFlag != "" { cmd.Args = append(cmd.Args, "--config", configFlag) }