From a93570436815a3694fcb77f0e8e4833761f699f0 Mon Sep 17 00:00:00 2001 From: Michael 'Flimmy' Flemming Date: Thu, 15 Jan 2026 11:22:34 +0100 Subject: [PATCH 1/4] add prefix removal for stable branches in docs gen pipeline --- .woodpecker.star | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.woodpecker.star b/.woodpecker.star index faa4a6423a..44d76c5278 100644 --- a/.woodpecker.star +++ b/.woodpecker.star @@ -2238,7 +2238,7 @@ def genDocsPr(ctx): }, "GIT_SSH_COMMAND": "ssh -o StrictHostKeyChecking=no -i /root/id_rsa", "OC_GIT_BRANCH": "${CI_COMMIT_BRANCH}", - "MY_TARGET_BRANCH": "${CI_COMMIT_BRANCH}", + "MY_TARGET_BRANCH": "${CI_COMMIT_BRANCH##stable-}", }, "commands": [ 'export DOC_GIT_TARGET_FOLDER="$$(if [ \"$$MY_TARGET_BRANCH\" = \"main\" ]; then echo \"tmpdocs/docs/dev/_static/env-vars/\"; else echo \"tmpdocs/versioned_docs/version-$${MY_TARGET_BRANCH}/dev/_static/env-vars/\"; fi)"', From 11b20f4ca5954427222948a05cdf96047f1ae9a7 Mon Sep 17 00:00:00 2001 From: Michael 'Flimmy' Flemming Date: Thu, 15 Jan 2026 11:51:23 +0100 Subject: [PATCH 2/4] fix cron not triggering GenDocsPr --- .woodpecker.star | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.woodpecker.star b/.woodpecker.star index 44d76c5278..13031c0c2a 100644 --- a/.woodpecker.star +++ b/.woodpecker.star @@ -2262,7 +2262,7 @@ def genDocsPr(ctx): { "event": "cron", "branch": "[main]", - "cron": "nightly (@daily)", + "cron": "nightly *", }, ], }] From 82c00913d30275b405d78a38dbab34d14c66b1ea Mon Sep 17 00:00:00 2001 From: Michael 'Flimmy' Flemming Date: Thu, 15 Jan 2026 12:35:52 +0100 Subject: [PATCH 3/4] add shared pkgs to trigger path for GenDocsPr pipeline --- .woodpecker.star | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/.woodpecker.star b/.woodpecker.star index 13031c0c2a..e7729e746d 100644 --- a/.woodpecker.star +++ b/.woodpecker.star @@ -2250,13 +2250,18 @@ def genDocsPr(ctx): "make git-clone", "make all", "make create-docs-pullrequest", - ] + ], }, ], "when": [ { "event": "push", - "path": "services/*/pkg/config/**/*.go", + "path": { + "include": [ + "services/*/pkg/config/**/*.go", + "pkg/**/*.go", + ], + }, "branch": "[main, stable-*]", }, { From 22a7eaa00517abf06fbac515fce7bab1abff362f Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 15 Jan 2026 12:26:00 +0000 Subject: [PATCH 4/4] build(deps): bump github.com/go-chi/chi/v5 from 5.2.3 to 5.2.4 Bumps [github.com/go-chi/chi/v5](https://github.com/go-chi/chi) from 5.2.3 to 5.2.4. - [Release notes](https://github.com/go-chi/chi/releases) - [Changelog](https://github.com/go-chi/chi/blob/master/CHANGELOG.md) - [Commits](https://github.com/go-chi/chi/compare/v5.2.3...v5.2.4) --- updated-dependencies: - dependency-name: github.com/go-chi/chi/v5 dependency-version: 5.2.4 dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- go.mod | 2 +- go.sum | 4 ++-- vendor/github.com/go-chi/chi/v5/chi.go | 2 +- .../chi/v5/middleware/content_charset.go | 9 ++------ .../go-chi/chi/v5/middleware/request_id.go | 6 +++--- .../go-chi/chi/v5/middleware/strip.go | 11 ++++++++-- vendor/github.com/go-chi/chi/v5/mux.go | 6 ++++-- vendor/github.com/go-chi/chi/v5/path_value.go | 21 ------------------- .../go-chi/chi/v5/path_value_fallback.go | 19 ----------------- vendor/github.com/go-chi/chi/v5/tree.go | 21 +++++++------------ vendor/modules.txt | 4 ++-- 11 files changed, 31 insertions(+), 74 deletions(-) delete mode 100644 vendor/github.com/go-chi/chi/v5/path_value.go delete mode 100644 vendor/github.com/go-chi/chi/v5/path_value_fallback.go diff --git a/go.mod b/go.mod index 23b1c5d3c8..72c3bdd3f2 100644 --- a/go.mod +++ b/go.mod @@ -20,7 +20,7 @@ require ( github.com/dutchcoders/go-clamd v0.0.0-20170520113014-b970184f4d9e github.com/gabriel-vasile/mimetype v1.4.12 github.com/ggwhite/go-masker v1.1.0 - github.com/go-chi/chi/v5 v5.2.3 + github.com/go-chi/chi/v5 v5.2.4 github.com/go-chi/render v1.0.3 github.com/go-jose/go-jose/v3 v3.0.4 github.com/go-ldap/ldap/v3 v3.4.12 diff --git a/go.sum b/go.sum index 56e23155a8..a9014e9287 100644 --- a/go.sum +++ b/go.sum @@ -381,8 +381,8 @@ github.com/go-asn1-ber/asn1-ber v1.4.1/go.mod h1:hEBeB/ic+5LoWskz+yKT7vGhhPYkPro github.com/go-asn1-ber/asn1-ber v1.5.8-0.20250403174932-29230038a667 h1:BP4M0CvQ4S3TGls2FvczZtj5Re/2ZzkV9VwqPHH/3Bo= github.com/go-asn1-ber/asn1-ber v1.5.8-0.20250403174932-29230038a667/go.mod h1:hEBeB/ic+5LoWskz+yKT7vGhhPYkProFKoKdwZRWMe0= github.com/go-chi/chi v4.0.2+incompatible/go.mod h1:eB3wogJHnLi3x/kFX2A+IbTBlXxmMeXJVKy9tTv1XzQ= -github.com/go-chi/chi/v5 v5.2.3 h1:WQIt9uxdsAbgIYgid+BpYc+liqQZGMHRaUwp0JUcvdE= -github.com/go-chi/chi/v5 v5.2.3/go.mod h1:L2yAIGWB3H+phAw1NxKwWM+7eUH/lU8pOMm5hHcoops= +github.com/go-chi/chi/v5 v5.2.4 h1:WtFKPHwlywe8Srng8j2BhOD9312j9cGUxG1SP4V2cR4= +github.com/go-chi/chi/v5 v5.2.4/go.mod h1:X7Gx4mteadT3eDOMTsXzmI4/rwUpOwBHLpAfupzFJP0= github.com/go-chi/render v1.0.3 h1:AsXqd2a1/INaIfUSKq3G5uA8weYx20FOsM7uSoCyyt4= github.com/go-chi/render v1.0.3/go.mod h1:/gr3hVkmYR0YlEy3LxCuVRFzEu9Ruok+gFqbIofjao0= github.com/go-cmd/cmd v1.0.5/go.mod h1:y8q8qlK5wQibcw63djSl/ntiHUHXHGdCkPk0j4QeW4s= diff --git a/vendor/github.com/go-chi/chi/v5/chi.go b/vendor/github.com/go-chi/chi/v5/chi.go index 2b6ebd337c..f650116a87 100644 --- a/vendor/github.com/go-chi/chi/v5/chi.go +++ b/vendor/github.com/go-chi/chi/v5/chi.go @@ -1,6 +1,6 @@ // Package chi is a small, idiomatic and composable router for building HTTP services. // -// chi requires Go 1.14 or newer. +// chi supports the four most recent major versions of Go. // // Example: // diff --git a/vendor/github.com/go-chi/chi/v5/middleware/content_charset.go b/vendor/github.com/go-chi/chi/v5/middleware/content_charset.go index 07bff9f2e3..8e75fe8e46 100644 --- a/vendor/github.com/go-chi/chi/v5/middleware/content_charset.go +++ b/vendor/github.com/go-chi/chi/v5/middleware/content_charset.go @@ -2,6 +2,7 @@ package middleware import ( "net/http" + "slices" "strings" ) @@ -29,13 +30,7 @@ func contentEncoding(ce string, charsets ...string) bool { _, ce = split(strings.ToLower(ce), ";") _, ce = split(ce, "charset=") ce, _ = split(ce, ";") - for _, c := range charsets { - if ce == c { - return true - } - } - - return false + return slices.Contains(charsets, ce) } // Split a string in two parts, cleaning any whitespace. diff --git a/vendor/github.com/go-chi/chi/v5/middleware/request_id.go b/vendor/github.com/go-chi/chi/v5/middleware/request_id.go index 4903ecc214..e1d4ccb7da 100644 --- a/vendor/github.com/go-chi/chi/v5/middleware/request_id.go +++ b/vendor/github.com/go-chi/chi/v5/middleware/request_id.go @@ -25,7 +25,7 @@ const RequestIDKey ctxKeyRequestID = 0 var RequestIDHeader = "X-Request-Id" var prefix string -var reqid uint64 +var reqid atomic.Uint64 // A quick note on the statistics here: we're trying to calculate the chance that // two randomly generated base62 prefixes will collide. We use the formula from @@ -69,7 +69,7 @@ func RequestID(next http.Handler) http.Handler { ctx := r.Context() requestID := r.Header.Get(RequestIDHeader) if requestID == "" { - myid := atomic.AddUint64(&reqid, 1) + myid := reqid.Add(1) requestID = fmt.Sprintf("%s-%06d", prefix, myid) } ctx = context.WithValue(ctx, RequestIDKey, requestID) @@ -92,5 +92,5 @@ func GetReqID(ctx context.Context) string { // NextRequestID generates the next request ID in the sequence. func NextRequestID() uint64 { - return atomic.AddUint64(&reqid, 1) + return reqid.Add(1) } diff --git a/vendor/github.com/go-chi/chi/v5/middleware/strip.go b/vendor/github.com/go-chi/chi/v5/middleware/strip.go index 17aa9bf32a..32d21e90b2 100644 --- a/vendor/github.com/go-chi/chi/v5/middleware/strip.go +++ b/vendor/github.com/go-chi/chi/v5/middleware/strip.go @@ -47,15 +47,22 @@ func RedirectSlashes(next http.Handler) http.Handler { } else { path = r.URL.Path } + if len(path) > 1 && path[len(path)-1] == '/' { - // Trim all leading and trailing slashes (e.g., "//evil.com", "/some/path//") - path = "/" + strings.Trim(path, "/") + // Normalize backslashes to forward slashes to prevent "/\evil.com" style redirects + // that some clients may interpret as protocol-relative. + path = strings.ReplaceAll(path, `\`, `/`) + + // Collapse leading/trailing slashes and force a single leading slash. + path := "/" + strings.Trim(path, "/") + if r.URL.RawQuery != "" { path = fmt.Sprintf("%s?%s", path, r.URL.RawQuery) } http.Redirect(w, r, path, 301) return } + next.ServeHTTP(w, r) } return http.HandlerFunc(fn) diff --git a/vendor/github.com/go-chi/chi/v5/mux.go b/vendor/github.com/go-chi/chi/v5/mux.go index ad66bba91c..71652dd17a 100644 --- a/vendor/github.com/go-chi/chi/v5/mux.go +++ b/vendor/github.com/go-chi/chi/v5/mux.go @@ -467,8 +467,10 @@ func (mx *Mux) routeHTTP(w http.ResponseWriter, r *http.Request) { // Find the route if _, _, h := mx.tree.FindRoute(rctx, method, routePath); h != nil { - if supportsPathValue { - setPathValue(rctx, r) + // Set http.Request path values from our request context + for i, key := range rctx.URLParams.Keys { + value := rctx.URLParams.Values[i] + r.SetPathValue(key, value) } if supportsPattern { setPattern(rctx, r) diff --git a/vendor/github.com/go-chi/chi/v5/path_value.go b/vendor/github.com/go-chi/chi/v5/path_value.go deleted file mode 100644 index 77c840f019..0000000000 --- a/vendor/github.com/go-chi/chi/v5/path_value.go +++ /dev/null @@ -1,21 +0,0 @@ -//go:build go1.22 && !tinygo -// +build go1.22,!tinygo - - -package chi - -import "net/http" - -// supportsPathValue is true if the Go version is 1.22 and above. -// -// If this is true, `net/http.Request` has methods `SetPathValue` and `PathValue`. -const supportsPathValue = true - -// setPathValue sets the path values in the Request value -// based on the provided request context. -func setPathValue(rctx *Context, r *http.Request) { - for i, key := range rctx.URLParams.Keys { - value := rctx.URLParams.Values[i] - r.SetPathValue(key, value) - } -} diff --git a/vendor/github.com/go-chi/chi/v5/path_value_fallback.go b/vendor/github.com/go-chi/chi/v5/path_value_fallback.go deleted file mode 100644 index 749a8520a7..0000000000 --- a/vendor/github.com/go-chi/chi/v5/path_value_fallback.go +++ /dev/null @@ -1,19 +0,0 @@ -//go:build !go1.22 || tinygo -// +build !go1.22 tinygo - -package chi - -import "net/http" - -// supportsPathValue is true if the Go version is 1.22 and above. -// -// If this is true, `net/http.Request` has methods `SetPathValue` and `PathValue`. -const supportsPathValue = false - -// setPathValue sets the path values in the Request value -// based on the provided request context. -// -// setPathValue is only supported in Go 1.22 and above so -// this is just a blank function so that it compiles. -func setPathValue(rctx *Context, r *http.Request) { -} diff --git a/vendor/github.com/go-chi/chi/v5/tree.go b/vendor/github.com/go-chi/chi/v5/tree.go index bcb86b6f17..8b1ed19958 100644 --- a/vendor/github.com/go-chi/chi/v5/tree.go +++ b/vendor/github.com/go-chi/chi/v5/tree.go @@ -71,6 +71,7 @@ func RegisterMethod(method string) { } mt := methodTyp(2 << n) methodMap[method] = mt + reverseMethodMap[mt] = method mALL |= mt } @@ -328,7 +329,7 @@ func (n *node) replaceChild(label, tail byte, child *node) { func (n *node) getEdge(ntyp nodeTyp, label, tail byte, prefix string) *node { nds := n.children[ntyp] - for i := 0; i < len(nds); i++ { + for i := range nds { if nds[i].label == label && nds[i].tail == tail { if ntyp == ntRegexp && nds[i].prefix != prefix { continue @@ -429,9 +430,7 @@ func (n *node) findRoute(rctx *Context, method methodTyp, path string) *node { } // serially loop through each node grouped by the tail delimiter - for idx := 0; idx < len(nds); idx++ { - xn = nds[idx] - + for _, xn = range nds { // label for param nodes is the delimiter byte p := strings.IndexByte(xsearch, xn.tail) @@ -770,20 +769,14 @@ func patParamKeys(pattern string) []string { } } -// longestPrefix finds the length of the shared prefix -// of two strings -func longestPrefix(k1, k2 string) int { - max := len(k1) - if l := len(k2); l < max { - max = l - } - var i int - for i = 0; i < max; i++ { +// longestPrefix finds the length of the shared prefix of two strings +func longestPrefix(k1, k2 string) (i int) { + for i = 0; i < min(len(k1), len(k2)); i++ { if k1[i] != k2[i] { break } } - return i + return } type nodes []*node diff --git a/vendor/modules.txt b/vendor/modules.txt index 32a8ae09e5..5efd7248ee 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -475,8 +475,8 @@ github.com/go-acme/lego/v4/challenge # github.com/go-asn1-ber/asn1-ber v1.5.8-0.20250403174932-29230038a667 ## explicit; go 1.13 github.com/go-asn1-ber/asn1-ber -# github.com/go-chi/chi/v5 v5.2.3 -## explicit; go 1.20 +# github.com/go-chi/chi/v5 v5.2.4 +## explicit; go 1.22 github.com/go-chi/chi/v5 github.com/go-chi/chi/v5/middleware # github.com/go-chi/render v1.0.3