From fd9ff7cd6fb28085877e3b4a2c1cf4518b36525c Mon Sep 17 00:00:00 2001 From: 6543 <6543@obermui.de> Date: Sat, 22 Jan 2022 19:32:10 +0100 Subject: [PATCH 001/240] Update github.com/duo-labs/webauthn (#18357) (#18364) --- go.mod | 6 ++---- go.sum | 9 ++++----- 2 files changed, 6 insertions(+), 9 deletions(-) diff --git a/go.mod b/go.mod index ce3be970bd..47040f0b30 100644 --- a/go.mod +++ b/go.mod @@ -30,7 +30,7 @@ require ( github.com/denisenkom/go-mssqldb v0.10.0 github.com/djherbis/buffer v1.2.0 github.com/djherbis/nio/v3 v3.0.1 - github.com/duo-labs/webauthn v0.0.0-20211221191814-a22482edaa3b + github.com/duo-labs/webauthn v0.0.0-20220122034320-81aea484c951 github.com/dustin/go-humanize v1.0.0 github.com/editorconfig/editorconfig-core-go/v2 v2.4.2 github.com/emirpasic/gods v1.12.0 @@ -54,7 +54,7 @@ require ( github.com/golang-jwt/jwt/v4 v4.2.0 github.com/golang/snappy v0.0.4 // indirect github.com/google/go-github/v39 v39.2.0 - github.com/google/uuid v1.2.0 + github.com/google/uuid v1.3.0 github.com/gorilla/feeds v1.1.1 github.com/gorilla/mux v1.8.0 // indirect github.com/gorilla/sessions v1.2.1 @@ -145,8 +145,6 @@ replace github.com/markbates/goth v1.68.0 => github.com/zeripath/goth v1.68.1-0. replace github.com/shurcooL/vfsgen => github.com/lunny/vfsgen v0.0.0-20220105142115-2c99e1ffdfa0 -replace github.com/duo-labs/webauthn => github.com/authelia/webauthn v0.0.0-20211225121951-80d1f2a572e4 - replace github.com/satori/go.uuid v1.2.0 => github.com/gofrs/uuid v4.2.0+incompatible exclude github.com/gofrs/uuid v3.2.0+incompatible diff --git a/go.sum b/go.sum index 22fdb0b7ac..64badd69e1 100644 --- a/go.sum +++ b/go.sum @@ -131,8 +131,6 @@ github.com/asaskevich/govalidator v0.0.0-20200428143746-21a406dcc535/go.mod h1:o github.com/asaskevich/govalidator v0.0.0-20200907205600-7a23bdc65eef/go.mod h1:WaHUgvxTVq04UNunO+XhnAqY/wQc+bxr74GqbsZ/Jqw= github.com/asaskevich/govalidator v0.0.0-20210307081110-f21760c49a8d h1:Byv0BzEl3/e6D5CLfI0j/7hiIEtvGVFPCZ7Ei2oq8iQ= github.com/asaskevich/govalidator v0.0.0-20210307081110-f21760c49a8d/go.mod h1:WaHUgvxTVq04UNunO+XhnAqY/wQc+bxr74GqbsZ/Jqw= -github.com/authelia/webauthn v0.0.0-20211225121951-80d1f2a572e4 h1:u3eFvgr4A8IjlAokbFt6XY6VdurX7DEYnQMQ4K2yobc= -github.com/authelia/webauthn v0.0.0-20211225121951-80d1f2a572e4/go.mod h1:EYSpSkwoEcryMmQGfhol2IiB3IMN9IIIaNd/wcAQMGQ= github.com/aws/aws-lambda-go v1.13.3/go.mod h1:4UKl9IzQMoD+QF79YdCuzCwp8VbmG4VAQwij/eHl5CU= github.com/aws/aws-sdk-go v1.27.0/go.mod h1:KmX6BPdI08NWTb3/sm4ZGu5ShLoqVDhKgpiN924inxo= github.com/aws/aws-sdk-go v1.34.28/go.mod h1:H7NKnBqNVzoTJpGfLrQkkD+ytBA93eiDYi/+8rV9s48= @@ -276,6 +274,8 @@ github.com/docker/go-units v0.4.0/go.mod h1:fgPhTUdO+D/Jk86RDLlptpiXQzgHJF7gydDD github.com/dsnet/compress v0.0.1 h1:PlZu0n3Tuv04TzpfPbrnI0HW/YwodEXDS+oPKahKF0Q= github.com/dsnet/compress v0.0.1/go.mod h1:Aw8dCMJ7RioblQeTqt88akK31OvO8Dhf5JflhBbQEHo= github.com/dsnet/golib v0.0.0-20171103203638-1ea166775780/go.mod h1:Lj+Z9rebOhdfkVLjJ8T6VcRQv3SXugXy999NBtR9aFY= +github.com/duo-labs/webauthn v0.0.0-20220122034320-81aea484c951 h1:17esZ09oW+29rklBtCVphIguql2u3NxYH2OasFPPZoo= +github.com/duo-labs/webauthn v0.0.0-20220122034320-81aea484c951/go.mod h1:nHy3JdztZWcsjenDeBuE8gn171OAwg12LBN027UP5AE= github.com/dustin/go-humanize v0.0.0-20171111073723-bb3d318650d4/go.mod h1:HtrtbFcZ19U5GC7JDqmcUSB87Iq5E25KnS6fMYU6eOk= github.com/dustin/go-humanize v1.0.0 h1:VSnTsYCnlFHaM2/igO1h6X3HA71jcobQuxemgkq4zYo= github.com/dustin/go-humanize v1.0.0/go.mod h1:HtrtbFcZ19U5GC7JDqmcUSB87Iq5E25KnS6fMYU6eOk= @@ -491,7 +491,6 @@ github.com/gobwas/glob v0.2.3 h1:A4xDbljILXROh+kObIiy5kIaPYD8e96x1tgBhUI5J+Y= github.com/gobwas/glob v0.2.3/go.mod h1:d3Ez4x06l9bZtSvzIay5+Yzi0fmZzPgnTbPcKjJAkT8= github.com/goccy/go-json v0.7.4 h1:B44qRUFwz/vxPKPISQ1KhvzRi9kZ28RAf6YtjriBZ5k= github.com/goccy/go-json v0.7.4/go.mod h1:6MelG93GURQebXPDq3khkgXZkazVtN9CRI+MGFi0w8I= -github.com/gofrs/uuid v4.2.0+incompatible h1:yyYWMnhkhrKwwr8gAOcOCYxOOscHgDS9yZgBrnJfGa0= github.com/gofrs/uuid v4.2.0+incompatible/go.mod h1:b2aQJv3Z4Fp6yNu3cdSllBxTCLRxnplIgP/c0N/04lM= github.com/gogo/googleapis v1.1.0/go.mod h1:gf4bu3Q80BeJ6H1S1vYPm8/ELATdvryBaNFGgqEef3s= github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ= @@ -585,8 +584,8 @@ github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm4 github.com/google/uuid v1.0.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/google/uuid v1.1.1/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= -github.com/google/uuid v1.2.0 h1:qJYtXnJRWmpe7m/3XlyhrsLrEURqHRM2kxzoxXqyUDs= -github.com/google/uuid v1.2.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= +github.com/google/uuid v1.3.0 h1:t6JiXgmwXMjEs8VusXIJk2BXHsn+wx8BZdTaoZ5fu7I= +github.com/google/uuid v1.3.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/googleapis/gax-go/v2 v2.0.4/go.mod h1:0Wqv26UfaUD9n4G6kQubkQ+KchISgw+vpHVxEJEs9eg= github.com/googleapis/gax-go/v2 v2.0.5/go.mod h1:DWXyrwAJ9X0FpwwEdw+IPEYBICEFu5mhpdKc/us6bOk= github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1/go.mod h1:wJfORRmW1u3UXTncJ5qlYoELFm8eSnnEO6hX4iZ3EWY= From d644289fcb6054b3829d26b3bb0b7dcba310bca5 Mon Sep 17 00:00:00 2001 From: Gusted Date: Sat, 22 Jan 2022 23:58:09 +0000 Subject: [PATCH 002/240] Backport: Disable content sniffing on `PlainTextBytes` (#18365) - Backport of #18359 --- modules/context/context.go | 1 + 1 file changed, 1 insertion(+) diff --git a/modules/context/context.go b/modules/context/context.go index 5038850649..dd571b4d78 100644 --- a/modules/context/context.go +++ b/modules/context/context.go @@ -291,6 +291,7 @@ func (ctx *Context) PlainTextBytes(status int, bs []byte) { } ctx.Resp.WriteHeader(status) ctx.Resp.Header().Set("Content-Type", "text/plain;charset=utf-8") + ctx.Resp.Header().Set("X-Content-Type-Options", "nosniff") if _, err := ctx.Resp.Write(bs); err != nil { log.Error("Write bytes failed: %v", err) } From 160de9fbdac41580b9cba88061bfaf1b3324d5a8 Mon Sep 17 00:00:00 2001 From: wxiaoguang Date: Sun, 23 Jan 2022 21:17:20 +0800 Subject: [PATCH 003/240] Fix mime-type detection for HTTP server (#18371) --- modules/public/mime_types.go | 41 +++++++++++++++++++ modules/public/public.go | 11 +++++ .../public/{dynamic.go => serve_dynamic.go} | 0 modules/public/{static.go => serve_static.go} | 29 ++++--------- 4 files changed, 61 insertions(+), 20 deletions(-) create mode 100644 modules/public/mime_types.go rename modules/public/{dynamic.go => serve_dynamic.go} (100%) rename modules/public/{static.go => serve_static.go} (68%) diff --git a/modules/public/mime_types.go b/modules/public/mime_types.go new file mode 100644 index 0000000000..f8c92e824f --- /dev/null +++ b/modules/public/mime_types.go @@ -0,0 +1,41 @@ +// Copyright 2022 The Gitea Authors. All rights reserved. +// Use of this source code is governed by a MIT-style +// license that can be found in the LICENSE file. + +package public + +import "strings" + +// wellKnownMimeTypesLower comes from Golang's builtin mime package: `builtinTypesLower`, see the comment of detectWellKnownMimeType +var wellKnownMimeTypesLower = map[string]string{ + ".avif": "image/avif", + ".css": "text/css; charset=utf-8", + ".gif": "image/gif", + ".htm": "text/html; charset=utf-8", + ".html": "text/html; charset=utf-8", + ".jpeg": "image/jpeg", + ".jpg": "image/jpeg", + ".js": "text/javascript; charset=utf-8", + ".json": "application/json", + ".mjs": "text/javascript; charset=utf-8", + ".pdf": "application/pdf", + ".png": "image/png", + ".svg": "image/svg+xml", + ".wasm": "application/wasm", + ".webp": "image/webp", + ".xml": "text/xml; charset=utf-8", + + // well, there are some types missing from the builtin list + ".txt": "text/plain; charset=utf-8", +} + +// detectWellKnownMimeType will return the mime-type for a well-known file ext name +// The purpose of this function is to bypass the unstable behavior of Golang's mime.TypeByExtension +// mime.TypeByExtension would use OS's mime-type config to overwrite the well-known types (see its document). +// If the user's OS has incorrect mime-type config, it would make Gitea can not respond a correct Content-Type to browsers. +// For example, if Gitea returns `text/plain` for a `.js` file, the browser couldn't run the JS due to security reasons. +// detectWellKnownMimeType makes the Content-Type for well-known files stable. +func detectWellKnownMimeType(ext string) string { + ext = strings.ToLower(ext) + return wellKnownMimeTypesLower[ext] +} diff --git a/modules/public/public.go b/modules/public/public.go index a58709d86f..6dd9b54e64 100644 --- a/modules/public/public.go +++ b/modules/public/public.go @@ -95,6 +95,15 @@ func parseAcceptEncoding(val string) map[string]bool { return types } +// setWellKnownContentType will set the Content-Type if the file is a well-known type. +// See the comments of detectWellKnownMimeType +func setWellKnownContentType(w http.ResponseWriter, file string) { + mimeType := detectWellKnownMimeType(filepath.Ext(file)) + if mimeType != "" { + w.Header().Set("Content-Type", mimeType) + } +} + func (opts *Options) handle(w http.ResponseWriter, req *http.Request, fs http.FileSystem, file string) bool { // use clean to keep the file is a valid path with no . or .. f, err := fs.Open(path.Clean(file)) @@ -125,6 +134,8 @@ func (opts *Options) handle(w http.ResponseWriter, req *http.Request, fs http.Fi return true } + setWellKnownContentType(w, file) + serveContent(w, req, fi, fi.ModTime(), f) return true } diff --git a/modules/public/dynamic.go b/modules/public/serve_dynamic.go similarity index 100% rename from modules/public/dynamic.go rename to modules/public/serve_dynamic.go diff --git a/modules/public/static.go b/modules/public/serve_static.go similarity index 68% rename from modules/public/static.go rename to modules/public/serve_static.go index a81efacfa4..28975ec6c3 100644 --- a/modules/public/static.go +++ b/modules/public/serve_static.go @@ -9,15 +9,12 @@ package public import ( "bytes" - "compress/gzip" "io" - "mime" "net/http" "os" "path/filepath" "time" - "code.gitea.io/gitea/modules/log" "code.gitea.io/gitea/modules/timeutil" ) @@ -66,24 +63,16 @@ func serveContent(w http.ResponseWriter, req *http.Request, fi os.FileInfo, modt encodings := parseAcceptEncoding(req.Header.Get("Accept-Encoding")) if encodings["gzip"] { if cf, ok := fi.(*vfsgen۰CompressedFileInfo); ok { - rd := bytes.NewReader(cf.GzipBytes()) - w.Header().Set("Content-Encoding", "gzip") - ctype := mime.TypeByExtension(filepath.Ext(fi.Name())) - if ctype == "" { - // read a chunk to decide between utf-8 text and binary - var buf [512]byte - grd, _ := gzip.NewReader(rd) - n, _ := io.ReadFull(grd, buf[:]) - ctype = http.DetectContentType(buf[:n]) - _, err := rd.Seek(0, io.SeekStart) // rewind to output whole file - if err != nil { - log.Error("rd.Seek error: %v", err) - http.Error(w, http.StatusText(http.StatusInternalServerError), http.StatusInternalServerError) - return - } + rdGzip := bytes.NewReader(cf.GzipBytes()) + // all static files are managed by Gitea, so we can make sure every file has the correct ext name + // then we can get the correct Content-Type, we do not need to do http.DetectContentType on the decompressed data + mimeType := detectWellKnownMimeType(filepath.Ext(fi.Name())) + if mimeType == "" { + mimeType = "application/octet-stream" } - w.Header().Set("Content-Type", ctype) - http.ServeContent(w, req, fi.Name(), modtime, rd) + w.Header().Set("Content-Type", mimeType) + w.Header().Set("Content-Encoding", "gzip") + http.ServeContent(w, req, fi.Name(), modtime, rdGzip) return } } From 42991dc89a7f3dadb7ad3b36d18b1a74628ec272 Mon Sep 17 00:00:00 2001 From: Gusted Date: Sun, 23 Jan 2022 21:46:09 +0000 Subject: [PATCH 004/240] Fix partial cloning a repo (#18373) (#18377) * Fix partial cloning a repo (#18373) - Backport from: #18373 - Backport isn't 1-1, because the frontport had a refactor in that area, which v1.16 doesn't have. * Include diff & use copy * Add partial clone test * patch * Apply suggestions from code review * globalArgs first * avoid copy but make GlobalCMDArgs append first * please linter Co-authored-by: Lunny Xiao Co-authored-by: 6543 <6543@obermui.de> --- integrations/git_helper_for_declarative_test.go | 11 +++++++++++ integrations/git_test.go | 6 ++++++ modules/git/diff.go | 15 ++++++++------- modules/git/repo.go | 5 ++++- routers/web/repo/http.go | 5 ++++- 5 files changed, 33 insertions(+), 9 deletions(-) diff --git a/integrations/git_helper_for_declarative_test.go b/integrations/git_helper_for_declarative_test.go index 8105bcab8d..05a3e87775 100644 --- a/integrations/git_helper_for_declarative_test.go +++ b/integrations/git_helper_for_declarative_test.go @@ -123,6 +123,17 @@ func doGitClone(dstLocalPath string, u *url.URL) func(*testing.T) { } } +func doPartialGitClone(dstLocalPath string, u *url.URL) func(*testing.T) { + return func(t *testing.T) { + assert.NoError(t, git.CloneWithArgs(context.Background(), u.String(), dstLocalPath, allowLFSFilters(), git.CloneRepoOptions{ + Filter: "blob:none", + })) + exist, err := util.IsExist(filepath.Join(dstLocalPath, "README.md")) + assert.NoError(t, err) + assert.True(t, exist) + } +} + func doGitCloneFail(u *url.URL) func(*testing.T) { return func(t *testing.T) { tmpDir, err := os.MkdirTemp("", "doGitCloneFail") diff --git a/integrations/git_test.go b/integrations/git_test.go index 0d33c786aa..f8e3b8dd3f 100644 --- a/integrations/git_test.go +++ b/integrations/git_test.go @@ -69,6 +69,12 @@ func testGit(t *testing.T, u *url.URL) { t.Run("Clone", doGitClone(dstPath, u)) + dstPath2, err := os.MkdirTemp("", httpContext.Reponame) + assert.NoError(t, err) + defer util.RemoveAll(dstPath2) + + t.Run("Partial Clone", doPartialGitClone(dstPath2, u)) + little, big := standardCommitAndPushTest(t, dstPath) littleLFS, bigLFS := lfsCommitAndPushTest(t, dstPath) rawTest(t, &httpContext, little, big, littleLFS, bigLFS) diff --git a/modules/git/diff.go b/modules/git/diff.go index f90f911be0..8ca58b4809 100644 --- a/modules/git/diff.go +++ b/modules/git/diff.go @@ -59,27 +59,28 @@ func GetRepoRawDiffForFile(repo *Repository, startCommit, endCommit string, diff ctx, _, finished := process.GetManager().AddContext(repo.Ctx, fmt.Sprintf("GetRawDiffForFile: [repo_path: %s]", repo.Path)) defer finished() - var cmd *exec.Cmd + cmd := exec.CommandContext(ctx, GitExecutable, GlobalCommandArgs...) + switch diffType { case RawDiffNormal: if len(startCommit) != 0 { - cmd = exec.CommandContext(ctx, GitExecutable, append([]string{"diff", "-M", startCommit, endCommit}, fileArgs...)...) + cmd.Args = append(cmd.Args, append([]string{"diff", "-M", startCommit, endCommit}, fileArgs...)...) } else if commit.ParentCount() == 0 { - cmd = exec.CommandContext(ctx, GitExecutable, append([]string{"show", endCommit}, fileArgs...)...) + cmd.Args = append(cmd.Args, append([]string{"show", endCommit}, fileArgs...)...) } else { c, _ := commit.Parent(0) - cmd = exec.CommandContext(ctx, GitExecutable, append([]string{"diff", "-M", c.ID.String(), endCommit}, fileArgs...)...) + cmd.Args = append(cmd.Args, append([]string{"diff", "-M", c.ID.String(), endCommit}, fileArgs...)...) } case RawDiffPatch: if len(startCommit) != 0 { query := fmt.Sprintf("%s...%s", endCommit, startCommit) - cmd = exec.CommandContext(ctx, GitExecutable, append([]string{"format-patch", "--no-signature", "--stdout", "--root", query}, fileArgs...)...) + cmd.Args = append(cmd.Args, append([]string{"format-patch", "--no-signature", "--stdout", "--root", query}, fileArgs...)...) } else if commit.ParentCount() == 0 { - cmd = exec.CommandContext(ctx, GitExecutable, append([]string{"format-patch", "--no-signature", "--stdout", "--root", endCommit}, fileArgs...)...) + cmd.Args = append(cmd.Args, append([]string{"format-patch", "--no-signature", "--stdout", "--root", endCommit}, fileArgs...)...) } else { c, _ := commit.Parent(0) query := fmt.Sprintf("%s...%s", endCommit, c.ID.String()) - cmd = exec.CommandContext(ctx, GitExecutable, append([]string{"format-patch", "--no-signature", "--stdout", query}, fileArgs...)...) + cmd.Args = append(cmd.Args, append([]string{"format-patch", "--no-signature", "--stdout", query}, fileArgs...)...) } default: return fmt.Errorf("invalid diffType: %s", diffType) diff --git a/modules/git/repo.go b/modules/git/repo.go index b19e80cd44..47e46de3aa 100644 --- a/modules/git/repo.go +++ b/modules/git/repo.go @@ -101,6 +101,7 @@ type CloneRepoOptions struct { Shared bool NoCheckout bool Depth int + Filter string } // Clone clones original repository to target path. @@ -141,7 +142,9 @@ func CloneWithArgs(ctx context.Context, from, to string, args []string, opts Clo if opts.Depth > 0 { cmd.AddArguments("--depth", strconv.Itoa(opts.Depth)) } - + if opts.Filter != "" { + cmd.AddArguments("--filter", opts.Filter) + } if len(opts.Branch) > 0 { cmd.AddArguments("-b", opts.Branch) } diff --git a/routers/web/repo/http.go b/routers/web/repo/http.go index 6ebf6a789a..f5ca7f1856 100644 --- a/routers/web/repo/http.go +++ b/routers/web/repo/http.go @@ -491,7 +491,10 @@ func serviceRPC(h serviceHandler, service string) { defer finished() var stderr bytes.Buffer - cmd := exec.CommandContext(ctx, git.GitExecutable, service, "--stateless-rpc", h.dir) + args := make([]string, len(git.GlobalCommandArgs)) + copy(args, git.GlobalCommandArgs) + args = append(args, []string{service, "--stateless-rpc", h.dir}...) + cmd := exec.CommandContext(ctx, git.GitExecutable, args...) cmd.Dir = h.dir cmd.Env = append(os.Environ(), h.environ...) cmd.Stdout = h.w From b68e605d56ef472de597e9a7c6df406ce97028c0 Mon Sep 17 00:00:00 2001 From: wxiaoguang Date: Tue, 25 Jan 2022 08:11:49 +0800 Subject: [PATCH 005/240] Prevent showing webauthn error for every time visiting `/user/settings/security` (#18385) (#18386) Backport #18385 --- web_src/js/features/user-auth-webauthn.js | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/web_src/js/features/user-auth-webauthn.js b/web_src/js/features/user-auth-webauthn.js index bc221d037f..cf60535d40 100644 --- a/web_src/js/features/user-auth-webauthn.js +++ b/web_src/js/features/user-auth-webauthn.js @@ -150,13 +150,12 @@ export function initUserAuthWebAuthnRegister() { return; } - if (!detectWebAuthnSupport()) { - return; - } - $('#webauthn-error').modal({allowMultiple: false}); $('#register-webauthn').on('click', (e) => { e.preventDefault(); + if (!detectWebAuthnSupport()) { + return; + } webAuthnRegisterRequest(); }); } From 0b83cc21be4b53de401e9c3ffca74ae3f003e55e Mon Sep 17 00:00:00 2001 From: Gusted Date: Tue, 25 Jan 2022 05:48:56 +0000 Subject: [PATCH 006/240] Fix commit's time (#18375) (#18392) - Backport of #18375 --- templates/repo/commits_list.tmpl | 6 +++++- templates/repo/view_list.tmpl | 2 +- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/templates/repo/commits_list.tmpl b/templates/repo/commits_list.tmpl index d43170e525..85bfe9ab4f 100644 --- a/templates/repo/commits_list.tmpl +++ b/templates/repo/commits_list.tmpl @@ -75,7 +75,11 @@ {{end}} - {{TimeSince .Author.When $.Lang}} + {{if .Committer}} + {{TimeSince .Committer.When $.Lang}} + {{else}} + {{TimeSince .Author.When $.Lang}} + {{end}} {{end}} diff --git a/templates/repo/view_list.tmpl b/templates/repo/view_list.tmpl index d490220694..7c76d87875 100644 --- a/templates/repo/view_list.tmpl +++ b/templates/repo/view_list.tmpl @@ -34,7 +34,7 @@ {{end}} - {{if .LatestCommit}}{{if .LatestCommit.Author}}{{TimeSince .LatestCommit.Author.When $.Lang}}{{end}}{{end}} + {{if .LatestCommit}}{{if .LatestCommit.Committer}}{{TimeSince .LatestCommit.Committer.When $.Lang}}{{end}}{{end}} From 0734ca01323135d0171a6c69e25fe7046d3fa748 Mon Sep 17 00:00:00 2001 From: Lunny Xiao Date: Tue, 25 Jan 2022 15:28:28 +0800 Subject: [PATCH 007/240] Fix restore without topic failure (#18387) (#18400) Co-authored-by: zeripath --- services/migrations/restore.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/services/migrations/restore.go b/services/migrations/restore.go index 357e995423..d7f3b76c2d 100644 --- a/services/migrations/restore.go +++ b/services/migrations/restore.go @@ -97,6 +97,9 @@ func (r *RepositoryRestorer) GetTopics() ([]string, error) { bs, err := os.ReadFile(p) if err != nil { + if os.IsNotExist(err) { + return nil, nil + } return nil, err } From 0b331e2213e7b1efcc817dcd6be4d5e98a2c7b82 Mon Sep 17 00:00:00 2001 From: zeripath Date: Tue, 25 Jan 2022 12:44:18 +0000 Subject: [PATCH 008/240] Place inline diff comment dialogs on split diff in 4th and 8th columns (#18403) (#18404) Backport #18403 Fix #18391 Fix #18320 Signed-off-by: Andrew Thornton --- web_src/js/features/repo-issue.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/web_src/js/features/repo-issue.js b/web_src/js/features/repo-issue.js index 4bdf953822..0523c3fb01 100644 --- a/web_src/js/features/repo-issue.js +++ b/web_src/js/features/repo-issue.js @@ -496,9 +496,11 @@ export function initRepoPullRequestReview() { ${isSplit ? ` + + ` : ` From cada7202aa0e5766eb770f7d5c95e8483386adf1 Mon Sep 17 00:00:00 2001 From: zeripath Date: Wed, 26 Jan 2022 22:09:07 +0000 Subject: [PATCH 009/240] Only view milestones from current repo (#18414) (#18417) Backport #18414 The endpoint /{username}/{reponame}/milestone/{id} is not currently restricted to the repo. This PR restricts the milestones to those within the repo. Signed-off-by: Andrew Thornton --- models/issue_milestone.go | 16 ---------------- routers/web/repo/issue.go | 4 ++-- routers/web/repo/milestone.go | 2 +- 3 files changed, 3 insertions(+), 19 deletions(-) diff --git a/models/issue_milestone.go b/models/issue_milestone.go index 7f2fd9a1f3..a321718513 100644 --- a/models/issue_milestone.go +++ b/models/issue_milestone.go @@ -134,22 +134,6 @@ func GetMilestoneByRepoIDANDName(repoID int64, name string) (*Milestone, error) return &mile, nil } -// GetMilestoneByID returns the milestone via id . -func GetMilestoneByID(id int64) (*Milestone, error) { - return getMilestoneByID(db.GetEngine(db.DefaultContext), id) -} - -func getMilestoneByID(e db.Engine, id int64) (*Milestone, error) { - var m Milestone - has, err := e.ID(id).Get(&m) - if err != nil { - return nil, err - } else if !has { - return nil, ErrMilestoneNotExist{ID: id, RepoID: 0} - } - return &m, nil -} - // UpdateMilestone updates information of given milestone. func UpdateMilestone(m *Milestone, oldIsClosed bool) error { ctx, committer, err := db.TxContext() diff --git a/routers/web/repo/issue.go b/routers/web/repo/issue.go index 9dee477537..8c707e1678 100644 --- a/routers/web/repo/issue.go +++ b/routers/web/repo/issue.go @@ -802,7 +802,7 @@ func NewIssue(ctx *context.Context) { milestoneID := ctx.FormInt64("milestone") if milestoneID > 0 { - milestone, err := models.GetMilestoneByID(milestoneID) + milestone, err := models.GetMilestoneByRepoID(ctx.Repo.Repository.ID, milestoneID) if err != nil { log.Error("GetMilestoneByID: %d: %v", milestoneID, err) } else { @@ -889,7 +889,7 @@ func ValidateRepoMetas(ctx *context.Context, form forms.CreateIssueForm, isPull // Check milestone. milestoneID := form.MilestoneID if milestoneID > 0 { - milestone, err := models.GetMilestoneByID(milestoneID) + milestone, err := models.GetMilestoneByRepoID(ctx.Repo.Repository.ID, milestoneID) if err != nil { ctx.ServerError("GetMilestoneByID", err) return nil, nil, 0, 0 diff --git a/routers/web/repo/milestone.go b/routers/web/repo/milestone.go index eadc89333f..df5fd411b4 100644 --- a/routers/web/repo/milestone.go +++ b/routers/web/repo/milestone.go @@ -264,7 +264,7 @@ func DeleteMilestone(ctx *context.Context) { // MilestoneIssuesAndPulls lists all the issues and pull requests of the milestone func MilestoneIssuesAndPulls(ctx *context.Context) { milestoneID := ctx.ParamsInt64(":id") - milestone, err := models.GetMilestoneByID(milestoneID) + milestone, err := models.GetMilestoneByRepoID(ctx.Repo.Repository.ID, milestoneID) if err != nil { if models.IsErrMilestoneNotExist(err) { ctx.NotFound("GetMilestoneByID", err) From 781ad8a79e22344e4b5d79ba29d8dac4b39f1ff4 Mon Sep 17 00:00:00 2001 From: zeripath Date: Wed, 26 Jan 2022 23:48:33 +0000 Subject: [PATCH 010/240] Fix broken oauth2 authentication source edit page (#18412) (#18419) Backport #18412 It appears that there was a broken merge of the edit.tmpl page during the merge of #16594 - I am not entirely sure how this happened as the PR was correct. This PR fixes the broken template. Fix #18388 Signed-off-by: Andrew Thornton --- templates/admin/auth/edit.tmpl | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/templates/admin/auth/edit.tmpl b/templates/admin/auth/edit.tmpl index a9942354c0..efa440ff33 100644 --- a/templates/admin/auth/edit.tmpl +++ b/templates/admin/auth/edit.tmpl @@ -286,6 +286,10 @@

{{.i18n.Tr "admin.auths.skip_local_two_fa_helper"}}

+ +
+
+
From 2f22337125f496ada3a4d17148bb6b2a82c639e5 Mon Sep 17 00:00:00 2001 From: Lunny Xiao Date: Fri, 28 Jan 2022 14:48:36 +0800 Subject: [PATCH 011/240] Fix broken when no commits and default branch is not master (#18423) * Fix broken when no commits and default branch is not master * Fix IsEmpty check * Improve codes --- modules/git/repo.go | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/modules/git/repo.go b/modules/git/repo.go index 47e46de3aa..5dca619ef6 100644 --- a/modules/git/repo.go +++ b/modules/git/repo.go @@ -79,16 +79,21 @@ func InitRepository(repoPath string, bare bool) error { // IsEmpty Check if repository is empty. func (repo *Repository) IsEmpty() (bool, error) { - var errbuf strings.Builder - if err := NewCommand("log", "-1").RunInDirPipeline(repo.Path, nil, &errbuf); err != nil { - if strings.Contains(errbuf.String(), "fatal: bad default revision 'HEAD'") || - strings.Contains(errbuf.String(), "fatal: your current branch 'master' does not have any commits yet") { - return true, nil - } + var errbuf, output strings.Builder + if err := NewCommandContext(repo.Ctx, "rev-list", "--all", "--count", "--max-count=1").RunWithContext(&RunContext{ + Timeout: -1, + Dir: repo.Path, + Stdout: &output, + Stderr: &errbuf, + }); err != nil { return true, fmt.Errorf("check empty: %v - %s", err, errbuf.String()) } - return false, nil + c, err := strconv.Atoi(strings.TrimSpace(output.String())) + if err != nil { + return true, fmt.Errorf("check empty: convert %s to count failed: %v", output.String(), err) + } + return c == 0, nil } // CloneRepoOptions options when clone a repository From f93d72c09be24f5a11f6543867736f46d1f905fd Mon Sep 17 00:00:00 2001 From: Aravinth Manivannan Date: Sun, 30 Jan 2022 13:56:39 +0000 Subject: [PATCH 012/240] GitLab reviews may not have the updated_at field set (#18450) (#18461) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fallback to created_at if that the case and to time.Now() if it is also missing. Fixes: #18434 Co-authored-by: Loïc Dachary Conflicts: services/migrations/gitlab.go trivial context conflict because var reviews became reviews := in 1.17 --- services/migrations/gitlab.go | 56 +++++++----- services/migrations/gitlab_test.go | 140 +++++++++++++++++++++++++++++ services/migrations/main_test.go | 18 ++-- 3 files changed, 181 insertions(+), 33 deletions(-) diff --git a/services/migrations/gitlab.go b/services/migrations/gitlab.go index 4eb7e3e47c..97ebc4dd8b 100644 --- a/services/migrations/gitlab.go +++ b/services/migrations/gitlab.go @@ -32,8 +32,7 @@ func init() { } // GitlabDownloaderFactory defines a gitlab downloader factory -type GitlabDownloaderFactory struct { -} +type GitlabDownloaderFactory struct{} // New returns a Downloader related to this factory according MigrateOptions func (f *GitlabDownloaderFactory) New(ctx context.Context, opts base.MigrateOptions) (base.Downloader, error) { @@ -184,16 +183,17 @@ func (g *GitlabDownloader) GetTopics() ([]string, error) { // GetMilestones returns milestones func (g *GitlabDownloader) GetMilestones() ([]*base.Milestone, error) { - var perPage = g.maxPerPage - var state = "all" - var milestones = make([]*base.Milestone, 0, perPage) + perPage := g.maxPerPage + state := "all" + milestones := make([]*base.Milestone, 0, perPage) for i := 1; ; i++ { ms, _, err := g.client.Milestones.ListMilestones(g.repoID, &gitlab.ListMilestonesOptions{ State: &state, ListOptions: gitlab.ListOptions{ Page: i, PerPage: perPage, - }}, nil, gitlab.WithContext(g.ctx)) + }, + }, nil, gitlab.WithContext(g.ctx)) if err != nil { return nil, err } @@ -203,7 +203,7 @@ func (g *GitlabDownloader) GetMilestones() ([]*base.Milestone, error) { if m.Description != "" { desc = m.Description } - var state = "open" + state := "open" var closedAt *time.Time if m.State != "" { state = m.State @@ -255,8 +255,8 @@ func (g *GitlabDownloader) normalizeColor(val string) string { // GetLabels returns labels func (g *GitlabDownloader) GetLabels() ([]*base.Label, error) { - var perPage = g.maxPerPage - var labels = make([]*base.Label, 0, perPage) + perPage := g.maxPerPage + labels := make([]*base.Label, 0, perPage) for i := 1; ; i++ { ls, _, err := g.client.Labels.ListLabels(g.repoID, &gitlab.ListLabelsOptions{ListOptions: gitlab.ListOptions{ Page: i, @@ -327,8 +327,8 @@ func (g *GitlabDownloader) convertGitlabRelease(rel *gitlab.Release) *base.Relea // GetReleases returns releases func (g *GitlabDownloader) GetReleases() ([]*base.Release, error) { - var perPage = g.maxPerPage - var releases = make([]*base.Release, 0, perPage) + perPage := g.maxPerPage + releases := make([]*base.Release, 0, perPage) for i := 1; ; i++ { ls, _, err := g.client.Releases.ListReleases(g.repoID, &gitlab.ListReleasesOptions{ Page: i, @@ -381,7 +381,7 @@ func (g *GitlabDownloader) GetIssues(page, perPage int) ([]*base.Issue, bool, er }, } - var allIssues = make([]*base.Issue, 0, perPage) + allIssues := make([]*base.Issue, 0, perPage) issues, _, err := g.client.Issues.ListProjectIssues(g.repoID, opt, nil, gitlab.WithContext(g.ctx)) if err != nil { @@ -389,7 +389,7 @@ func (g *GitlabDownloader) GetIssues(page, perPage int) ([]*base.Issue, bool, er } for _, issue := range issues { - var labels = make([]*base.Label, 0, len(issue.Labels)) + labels := make([]*base.Label, 0, len(issue.Labels)) for _, l := range issue.Labels { labels = append(labels, &base.Label{ Name: l, @@ -402,7 +402,7 @@ func (g *GitlabDownloader) GetIssues(page, perPage int) ([]*base.Issue, bool, er } var reactions []*base.Reaction - var awardPage = 1 + awardPage := 1 for { awards, _, err := g.client.AwardEmoji.ListIssueAwardEmoji(g.repoID, issue.IID, &gitlab.ListAwardEmojiOptions{Page: awardPage, PerPage: perPage}, gitlab.WithContext(g.ctx)) if err != nil { @@ -456,9 +456,9 @@ func (g *GitlabDownloader) GetComments(opts base.GetCommentOptions) ([]*base.Com return nil, false, fmt.Errorf("unexpected context: %+v", opts.Context) } - var allComments = make([]*base.Comment, 0, g.maxPerPage) + allComments := make([]*base.Comment, 0, g.maxPerPage) - var page = 1 + page := 1 for { var comments []*gitlab.Discussion @@ -503,7 +503,6 @@ func (g *GitlabDownloader) GetComments(opts base.GetCommentOptions) ([]*base.Com Created: *c.CreatedAt, }) } - } if resp.NextPage == 0 { break @@ -526,7 +525,7 @@ func (g *GitlabDownloader) GetPullRequests(page, perPage int) ([]*base.PullReque }, } - var allPRs = make([]*base.PullRequest, 0, perPage) + allPRs := make([]*base.PullRequest, 0, perPage) prs, _, err := g.client.MergeRequests.ListProjectMergeRequests(g.repoID, opt, nil, gitlab.WithContext(g.ctx)) if err != nil { @@ -534,7 +533,7 @@ func (g *GitlabDownloader) GetPullRequests(page, perPage int) ([]*base.PullReque } for _, pr := range prs { - var labels = make([]*base.Label, 0, len(pr.Labels)) + labels := make([]*base.Label, 0, len(pr.Labels)) for _, l := range pr.Labels { labels = append(labels, &base.Label{ Name: l, @@ -547,12 +546,12 @@ func (g *GitlabDownloader) GetPullRequests(page, perPage int) ([]*base.PullReque pr.State = "closed" } - var mergeTime = pr.MergedAt + mergeTime := pr.MergedAt if merged && pr.MergedAt == nil { mergeTime = pr.UpdatedAt } - var closeTime = pr.ClosedAt + closeTime := pr.ClosedAt if merged && pr.ClosedAt == nil { closeTime = pr.UpdatedAt } @@ -568,7 +567,7 @@ func (g *GitlabDownloader) GetPullRequests(page, perPage int) ([]*base.PullReque } var reactions []*base.Reaction - var awardPage = 1 + awardPage := 1 for { awards, _, err := g.client.AwardEmoji.ListMergeRequestAwardEmoji(g.repoID, pr.IID, &gitlab.ListAwardEmojiOptions{Page: awardPage, PerPage: perPage}, gitlab.WithContext(g.ctx)) if err != nil { @@ -641,13 +640,22 @@ func (g *GitlabDownloader) GetReviews(context base.IssueContext) ([]*base.Review return nil, err } - var reviews = make([]*base.Review, 0, len(approvals.ApprovedBy)) + var createdAt time.Time + if approvals.CreatedAt != nil { + createdAt = *approvals.CreatedAt + } else if approvals.UpdatedAt != nil { + createdAt = *approvals.UpdatedAt + } else { + createdAt = time.Now() + } + + reviews := make([]*base.Review, 0, len(approvals.ApprovedBy)) for _, user := range approvals.ApprovedBy { reviews = append(reviews, &base.Review{ IssueIndex: context.LocalID(), ReviewerID: int64(user.User.ID), ReviewerName: user.User.Username, - CreatedAt: *approvals.UpdatedAt, + CreatedAt: createdAt, // All we get are approvals State: base.ReviewStateApproved, }) diff --git a/services/migrations/gitlab_test.go b/services/migrations/gitlab_test.go index 6b77aa62ef..ad61577653 100644 --- a/services/migrations/gitlab_test.go +++ b/services/migrations/gitlab_test.go @@ -8,13 +8,16 @@ import ( "context" "fmt" "net/http" + "net/http/httptest" "os" + "strconv" "testing" "time" base "code.gitea.io/gitea/modules/migration" "github.com/stretchr/testify/assert" + "github.com/xanzy/go-gitlab" ) func TestGitlabDownloadRepo(t *testing.T) { @@ -310,12 +313,14 @@ func TestGitlabDownloadRepo(t *testing.T) { assert.NoError(t, err) assertReviewsEqual(t, []*base.Review{ { + IssueIndex: 1, ReviewerID: 4102996, ReviewerName: "zeripath", CreatedAt: time.Date(2019, 11, 28, 16, 2, 8, 377000000, time.UTC), State: "APPROVED", }, { + IssueIndex: 1, ReviewerID: 527793, ReviewerName: "axifive", CreatedAt: time.Date(2019, 11, 28, 16, 2, 8, 377000000, time.UTC), @@ -327,6 +332,7 @@ func TestGitlabDownloadRepo(t *testing.T) { assert.NoError(t, err) assertReviewsEqual(t, []*base.Review{ { + IssueIndex: 2, ReviewerID: 4575606, ReviewerName: "real6543", CreatedAt: time.Date(2020, 4, 19, 19, 24, 21, 108000000, time.UTC), @@ -334,3 +340,137 @@ func TestGitlabDownloadRepo(t *testing.T) { }, }, rvs) } + +func gitlabClientMockSetup(t *testing.T) (*http.ServeMux, *httptest.Server, *gitlab.Client) { + // mux is the HTTP request multiplexer used with the test server. + mux := http.NewServeMux() + + // server is a test HTTP server used to provide mock API responses. + server := httptest.NewServer(mux) + + // client is the Gitlab client being tested. + client, err := gitlab.NewClient("", gitlab.WithBaseURL(server.URL)) + if err != nil { + server.Close() + t.Fatalf("Failed to create client: %v", err) + } + + return mux, server, client +} + +func gitlabClientMockTeardown(server *httptest.Server) { + server.Close() +} + +type reviewTestCase struct { + repoID, prID, reviewerID int + reviewerName string + createdAt, updatedAt *time.Time + expectedCreatedAt time.Time +} + +func convertTestCase(t reviewTestCase) (func(w http.ResponseWriter, r *http.Request), base.Review) { + var updatedAtField string + if t.updatedAt == nil { + updatedAtField = "" + } else { + updatedAtField = `"updated_at": "` + t.updatedAt.Format(time.RFC3339) + `",` + } + + var createdAtField string + if t.createdAt == nil { + createdAtField = "" + } else { + createdAtField = `"created_at": "` + t.createdAt.Format(time.RFC3339) + `",` + } + + handler := func(w http.ResponseWriter, r *http.Request) { + fmt.Fprint(w, ` +{ + "id": 5, + "iid": `+strconv.Itoa(t.prID)+`, + "project_id": `+strconv.Itoa(t.repoID)+`, + "title": "Approvals API", + "description": "Test", + "state": "opened", + `+createdAtField+` + `+updatedAtField+` + "merge_status": "cannot_be_merged", + "approvals_required": 2, + "approvals_left": 1, + "approved_by": [ + { + "user": { + "name": "Administrator", + "username": "`+t.reviewerName+`", + "id": `+strconv.Itoa(t.reviewerID)+`, + "state": "active", + "avatar_url": "http://www.gravatar.com/avatar/e64c7d89f26bd1972efa854d13d7dd61?s=80\u0026d=identicon", + "web_url": "http://localhost:3000/root" + } + } + ] +}`) + } + review := base.Review{ + IssueIndex: int64(t.prID), + ReviewerID: int64(t.reviewerID), + ReviewerName: t.reviewerName, + CreatedAt: t.expectedCreatedAt, + State: "APPROVED", + } + + return handler, review +} + +func TestGitlabGetReviews(t *testing.T) { + mux, server, client := gitlabClientMockSetup(t) + defer gitlabClientMockTeardown(server) + + repoID := 1324 + + downloader := &GitlabDownloader{ + ctx: context.Background(), + client: client, + repoID: repoID, + } + + createdAt := time.Date(2020, 4, 19, 19, 24, 21, 0, time.UTC) + + for _, testCase := range []reviewTestCase{ + { + repoID: repoID, + prID: 1, + reviewerID: 801, + reviewerName: "someone1", + createdAt: nil, + updatedAt: &createdAt, + expectedCreatedAt: createdAt, + }, + { + repoID: repoID, + prID: 2, + reviewerID: 802, + reviewerName: "someone2", + createdAt: &createdAt, + updatedAt: nil, + expectedCreatedAt: createdAt, + }, + { + repoID: repoID, + prID: 3, + reviewerID: 803, + reviewerName: "someone3", + createdAt: nil, + updatedAt: nil, + expectedCreatedAt: time.Now(), + }, + } { + mock, review := convertTestCase(testCase) + mux.HandleFunc(fmt.Sprintf("/api/v4/projects/%d/merge_requests/%d/approvals", testCase.repoID, testCase.prID), mock) + + rvs, err := downloader.GetReviews(base.BasicIssueContext(testCase.prID)) + assert.NoError(t, err) + assertReviewsEqual(t, []*base.Review{&review}, rvs) + } +} diff --git a/services/migrations/main_test.go b/services/migrations/main_test.go index ddf73df98e..b040df83d1 100644 --- a/services/migrations/main_test.go +++ b/services/migrations/main_test.go @@ -223,15 +223,15 @@ func assertRepositoryEqual(t *testing.T, expected, actual *base.Repository) { } func assertReviewEqual(t *testing.T, expected, actual *base.Review) { - assert.Equal(t, expected.ID, actual.ID) - assert.Equal(t, expected.IssueIndex, actual.IssueIndex) - assert.Equal(t, expected.ReviewerID, actual.ReviewerID) - assert.Equal(t, expected.ReviewerName, actual.ReviewerName) - assert.Equal(t, expected.Official, actual.Official) - assert.Equal(t, expected.CommitID, actual.CommitID) - assert.Equal(t, expected.Content, actual.Content) - assertTimeEqual(t, expected.CreatedAt, actual.CreatedAt) - assert.Equal(t, expected.State, actual.State) + assert.Equal(t, expected.ID, actual.ID, "ID") + assert.Equal(t, expected.IssueIndex, actual.IssueIndex, "IsssueIndex") + assert.Equal(t, expected.ReviewerID, actual.ReviewerID, "ReviewerID") + assert.Equal(t, expected.ReviewerName, actual.ReviewerName, "ReviewerName") + assert.Equal(t, expected.Official, actual.Official, "Official") + assert.Equal(t, expected.CommitID, actual.CommitID, "CommitID") + assert.Equal(t, expected.Content, actual.Content, "Content") + assert.WithinDuration(t, expected.CreatedAt, actual.CreatedAt, 10*time.Second) + assert.Equal(t, expected.State, actual.State, "State") assertReviewCommentsEqual(t, expected.Comments, actual.Comments) } From a044ec8b53de41d01c05e9aedf9814bf0e45b602 Mon Sep 17 00:00:00 2001 From: zeripath Date: Sun, 30 Jan 2022 17:42:12 +0000 Subject: [PATCH 013/240] Changelog 1.16.0 (#18468) * Changelog for 1.16.0 Signed-off-by: Andrew Thornton --- CHANGELOG.md | 27 ++++++++++++++++++++++++++- docs/config.yaml | 2 +- 2 files changed, 27 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 9c3c67dd7b..6f1a05e779 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,13 +4,15 @@ This changelog goes through all the changes that have been made in each release without substantial changes to our git log; to see the highlights of what has been added to each release, please refer to the [blog](https://blog.gitea.io). -## [1.16.0-rc1](https://github.com/go-gitea/gitea/releases/tag/v1.16.0-rc1) - 2022-01-19 +## [1.16.0](https://github.com/go-gitea/gitea/releases/tag/v1.16.0) - 2022-01-30 * BREAKING * Remove golang vendored directory (#18277) * Paginate releases page & set default page size to 10 (#16857) * Only allow webhook to send requests to allowed hosts (#17482) * SECURITY + * Disable content sniffing on `PlainTextBytes` (#18359) (#18365) + * Only view milestones from current repo (#18414) (#18417) * Sanitize user-input on file name (#17666) * Use `hostmatcher` to replace `matchlist` to improve blocking of bad hosts in Webhooks (#17605) * FEATURES @@ -228,6 +230,16 @@ been added to each release, please refer to the [blog](https://blog.gitea.io). * Add left padding for chunk header of split diff view (#13397) * Allow U2F 2FA without TOTP (#11573) * BUGFIXES + * GitLab reviews may not have the updated_at field set (#18450) (#18461) + * Fix detection of no commits when the default branch is not master (#18422) (#18423) + * Fix broken oauth2 authentication source edit page (#18412) (#18419) + * Place inline diff comment dialogs on split diff in 4th and 8th columns (#18403) (#18404) + * Fix restore without topic failure (#18387) (#18400) + * Fix commit's time (#18375) (#18392) + * Fix partial cloning a repo (#18373) (#18377) + * Stop trimming preceding and suffixing spaces from editor filenames (#18334) + * Prevent showing webauthn error for every time visiting `/user/settings/security` (#18386) + * Fix mime-type detection for HTTP server (#18370) (#18371) * Stop trimming preceding and suffixing spaces from editor filenames (#18334) * Restore propagation of ErrDependenciesLeft (#18325) * Fix PR comments UI (#18323) @@ -299,6 +311,19 @@ been added to each release, please refer to the [blog](https://blog.gitea.io). * MISC * Update JS dependencies (#17611) +## [1.15.11](https://github.com/go-gitea/gitea/releases/tag/v1.15.11) - 2022-01-29 + +* SECURITY + * Only view milestones from current repo (#18414) (#18418) +* BUGFIXES + * Fix broken when no commits and default branch is not master (#18422) (#18424) + * Fix commit's time (#18375) (#18409) + * Fix restore without topic failure (#18387) (#18401) + * Fix mermaid import in 1.15 (it uses ESModule now) (#18382) + * Update to go/text 0.3.7 (#18336) +* MISC + * Upgrade EasyMDE to 2.16.1 (#18278) (#18279) + ## [1.15.10](https://github.com/go-gitea/gitea/releases/tag/v1.15.10) - 2022-01-14 * BUGFIXES diff --git a/docs/config.yaml b/docs/config.yaml index 6f3bacc643..0008cadced 100644 --- a/docs/config.yaml +++ b/docs/config.yaml @@ -18,7 +18,7 @@ params: description: Git with a cup of tea author: The Gitea Authors website: https://docs.gitea.io - version: 1.15.10 + version: 1.16.0 minGoVersion: 1.16 goVersion: 1.17 minNodeVersion: 12.17 From d5027b6c0977cab63d77c9ec97ea0df4426000c1 Mon Sep 17 00:00:00 2001 From: Gusted Date: Mon, 31 Jan 2022 00:49:17 +0100 Subject: [PATCH 014/240] Prevent NPE on partial match of compare URL and allow short SHA1 compare URLs (#18472) (#18473) * Don't panic & allow shorter sha1 (#18472) - Backport of #18472 * Improve comment Co-authored-by: Andrew Thornton Co-authored-by: Andrew Thornton --- modules/markup/html.go | 9 ++++++++- modules/markup/html_test.go | 13 +++++++++++++ 2 files changed, 21 insertions(+), 1 deletion(-) diff --git a/modules/markup/html.go b/modules/markup/html.go index 827be1a9af..345c99e3b4 100644 --- a/modules/markup/html.go +++ b/modules/markup/html.go @@ -55,7 +55,7 @@ var ( anySHA1Pattern = regexp.MustCompile(`https?://(?:\S+/){4,5}([0-9a-f]{40})(/[-+~_%.a-zA-Z0-9/]+)?(#[-+~_%.a-zA-Z0-9]+)?`) // comparePattern matches "http://domain/org/repo/compare/COMMIT1...COMMIT2#hash" - comparePattern = regexp.MustCompile(`https?://(?:\S+/){4,5}([0-9a-f]{40})(\.\.\.?)([0-9a-f]{40})?(#[-+~_%.a-zA-Z0-9]+)?`) + comparePattern = regexp.MustCompile(`https?://(?:\S+/){4,5}([0-9a-f]{7,40})(\.\.\.?)([0-9a-f]{7,40})?(#[-+~_%.a-zA-Z0-9]+)?`) validLinksPattern = regexp.MustCompile(`^[a-z][\w-]+://`) @@ -944,6 +944,13 @@ func comparePatternProcessor(ctx *RenderContext, node *html.Node) { return } + // Ensure that every group (m[0]...m[7]) has a match + for i := 0; i < 8; i++ { + if m[i] == -1 { + return + } + } + urlFull := node.Data[m[0]:m[1]] text1 := base.ShortSha(node.Data[m[2]:m[3]]) textDots := base.ShortSha(node.Data[m[4]:m[5]]) diff --git a/modules/markup/html_test.go b/modules/markup/html_test.go index 3fd9ef9f83..23d7b44570 100644 --- a/modules/markup/html_test.go +++ b/modules/markup/html_test.go @@ -546,3 +546,16 @@ func TestFuzz(t *testing.T) { assert.NoError(t, err) } + +func TestIssue18471(t *testing.T) { + data := `http://domain/org/repo/compare/783b039...da951ce` + + var res strings.Builder + err := PostProcess(&RenderContext{ + URLPrefix: "https://example.com", + Metas: localMetas, + }, strings.NewReader(data), &res) + + assert.NoError(t, err) + assert.Equal(t, res.String(), "783b039...da951ce") +} From 083b85c655c243d63754a13c29eb7d3a3db1fa87 Mon Sep 17 00:00:00 2001 From: zeripath Date: Mon, 31 Jan 2022 21:36:34 +0000 Subject: [PATCH 015/240] Fix OAuth Source Edit Page (#18495) (#18503) Backport #18495 * Fix OAuth Source Edit Page to ensure restricted and group settings are set * Also tolerate []interface in the groups Fix #18432 Signed-off-by: Andrew Thornton --- routers/web/admin/auths.go | 3 +++ routers/web/auth/oauth.go | 4 ++++ 2 files changed, 7 insertions(+) diff --git a/routers/web/admin/auths.go b/routers/web/admin/auths.go index 338a54c5dd..20f364739e 100644 --- a/routers/web/admin/auths.go +++ b/routers/web/admin/auths.go @@ -192,6 +192,9 @@ func parseOAuth2Config(form forms.AuthenticationForm) *oauth2.Source { RequiredClaimName: form.Oauth2RequiredClaimName, RequiredClaimValue: form.Oauth2RequiredClaimValue, SkipLocalTwoFA: form.SkipLocalTwoFA, + GroupClaimName: form.Oauth2GroupClaimName, + RestrictedGroup: form.Oauth2RestrictedGroup, + AdminGroup: form.Oauth2AdminGroup, } } diff --git a/routers/web/auth/oauth.go b/routers/web/auth/oauth.go index fa2b0aa65f..dbd1756348 100644 --- a/routers/web/auth/oauth.go +++ b/routers/web/auth/oauth.go @@ -904,6 +904,10 @@ func claimValueToStringSlice(claimValue interface{}) []string { switch rawGroup := claimValue.(type) { case []string: groups = rawGroup + case []interface{}: + for _, group := range rawGroup { + groups = append(groups, fmt.Sprintf("%s", group)) + } default: str := fmt.Sprintf("%s", rawGroup) groups = strings.Split(str, ",") From edd57028a15580a7faae352fdd171e291ea71688 Mon Sep 17 00:00:00 2001 From: techknowlogick Date: Mon, 31 Jan 2022 17:50:41 -0500 Subject: [PATCH 016/240] point to s3 endpoint directly (#18497) (#18510) --- .drone.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.drone.yml b/.drone.yml index 4ba081e809..2fdab6cddc 100644 --- a/.drone.yml +++ b/.drone.yml @@ -567,7 +567,7 @@ steps: settings: acl: public-read bucket: gitea-artifacts - endpoint: https://storage.gitea.io + endpoint: https://ams3.digitaloceanspaces.com path_style: true source: "dist/release/*" strip_prefix: dist/release/ @@ -588,7 +588,7 @@ steps: settings: acl: public-read bucket: gitea-artifacts - endpoint: https://storage.gitea.io + endpoint: https://ams3.digitaloceanspaces.com path_style: true source: "dist/release/*" strip_prefix: dist/release/ @@ -663,7 +663,7 @@ steps: settings: acl: public-read bucket: gitea-artifacts - endpoint: https://storage.gitea.io + endpoint: https://ams3.digitaloceanspaces.com path_style: true source: "dist/release/*" strip_prefix: dist/release/ From 483bda4b2d954692b197f93e813402f2a95a9360 Mon Sep 17 00:00:00 2001 From: Gusted Date: Tue, 1 Feb 2022 03:45:58 +0100 Subject: [PATCH 017/240] Use `ImagedProvider` for gplus oauth2 provider (#18504) (#18505) - Bacport of #18504 Co-authored-by: 6543 <6543@obermui.de> --- services/auth/source/oauth2/providers_simple.go | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/services/auth/source/oauth2/providers_simple.go b/services/auth/source/oauth2/providers_simple.go index a4d61eb2f3..39d3d74f6d 100644 --- a/services/auth/source/oauth2/providers_simple.go +++ b/services/auth/source/oauth2/providers_simple.go @@ -70,13 +70,13 @@ func init() { })) // named gplus due to legacy gplus -> google migration (Google killed Google+). This ensures old connections still work - RegisterGothProvider(NewSimpleProvider("gplus", "Google", []string{"email"}, + RegisterGothProvider(NewImagedProvider("/assets/img/auth/google.png", NewSimpleProvider("gplus", "Google", []string{"email"}, func(clientKey, secret, callbackURL string, scopes ...string) goth.Provider { if setting.OAuth2Client.UpdateAvatar || setting.OAuth2Client.EnableAutoRegistration { scopes = append(scopes, "profile") } return google.New(clientKey, secret, callbackURL, scopes...) - })) + }))) RegisterGothProvider(NewSimpleProvider("twitter", "Twitter", nil, func(clientKey, secret, callbackURL string, scopes ...string) goth.Provider { @@ -107,5 +107,4 @@ func init() { return microsoftonline.New(clientID, secret, callbackURL, scopes...) }, )) - } From f7606de13a1a85dc9383fe091c9dfa502708fc47 Mon Sep 17 00:00:00 2001 From: Gusted Date: Tue, 1 Feb 2022 21:24:27 +0100 Subject: [PATCH 018/240] Use "read" value for General Access (#18496) (#18500) - Backport of #18496 --- templates/org/team/new.tmpl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/templates/org/team/new.tmpl b/templates/org/team/new.tmpl index 9877e9a941..2531868ec8 100644 --- a/templates/org/team/new.tmpl +++ b/templates/org/team/new.tmpl @@ -56,7 +56,7 @@
- + {{.i18n.Tr "org.teams.general_access_helper"}}
From e4919e414f958b21ddababd1f27d0f21f361d645 Mon Sep 17 00:00:00 2001 From: zeripath Date: Tue, 1 Feb 2022 22:09:07 +0000 Subject: [PATCH 019/240] Update 1.16.0 changelog to set #17846 as breaking (#18533) (#18534) Backport #18533 Unfortunately #17846 was determined to be breaking due to affecting ssh passthrough however, this discovery happened after the changelog was created. Update the Changelog to mark this as breaking. Signed-off-by: Andrew Thornton --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 6f1a05e779..3108893c2a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,6 +9,7 @@ been added to each release, please refer to the [blog](https://blog.gitea.io). * BREAKING * Remove golang vendored directory (#18277) * Paginate releases page & set default page size to 10 (#16857) + * Use shadowing script for docker (#17846) * Only allow webhook to send requests to allowed hosts (#17482) * SECURITY * Disable content sniffing on `PlainTextBytes` (#18359) (#18365) @@ -307,7 +308,6 @@ been added to each release, please refer to the [blog](https://blog.gitea.io). * BUILD * Add lockfile-check (#18285) * Don't store assets modified time into generated files (#18193) - * Use shadowing script for docker (#17846) * MISC * Update JS dependencies (#17611) From 73b68015de4d015f434c99ccaca49717bd164d3e Mon Sep 17 00:00:00 2001 From: zeripath Date: Tue, 1 Feb 2022 22:46:45 +0000 Subject: [PATCH 020/240] In docker rootless use $GITEA_APP_INI if provided (#18524) (#18535) Currently when calling `gitea` from any shell in rootless docker image it won't respect my `$GITEA_APP_INI`. Which this change it will use that value when defined instead of the default value. - https://discourse.gitea.io/t/gitea-1-16-0-unable-to-find-configuration-file/4543 - https://gitea.com/gitea/helm-chart/issues/287 Co-authored-by: Michael Kriese Co-authored-by: techknowlogick --- docker/rootless/usr/local/bin/gitea | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docker/rootless/usr/local/bin/gitea b/docker/rootless/usr/local/bin/gitea index 5fdadfb3fe..1b33ca8547 100644 --- a/docker/rootless/usr/local/bin/gitea +++ b/docker/rootless/usr/local/bin/gitea @@ -32,7 +32,7 @@ for i in "$@"; do done if [ -z "$APP_INI_SET" ]; then - CONF_ARG="-c \"$APP_INI\"" + CONF_ARG="-c \"${GITEA_APP_INI:-$APP_INI}\"" fi From db134c5d71aada5d198d3029833536b2f96ead16 Mon Sep 17 00:00:00 2001 From: zeripath Date: Wed, 2 Feb 2022 03:30:52 +0000 Subject: [PATCH 021/240] Fix for AvatarURL database type (#18487) (#18529) Backport #18487 Co-authored-by: Viktor Kuzmin --- models/user/external_login_user.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/models/user/external_login_user.go b/models/user/external_login_user.go index 8cf7c652b1..d1abe292f5 100644 --- a/models/user/external_login_user.go +++ b/models/user/external_login_user.go @@ -60,7 +60,7 @@ type ExternalLoginUser struct { LastName string NickName string Description string - AvatarURL string + AvatarURL string `xorm:"TEXT"` Location string AccessToken string `xorm:"TEXT"` AccessTokenSecret string `xorm:"TEXT"` From 72fa108cbc0a3a7582ca7aaefc46787ec096640a Mon Sep 17 00:00:00 2001 From: zeripath Date: Wed, 2 Feb 2022 08:38:28 +0000 Subject: [PATCH 022/240] Fix review excerpt (#18502) (#18530) Backport #18502 Currently the "File Changed" tab of a PR is somehow broken. This is also true for the current release 1.16.0. When you are on the "File Changed" tab, and want to look at code excerpt before or after the code changes, the layout breaks. You can test this on try.gitea.io here: https://try.gitea.io/testnotexisting/magic_enum/pulls/2/files The problem occurs for the unified view and for the split view. Kind of the same problem was there for commenting a line of code, this was fixed in #18321 and #18403. For consistency, I changed the solution of #18321, I removed the ``colspan`` and instead added a ````. The goal was to have code similarly with the split view. Also the separator line in the split view was in the wrong column, this was fixed too.* more consistent unified review comment Fix #18516 Co-authored-by: Andrew Thornton Co-authored-by: confusedsushi --- templates/repo/diff/blob_excerpt.tmpl | 21 +++++++++------------ web_src/js/features/repo-issue.js | 4 +++- web_src/less/_repository.less | 2 +- 3 files changed, 13 insertions(+), 14 deletions(-) diff --git a/templates/repo/diff/blob_excerpt.tmpl b/templates/repo/diff/blob_excerpt.tmpl index b3e80881fd..9bf0a7f990 100644 --- a/templates/repo/diff/blob_excerpt.tmpl +++ b/templates/repo/diff/blob_excerpt.tmpl @@ -21,23 +21,18 @@ {{$inlineDiff := $.section.GetComputedInlineDiffFor $line}}{{$inlineDiff.Content}} {{else}} + {{$inlineDiff := $.section.GetComputedInlineDiffFor $line}} + {{if and $line.LeftIdx $inlineDiff.EscapeStatus.Escaped}}{{end}} {{if $line.LeftIdx}}{{end}} {{/* - */}}{{if $line.LeftIdx}}{{/* - */}}{{$inlineDiff := $.section.GetComputedInlineDiffFor $line}}{{$inlineDiff.Content}}{{/* - */}}{{else}}{{/* - */}}{{/* - */}}{{end}}{{/* - */}} + */}}{{if $line.LeftIdx}}{{$inlineDiff.Content}}{{end}}{{/* + */}} + {{if and $line.RightIdx $inlineDiff.EscapeStatus.Escaped}}{{end}} {{if $line.RightIdx}}{{end}} {{/* - */}}{{if $line.RightIdx}}{{/* - */}}{{$inlineDiff := $.section.GetComputedInlineDiffFor $line}}{{$inlineDiff.Content}}{{/* - */}}{{else}}{{/* - */}}{{/* - */}}{{end}}{{/* + */}}{{if $line.RightIdx}}{{$inlineDiff.Content}}{{end}}{{/* */}} {{end}} @@ -67,8 +62,10 @@ {{end}} + {{$inlineDiff := $.section.GetComputedInlineDiffFor $line}} + {{if $inlineDiff.EscapeStatus.Escaped}}{{end}} - {{$inlineDiff := $.section.GetComputedInlineDiffFor $line}}{{$inlineDiff.Content}} + {{$inlineDiff.Content}} {{end}} {{end}} diff --git a/web_src/js/features/repo-issue.js b/web_src/js/features/repo-issue.js index 0523c3fb01..ce4981fbe3 100644 --- a/web_src/js/features/repo-issue.js +++ b/web_src/js/features/repo-issue.js @@ -504,7 +504,9 @@ export function initRepoPullRequestReview() { ` : ` - + + + `} `); diff --git a/web_src/less/_repository.less b/web_src/less/_repository.less index 75ccc8d25f..18c463bf18 100644 --- a/web_src/less/_repository.less +++ b/web_src/less/_repository.less @@ -3186,7 +3186,7 @@ td.blob-excerpt { background: var(--color-diff-inactive); } -.code-diff-split tbody tr td:nth-child(4) { +.code-diff-split tbody tr td:nth-child(5) { border-left: 1px solid var(--color-secondary); } From 9c318a17f576887736e97c7bc2971d2ad7579a33 Mon Sep 17 00:00:00 2001 From: zeripath Date: Wed, 2 Feb 2022 08:40:04 +0000 Subject: [PATCH 023/240] Add `GetUserTeams` (#18499) (#18531) Backport #18499 * Correct use `UserID` in `SearchTeams` - Use `UserID` in the `SearchTeams` function, currently it was useless to pass such information. Now it does a INNER statement to `team_user` which obtains UserID -> TeamID data. - Make OrgID optional. - Resolves #18484 * Seperate searching specific user * Add condition back * Use correct struct type Co-authored-by: Gusted Co-authored-by: 6543 <6543@obermui.de> Co-authored-by: Lunny Xiao Co-authored-by: wxiaoguang Co-authored-by: techknowlogick --- models/org_team.go | 61 +++++++++++++++++++++++++++---- models/org_team_test.go | 4 +- modules/repository/create_test.go | 2 +- routers/api/v1/org/team.go | 11 +++--- routers/web/org/teams.go | 2 +- 5 files changed, 62 insertions(+), 18 deletions(-) diff --git a/models/org_team.go b/models/org_team.go index bce4afb061..17f95bb5b0 100644 --- a/models/org_team.go +++ b/models/org_team.go @@ -49,22 +49,67 @@ func init() { db.RegisterModel(new(TeamUnit)) } -// SearchTeamOptions holds the search options -type SearchTeamOptions struct { +// SearchOrgTeamOptions holds the search options +type SearchOrgTeamOptions struct { db.ListOptions - UserID int64 Keyword string OrgID int64 IncludeDesc bool } +// GetUserTeamOptions holds the search options. +type GetUserTeamOptions struct { + db.ListOptions + UserID int64 +} + // SearchMembersOptions holds the search options type SearchMembersOptions struct { db.ListOptions } -// SearchTeam search for teams. Caller is responsible to check permissions. -func SearchTeam(opts *SearchTeamOptions) ([]*Team, int64, error) { +// GetUserTeams search for org teams. Caller is responsible to check permissions. +func GetUserTeams(opts *GetUserTeamOptions) ([]*Team, int64, error) { + if opts.Page <= 0 { + opts.Page = 1 + } + if opts.PageSize == 0 { + // Default limit + opts.PageSize = 10 + } + + sess := db.GetEngine(db.DefaultContext) + + sess = sess.Join("INNER", "team_user", "team_user.team_id = team.id"). + And("team_user.uid=?", opts.UserID) + + count, err := sess. + Count(new(Team)) + if err != nil { + return nil, 0, err + } + + if opts.PageSize == -1 { + opts.PageSize = int(count) + } else { + sess = sess.Limit(opts.PageSize, (opts.Page-1)*opts.PageSize) + } + + sess = sess.Join("INNER", "team_user", "team_user.team_id = team.id"). + And("team_user.uid=?", opts.UserID) + + teams := make([]*Team, 0, opts.PageSize) + if err = sess. + OrderBy("lower_name"). + Find(&teams); err != nil { + return nil, 0, err + } + + return teams, count, nil +} + +// SearchOrgTeams search for org teams. Caller is responsible to check permissions. +func SearchOrgTeams(opts *SearchOrgTeamOptions) ([]*Team, int64, error) { if opts.Page <= 0 { opts.Page = 1 } @@ -196,7 +241,7 @@ func (t *Team) getRepositories(e db.Engine) error { } // GetRepositories returns paginated repositories in team of organization. -func (t *Team) GetRepositories(opts *SearchTeamOptions) error { +func (t *Team) GetRepositories(opts *SearchOrgTeamOptions) error { if opts.Page == 0 { return t.getRepositories(db.GetEngine(db.DefaultContext)) } @@ -716,7 +761,7 @@ func UpdateTeam(t *Team, authChanged, includeAllChanged bool) (err error) { // DeleteTeam deletes given team. // It's caller's responsibility to assign organization ID. func DeleteTeam(t *Team) error { - if err := t.GetRepositories(&SearchTeamOptions{}); err != nil { + if err := t.GetRepositories(&SearchOrgTeamOptions{}); err != nil { return err } @@ -858,7 +903,7 @@ func AddTeamMember(team *Team, userID int64) error { } // Get team and its repositories. - if err := team.GetRepositories(&SearchTeamOptions{}); err != nil { + if err := team.GetRepositories(&SearchOrgTeamOptions{}); err != nil { return err } diff --git a/models/org_team_test.go b/models/org_team_test.go index aa62cc58e2..cf3a797991 100644 --- a/models/org_team_test.go +++ b/models/org_team_test.go @@ -46,7 +46,7 @@ func TestTeam_GetRepositories(t *testing.T) { test := func(teamID int64) { team := unittest.AssertExistsAndLoadBean(t, &Team{ID: teamID}).(*Team) - assert.NoError(t, team.GetRepositories(&SearchTeamOptions{})) + assert.NoError(t, team.GetRepositories(&SearchOrgTeamOptions{})) assert.Len(t, team.Repos, team.NumRepos) for _, repo := range team.Repos { unittest.AssertExistsAndLoadBean(t, &TeamRepo{TeamID: teamID, RepoID: repo.ID}) @@ -292,7 +292,7 @@ func TestGetTeamMembers(t *testing.T) { func TestGetUserTeams(t *testing.T) { assert.NoError(t, unittest.PrepareTestDatabase()) test := func(userID int64) { - teams, _, err := SearchTeam(&SearchTeamOptions{UserID: userID}) + teams, _, err := GetUserTeams(&GetUserTeamOptions{UserID: userID}) assert.NoError(t, err) for _, team := range teams { unittest.AssertExistsAndLoadBean(t, &TeamUser{TeamID: team.ID, UID: userID}) diff --git a/modules/repository/create_test.go b/modules/repository/create_test.go index ed890ace43..4e232a8609 100644 --- a/modules/repository/create_test.go +++ b/modules/repository/create_test.go @@ -23,7 +23,7 @@ func TestIncludesAllRepositoriesTeams(t *testing.T) { testTeamRepositories := func(teamID int64, repoIds []int64) { team := unittest.AssertExistsAndLoadBean(t, &models.Team{ID: teamID}).(*models.Team) - assert.NoError(t, team.GetRepositories(&models.SearchTeamOptions{}), "%s: GetRepositories", team.Name) + assert.NoError(t, team.GetRepositories(&models.SearchOrgTeamOptions{}), "%s: GetRepositories", team.Name) assert.Len(t, team.Repos, team.NumRepos, "%s: len repo", team.Name) assert.Len(t, team.Repos, len(repoIds), "%s: repo count", team.Name) for i, rid := range repoIds { diff --git a/routers/api/v1/org/team.go b/routers/api/v1/org/team.go index cc7a63af33..62e6c0a6b4 100644 --- a/routers/api/v1/org/team.go +++ b/routers/api/v1/org/team.go @@ -47,7 +47,7 @@ func ListTeams(ctx *context.APIContext) { // "200": // "$ref": "#/responses/TeamList" - teams, count, err := models.SearchTeam(&models.SearchTeamOptions{ + teams, count, err := models.SearchOrgTeams(&models.SearchOrgTeamOptions{ ListOptions: utils.GetListOptions(ctx), OrgID: ctx.Org.Organization.ID, }) @@ -90,7 +90,7 @@ func ListUserTeams(ctx *context.APIContext) { // "200": // "$ref": "#/responses/TeamList" - teams, count, err := models.SearchTeam(&models.SearchTeamOptions{ + teams, count, err := models.GetUserTeams(&models.GetUserTeamOptions{ ListOptions: utils.GetListOptions(ctx), UserID: ctx.User.ID, }) @@ -533,7 +533,7 @@ func GetTeamRepos(ctx *context.APIContext) { // "$ref": "#/responses/RepositoryList" team := ctx.Org.Team - if err := team.GetRepositories(&models.SearchTeamOptions{ + if err := team.GetRepositories(&models.SearchOrgTeamOptions{ ListOptions: utils.GetListOptions(ctx), }); err != nil { ctx.Error(http.StatusInternalServerError, "GetTeamRepos", err) @@ -707,15 +707,14 @@ func SearchTeam(ctx *context.APIContext) { listOptions := utils.GetListOptions(ctx) - opts := &models.SearchTeamOptions{ - UserID: ctx.User.ID, + opts := &models.SearchOrgTeamOptions{ Keyword: ctx.FormTrim("q"), OrgID: ctx.Org.Organization.ID, IncludeDesc: ctx.FormString("include_desc") == "" || ctx.FormBool("include_desc"), ListOptions: listOptions, } - teams, maxResults, err := models.SearchTeam(opts) + teams, maxResults, err := models.SearchOrgTeams(opts) if err != nil { log.Error("SearchTeam failed: %v", err) ctx.JSON(http.StatusInternalServerError, map[string]interface{}{ diff --git a/routers/web/org/teams.go b/routers/web/org/teams.go index 732f24b22c..9b0212e569 100644 --- a/routers/web/org/teams.go +++ b/routers/web/org/teams.go @@ -319,7 +319,7 @@ func TeamRepositories(ctx *context.Context) { ctx.Data["Title"] = ctx.Org.Team.Name ctx.Data["PageIsOrgTeams"] = true ctx.Data["PageIsOrgTeamRepos"] = true - if err := ctx.Org.Team.GetRepositories(&models.SearchTeamOptions{}); err != nil { + if err := ctx.Org.Team.GetRepositories(&models.SearchOrgTeamOptions{}); err != nil { ctx.ServerError("GetRepositories", err) return } From 1d173139497189e19ca2e68285a70f44b77ca452 Mon Sep 17 00:00:00 2001 From: silverwind Date: Wed, 2 Feb 2022 00:42:23 -0800 Subject: [PATCH 024/240] Update JS dependencies, fix lint (#18389) (#18540) - Update all JS dependencies, including a security issue in mermaid - Fix new linter errors related to value-keyword-case - Tested Mermaid and Swagger Co-authored-by: zeripath Co-authored-by: Lunny Xiao Co-authored-by: wxiaoguang Co-authored-by: techknowlogick --- package-lock.json | 732 ++++++++++++++------------- package.json | 12 +- web_src/less/_repository.less | 2 +- web_src/less/_svg.less | 2 +- web_src/less/features/heatmap.less | 2 +- web_src/less/standalone/swagger.less | 2 +- 6 files changed, 391 insertions(+), 361 deletions(-) diff --git a/package-lock.json b/package-lock.json index da8a0d8303..b771f23d79 100644 --- a/package-lock.json +++ b/package-lock.json @@ -10,7 +10,7 @@ "@claviska/jquery-minicolors": "2.3.6", "@primer/octicons": "16.2.0", "add-asset-webpack-plugin": "2.0.1", - "codemirror": "5.65.0", + "codemirror": "5.65.1", "css-loader": "6.5.1", "dropzone": "6.0.0-beta.2", "easymde": "2.16.1", @@ -23,13 +23,13 @@ "less": "4.1.2", "less-loader": "10.2.0", "license-checker-webpack-plugin": "0.2.1", - "mermaid": "8.13.9", + "mermaid": "8.13.10", "mini-css-extract-plugin": "2.5.2", "monaco-editor": "0.31.1", "monaco-editor-webpack-plugin": "7.0.1", "pretty-ms": "7.0.1", "sortablejs": "1.14.0", - "swagger-ui-dist": "4.1.3", + "swagger-ui-dist": "4.2.1", "tributejs": "5.1.3", "uint8-to-base64": "0.2.0", "vue": "2.6.14", @@ -37,8 +37,8 @@ "vue-calendar-heatmap": "0.8.4", "vue-loader": "15.9.8", "vue-template-compiler": "2.6.14", - "webpack": "5.66.0", - "webpack-cli": "4.9.1", + "webpack": "5.67.0", + "webpack-cli": "4.9.2", "workbox-routing": "6.4.2", "workbox-strategies": "6.4.2", "worker-loader": "3.0.8", @@ -55,7 +55,7 @@ "jest-extended": "1.2.0", "jest-raw-loader": "1.0.1", "postcss-less": "6.0.0", - "stylelint": "14.2.0", + "stylelint": "14.3.0", "stylelint-config-standard": "24.0.0", "svgo": "2.8.0", "updates": "13.0.0" @@ -86,20 +86,20 @@ } }, "node_modules/@babel/core": { - "version": "7.16.7", - "resolved": "https://registry.npmjs.org/@babel/core/-/core-7.16.7.tgz", - "integrity": "sha512-aeLaqcqThRNZYmbMqtulsetOQZ/5gbR/dWruUCJcpas4Qoyy+QeagfDsPdMrqwsPRDNxJvBlRiZxxX7THO7qtA==", + "version": "7.16.12", + "resolved": "https://registry.npmjs.org/@babel/core/-/core-7.16.12.tgz", + "integrity": "sha512-dK5PtG1uiN2ikk++5OzSYsitZKny4wOCD0nrO4TqnW4BVBTQ2NGS3NgilvT/TEyxTST7LNyWV/T4tXDoD3fOgg==", "dev": true, "dependencies": { "@babel/code-frame": "^7.16.7", - "@babel/generator": "^7.16.7", + "@babel/generator": "^7.16.8", "@babel/helper-compilation-targets": "^7.16.7", "@babel/helper-module-transforms": "^7.16.7", "@babel/helpers": "^7.16.7", - "@babel/parser": "^7.16.7", + "@babel/parser": "^7.16.12", "@babel/template": "^7.16.7", - "@babel/traverse": "^7.16.7", - "@babel/types": "^7.16.7", + "@babel/traverse": "^7.16.10", + "@babel/types": "^7.16.8", "convert-source-map": "^1.7.0", "debug": "^4.1.0", "gensync": "^1.0.0-beta.2", @@ -330,9 +330,9 @@ } }, "node_modules/@babel/highlight": { - "version": "7.16.7", - "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.16.7.tgz", - "integrity": "sha512-aKpPMfLvGO3Q97V0qhw/V2SWNWlwfJknuwAunU7wZLSfrM4xTBvg7E5opUVi1kJTBKihE38CPg4nBiqX83PWYw==", + "version": "7.16.10", + "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.16.10.tgz", + "integrity": "sha512-5FnTQLSLswEj6IkgVw5KusNUUFY9ZGqe/TRFnP/BKYHYgfh7tc+C7mwiy95/yNP7Dh9x580Vv8r7u7ZfTBFxdw==", "dev": true, "dependencies": { "@babel/helper-validator-identifier": "^7.16.7", @@ -415,9 +415,9 @@ } }, "node_modules/@babel/parser": { - "version": "7.16.8", - "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.16.8.tgz", - "integrity": "sha512-i7jDUfrVBWc+7OKcBzEe5n7fbv3i2fWtxKzzCvOjnzSxMfWMigAhtfJ7qzZNGFNMsCCd67+uz553dYKWXPvCKw==", + "version": "7.16.12", + "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.16.12.tgz", + "integrity": "sha512-VfaV15po8RiZssrkPweyvbGVSe4x2y+aciFCgn0n0/SJMR22cwofRV1mtnJQYcSB1wUTaA/X1LnA3es66MCO5A==", "dev": true, "bin": { "parser": "bin/babel-parser.js" @@ -614,9 +614,9 @@ } }, "node_modules/@babel/traverse": { - "version": "7.16.8", - "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.16.8.tgz", - "integrity": "sha512-xe+H7JlvKsDQwXRsBhSnq1/+9c+LlQcCK3Tn/l5sbx02HYns/cn7ibp9+RV1sIUqu7hKg91NWsgHurO9dowITQ==", + "version": "7.16.10", + "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.16.10.tgz", + "integrity": "sha512-yzuaYXoRJBGMlBhsMJoUW7G1UmSb/eXr/JHYM/MsOJgavJibLwASijW7oXBdw3NQ6T0bW7Ty5P/VarOs9cHmqw==", "dev": true, "dependencies": { "@babel/code-frame": "^7.16.7", @@ -625,7 +625,7 @@ "@babel/helper-function-name": "^7.16.7", "@babel/helper-hoist-variables": "^7.16.7", "@babel/helper-split-export-declaration": "^7.16.7", - "@babel/parser": "^7.16.8", + "@babel/parser": "^7.16.10", "@babel/types": "^7.16.8", "debug": "^4.1.0", "globals": "^11.1.0" @@ -1229,9 +1229,9 @@ } }, "node_modules/@types/eslint": { - "version": "8.2.2", - "resolved": "https://registry.npmjs.org/@types/eslint/-/eslint-8.2.2.tgz", - "integrity": "sha512-nQxgB8/Sg+QKhnV8e0WzPpxjIGT3tuJDDzybkDi8ItE/IgTlHo07U0shaIjzhcvQxlq9SDRE42lsJ23uvEgJ2A==", + "version": "8.4.1", + "resolved": "https://registry.npmjs.org/@types/eslint/-/eslint-8.4.1.tgz", + "integrity": "sha512-GE44+DNEyxxh2Kc6ro/VkIj+9ma0pO0bwv9+uHSyBrikYOHr8zYcdPvnBOp1aw8s+CjRvuSx7CyWqRrNFQ59mA==", "dependencies": { "@types/estree": "*", "@types/json-schema": "*" @@ -1307,9 +1307,9 @@ "dev": true }, "node_modules/@types/node": { - "version": "17.0.9", - "resolved": "https://registry.npmjs.org/@types/node/-/node-17.0.9.tgz", - "integrity": "sha512-5dNBXu/FOER+EXnyah7rn8xlNrfMOQb/qXnw4NQgLkCygKBKhdmF/CA5oXVOKZLBEahw8s2WP9LxIcN/oDDRgQ==" + "version": "17.0.10", + "resolved": "https://registry.npmjs.org/@types/node/-/node-17.0.10.tgz", + "integrity": "sha512-S/3xB4KzyFxYGCppyDt68yzBU9ysL88lSdIah4D6cptdcltc4NCPCAMc0+PCpg/lLIyC7IPvj2Z52OJWeIUkog==" }, "node_modules/@types/normalize-package-data": { "version": "2.4.1", @@ -1543,18 +1543,18 @@ } }, "node_modules/@webpack-cli/configtest": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/@webpack-cli/configtest/-/configtest-1.1.0.tgz", - "integrity": "sha512-ttOkEkoalEHa7RaFYpM0ErK1xc4twg3Am9hfHhL7MVqlHebnkYd2wuI/ZqTDj0cVzZho6PdinY0phFZV3O0Mzg==", + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/@webpack-cli/configtest/-/configtest-1.1.1.tgz", + "integrity": "sha512-1FBc1f9G4P/AxMqIgfZgeOTuRnwZMten8E7zap5zgpPInnCrP8D4Q81+4CWIch8i/Nf7nXjP0v6CjjbHOrXhKg==", "peerDependencies": { "webpack": "4.x.x || 5.x.x", "webpack-cli": "4.x.x" } }, "node_modules/@webpack-cli/info": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/@webpack-cli/info/-/info-1.4.0.tgz", - "integrity": "sha512-F6b+Man0rwE4n0409FyAJHStYA5OIZERxmnUfLVwv0mc0V1wLad3V7jqRlMkgKBeAq07jUvglacNaa6g9lOpuw==", + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/@webpack-cli/info/-/info-1.4.1.tgz", + "integrity": "sha512-PKVGmazEq3oAo46Q63tpMr4HipI3OPfP7LiNOEJg963RMgT0rqheag28NCML0o3GIzA3DmxP1ZIAv9oTX1CUIA==", "dependencies": { "envinfo": "^7.7.3" }, @@ -1563,9 +1563,9 @@ } }, "node_modules/@webpack-cli/serve": { - "version": "1.6.0", - "resolved": "https://registry.npmjs.org/@webpack-cli/serve/-/serve-1.6.0.tgz", - "integrity": "sha512-ZkVeqEmRpBV2GHvjjUZqEai2PpUbuq8Bqd//vEYsp63J8WyexI8ppCqVS3Zs0QADf6aWuPdU+0XsPI647PVlQA==", + "version": "1.6.1", + "resolved": "https://registry.npmjs.org/@webpack-cli/serve/-/serve-1.6.1.tgz", + "integrity": "sha512-gNGTiTrjEVQ0OcVnzsRSqTxaBSr+dmTfm+qJsCDluky8uhdLWep7Gcr62QsAKHTMxjCS/8nEITsmFAhfIx+QSw==", "peerDependencies": { "webpack-cli": "4.x.x" }, @@ -2119,9 +2119,9 @@ } }, "node_modules/caniuse-lite": { - "version": "1.0.30001300", - "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001300.tgz", - "integrity": "sha512-cVjiJHWGcNlJi8TZVKNMnvMid3Z3TTdDHmLDzlOdIiZq138Exvo0G+G0wTdVYolxKb4AYwC+38pxodiInVtJSA==", + "version": "1.0.30001301", + "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001301.tgz", + "integrity": "sha512-csfD/GpHMqgEL3V3uIgosvh+SVIQvCh43SNu9HRbP1lnxkKm1kjDG4f32PP571JplkLjfS+mg2p1gxR7MYrrIA==", "funding": { "type": "opencollective", "url": "https://opencollective.com/browserslist" @@ -2277,9 +2277,9 @@ } }, "node_modules/codemirror": { - "version": "5.65.0", - "resolved": "https://registry.npmjs.org/codemirror/-/codemirror-5.65.0.tgz", - "integrity": "sha512-gWEnHKEcz1Hyz7fsQWpK7P0sPI2/kSkRX2tc7DFA6TmZuDN75x/1ejnH/Pn8adYKrLEA1V2ww6L00GudHZbSKw==" + "version": "5.65.1", + "resolved": "https://registry.npmjs.org/codemirror/-/codemirror-5.65.1.tgz", + "integrity": "sha512-s6aac+DD+4O2u1aBmdxhB7yz2XU7tG3snOyQ05Kxifahz7hoxnfxIRHxiCSEv3TUC38dIVH8G+lZH9UWSfGQxA==" }, "node_modules/codemirror-spell-checker": { "version": "1.1.2", @@ -3495,9 +3495,9 @@ } }, "node_modules/electron-to-chromium": { - "version": "1.4.47", - "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.4.47.tgz", - "integrity": "sha512-ZHc8i3/cgeCRK/vC7W2htAG6JqUmOUgDNn/f9yY9J8UjfLjwzwOVEt4MWmgJAdvmxyrsR5KIFA/6+kUHGY0eUA==" + "version": "1.4.51", + "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.4.51.tgz", + "integrity": "sha512-JNEmcYl3mk1tGQmy0EvL5eik/CKSBuzAyGP0QFdG6LIgxQe3II0BL1m2zKc2MZMf3uGqHWE1TFddJML0RpjSHQ==" }, "node_modules/emittery": { "version": "0.8.1", @@ -3637,38 +3637,38 @@ } }, "node_modules/esbuild": { - "version": "0.14.11", - "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.14.11.tgz", - "integrity": "sha512-xZvPtVj6yecnDeFb3KjjCM6i7B5TCAQZT77kkW/CpXTMnd6VLnRPKrUB1XHI1pSq6a4Zcy3BGueQ8VljqjDGCg==", + "version": "0.14.13", + "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.14.13.tgz", + "integrity": "sha512-FIxvAdj3i2oHA6ex+E67bG7zlSTO+slt8kU2ogHDgGtrQLy2HNChv3PYjiFTYkt8hZbEAniZCXVeHn+FrHt7dA==", "hasInstallScript": true, "bin": { "esbuild": "bin/esbuild" }, "optionalDependencies": { - "esbuild-android-arm64": "0.14.11", - "esbuild-darwin-64": "0.14.11", - "esbuild-darwin-arm64": "0.14.11", - "esbuild-freebsd-64": "0.14.11", - "esbuild-freebsd-arm64": "0.14.11", - "esbuild-linux-32": "0.14.11", - "esbuild-linux-64": "0.14.11", - "esbuild-linux-arm": "0.14.11", - "esbuild-linux-arm64": "0.14.11", - "esbuild-linux-mips64le": "0.14.11", - "esbuild-linux-ppc64le": "0.14.11", - "esbuild-linux-s390x": "0.14.11", - "esbuild-netbsd-64": "0.14.11", - "esbuild-openbsd-64": "0.14.11", - "esbuild-sunos-64": "0.14.11", - "esbuild-windows-32": "0.14.11", - "esbuild-windows-64": "0.14.11", - "esbuild-windows-arm64": "0.14.11" + "esbuild-android-arm64": "0.14.13", + "esbuild-darwin-64": "0.14.13", + "esbuild-darwin-arm64": "0.14.13", + "esbuild-freebsd-64": "0.14.13", + "esbuild-freebsd-arm64": "0.14.13", + "esbuild-linux-32": "0.14.13", + "esbuild-linux-64": "0.14.13", + "esbuild-linux-arm": "0.14.13", + "esbuild-linux-arm64": "0.14.13", + "esbuild-linux-mips64le": "0.14.13", + "esbuild-linux-ppc64le": "0.14.13", + "esbuild-linux-s390x": "0.14.13", + "esbuild-netbsd-64": "0.14.13", + "esbuild-openbsd-64": "0.14.13", + "esbuild-sunos-64": "0.14.13", + "esbuild-windows-32": "0.14.13", + "esbuild-windows-64": "0.14.13", + "esbuild-windows-arm64": "0.14.13" } }, "node_modules/esbuild-android-arm64": { - "version": "0.14.11", - "resolved": "https://registry.npmjs.org/esbuild-android-arm64/-/esbuild-android-arm64-0.14.11.tgz", - "integrity": "sha512-6iHjgvMnC/SzDH8TefL+/3lgCjYWwAd1LixYfmz/TBPbDQlxcuSkX0yiQgcJB9k+ibZ54yjVXziIwGdlc+6WNw==", + "version": "0.14.13", + "resolved": "https://registry.npmjs.org/esbuild-android-arm64/-/esbuild-android-arm64-0.14.13.tgz", + "integrity": "sha512-rhtwl+KJ3BzzXkK09N3/YbEF1i5WhriysJEStoeWNBzchx9hlmzyWmDGQQhu56HF78ua3JrVPyLOsdLGvtMvxQ==", "cpu": [ "arm64" ], @@ -3678,9 +3678,9 @@ ] }, "node_modules/esbuild-darwin-64": { - "version": "0.14.11", - "resolved": "https://registry.npmjs.org/esbuild-darwin-64/-/esbuild-darwin-64-0.14.11.tgz", - "integrity": "sha512-olq84ikh6TiBcrs3FnM4eR5VPPlcJcdW8BnUz/lNoEWYifYQ+Po5DuYV1oz1CTFMw4k6bQIZl8T3yxL+ZT2uvQ==", + "version": "0.14.13", + "resolved": "https://registry.npmjs.org/esbuild-darwin-64/-/esbuild-darwin-64-0.14.13.tgz", + "integrity": "sha512-Fl47xIt5RMu50WIgMU93kwmUUJb+BPuL8R895n/aBNQqavS+KUMpLPoqKGABBV4myfx/fnAD/97X8Gt1C1YW6w==", "cpu": [ "x64" ], @@ -3690,9 +3690,9 @@ ] }, "node_modules/esbuild-darwin-arm64": { - "version": "0.14.11", - "resolved": "https://registry.npmjs.org/esbuild-darwin-arm64/-/esbuild-darwin-arm64-0.14.11.tgz", - "integrity": "sha512-Jj0ieWLREPBYr/TZJrb2GFH8PVzDqiQWavo1pOFFShrcmHWDBDrlDxPzEZ67NF/Un3t6sNNmeI1TUS/fe1xARg==", + "version": "0.14.13", + "resolved": "https://registry.npmjs.org/esbuild-darwin-arm64/-/esbuild-darwin-arm64-0.14.13.tgz", + "integrity": "sha512-UttqKRFXsWvuivcyAbFmo54vdkC9Me1ZYQNuoz/uBYDbkb2MgqKYG2+xoVKPBhLvhT0CKM5QGKD81flMH5BE6A==", "cpu": [ "arm64" ], @@ -3702,9 +3702,9 @@ ] }, "node_modules/esbuild-freebsd-64": { - "version": "0.14.11", - "resolved": "https://registry.npmjs.org/esbuild-freebsd-64/-/esbuild-freebsd-64-0.14.11.tgz", - "integrity": "sha512-C5sT3/XIztxxz/zwDjPRHyzj/NJFOnakAanXuyfLDwhwupKPd76/PPHHyJx6Po6NI6PomgVp/zi6GRB8PfrOTA==", + "version": "0.14.13", + "resolved": "https://registry.npmjs.org/esbuild-freebsd-64/-/esbuild-freebsd-64-0.14.13.tgz", + "integrity": "sha512-dlIhPFSp29Yq2TPh7Cm3/4M0uKjlfvOylHVNCRvRNiOvDbBol6/NZ3kLisczms+Yra0rxVapBPN1oMbSMuts9g==", "cpu": [ "x64" ], @@ -3714,9 +3714,9 @@ ] }, "node_modules/esbuild-freebsd-arm64": { - "version": "0.14.11", - "resolved": "https://registry.npmjs.org/esbuild-freebsd-arm64/-/esbuild-freebsd-arm64-0.14.11.tgz", - "integrity": "sha512-y3Llu4wbs0bk4cwjsdAtVOesXb6JkdfZDLKMt+v1U3tOEPBdSu6w8796VTksJgPfqvpX22JmPLClls0h5p+L9w==", + "version": "0.14.13", + "resolved": "https://registry.npmjs.org/esbuild-freebsd-arm64/-/esbuild-freebsd-arm64-0.14.13.tgz", + "integrity": "sha512-bNOHLu7Oq6RwaAMnwPbJ40DVGPl9GlAOnfH/dFZ792f8hFEbopkbtVzo1SU1jjfY3TGLWOgqHNWxPxx1N7Au+g==", "cpu": [ "arm64" ], @@ -3726,9 +3726,9 @@ ] }, "node_modules/esbuild-linux-32": { - "version": "0.14.11", - "resolved": "https://registry.npmjs.org/esbuild-linux-32/-/esbuild-linux-32-0.14.11.tgz", - "integrity": "sha512-Cg3nVsxArjyLke9EuwictFF3Sva+UlDTwHIuIyx8qpxRYAOUTmxr2LzYrhHyTcGOleLGXUXYsnUVwKqnKAgkcg==", + "version": "0.14.13", + "resolved": "https://registry.npmjs.org/esbuild-linux-32/-/esbuild-linux-32-0.14.13.tgz", + "integrity": "sha512-WzXyBx6zx16adGi7wPBvH2lRCBzYMcqnBRrJ8ciLIqYyruGvprZocX1nFWfiexjLcFxIElWnMNPX6LG7ULqyXA==", "cpu": [ "ia32" ], @@ -3738,9 +3738,9 @@ ] }, "node_modules/esbuild-linux-64": { - "version": "0.14.11", - "resolved": "https://registry.npmjs.org/esbuild-linux-64/-/esbuild-linux-64-0.14.11.tgz", - "integrity": "sha512-oeR6dIrrojr8DKVrxtH3xl4eencmjsgI6kPkDCRIIFwv4p+K7ySviM85K66BN01oLjzthpUMvBVfWSJkBLeRbg==", + "version": "0.14.13", + "resolved": "https://registry.npmjs.org/esbuild-linux-64/-/esbuild-linux-64-0.14.13.tgz", + "integrity": "sha512-P6OFAfcoUvE7g9h/0UKm3qagvTovwqpCF1wbFLWe/BcCY8BS1bR/+SxUjCeKX2BcpIsg4/43ezHDE/ntg/iOpw==", "cpu": [ "x64" ], @@ -3750,9 +3750,9 @@ ] }, "node_modules/esbuild-linux-arm": { - "version": "0.14.11", - "resolved": "https://registry.npmjs.org/esbuild-linux-arm/-/esbuild-linux-arm-0.14.11.tgz", - "integrity": "sha512-vcwskfD9g0tojux/ZaTJptJQU3a7YgTYsptK1y6LQ/rJmw7U5QJvboNawqM98Ca3ToYEucfCRGbl66OTNtp6KQ==", + "version": "0.14.13", + "resolved": "https://registry.npmjs.org/esbuild-linux-arm/-/esbuild-linux-arm-0.14.13.tgz", + "integrity": "sha512-4jmm0UySCg3Wi6FEBS7jpiPb1IyckI5um5kzYRwulHxPzkiokd6cgpcsTakR4/Y84UEicS8LnFAghHhXHZhbFg==", "cpu": [ "arm" ], @@ -3762,9 +3762,9 @@ ] }, "node_modules/esbuild-linux-arm64": { - "version": "0.14.11", - "resolved": "https://registry.npmjs.org/esbuild-linux-arm64/-/esbuild-linux-arm64-0.14.11.tgz", - "integrity": "sha512-+e6ZCgTFQYZlmg2OqLkg1jHLYtkNDksxWDBWNtI4XG4WxuOCUErLqfEt9qWjvzK3XBcCzHImrajkUjO+rRkbMg==", + "version": "0.14.13", + "resolved": "https://registry.npmjs.org/esbuild-linux-arm64/-/esbuild-linux-arm64-0.14.13.tgz", + "integrity": "sha512-k/uIvmkm4mc7vyMvJVwILgGxi2F+FuvLdmESIIWoHrnxEfEekC5AWpI/R6GQ2OMfp8snebSQLs8KL05QPnt1zA==", "cpu": [ "arm64" ], @@ -3774,9 +3774,9 @@ ] }, "node_modules/esbuild-linux-mips64le": { - "version": "0.14.11", - "resolved": "https://registry.npmjs.org/esbuild-linux-mips64le/-/esbuild-linux-mips64le-0.14.11.tgz", - "integrity": "sha512-Rrs99L+p54vepmXIb87xTG6ukrQv+CzrM8eoeR+r/OFL2Rg8RlyEtCeshXJ2+Q66MXZOgPJaokXJZb9snq28bw==", + "version": "0.14.13", + "resolved": "https://registry.npmjs.org/esbuild-linux-mips64le/-/esbuild-linux-mips64le-0.14.13.tgz", + "integrity": "sha512-vwYtgjQ1TRlUGL88km9wH9TjXsdZyZ/Xht1ASptg5XGRlqGquVjLGH11PfLLunoMdkQ0YTXR68b4l5gRfjVbyg==", "cpu": [ "mips64el" ], @@ -3786,9 +3786,9 @@ ] }, "node_modules/esbuild-linux-ppc64le": { - "version": "0.14.11", - "resolved": "https://registry.npmjs.org/esbuild-linux-ppc64le/-/esbuild-linux-ppc64le-0.14.11.tgz", - "integrity": "sha512-JyzziGAI0D30Vyzt0HDihp4s1IUtJ3ssV2zx9O/c+U/dhUHVP2TmlYjzCfCr2Q6mwXTeloDcLS4qkyvJtYptdQ==", + "version": "0.14.13", + "resolved": "https://registry.npmjs.org/esbuild-linux-ppc64le/-/esbuild-linux-ppc64le-0.14.13.tgz", + "integrity": "sha512-0KqDSIkZaYugtcdpFCd3eQ38Fg6TzhxmOpkhDIKNTwD/W2RoXeiS+Z4y5yQ3oysb/ySDOxWkwNqTdXS4sz2LdQ==", "cpu": [ "ppc64" ], @@ -3798,9 +3798,9 @@ ] }, "node_modules/esbuild-linux-s390x": { - "version": "0.14.11", - "resolved": "https://registry.npmjs.org/esbuild-linux-s390x/-/esbuild-linux-s390x-0.14.11.tgz", - "integrity": "sha512-DoThrkzunZ1nfRGoDN6REwmo8ZZWHd2ztniPVIR5RMw/Il9wiWEYBahb8jnMzQaSOxBsGp0PbyJeVLTUatnlcw==", + "version": "0.14.13", + "resolved": "https://registry.npmjs.org/esbuild-linux-s390x/-/esbuild-linux-s390x-0.14.13.tgz", + "integrity": "sha512-bG20i7d0CN97fwPN9LaLe64E2IrI0fPZWEcoiff9hzzsvo/fQCx0YjMbPC2T3gqQ48QZRltdU9hQilTjHk3geQ==", "cpu": [ "s390x" ], @@ -3829,9 +3829,9 @@ } }, "node_modules/esbuild-netbsd-64": { - "version": "0.14.11", - "resolved": "https://registry.npmjs.org/esbuild-netbsd-64/-/esbuild-netbsd-64-0.14.11.tgz", - "integrity": "sha512-12luoRQz+6eihKYh1zjrw0CBa2aw3twIiHV/FAfjh2NEBDgJQOY4WCEUEN+Rgon7xmLh4XUxCQjnwrvf8zhACw==", + "version": "0.14.13", + "resolved": "https://registry.npmjs.org/esbuild-netbsd-64/-/esbuild-netbsd-64-0.14.13.tgz", + "integrity": "sha512-jz96PQb0ltqyqLggPpcRbWxzLvWHvrZBHZQyjcOzKRDqg1fR/R1y10b1Cuv84xoIbdAf+ceNUJkMN21FfR9G2g==", "cpu": [ "x64" ], @@ -3841,9 +3841,9 @@ ] }, "node_modules/esbuild-openbsd-64": { - "version": "0.14.11", - "resolved": "https://registry.npmjs.org/esbuild-openbsd-64/-/esbuild-openbsd-64-0.14.11.tgz", - "integrity": "sha512-l18TZDjmvwW6cDeR4fmizNoxndyDHamGOOAenwI4SOJbzlJmwfr0jUgjbaXCUuYVOA964siw+Ix+A+bhALWg8Q==", + "version": "0.14.13", + "resolved": "https://registry.npmjs.org/esbuild-openbsd-64/-/esbuild-openbsd-64-0.14.13.tgz", + "integrity": "sha512-bp6zSo3kDCXKPM5MmVUg6DEpt+yXDx37iDGzNTn3Kf9xh6d0cdITxUC4Bx6S3Di79GVYubWs+wNjSRVFIJpryw==", "cpu": [ "x64" ], @@ -3853,9 +3853,9 @@ ] }, "node_modules/esbuild-sunos-64": { - "version": "0.14.11", - "resolved": "https://registry.npmjs.org/esbuild-sunos-64/-/esbuild-sunos-64-0.14.11.tgz", - "integrity": "sha512-bmYzDtwASBB8c+0/HVOAiE9diR7+8zLm/i3kEojUH2z0aIs6x/S4KiTuT5/0VKJ4zk69kXel1cNWlHBMkmavQg==", + "version": "0.14.13", + "resolved": "https://registry.npmjs.org/esbuild-sunos-64/-/esbuild-sunos-64-0.14.13.tgz", + "integrity": "sha512-08Fne1T9QHYxUnu55sV9V4i/yECADOaI1zMGET2YUa8SRkib10i80hc89U7U/G02DxpN/KUJMWEGq2wKTn0QFQ==", "cpu": [ "x64" ], @@ -3865,9 +3865,9 @@ ] }, "node_modules/esbuild-windows-32": { - "version": "0.14.11", - "resolved": "https://registry.npmjs.org/esbuild-windows-32/-/esbuild-windows-32-0.14.11.tgz", - "integrity": "sha512-J1Ys5hMid8QgdY00OBvIolXgCQn1ARhYtxPnG6ESWNTty3ashtc4+As5nTrsErnv8ZGUcWZe4WzTP/DmEVX1UQ==", + "version": "0.14.13", + "resolved": "https://registry.npmjs.org/esbuild-windows-32/-/esbuild-windows-32-0.14.13.tgz", + "integrity": "sha512-MW3BMIi9+fzTyDdljH0ftfT/qlD3t+aVzle1O+zZ2MgHRMQD20JwWgyqoJXhe6uDVyunrAUbcjH3qTIEZN3isg==", "cpu": [ "ia32" ], @@ -3877,9 +3877,9 @@ ] }, "node_modules/esbuild-windows-64": { - "version": "0.14.11", - "resolved": "https://registry.npmjs.org/esbuild-windows-64/-/esbuild-windows-64-0.14.11.tgz", - "integrity": "sha512-h9FmMskMuGeN/9G9+LlHPAoiQk9jlKDUn9yA0MpiGzwLa82E7r1b1u+h2a+InprbSnSLxDq/7p5YGtYVO85Mlg==", + "version": "0.14.13", + "resolved": "https://registry.npmjs.org/esbuild-windows-64/-/esbuild-windows-64-0.14.13.tgz", + "integrity": "sha512-d7+0N+EOgBKdi/nMxlQ8QA5xHBlpcLtSrYnHsA+Xp4yZk28dYfRw1+embsHf5uN5/1iPvrJwPrcpgDH1xyy4JA==", "cpu": [ "x64" ], @@ -3889,9 +3889,9 @@ ] }, "node_modules/esbuild-windows-arm64": { - "version": "0.14.11", - "resolved": "https://registry.npmjs.org/esbuild-windows-arm64/-/esbuild-windows-arm64-0.14.11.tgz", - "integrity": "sha512-dZp7Krv13KpwKklt9/1vBFBMqxEQIO6ri7Azf8C+ob4zOegpJmha2XY9VVWP/OyQ0OWk6cEeIzMJwInRZrzBUQ==", + "version": "0.14.13", + "resolved": "https://registry.npmjs.org/esbuild-windows-arm64/-/esbuild-windows-arm64-0.14.13.tgz", + "integrity": "sha512-oX5hmgXk9yNKbb5AxThzRQm/E9kiHyDll7JJeyeT1fuGENTifv33f0INCpjBQ+Ty5ChKc84++ZQTEBwLCA12Kw==", "cpu": [ "arm64" ], @@ -6797,9 +6797,9 @@ } }, "node_modules/mermaid": { - "version": "8.13.9", - "resolved": "https://registry.npmjs.org/mermaid/-/mermaid-8.13.9.tgz", - "integrity": "sha512-kMH676xEomSe/gzxMpDx91L+z9L+9iB3lvtPFA8aeOPRNNrfd3ZDvDCGFnuqQaJvPRCxs3Me2JDaVVNOZjojrg==", + "version": "8.13.10", + "resolved": "https://registry.npmjs.org/mermaid/-/mermaid-8.13.10.tgz", + "integrity": "sha512-2ANep359uML87+wiYaWSu83eg9Qc0xCLnNJdCh100m4v0orS3fp8SScsZLcDSElRGHi+1zuVJsEEVEWH05+COQ==", "dependencies": { "@braintree/sanitize-url": "^3.1.0", "d3": "^7.0.0", @@ -7413,9 +7413,9 @@ } }, "node_modules/pirates": { - "version": "4.0.4", - "resolved": "https://registry.npmjs.org/pirates/-/pirates-4.0.4.tgz", - "integrity": "sha512-ZIrVPH+A52Dw84R0L3/VS9Op04PuQ2SEoJL6bkshmiTic/HldyW9Tf7oH5mhJZBK7NmDx27vSMrYEXPXclpDKw==", + "version": "4.0.5", + "resolved": "https://registry.npmjs.org/pirates/-/pirates-4.0.5.tgz", + "integrity": "sha512-8V9+HQPupnaXMA23c5hvl69zXvTwTzyAYasnkb0Tts4XvO4CliqONMOnvlq26rkhLC3nWDFBJf73LU1e1VZLaQ==", "dev": true, "engines": { "node": ">= 6" @@ -7628,9 +7628,9 @@ } }, "node_modules/postcss-selector-parser": { - "version": "6.0.8", - "resolved": "https://registry.npmjs.org/postcss-selector-parser/-/postcss-selector-parser-6.0.8.tgz", - "integrity": "sha512-D5PG53d209Z1Uhcc0qAZ5U3t5HagH3cxu+WLZ22jt3gLUpXM4eXXfiO14jiDWST3NNooX/E8wISfOhZ9eIjGTQ==", + "version": "6.0.9", + "resolved": "https://registry.npmjs.org/postcss-selector-parser/-/postcss-selector-parser-6.0.9.tgz", + "integrity": "sha512-UO3SgnZOVTwu4kyLR22UQ1xZh086RyNZppb7lLAKBFK8a32ttG5i87Y/P3+2bRSjZNyJ1B7hfFNo273tKe9YxQ==", "dependencies": { "cssesc": "^3.0.0", "util-deprecate": "^1.0.2" @@ -7973,11 +7973,11 @@ } }, "node_modules/resolve": { - "version": "1.21.0", - "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.21.0.tgz", - "integrity": "sha512-3wCbTpk5WJlyE4mSOtDLhqQmGFi0/TD9VPwmiolnk8U0wRgMEktqCXd3vy5buTO3tljvalNvKrjHEfrd2WpEKA==", + "version": "1.22.0", + "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.22.0.tgz", + "integrity": "sha512-Hhtrw0nLeSrFQ7phPp4OOcVjLPIeMnRlr5mcnVuMe7M/7eBn98A3hmFRLoFo3DLZkivSYwhRUJTyPyWAk56WLw==", "dependencies": { - "is-core-module": "^2.8.0", + "is-core-module": "^2.8.1", "path-parse": "^1.0.7", "supports-preserve-symlinks-flag": "^1.0.0" }, @@ -8289,9 +8289,9 @@ } }, "node_modules/source-map-js": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/source-map-js/-/source-map-js-1.0.1.tgz", - "integrity": "sha512-4+TN2b3tqOCd/kaGRJ/sTYA0tR0mdXx26ipdolxcwtJVqEnqNYvlCAt1q3ypy4QMlYus+Zh34RNtYLoq2oQ4IA==", + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/source-map-js/-/source-map-js-1.0.2.tgz", + "integrity": "sha512-R0XvVJ9WusLiqTCEiGCmICCMplcCkIwwR11mOSD9CR5u+IXYdiseeEuXCVAjS54zqwkLcPNnmU4OeJ6tUrWhDw==", "engines": { "node": ">=0.10.0" } @@ -8520,9 +8520,9 @@ "dev": true }, "node_modules/stylelint": { - "version": "14.2.0", - "resolved": "https://registry.npmjs.org/stylelint/-/stylelint-14.2.0.tgz", - "integrity": "sha512-i0DrmDXFNpDsWiwx6SPRs4/pyw4kvZgqpDGvsTslQMY7hpUl6r33aQvNSn6cnTg2wtZ9rreFElI7XAKpOWi1vQ==", + "version": "14.3.0", + "resolved": "https://registry.npmjs.org/stylelint/-/stylelint-14.3.0.tgz", + "integrity": "sha512-PZXSwtJe4f4qBPWBwAbHL0M0Qjrv8iHN+cLpUNsffaVMS3YzpDDRI73+2lsqLAYfQEzxRwpll6BDKImREbpHWA==", "dev": true, "dependencies": { "balanced-match": "^2.0.0", @@ -8530,12 +8530,12 @@ "cosmiconfig": "^7.0.1", "debug": "^4.3.3", "execall": "^2.0.0", - "fast-glob": "^3.2.7", + "fast-glob": "^3.2.11", "fastest-levenshtein": "^1.0.12", "file-entry-cache": "^6.0.1", "get-stdin": "^8.0.0", "global-modules": "^2.0.0", - "globby": "^11.0.4", + "globby": "^11.1.0", "globjoin": "^0.1.4", "html-tags": "^3.1.0", "ignore": "^5.2.0", @@ -8549,21 +8549,22 @@ "normalize-path": "^3.0.0", "normalize-selector": "^0.2.0", "picocolors": "^1.0.0", - "postcss": "^8.3.11", + "postcss": "^8.4.5", "postcss-media-query-parser": "^0.2.3", "postcss-resolve-nested-selector": "^0.1.1", "postcss-safe-parser": "^6.0.0", - "postcss-selector-parser": "^6.0.7", - "postcss-value-parser": "^4.1.0", + "postcss-selector-parser": "^6.0.9", + "postcss-value-parser": "^4.2.0", "resolve-from": "^5.0.0", "specificity": "^0.4.1", "string-width": "^4.2.3", "strip-ansi": "^6.0.1", "style-search": "^0.1.0", + "supports-hyperlinks": "^2.2.0", "svg-tags": "^1.0.0", - "table": "^6.7.5", + "table": "^6.8.0", "v8-compile-cache": "^2.3.0", - "write-file-atomic": "^3.0.3" + "write-file-atomic": "^4.0.0" }, "bin": { "stylelint": "bin/stylelint.js" @@ -8612,6 +8613,41 @@ "node": ">=8" } }, + "node_modules/stylelint/node_modules/typedarray-to-buffer": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/typedarray-to-buffer/-/typedarray-to-buffer-4.0.0.tgz", + "integrity": "sha512-6dOYeZfS3O9RtRD1caom0sMxgK59b27+IwoNy8RDPsmslSGOyU+mpTamlaIW7aNKi90ZQZ9DFaZL3YRoiSCULQ==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ] + }, + "node_modules/stylelint/node_modules/write-file-atomic": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/write-file-atomic/-/write-file-atomic-4.0.0.tgz", + "integrity": "sha512-JhcWoKffJNF7ivO9yflBhc7tn3wKnokMUfWpBriM9yCXj4ePQnRPcWglBkkg1AHC8nsW/EfxwwhqsLtOy59djA==", + "dev": true, + "dependencies": { + "imurmurhash": "^0.1.4", + "is-typedarray": "^1.0.0", + "signal-exit": "^3.0.2", + "typedarray-to-buffer": "^4.0.0" + }, + "engines": { + "node": "^12.13.0 || ^14.15.0 || >=16" + } + }, "node_modules/stylis": { "version": "4.0.13", "resolved": "https://registry.npmjs.org/stylis/-/stylis-4.0.13.tgz", @@ -8686,9 +8722,9 @@ } }, "node_modules/swagger-ui-dist": { - "version": "4.1.3", - "resolved": "https://registry.npmjs.org/swagger-ui-dist/-/swagger-ui-dist-4.1.3.tgz", - "integrity": "sha512-WvfPSfAAMlE/sKS6YkW47nX/hA7StmhYnAHc6wWCXNL0oclwLj6UXv0hQCkLnDgvebi0MEV40SJJpVjKUgH1IQ==" + "version": "4.2.1", + "resolved": "https://registry.npmjs.org/swagger-ui-dist/-/swagger-ui-dist-4.2.1.tgz", + "integrity": "sha512-ZzUeNKIIMXmKI53iLscAVCpQ7jblYxI2XX5EBaoBr6UBEfxT3L0vlnE+fzPBbHc9g0sgdOMLZGhC5OW++9pqlw==" }, "node_modules/symbol-tree": { "version": "3.2.4", @@ -9166,14 +9202,14 @@ } }, "node_modules/vue-eslint-parser": { - "version": "8.0.1", - "resolved": "https://registry.npmjs.org/vue-eslint-parser/-/vue-eslint-parser-8.0.1.tgz", - "integrity": "sha512-lhWjDXJhe3UZw2uu3ztX51SJAPGPey1Tff2RK3TyZURwbuI4vximQLzz4nQfCv8CZq4xx7uIiogHMMoSJPr33A==", + "version": "8.2.0", + "resolved": "https://registry.npmjs.org/vue-eslint-parser/-/vue-eslint-parser-8.2.0.tgz", + "integrity": "sha512-hvl8OVT8imlKk/lQyhkshqwQQChzHETcBd5abiO4ePw7ib7QUZLfW+2TUrJHKUvFOCFRJrDin5KJO9OHzB5bRQ==", "dev": true, "dependencies": { "debug": "^4.3.2", - "eslint-scope": "^6.0.0", - "eslint-visitor-keys": "^3.0.0", + "eslint-scope": "^7.0.0", + "eslint-visitor-keys": "^3.1.0", "espree": "^9.0.0", "esquery": "^1.4.0", "lodash": "^4.17.21", @@ -9189,19 +9225,6 @@ "eslint": ">=6.0.0" } }, - "node_modules/vue-eslint-parser/node_modules/eslint-scope": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-6.0.0.tgz", - "integrity": "sha512-uRDL9MWmQCkaFus8RF5K9/L/2fn+80yoW3jkD53l4shjCh26fCtvJGasxjUqP5OT87SYTxCVA3BwTUzuELx9kA==", - "dev": true, - "dependencies": { - "esrecurse": "^4.3.0", - "estraverse": "^5.2.0" - }, - "engines": { - "node": "^12.22.0 || ^14.17.0 || >=16.0.0" - } - }, "node_modules/vue-hot-reload-api": { "version": "2.3.4", "resolved": "https://registry.npmjs.org/vue-hot-reload-api/-/vue-hot-reload-api-2.3.4.tgz", @@ -9365,9 +9388,9 @@ } }, "node_modules/webpack": { - "version": "5.66.0", - "resolved": "https://registry.npmjs.org/webpack/-/webpack-5.66.0.tgz", - "integrity": "sha512-NJNtGT7IKpGzdW7Iwpn/09OXz9inIkeIQ/ibY6B+MdV1x6+uReqz/5z1L89ezWnpPDWpXF0TY5PCYKQdWVn8Vg==", + "version": "5.67.0", + "resolved": "https://registry.npmjs.org/webpack/-/webpack-5.67.0.tgz", + "integrity": "sha512-LjFbfMh89xBDpUMgA1W9Ur6Rn/gnr2Cq1jjHFPo4v6a79/ypznSYbAyPgGhwsxBtMIaEmDD1oJoA7BEYw/Fbrw==", "dependencies": { "@types/eslint-scope": "^3.7.0", "@types/estree": "^0.0.50", @@ -9392,7 +9415,7 @@ "tapable": "^2.1.1", "terser-webpack-plugin": "^5.1.3", "watchpack": "^2.3.1", - "webpack-sources": "^3.2.2" + "webpack-sources": "^3.2.3" }, "bin": { "webpack": "bin/webpack.js" @@ -9411,14 +9434,14 @@ } }, "node_modules/webpack-cli": { - "version": "4.9.1", - "resolved": "https://registry.npmjs.org/webpack-cli/-/webpack-cli-4.9.1.tgz", - "integrity": "sha512-JYRFVuyFpzDxMDB+v/nanUdQYcZtqFPGzmlW4s+UkPMFhSpfRNmf1z4AwYcHJVdvEFAM7FFCQdNTpsBYhDLusQ==", + "version": "4.9.2", + "resolved": "https://registry.npmjs.org/webpack-cli/-/webpack-cli-4.9.2.tgz", + "integrity": "sha512-m3/AACnBBzK/kMTcxWHcZFPrw/eQuY4Df1TxvIWfWM2x7mRqBQCqKEd96oCUa9jkapLBaFfRce33eGDb4Pr7YQ==", "dependencies": { "@discoveryjs/json-ext": "^0.5.0", - "@webpack-cli/configtest": "^1.1.0", - "@webpack-cli/info": "^1.4.0", - "@webpack-cli/serve": "^1.6.0", + "@webpack-cli/configtest": "^1.1.1", + "@webpack-cli/info": "^1.4.1", + "@webpack-cli/serve": "^1.6.1", "colorette": "^2.0.14", "commander": "^7.0.0", "execa": "^5.0.0", @@ -9854,20 +9877,20 @@ "dev": true }, "@babel/core": { - "version": "7.16.7", - "resolved": "https://registry.npmjs.org/@babel/core/-/core-7.16.7.tgz", - "integrity": "sha512-aeLaqcqThRNZYmbMqtulsetOQZ/5gbR/dWruUCJcpas4Qoyy+QeagfDsPdMrqwsPRDNxJvBlRiZxxX7THO7qtA==", + "version": "7.16.12", + "resolved": "https://registry.npmjs.org/@babel/core/-/core-7.16.12.tgz", + "integrity": "sha512-dK5PtG1uiN2ikk++5OzSYsitZKny4wOCD0nrO4TqnW4BVBTQ2NGS3NgilvT/TEyxTST7LNyWV/T4tXDoD3fOgg==", "dev": true, "requires": { "@babel/code-frame": "^7.16.7", - "@babel/generator": "^7.16.7", + "@babel/generator": "^7.16.8", "@babel/helper-compilation-targets": "^7.16.7", "@babel/helper-module-transforms": "^7.16.7", "@babel/helpers": "^7.16.7", - "@babel/parser": "^7.16.7", + "@babel/parser": "^7.16.12", "@babel/template": "^7.16.7", - "@babel/traverse": "^7.16.7", - "@babel/types": "^7.16.7", + "@babel/traverse": "^7.16.10", + "@babel/types": "^7.16.8", "convert-source-map": "^1.7.0", "debug": "^4.1.0", "gensync": "^1.0.0-beta.2", @@ -10040,9 +10063,9 @@ } }, "@babel/highlight": { - "version": "7.16.7", - "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.16.7.tgz", - "integrity": "sha512-aKpPMfLvGO3Q97V0qhw/V2SWNWlwfJknuwAunU7wZLSfrM4xTBvg7E5opUVi1kJTBKihE38CPg4nBiqX83PWYw==", + "version": "7.16.10", + "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.16.10.tgz", + "integrity": "sha512-5FnTQLSLswEj6IkgVw5KusNUUFY9ZGqe/TRFnP/BKYHYgfh7tc+C7mwiy95/yNP7Dh9x580Vv8r7u7ZfTBFxdw==", "dev": true, "requires": { "@babel/helper-validator-identifier": "^7.16.7", @@ -10109,9 +10132,9 @@ } }, "@babel/parser": { - "version": "7.16.8", - "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.16.8.tgz", - "integrity": "sha512-i7jDUfrVBWc+7OKcBzEe5n7fbv3i2fWtxKzzCvOjnzSxMfWMigAhtfJ7qzZNGFNMsCCd67+uz553dYKWXPvCKw==", + "version": "7.16.12", + "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.16.12.tgz", + "integrity": "sha512-VfaV15po8RiZssrkPweyvbGVSe4x2y+aciFCgn0n0/SJMR22cwofRV1mtnJQYcSB1wUTaA/X1LnA3es66MCO5A==", "dev": true }, "@babel/plugin-syntax-async-generators": { @@ -10251,9 +10274,9 @@ } }, "@babel/traverse": { - "version": "7.16.8", - "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.16.8.tgz", - "integrity": "sha512-xe+H7JlvKsDQwXRsBhSnq1/+9c+LlQcCK3Tn/l5sbx02HYns/cn7ibp9+RV1sIUqu7hKg91NWsgHurO9dowITQ==", + "version": "7.16.10", + "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.16.10.tgz", + "integrity": "sha512-yzuaYXoRJBGMlBhsMJoUW7G1UmSb/eXr/JHYM/MsOJgavJibLwASijW7oXBdw3NQ6T0bW7Ty5P/VarOs9cHmqw==", "dev": true, "requires": { "@babel/code-frame": "^7.16.7", @@ -10262,7 +10285,7 @@ "@babel/helper-function-name": "^7.16.7", "@babel/helper-hoist-variables": "^7.16.7", "@babel/helper-split-export-declaration": "^7.16.7", - "@babel/parser": "^7.16.8", + "@babel/parser": "^7.16.10", "@babel/types": "^7.16.8", "debug": "^4.1.0", "globals": "^11.1.0" @@ -10752,9 +10775,9 @@ } }, "@types/eslint": { - "version": "8.2.2", - "resolved": "https://registry.npmjs.org/@types/eslint/-/eslint-8.2.2.tgz", - "integrity": "sha512-nQxgB8/Sg+QKhnV8e0WzPpxjIGT3tuJDDzybkDi8ItE/IgTlHo07U0shaIjzhcvQxlq9SDRE42lsJ23uvEgJ2A==", + "version": "8.4.1", + "resolved": "https://registry.npmjs.org/@types/eslint/-/eslint-8.4.1.tgz", + "integrity": "sha512-GE44+DNEyxxh2Kc6ro/VkIj+9ma0pO0bwv9+uHSyBrikYOHr8zYcdPvnBOp1aw8s+CjRvuSx7CyWqRrNFQ59mA==", "requires": { "@types/estree": "*", "@types/json-schema": "*" @@ -10830,9 +10853,9 @@ "dev": true }, "@types/node": { - "version": "17.0.9", - "resolved": "https://registry.npmjs.org/@types/node/-/node-17.0.9.tgz", - "integrity": "sha512-5dNBXu/FOER+EXnyah7rn8xlNrfMOQb/qXnw4NQgLkCygKBKhdmF/CA5oXVOKZLBEahw8s2WP9LxIcN/oDDRgQ==" + "version": "17.0.10", + "resolved": "https://registry.npmjs.org/@types/node/-/node-17.0.10.tgz", + "integrity": "sha512-S/3xB4KzyFxYGCppyDt68yzBU9ysL88lSdIah4D6cptdcltc4NCPCAMc0+PCpg/lLIyC7IPvj2Z52OJWeIUkog==" }, "@types/normalize-package-data": { "version": "2.4.1", @@ -11059,23 +11082,23 @@ } }, "@webpack-cli/configtest": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/@webpack-cli/configtest/-/configtest-1.1.0.tgz", - "integrity": "sha512-ttOkEkoalEHa7RaFYpM0ErK1xc4twg3Am9hfHhL7MVqlHebnkYd2wuI/ZqTDj0cVzZho6PdinY0phFZV3O0Mzg==", + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/@webpack-cli/configtest/-/configtest-1.1.1.tgz", + "integrity": "sha512-1FBc1f9G4P/AxMqIgfZgeOTuRnwZMten8E7zap5zgpPInnCrP8D4Q81+4CWIch8i/Nf7nXjP0v6CjjbHOrXhKg==", "requires": {} }, "@webpack-cli/info": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/@webpack-cli/info/-/info-1.4.0.tgz", - "integrity": "sha512-F6b+Man0rwE4n0409FyAJHStYA5OIZERxmnUfLVwv0mc0V1wLad3V7jqRlMkgKBeAq07jUvglacNaa6g9lOpuw==", + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/@webpack-cli/info/-/info-1.4.1.tgz", + "integrity": "sha512-PKVGmazEq3oAo46Q63tpMr4HipI3OPfP7LiNOEJg963RMgT0rqheag28NCML0o3GIzA3DmxP1ZIAv9oTX1CUIA==", "requires": { "envinfo": "^7.7.3" } }, "@webpack-cli/serve": { - "version": "1.6.0", - "resolved": "https://registry.npmjs.org/@webpack-cli/serve/-/serve-1.6.0.tgz", - "integrity": "sha512-ZkVeqEmRpBV2GHvjjUZqEai2PpUbuq8Bqd//vEYsp63J8WyexI8ppCqVS3Zs0QADf6aWuPdU+0XsPI647PVlQA==", + "version": "1.6.1", + "resolved": "https://registry.npmjs.org/@webpack-cli/serve/-/serve-1.6.1.tgz", + "integrity": "sha512-gNGTiTrjEVQ0OcVnzsRSqTxaBSr+dmTfm+qJsCDluky8uhdLWep7Gcr62QsAKHTMxjCS/8nEITsmFAhfIx+QSw==", "requires": {} }, "@xtuc/ieee754": { @@ -11474,9 +11497,9 @@ } }, "caniuse-lite": { - "version": "1.0.30001300", - "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001300.tgz", - "integrity": "sha512-cVjiJHWGcNlJi8TZVKNMnvMid3Z3TTdDHmLDzlOdIiZq138Exvo0G+G0wTdVYolxKb4AYwC+38pxodiInVtJSA==" + "version": "1.0.30001301", + "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001301.tgz", + "integrity": "sha512-csfD/GpHMqgEL3V3uIgosvh+SVIQvCh43SNu9HRbP1lnxkKm1kjDG4f32PP571JplkLjfS+mg2p1gxR7MYrrIA==" }, "chalk": { "version": "4.1.2", @@ -11594,9 +11617,9 @@ "dev": true }, "codemirror": { - "version": "5.65.0", - "resolved": "https://registry.npmjs.org/codemirror/-/codemirror-5.65.0.tgz", - "integrity": "sha512-gWEnHKEcz1Hyz7fsQWpK7P0sPI2/kSkRX2tc7DFA6TmZuDN75x/1ejnH/Pn8adYKrLEA1V2ww6L00GudHZbSKw==" + "version": "5.65.1", + "resolved": "https://registry.npmjs.org/codemirror/-/codemirror-5.65.1.tgz", + "integrity": "sha512-s6aac+DD+4O2u1aBmdxhB7yz2XU7tG3snOyQ05Kxifahz7hoxnfxIRHxiCSEv3TUC38dIVH8G+lZH9UWSfGQxA==" }, "codemirror-spell-checker": { "version": "1.1.2", @@ -12577,9 +12600,9 @@ } }, "electron-to-chromium": { - "version": "1.4.47", - "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.4.47.tgz", - "integrity": "sha512-ZHc8i3/cgeCRK/vC7W2htAG6JqUmOUgDNn/f9yY9J8UjfLjwzwOVEt4MWmgJAdvmxyrsR5KIFA/6+kUHGY0eUA==" + "version": "1.4.51", + "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.4.51.tgz", + "integrity": "sha512-JNEmcYl3mk1tGQmy0EvL5eik/CKSBuzAyGP0QFdG6LIgxQe3II0BL1m2zKc2MZMf3uGqHWE1TFddJML0RpjSHQ==" }, "emittery": { "version": "0.8.1", @@ -12680,100 +12703,100 @@ } }, "esbuild": { - "version": "0.14.11", - "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.14.11.tgz", - "integrity": "sha512-xZvPtVj6yecnDeFb3KjjCM6i7B5TCAQZT77kkW/CpXTMnd6VLnRPKrUB1XHI1pSq6a4Zcy3BGueQ8VljqjDGCg==", + "version": "0.14.13", + "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.14.13.tgz", + "integrity": "sha512-FIxvAdj3i2oHA6ex+E67bG7zlSTO+slt8kU2ogHDgGtrQLy2HNChv3PYjiFTYkt8hZbEAniZCXVeHn+FrHt7dA==", "requires": { - "esbuild-android-arm64": "0.14.11", - "esbuild-darwin-64": "0.14.11", - "esbuild-darwin-arm64": "0.14.11", - "esbuild-freebsd-64": "0.14.11", - "esbuild-freebsd-arm64": "0.14.11", - "esbuild-linux-32": "0.14.11", - "esbuild-linux-64": "0.14.11", - "esbuild-linux-arm": "0.14.11", - "esbuild-linux-arm64": "0.14.11", - "esbuild-linux-mips64le": "0.14.11", - "esbuild-linux-ppc64le": "0.14.11", - "esbuild-linux-s390x": "0.14.11", - "esbuild-netbsd-64": "0.14.11", - "esbuild-openbsd-64": "0.14.11", - "esbuild-sunos-64": "0.14.11", - "esbuild-windows-32": "0.14.11", - "esbuild-windows-64": "0.14.11", - "esbuild-windows-arm64": "0.14.11" + "esbuild-android-arm64": "0.14.13", + "esbuild-darwin-64": "0.14.13", + "esbuild-darwin-arm64": "0.14.13", + "esbuild-freebsd-64": "0.14.13", + "esbuild-freebsd-arm64": "0.14.13", + "esbuild-linux-32": "0.14.13", + "esbuild-linux-64": "0.14.13", + "esbuild-linux-arm": "0.14.13", + "esbuild-linux-arm64": "0.14.13", + "esbuild-linux-mips64le": "0.14.13", + "esbuild-linux-ppc64le": "0.14.13", + "esbuild-linux-s390x": "0.14.13", + "esbuild-netbsd-64": "0.14.13", + "esbuild-openbsd-64": "0.14.13", + "esbuild-sunos-64": "0.14.13", + "esbuild-windows-32": "0.14.13", + "esbuild-windows-64": "0.14.13", + "esbuild-windows-arm64": "0.14.13" } }, "esbuild-android-arm64": { - "version": "0.14.11", - "resolved": "https://registry.npmjs.org/esbuild-android-arm64/-/esbuild-android-arm64-0.14.11.tgz", - "integrity": "sha512-6iHjgvMnC/SzDH8TefL+/3lgCjYWwAd1LixYfmz/TBPbDQlxcuSkX0yiQgcJB9k+ibZ54yjVXziIwGdlc+6WNw==", + "version": "0.14.13", + "resolved": "https://registry.npmjs.org/esbuild-android-arm64/-/esbuild-android-arm64-0.14.13.tgz", + "integrity": "sha512-rhtwl+KJ3BzzXkK09N3/YbEF1i5WhriysJEStoeWNBzchx9hlmzyWmDGQQhu56HF78ua3JrVPyLOsdLGvtMvxQ==", "optional": true }, "esbuild-darwin-64": { - "version": "0.14.11", - "resolved": "https://registry.npmjs.org/esbuild-darwin-64/-/esbuild-darwin-64-0.14.11.tgz", - "integrity": "sha512-olq84ikh6TiBcrs3FnM4eR5VPPlcJcdW8BnUz/lNoEWYifYQ+Po5DuYV1oz1CTFMw4k6bQIZl8T3yxL+ZT2uvQ==", + "version": "0.14.13", + "resolved": "https://registry.npmjs.org/esbuild-darwin-64/-/esbuild-darwin-64-0.14.13.tgz", + "integrity": "sha512-Fl47xIt5RMu50WIgMU93kwmUUJb+BPuL8R895n/aBNQqavS+KUMpLPoqKGABBV4myfx/fnAD/97X8Gt1C1YW6w==", "optional": true }, "esbuild-darwin-arm64": { - "version": "0.14.11", - "resolved": "https://registry.npmjs.org/esbuild-darwin-arm64/-/esbuild-darwin-arm64-0.14.11.tgz", - "integrity": "sha512-Jj0ieWLREPBYr/TZJrb2GFH8PVzDqiQWavo1pOFFShrcmHWDBDrlDxPzEZ67NF/Un3t6sNNmeI1TUS/fe1xARg==", + "version": "0.14.13", + "resolved": "https://registry.npmjs.org/esbuild-darwin-arm64/-/esbuild-darwin-arm64-0.14.13.tgz", + "integrity": "sha512-UttqKRFXsWvuivcyAbFmo54vdkC9Me1ZYQNuoz/uBYDbkb2MgqKYG2+xoVKPBhLvhT0CKM5QGKD81flMH5BE6A==", "optional": true }, "esbuild-freebsd-64": { - "version": "0.14.11", - "resolved": "https://registry.npmjs.org/esbuild-freebsd-64/-/esbuild-freebsd-64-0.14.11.tgz", - "integrity": "sha512-C5sT3/XIztxxz/zwDjPRHyzj/NJFOnakAanXuyfLDwhwupKPd76/PPHHyJx6Po6NI6PomgVp/zi6GRB8PfrOTA==", + "version": "0.14.13", + "resolved": "https://registry.npmjs.org/esbuild-freebsd-64/-/esbuild-freebsd-64-0.14.13.tgz", + "integrity": "sha512-dlIhPFSp29Yq2TPh7Cm3/4M0uKjlfvOylHVNCRvRNiOvDbBol6/NZ3kLisczms+Yra0rxVapBPN1oMbSMuts9g==", "optional": true }, "esbuild-freebsd-arm64": { - "version": "0.14.11", - "resolved": "https://registry.npmjs.org/esbuild-freebsd-arm64/-/esbuild-freebsd-arm64-0.14.11.tgz", - "integrity": "sha512-y3Llu4wbs0bk4cwjsdAtVOesXb6JkdfZDLKMt+v1U3tOEPBdSu6w8796VTksJgPfqvpX22JmPLClls0h5p+L9w==", + "version": "0.14.13", + "resolved": "https://registry.npmjs.org/esbuild-freebsd-arm64/-/esbuild-freebsd-arm64-0.14.13.tgz", + "integrity": "sha512-bNOHLu7Oq6RwaAMnwPbJ40DVGPl9GlAOnfH/dFZ792f8hFEbopkbtVzo1SU1jjfY3TGLWOgqHNWxPxx1N7Au+g==", "optional": true }, "esbuild-linux-32": { - "version": "0.14.11", - "resolved": "https://registry.npmjs.org/esbuild-linux-32/-/esbuild-linux-32-0.14.11.tgz", - "integrity": "sha512-Cg3nVsxArjyLke9EuwictFF3Sva+UlDTwHIuIyx8qpxRYAOUTmxr2LzYrhHyTcGOleLGXUXYsnUVwKqnKAgkcg==", + "version": "0.14.13", + "resolved": "https://registry.npmjs.org/esbuild-linux-32/-/esbuild-linux-32-0.14.13.tgz", + "integrity": "sha512-WzXyBx6zx16adGi7wPBvH2lRCBzYMcqnBRrJ8ciLIqYyruGvprZocX1nFWfiexjLcFxIElWnMNPX6LG7ULqyXA==", "optional": true }, "esbuild-linux-64": { - "version": "0.14.11", - "resolved": "https://registry.npmjs.org/esbuild-linux-64/-/esbuild-linux-64-0.14.11.tgz", - "integrity": "sha512-oeR6dIrrojr8DKVrxtH3xl4eencmjsgI6kPkDCRIIFwv4p+K7ySviM85K66BN01oLjzthpUMvBVfWSJkBLeRbg==", + "version": "0.14.13", + "resolved": "https://registry.npmjs.org/esbuild-linux-64/-/esbuild-linux-64-0.14.13.tgz", + "integrity": "sha512-P6OFAfcoUvE7g9h/0UKm3qagvTovwqpCF1wbFLWe/BcCY8BS1bR/+SxUjCeKX2BcpIsg4/43ezHDE/ntg/iOpw==", "optional": true }, "esbuild-linux-arm": { - "version": "0.14.11", - "resolved": "https://registry.npmjs.org/esbuild-linux-arm/-/esbuild-linux-arm-0.14.11.tgz", - "integrity": "sha512-vcwskfD9g0tojux/ZaTJptJQU3a7YgTYsptK1y6LQ/rJmw7U5QJvboNawqM98Ca3ToYEucfCRGbl66OTNtp6KQ==", + "version": "0.14.13", + "resolved": "https://registry.npmjs.org/esbuild-linux-arm/-/esbuild-linux-arm-0.14.13.tgz", + "integrity": "sha512-4jmm0UySCg3Wi6FEBS7jpiPb1IyckI5um5kzYRwulHxPzkiokd6cgpcsTakR4/Y84UEicS8LnFAghHhXHZhbFg==", "optional": true }, "esbuild-linux-arm64": { - "version": "0.14.11", - "resolved": "https://registry.npmjs.org/esbuild-linux-arm64/-/esbuild-linux-arm64-0.14.11.tgz", - "integrity": "sha512-+e6ZCgTFQYZlmg2OqLkg1jHLYtkNDksxWDBWNtI4XG4WxuOCUErLqfEt9qWjvzK3XBcCzHImrajkUjO+rRkbMg==", + "version": "0.14.13", + "resolved": "https://registry.npmjs.org/esbuild-linux-arm64/-/esbuild-linux-arm64-0.14.13.tgz", + "integrity": "sha512-k/uIvmkm4mc7vyMvJVwILgGxi2F+FuvLdmESIIWoHrnxEfEekC5AWpI/R6GQ2OMfp8snebSQLs8KL05QPnt1zA==", "optional": true }, "esbuild-linux-mips64le": { - "version": "0.14.11", - "resolved": "https://registry.npmjs.org/esbuild-linux-mips64le/-/esbuild-linux-mips64le-0.14.11.tgz", - "integrity": "sha512-Rrs99L+p54vepmXIb87xTG6ukrQv+CzrM8eoeR+r/OFL2Rg8RlyEtCeshXJ2+Q66MXZOgPJaokXJZb9snq28bw==", + "version": "0.14.13", + "resolved": "https://registry.npmjs.org/esbuild-linux-mips64le/-/esbuild-linux-mips64le-0.14.13.tgz", + "integrity": "sha512-vwYtgjQ1TRlUGL88km9wH9TjXsdZyZ/Xht1ASptg5XGRlqGquVjLGH11PfLLunoMdkQ0YTXR68b4l5gRfjVbyg==", "optional": true }, "esbuild-linux-ppc64le": { - "version": "0.14.11", - "resolved": "https://registry.npmjs.org/esbuild-linux-ppc64le/-/esbuild-linux-ppc64le-0.14.11.tgz", - "integrity": "sha512-JyzziGAI0D30Vyzt0HDihp4s1IUtJ3ssV2zx9O/c+U/dhUHVP2TmlYjzCfCr2Q6mwXTeloDcLS4qkyvJtYptdQ==", + "version": "0.14.13", + "resolved": "https://registry.npmjs.org/esbuild-linux-ppc64le/-/esbuild-linux-ppc64le-0.14.13.tgz", + "integrity": "sha512-0KqDSIkZaYugtcdpFCd3eQ38Fg6TzhxmOpkhDIKNTwD/W2RoXeiS+Z4y5yQ3oysb/ySDOxWkwNqTdXS4sz2LdQ==", "optional": true }, "esbuild-linux-s390x": { - "version": "0.14.11", - "resolved": "https://registry.npmjs.org/esbuild-linux-s390x/-/esbuild-linux-s390x-0.14.11.tgz", - "integrity": "sha512-DoThrkzunZ1nfRGoDN6REwmo8ZZWHd2ztniPVIR5RMw/Il9wiWEYBahb8jnMzQaSOxBsGp0PbyJeVLTUatnlcw==", + "version": "0.14.13", + "resolved": "https://registry.npmjs.org/esbuild-linux-s390x/-/esbuild-linux-s390x-0.14.13.tgz", + "integrity": "sha512-bG20i7d0CN97fwPN9LaLe64E2IrI0fPZWEcoiff9hzzsvo/fQCx0YjMbPC2T3gqQ48QZRltdU9hQilTjHk3geQ==", "optional": true }, "esbuild-loader": { @@ -12790,39 +12813,39 @@ } }, "esbuild-netbsd-64": { - "version": "0.14.11", - "resolved": "https://registry.npmjs.org/esbuild-netbsd-64/-/esbuild-netbsd-64-0.14.11.tgz", - "integrity": "sha512-12luoRQz+6eihKYh1zjrw0CBa2aw3twIiHV/FAfjh2NEBDgJQOY4WCEUEN+Rgon7xmLh4XUxCQjnwrvf8zhACw==", + "version": "0.14.13", + "resolved": "https://registry.npmjs.org/esbuild-netbsd-64/-/esbuild-netbsd-64-0.14.13.tgz", + "integrity": "sha512-jz96PQb0ltqyqLggPpcRbWxzLvWHvrZBHZQyjcOzKRDqg1fR/R1y10b1Cuv84xoIbdAf+ceNUJkMN21FfR9G2g==", "optional": true }, "esbuild-openbsd-64": { - "version": "0.14.11", - "resolved": "https://registry.npmjs.org/esbuild-openbsd-64/-/esbuild-openbsd-64-0.14.11.tgz", - "integrity": "sha512-l18TZDjmvwW6cDeR4fmizNoxndyDHamGOOAenwI4SOJbzlJmwfr0jUgjbaXCUuYVOA964siw+Ix+A+bhALWg8Q==", + "version": "0.14.13", + "resolved": "https://registry.npmjs.org/esbuild-openbsd-64/-/esbuild-openbsd-64-0.14.13.tgz", + "integrity": "sha512-bp6zSo3kDCXKPM5MmVUg6DEpt+yXDx37iDGzNTn3Kf9xh6d0cdITxUC4Bx6S3Di79GVYubWs+wNjSRVFIJpryw==", "optional": true }, "esbuild-sunos-64": { - "version": "0.14.11", - "resolved": "https://registry.npmjs.org/esbuild-sunos-64/-/esbuild-sunos-64-0.14.11.tgz", - "integrity": "sha512-bmYzDtwASBB8c+0/HVOAiE9diR7+8zLm/i3kEojUH2z0aIs6x/S4KiTuT5/0VKJ4zk69kXel1cNWlHBMkmavQg==", + "version": "0.14.13", + "resolved": "https://registry.npmjs.org/esbuild-sunos-64/-/esbuild-sunos-64-0.14.13.tgz", + "integrity": "sha512-08Fne1T9QHYxUnu55sV9V4i/yECADOaI1zMGET2YUa8SRkib10i80hc89U7U/G02DxpN/KUJMWEGq2wKTn0QFQ==", "optional": true }, "esbuild-windows-32": { - "version": "0.14.11", - "resolved": "https://registry.npmjs.org/esbuild-windows-32/-/esbuild-windows-32-0.14.11.tgz", - "integrity": "sha512-J1Ys5hMid8QgdY00OBvIolXgCQn1ARhYtxPnG6ESWNTty3ashtc4+As5nTrsErnv8ZGUcWZe4WzTP/DmEVX1UQ==", + "version": "0.14.13", + "resolved": "https://registry.npmjs.org/esbuild-windows-32/-/esbuild-windows-32-0.14.13.tgz", + "integrity": "sha512-MW3BMIi9+fzTyDdljH0ftfT/qlD3t+aVzle1O+zZ2MgHRMQD20JwWgyqoJXhe6uDVyunrAUbcjH3qTIEZN3isg==", "optional": true }, "esbuild-windows-64": { - "version": "0.14.11", - "resolved": "https://registry.npmjs.org/esbuild-windows-64/-/esbuild-windows-64-0.14.11.tgz", - "integrity": "sha512-h9FmMskMuGeN/9G9+LlHPAoiQk9jlKDUn9yA0MpiGzwLa82E7r1b1u+h2a+InprbSnSLxDq/7p5YGtYVO85Mlg==", + "version": "0.14.13", + "resolved": "https://registry.npmjs.org/esbuild-windows-64/-/esbuild-windows-64-0.14.13.tgz", + "integrity": "sha512-d7+0N+EOgBKdi/nMxlQ8QA5xHBlpcLtSrYnHsA+Xp4yZk28dYfRw1+embsHf5uN5/1iPvrJwPrcpgDH1xyy4JA==", "optional": true }, "esbuild-windows-arm64": { - "version": "0.14.11", - "resolved": "https://registry.npmjs.org/esbuild-windows-arm64/-/esbuild-windows-arm64-0.14.11.tgz", - "integrity": "sha512-dZp7Krv13KpwKklt9/1vBFBMqxEQIO6ri7Azf8C+ob4zOegpJmha2XY9VVWP/OyQ0OWk6cEeIzMJwInRZrzBUQ==", + "version": "0.14.13", + "resolved": "https://registry.npmjs.org/esbuild-windows-arm64/-/esbuild-windows-arm64-0.14.13.tgz", + "integrity": "sha512-oX5hmgXk9yNKbb5AxThzRQm/E9kiHyDll7JJeyeT1fuGENTifv33f0INCpjBQ+Ty5ChKc84++ZQTEBwLCA12Kw==", "optional": true }, "escalade": { @@ -15010,9 +15033,9 @@ "integrity": "sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg==" }, "mermaid": { - "version": "8.13.9", - "resolved": "https://registry.npmjs.org/mermaid/-/mermaid-8.13.9.tgz", - "integrity": "sha512-kMH676xEomSe/gzxMpDx91L+z9L+9iB3lvtPFA8aeOPRNNrfd3ZDvDCGFnuqQaJvPRCxs3Me2JDaVVNOZjojrg==", + "version": "8.13.10", + "resolved": "https://registry.npmjs.org/mermaid/-/mermaid-8.13.10.tgz", + "integrity": "sha512-2ANep359uML87+wiYaWSu83eg9Qc0xCLnNJdCh100m4v0orS3fp8SScsZLcDSElRGHi+1zuVJsEEVEWH05+COQ==", "requires": { "@braintree/sanitize-url": "^3.1.0", "d3": "^7.0.0", @@ -15466,9 +15489,9 @@ "optional": true }, "pirates": { - "version": "4.0.4", - "resolved": "https://registry.npmjs.org/pirates/-/pirates-4.0.4.tgz", - "integrity": "sha512-ZIrVPH+A52Dw84R0L3/VS9Op04PuQ2SEoJL6bkshmiTic/HldyW9Tf7oH5mhJZBK7NmDx27vSMrYEXPXclpDKw==", + "version": "4.0.5", + "resolved": "https://registry.npmjs.org/pirates/-/pirates-4.0.5.tgz", + "integrity": "sha512-8V9+HQPupnaXMA23c5hvl69zXvTwTzyAYasnkb0Tts4XvO4CliqONMOnvlq26rkhLC3nWDFBJf73LU1e1VZLaQ==", "dev": true }, "pkg-dir": { @@ -15604,9 +15627,9 @@ "requires": {} }, "postcss-selector-parser": { - "version": "6.0.8", - "resolved": "https://registry.npmjs.org/postcss-selector-parser/-/postcss-selector-parser-6.0.8.tgz", - "integrity": "sha512-D5PG53d209Z1Uhcc0qAZ5U3t5HagH3cxu+WLZ22jt3gLUpXM4eXXfiO14jiDWST3NNooX/E8wISfOhZ9eIjGTQ==", + "version": "6.0.9", + "resolved": "https://registry.npmjs.org/postcss-selector-parser/-/postcss-selector-parser-6.0.9.tgz", + "integrity": "sha512-UO3SgnZOVTwu4kyLR22UQ1xZh086RyNZppb7lLAKBFK8a32ttG5i87Y/P3+2bRSjZNyJ1B7hfFNo273tKe9YxQ==", "requires": { "cssesc": "^3.0.0", "util-deprecate": "^1.0.2" @@ -15848,11 +15871,11 @@ "integrity": "sha512-Xf0nWe6RseziFMu+Ap9biiUbmplq6S9/p+7w7YXP/JBHhrUDDUhwa+vANyubuqfZWTveU//DYVGsDG7RKL/vEw==" }, "resolve": { - "version": "1.21.0", - "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.21.0.tgz", - "integrity": "sha512-3wCbTpk5WJlyE4mSOtDLhqQmGFi0/TD9VPwmiolnk8U0wRgMEktqCXd3vy5buTO3tljvalNvKrjHEfrd2WpEKA==", + "version": "1.22.0", + "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.22.0.tgz", + "integrity": "sha512-Hhtrw0nLeSrFQ7phPp4OOcVjLPIeMnRlr5mcnVuMe7M/7eBn98A3hmFRLoFo3DLZkivSYwhRUJTyPyWAk56WLw==", "requires": { - "is-core-module": "^2.8.0", + "is-core-module": "^2.8.1", "path-parse": "^1.0.7", "supports-preserve-symlinks-flag": "^1.0.0" } @@ -16079,9 +16102,9 @@ "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==" }, "source-map-js": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/source-map-js/-/source-map-js-1.0.1.tgz", - "integrity": "sha512-4+TN2b3tqOCd/kaGRJ/sTYA0tR0mdXx26ipdolxcwtJVqEnqNYvlCAt1q3ypy4QMlYus+Zh34RNtYLoq2oQ4IA==" + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/source-map-js/-/source-map-js-1.0.2.tgz", + "integrity": "sha512-R0XvVJ9WusLiqTCEiGCmICCMplcCkIwwR11mOSD9CR5u+IXYdiseeEuXCVAjS54zqwkLcPNnmU4OeJ6tUrWhDw==" }, "source-map-support": { "version": "0.5.21", @@ -16270,9 +16293,9 @@ "dev": true }, "stylelint": { - "version": "14.2.0", - "resolved": "https://registry.npmjs.org/stylelint/-/stylelint-14.2.0.tgz", - "integrity": "sha512-i0DrmDXFNpDsWiwx6SPRs4/pyw4kvZgqpDGvsTslQMY7hpUl6r33aQvNSn6cnTg2wtZ9rreFElI7XAKpOWi1vQ==", + "version": "14.3.0", + "resolved": "https://registry.npmjs.org/stylelint/-/stylelint-14.3.0.tgz", + "integrity": "sha512-PZXSwtJe4f4qBPWBwAbHL0M0Qjrv8iHN+cLpUNsffaVMS3YzpDDRI73+2lsqLAYfQEzxRwpll6BDKImREbpHWA==", "dev": true, "requires": { "balanced-match": "^2.0.0", @@ -16280,12 +16303,12 @@ "cosmiconfig": "^7.0.1", "debug": "^4.3.3", "execall": "^2.0.0", - "fast-glob": "^3.2.7", + "fast-glob": "^3.2.11", "fastest-levenshtein": "^1.0.12", "file-entry-cache": "^6.0.1", "get-stdin": "^8.0.0", "global-modules": "^2.0.0", - "globby": "^11.0.4", + "globby": "^11.1.0", "globjoin": "^0.1.4", "html-tags": "^3.1.0", "ignore": "^5.2.0", @@ -16299,21 +16322,22 @@ "normalize-path": "^3.0.0", "normalize-selector": "^0.2.0", "picocolors": "^1.0.0", - "postcss": "^8.3.11", + "postcss": "^8.4.5", "postcss-media-query-parser": "^0.2.3", "postcss-resolve-nested-selector": "^0.1.1", "postcss-safe-parser": "^6.0.0", - "postcss-selector-parser": "^6.0.7", - "postcss-value-parser": "^4.1.0", + "postcss-selector-parser": "^6.0.9", + "postcss-value-parser": "^4.2.0", "resolve-from": "^5.0.0", "specificity": "^0.4.1", "string-width": "^4.2.3", "strip-ansi": "^6.0.1", "style-search": "^0.1.0", + "supports-hyperlinks": "^2.2.0", "svg-tags": "^1.0.0", - "table": "^6.7.5", + "table": "^6.8.0", "v8-compile-cache": "^2.3.0", - "write-file-atomic": "^3.0.3" + "write-file-atomic": "^4.0.0" }, "dependencies": { "balanced-match": { @@ -16327,6 +16351,24 @@ "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-5.0.0.tgz", "integrity": "sha512-qYg9KP24dD5qka9J47d0aVky0N+b4fTU89LN9iDnjB5waksiC49rvMB0PrUJQGoTmH50XPiqOvAjDfaijGxYZw==", "dev": true + }, + "typedarray-to-buffer": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/typedarray-to-buffer/-/typedarray-to-buffer-4.0.0.tgz", + "integrity": "sha512-6dOYeZfS3O9RtRD1caom0sMxgK59b27+IwoNy8RDPsmslSGOyU+mpTamlaIW7aNKi90ZQZ9DFaZL3YRoiSCULQ==", + "dev": true + }, + "write-file-atomic": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/write-file-atomic/-/write-file-atomic-4.0.0.tgz", + "integrity": "sha512-JhcWoKffJNF7ivO9yflBhc7tn3wKnokMUfWpBriM9yCXj4ePQnRPcWglBkkg1AHC8nsW/EfxwwhqsLtOy59djA==", + "dev": true, + "requires": { + "imurmurhash": "^0.1.4", + "is-typedarray": "^1.0.0", + "signal-exit": "^3.0.2", + "typedarray-to-buffer": "^4.0.0" + } } } }, @@ -16402,9 +16444,9 @@ } }, "swagger-ui-dist": { - "version": "4.1.3", - "resolved": "https://registry.npmjs.org/swagger-ui-dist/-/swagger-ui-dist-4.1.3.tgz", - "integrity": "sha512-WvfPSfAAMlE/sKS6YkW47nX/hA7StmhYnAHc6wWCXNL0oclwLj6UXv0hQCkLnDgvebi0MEV40SJJpVjKUgH1IQ==" + "version": "4.2.1", + "resolved": "https://registry.npmjs.org/swagger-ui-dist/-/swagger-ui-dist-4.2.1.tgz", + "integrity": "sha512-ZzUeNKIIMXmKI53iLscAVCpQ7jblYxI2XX5EBaoBr6UBEfxT3L0vlnE+fzPBbHc9g0sgdOMLZGhC5OW++9pqlw==" }, "symbol-tree": { "version": "3.2.4", @@ -16774,30 +16816,18 @@ } }, "vue-eslint-parser": { - "version": "8.0.1", - "resolved": "https://registry.npmjs.org/vue-eslint-parser/-/vue-eslint-parser-8.0.1.tgz", - "integrity": "sha512-lhWjDXJhe3UZw2uu3ztX51SJAPGPey1Tff2RK3TyZURwbuI4vximQLzz4nQfCv8CZq4xx7uIiogHMMoSJPr33A==", + "version": "8.2.0", + "resolved": "https://registry.npmjs.org/vue-eslint-parser/-/vue-eslint-parser-8.2.0.tgz", + "integrity": "sha512-hvl8OVT8imlKk/lQyhkshqwQQChzHETcBd5abiO4ePw7ib7QUZLfW+2TUrJHKUvFOCFRJrDin5KJO9OHzB5bRQ==", "dev": true, "requires": { "debug": "^4.3.2", - "eslint-scope": "^6.0.0", - "eslint-visitor-keys": "^3.0.0", + "eslint-scope": "^7.0.0", + "eslint-visitor-keys": "^3.1.0", "espree": "^9.0.0", "esquery": "^1.4.0", "lodash": "^4.17.21", "semver": "^7.3.5" - }, - "dependencies": { - "eslint-scope": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-6.0.0.tgz", - "integrity": "sha512-uRDL9MWmQCkaFus8RF5K9/L/2fn+80yoW3jkD53l4shjCh26fCtvJGasxjUqP5OT87SYTxCVA3BwTUzuELx9kA==", - "dev": true, - "requires": { - "esrecurse": "^4.3.0", - "estraverse": "^5.2.0" - } - } } }, "vue-hot-reload-api": { @@ -16931,9 +16961,9 @@ "dev": true }, "webpack": { - "version": "5.66.0", - "resolved": "https://registry.npmjs.org/webpack/-/webpack-5.66.0.tgz", - "integrity": "sha512-NJNtGT7IKpGzdW7Iwpn/09OXz9inIkeIQ/ibY6B+MdV1x6+uReqz/5z1L89ezWnpPDWpXF0TY5PCYKQdWVn8Vg==", + "version": "5.67.0", + "resolved": "https://registry.npmjs.org/webpack/-/webpack-5.67.0.tgz", + "integrity": "sha512-LjFbfMh89xBDpUMgA1W9Ur6Rn/gnr2Cq1jjHFPo4v6a79/ypznSYbAyPgGhwsxBtMIaEmDD1oJoA7BEYw/Fbrw==", "requires": { "@types/eslint-scope": "^3.7.0", "@types/estree": "^0.0.50", @@ -16958,7 +16988,7 @@ "tapable": "^2.1.1", "terser-webpack-plugin": "^5.1.3", "watchpack": "^2.3.1", - "webpack-sources": "^3.2.2" + "webpack-sources": "^3.2.3" }, "dependencies": { "eslint-scope": { @@ -16993,14 +17023,14 @@ } }, "webpack-cli": { - "version": "4.9.1", - "resolved": "https://registry.npmjs.org/webpack-cli/-/webpack-cli-4.9.1.tgz", - "integrity": "sha512-JYRFVuyFpzDxMDB+v/nanUdQYcZtqFPGzmlW4s+UkPMFhSpfRNmf1z4AwYcHJVdvEFAM7FFCQdNTpsBYhDLusQ==", + "version": "4.9.2", + "resolved": "https://registry.npmjs.org/webpack-cli/-/webpack-cli-4.9.2.tgz", + "integrity": "sha512-m3/AACnBBzK/kMTcxWHcZFPrw/eQuY4Df1TxvIWfWM2x7mRqBQCqKEd96oCUa9jkapLBaFfRce33eGDb4Pr7YQ==", "requires": { "@discoveryjs/json-ext": "^0.5.0", - "@webpack-cli/configtest": "^1.1.0", - "@webpack-cli/info": "^1.4.0", - "@webpack-cli/serve": "^1.6.0", + "@webpack-cli/configtest": "^1.1.1", + "@webpack-cli/info": "^1.4.1", + "@webpack-cli/serve": "^1.6.1", "colorette": "^2.0.14", "commander": "^7.0.0", "execa": "^5.0.0", diff --git a/package.json b/package.json index 6983b46df0..74d8b7d682 100644 --- a/package.json +++ b/package.json @@ -10,7 +10,7 @@ "@claviska/jquery-minicolors": "2.3.6", "@primer/octicons": "16.2.0", "add-asset-webpack-plugin": "2.0.1", - "codemirror": "5.65.0", + "codemirror": "5.65.1", "css-loader": "6.5.1", "dropzone": "6.0.0-beta.2", "easymde": "2.16.1", @@ -23,13 +23,13 @@ "less": "4.1.2", "less-loader": "10.2.0", "license-checker-webpack-plugin": "0.2.1", - "mermaid": "8.13.9", + "mermaid": "8.13.10", "mini-css-extract-plugin": "2.5.2", "monaco-editor": "0.31.1", "monaco-editor-webpack-plugin": "7.0.1", "pretty-ms": "7.0.1", "sortablejs": "1.14.0", - "swagger-ui-dist": "4.1.3", + "swagger-ui-dist": "4.2.1", "tributejs": "5.1.3", "uint8-to-base64": "0.2.0", "vue": "2.6.14", @@ -37,8 +37,8 @@ "vue-calendar-heatmap": "0.8.4", "vue-loader": "15.9.8", "vue-template-compiler": "2.6.14", - "webpack": "5.66.0", - "webpack-cli": "4.9.1", + "webpack": "5.67.0", + "webpack-cli": "4.9.2", "workbox-routing": "6.4.2", "workbox-strategies": "6.4.2", "worker-loader": "3.0.8", @@ -55,7 +55,7 @@ "jest-extended": "1.2.0", "jest-raw-loader": "1.0.1", "postcss-less": "6.0.0", - "stylelint": "14.2.0", + "stylelint": "14.3.0", "stylelint-config-standard": "24.0.0", "svgo": "2.8.0", "updates": "13.0.0" diff --git a/web_src/less/_repository.less b/web_src/less/_repository.less index 18c463bf18..76ca5dff7d 100644 --- a/web_src/less/_repository.less +++ b/web_src/less/_repository.less @@ -3039,7 +3039,7 @@ td.blob-excerpt { } .file-info-entry + .file-info-entry { - border-left: 1px solid currentColor; + border-left: 1px solid currentcolor; margin-left: 8px; padding-left: 8px; } diff --git a/web_src/less/_svg.less b/web_src/less/_svg.less index 696d0558e0..a2ea64c438 100644 --- a/web_src/less/_svg.less +++ b/web_src/less/_svg.less @@ -1,7 +1,7 @@ .svg { display: inline-block; vertical-align: text-top; - fill: currentColor; + fill: currentcolor; .middle & { vertical-align: middle; diff --git a/web_src/less/features/heatmap.less b/web_src/less/features/heatmap.less index f82f3d12cd..f551daf333 100644 --- a/web_src/less/features/heatmap.less +++ b/web_src/less/features/heatmap.less @@ -17,7 +17,7 @@ } text { - fill: currentColor !important; + fill: currentcolor !important; } .total-contributions { diff --git a/web_src/less/standalone/swagger.less b/web_src/less/standalone/swagger.less index cc829961d3..3b902483d8 100644 --- a/web_src/less/standalone/swagger.less +++ b/web_src/less/standalone/swagger.less @@ -26,6 +26,6 @@ body { .swagger-back-link svg { color: inherit; - fill: currentColor; + fill: currentcolor; margin-right: .5rem; } From 0dfe5fa2d69f92058207249a62308915ed60c435 Mon Sep 17 00:00:00 2001 From: zeripath Date: Wed, 2 Feb 2022 14:35:25 +0000 Subject: [PATCH 025/240] Detect conflicts with 3way merge (#18536) (#18537) Backport #18536 Unforunately git apply --3way reports conflicts differently than standard patches resulting in conflicts being missed. Adjust the conflict detection code to account for this different error reporting. Fix #18514 Signed-off-by: Andrew Thornton --- services/pull/patch.go | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/services/pull/patch.go b/services/pull/patch.go index 0eba3f86ed..ee10c97392 100644 --- a/services/pull/patch.go +++ b/services/pull/patch.go @@ -339,8 +339,10 @@ func checkConflicts(pr *models.PullRequest, gitRepo *git.Repository, tmpBasePath if prConfig.IgnoreWhitespaceConflicts { args = append(args, "--ignore-whitespace") } + is3way := false if git.CheckGitVersionAtLeast("2.32.0") == nil { args = append(args, "--3way") + is3way = true } args = append(args, patchPath) pr.ConflictedFiles = make([]string, 0, 5) @@ -379,6 +381,9 @@ func checkConflicts(pr *models.PullRequest, gitRepo *git.Repository, tmpBasePath const prefix = "error: patch failed:" const errorPrefix = "error: " + const threewayFailed = "Failed to perform three-way merge..." + const appliedPatchPrefix = "Applied patch to '" + const withConflicts = "' with conflicts." conflictMap := map[string]bool{} @@ -390,6 +395,8 @@ func checkConflicts(pr *models.PullRequest, gitRepo *git.Repository, tmpBasePath conflict = true filepath := strings.TrimSpace(strings.Split(line[len(prefix):], ":")[0]) conflictMap[filepath] = true + } else if is3way && line == threewayFailed { + conflict = true } else if strings.HasPrefix(line, errorPrefix) { conflict = true for _, suffix := range patchErrorSuffices { @@ -401,6 +408,12 @@ func checkConflicts(pr *models.PullRequest, gitRepo *git.Repository, tmpBasePath break } } + } else if is3way && strings.HasPrefix(line, appliedPatchPrefix) && strings.HasSuffix(line, withConflicts) { + conflict = true + filepath := strings.TrimPrefix(strings.TrimSuffix(line, withConflicts), appliedPatchPrefix) + if filepath != "" { + conflictMap[filepath] = true + } } // only list 10 conflicted files if len(conflictMap) >= 10 { From 1fc9f11253a7002adda309bc60529bcfebc7bf65 Mon Sep 17 00:00:00 2001 From: "fnetX (aka fralix)" Date: Thu, 3 Feb 2022 11:28:27 +0100 Subject: [PATCH 026/240] Add dropdown icon to template loading dropdown (#18571) --- templates/repo/issue/labels/label_load_template.tmpl | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/templates/repo/issue/labels/label_load_template.tmpl b/templates/repo/issue/labels/label_load_template.tmpl index 037069c29b..e75a7bef5f 100644 --- a/templates/repo/issue/labels/label_load_template.tmpl +++ b/templates/repo/issue/labels/label_load_template.tmpl @@ -1,12 +1,6 @@
-

{{.i18n.Tr "repo.issues.label_templates.info"}}


@@ -20,6 +14,7 @@
{{$template}}
({{$labels}})
{{end}}
+ {{svg "octicon-triangle-down" 18 "dropdown icon"}}
From e84a432f760e801b4541512534ba5cba1a6a90b7 Mon Sep 17 00:00:00 2001 From: zeripath Date: Thu, 3 Feb 2022 12:00:33 +0000 Subject: [PATCH 027/240] Make docker gitea/gitea:v1.16-dev etc refer to the latest build on that branch (#18551) (#18569) Backport #18551 (Backporting this will enable this target to create 1.16-dev) One of the problems with our current docker tagging is that although we have strict version tags, latest and dev we do not have a way for docker users to track the current release branch. This PR simply suggests that we use the 1.x-dev tag for these and we build and push these. This will give users who want or need unreleased bug fixes the option of tracking the pre-release version instead of simply jumping to dev. (Also contains backport for #18573) Signed-off-by: Andrew Thornton Co-authored-by: KN4CK3R Co-authored-by: Lunny Xiao --- .drone.yml | 1 + docker/manifest.rootless.tmpl | 6 +++--- docker/manifest.tmpl | 8 ++++---- .../doc/installation/with-docker-rootless.en-us.md | 2 +- docs/content/doc/installation/with-docker.en-us.md | 2 +- 5 files changed, 10 insertions(+), 9 deletions(-) diff --git a/.drone.yml b/.drone.yml index 2fdab6cddc..98e325ad54 100644 --- a/.drone.yml +++ b/.drone.yml @@ -1086,6 +1086,7 @@ steps: trigger: ref: - refs/heads/main + - "refs/heads/release/v*" event: exclude: - cron diff --git a/docker/manifest.rootless.tmpl b/docker/manifest.rootless.tmpl index 1d14041ff2..c488934ea3 100644 --- a/docker/manifest.rootless.tmpl +++ b/docker/manifest.rootless.tmpl @@ -1,4 +1,4 @@ -image: gitea/gitea:{{#if build.tag}}{{trimPrefix "v" build.tag}}{{else}}dev{{/if}}-rootless +image: gitea/gitea:{{#if build.tag}}{{trimPrefix "v" build.tag}}{{else}}{{#equal build.ref "refs/heads/main"}}dev{{else}}{{trimPrefix "refs/heads/release/v" build.ref}}-dev{{/equal}}{{/if}}-rootless {{#if build.tags}} tags: {{#each build.tags}} @@ -8,12 +8,12 @@ tags: {{/if}} manifests: - - image: gitea/gitea:{{#if build.tag}}{{trimPrefix "v" build.tag}}{{else}}dev{{/if}}-linux-amd64-rootless + image: gitea/gitea:{{#if build.tag}}{{trimPrefix "v" build.tag}}{{else}}{{#equal build.ref "refs/heads/main"}}dev{{else}}{{trimPrefix "refs/heads/release/v" build.ref}}-dev{{/equal}}{{/if}}-linux-amd64-rootless platform: architecture: amd64 os: linux - - image: gitea/gitea:{{#if build.tag}}{{trimPrefix "v" build.tag}}{{else}}dev{{/if}}-linux-arm64-rootless + image: gitea/gitea:{{#if build.tag}}{{trimPrefix "v" build.tag}}{{else}}{{#equal build.ref "refs/heads/main"}}dev{{else}}{{trimPrefix "refs/heads/release/v" build.ref}}-dev{{/equal}}{{/if}}-linux-arm64-rootless platform: architecture: arm64 os: linux diff --git a/docker/manifest.tmpl b/docker/manifest.tmpl index 43a57f7f27..2d125c96ca 100644 --- a/docker/manifest.tmpl +++ b/docker/manifest.tmpl @@ -1,4 +1,4 @@ -image: gitea/gitea:{{#if build.tag}}{{trimPrefix "v" build.tag}}{{else}}dev{{/if}} +image: gitea/gitea:{{#if build.tag}}{{trimPrefix "v" build.tag}}{{else}}{{#equal build.ref "refs/heads/main"}}dev{{else}}{{trimPrefix "refs/heads/release/v" build.ref}}-dev{{/equal}}{{/if}} {{#if build.tags}} tags: {{#each build.tags}} @@ -8,13 +8,13 @@ tags: {{/if}} manifests: - - image: gitea/gitea:{{#if build.tag}}{{trimPrefix "v" build.tag}}-{{else}}dev-{{/if}}linux-amd64 + image: gitea/gitea:{{#if build.tag}}{{trimPrefix "v" build.tag}}{{else}}{{#equal build.ref "refs/heads/main"}}dev{{else}}{{trimPrefix "refs/heads/release/v" build.ref}}-dev{{/equal}}{{/if}}-linux-amd64 platform: architecture: amd64 os: linux - - image: gitea/gitea:{{#if build.tag}}{{trimPrefix "v" build.tag}}-{{else}}dev-{{/if}}linux-arm64 + image: gitea/gitea:{{#if build.tag}}{{trimPrefix "v" build.tag}}{{else}}{{#equal build.ref "refs/heads/main"}}dev{{else}}{{trimPrefix "refs/heads/release/v" build.ref}}-dev{{/equal}}{{/if}}-linux-arm64 platform: architecture: arm64 os: linux - variant: v8 \ No newline at end of file + variant: v8 diff --git a/docs/content/doc/installation/with-docker-rootless.en-us.md b/docs/content/doc/installation/with-docker-rootless.en-us.md index f28d506231..a49d3bb15b 100644 --- a/docs/content/doc/installation/with-docker-rootless.en-us.md +++ b/docs/content/doc/installation/with-docker-rootless.en-us.md @@ -32,7 +32,7 @@ image as a service. Since there is no database available, one can be initialized Create a directory for `data` and `config` then paste the following content into a file named `docker-compose.yml`. Note that the volume should be owned by the user/group with the UID/GID specified in the config file. By default Gitea in docker will use uid:1000 gid:1000. If needed you can set ownership on those folders with the command: `sudo chown 1000:1000 config/ data/` If you don't give the volume correct permissions, the container may not start. -For a stable release you could use `:latest-rootless`, `:1-rootless` or specify a certain release like `:{{< version >}}-rootless`, but if you'd like to use the latest development version then `:dev-rootless` would be an appropriate tag. +For a stable release you could use `:latest-rootless`, `:1-rootless` or specify a certain release like `:{{< version >}}-rootless`, but if you'd like to use the latest development version then `:dev-rootless` would be an appropriate tag. If you'd like to run the latest commit from a release branch you can use the `:1.x-dev-rootless` tag, where x is the minor version of Gitea. (e.g. `:1.16-dev-rootless`) ```yaml version: "2" diff --git a/docs/content/doc/installation/with-docker.en-us.md b/docs/content/doc/installation/with-docker.en-us.md index 43a262c593..de738cc0f8 100644 --- a/docs/content/doc/installation/with-docker.en-us.md +++ b/docs/content/doc/installation/with-docker.en-us.md @@ -34,7 +34,7 @@ image as a service. Since there is no database available, one can be initialized Create a directory like `gitea` and paste the following content into a file named `docker-compose.yml`. Note that the volume should be owned by the user/group with the UID/GID specified in the config file. If you don't give the volume correct permissions, the container may not start. -For a stable release you can use `:latest`, `:1` or specify a certain release like `:{{< version >}}`, but if you'd like to use the latest development version of Gitea then you could use the `:dev` tag. +For a stable release you can use `:latest`, `:1` or specify a certain release like `:{{< version >}}`, but if you'd like to use the latest development version of Gitea then you could use the `:dev` tag. If you'd like to run the latest commit from a release branch you can use the `:1.x-dev` tag, where x is the minor version of Gitea. (e.g. `:1.16-dev`) ```yaml version: "3" From 8d31cfbfff63d01150c131e674708ee7ed2e430d Mon Sep 17 00:00:00 2001 From: zeripath Date: Thu, 3 Feb 2022 13:36:42 +0000 Subject: [PATCH 028/240] Prevent panic on prohibited user login with oauth2 (#18562) (#18563) Backport #18562 There was an unfortunate regression in #17962 where following detection of the UserProhibitLogin error the err is cast to a pointer by mistake. This causes a panic due to an interface error. Fix #18561 Signed-off-by: Andrew Thornton --- routers/web/auth/oauth.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/routers/web/auth/oauth.go b/routers/web/auth/oauth.go index dbd1756348..8bd443a6c9 100644 --- a/routers/web/auth/oauth.go +++ b/routers/web/auth/oauth.go @@ -826,7 +826,7 @@ func SignInOAuthCallback(ctx *context.Context) { u, gothUser, err := oAuth2UserLoginCallback(authSource, ctx.Req, ctx.Resp) if err != nil { if user_model.IsErrUserProhibitLogin(err) { - uplerr := err.(*user_model.ErrUserProhibitLogin) + uplerr := err.(user_model.ErrUserProhibitLogin) log.Info("Failed authentication attempt for %s from %s: %v", uplerr.Name, ctx.RemoteAddr(), err) ctx.Data["Title"] = ctx.Tr("auth.prohibit_login") ctx.HTML(http.StatusOK, "user/auth/prohibit_login") From bc196a35e1c74f26d941aefbfde1733c2a989a6b Mon Sep 17 00:00:00 2001 From: zeripath Date: Thu, 3 Feb 2022 16:20:37 +0000 Subject: [PATCH 029/240] Collaborator trust model should trust collaborators (#18539) (#18557) Backport #18539 There was an unintended regression in #17917 which leads to only repository admin commits being trusted. This PR restores the old logic. Fix #18501 Signed-off-by: Andrew Thornton Co-authored-by: Lunny Xiao --- models/asymkey/gpg_key_commit_verification.go | 10 +++++----- models/commit.go | 2 +- modules/gitgraph/graph_models.go | 2 +- routers/web/repo/commit.go | 2 +- routers/web/repo/view.go | 2 +- 5 files changed, 9 insertions(+), 9 deletions(-) diff --git a/models/asymkey/gpg_key_commit_verification.go b/models/asymkey/gpg_key_commit_verification.go index 4b9d0cfda4..2f66863091 100644 --- a/models/asymkey/gpg_key_commit_verification.go +++ b/models/asymkey/gpg_key_commit_verification.go @@ -71,7 +71,7 @@ const ( ) // ParseCommitsWithSignature checks if signaute of commits are corresponding to users gpg keys. -func ParseCommitsWithSignature(oldCommits []*user_model.UserCommit, repoTrustModel repo_model.TrustModelType, isCodeReader func(*user_model.User) (bool, error)) []*SignCommit { +func ParseCommitsWithSignature(oldCommits []*user_model.UserCommit, repoTrustModel repo_model.TrustModelType, isOwnerMemberCollaborator func(*user_model.User) (bool, error)) []*SignCommit { newCommits := make([]*SignCommit, 0, len(oldCommits)) keyMap := map[string]bool{} @@ -81,7 +81,7 @@ func ParseCommitsWithSignature(oldCommits []*user_model.UserCommit, repoTrustMod Verification: ParseCommitWithSignature(c.Commit), } - _ = CalculateTrustStatus(signCommit.Verification, repoTrustModel, isCodeReader, &keyMap) + _ = CalculateTrustStatus(signCommit.Verification, repoTrustModel, isOwnerMemberCollaborator, &keyMap) newCommits = append(newCommits, signCommit) } @@ -455,7 +455,7 @@ func hashAndVerifyForKeyID(sig *packet.Signature, payload string, committer *use // CalculateTrustStatus will calculate the TrustStatus for a commit verification within a repository // There are several trust models in Gitea -func CalculateTrustStatus(verification *CommitVerification, repoTrustModel repo_model.TrustModelType, isCodeReader func(*user_model.User) (bool, error), keyMap *map[string]bool) (err error) { +func CalculateTrustStatus(verification *CommitVerification, repoTrustModel repo_model.TrustModelType, isOwnerMemberCollaborator func(*user_model.User) (bool, error), keyMap *map[string]bool) (err error) { if !verification.Verified { return } @@ -500,11 +500,11 @@ func CalculateTrustStatus(verification *CommitVerification, repoTrustModel repo_ var has bool isMember, has = (*keyMap)[verification.SigningKey.KeyID] if !has { - isMember, err = isCodeReader(verification.SigningUser) + isMember, err = isOwnerMemberCollaborator(verification.SigningUser) (*keyMap)[verification.SigningKey.KeyID] = isMember } } else { - isMember, err = isCodeReader(verification.SigningUser) + isMember, err = isOwnerMemberCollaborator(verification.SigningUser) } if !isMember { diff --git a/models/commit.go b/models/commit.go index 5df6964a1d..92a839b780 100644 --- a/models/commit.go +++ b/models/commit.go @@ -18,7 +18,7 @@ func ConvertFromGitCommit(commits []*git.Commit, repo *repo_model.Repository) [] user_model.ValidateCommitsWithEmails(commits), repo.GetTrustModel(), func(user *user_model.User) (bool, error) { - return IsUserRepoAdmin(repo, user) + return IsOwnerMemberCollaborator(repo, user.ID) }, ), repo, diff --git a/modules/gitgraph/graph_models.go b/modules/gitgraph/graph_models.go index 44773a3b9a..653384252d 100644 --- a/modules/gitgraph/graph_models.go +++ b/modules/gitgraph/graph_models.go @@ -117,7 +117,7 @@ func (graph *Graph) LoadAndProcessCommits(repository *repo_model.Repository, git c.Verification = asymkey_model.ParseCommitWithSignature(c.Commit) _ = asymkey_model.CalculateTrustStatus(c.Verification, repository.GetTrustModel(), func(user *user_model.User) (bool, error) { - return models.IsUserRepoAdmin(repository, user) + return models.IsOwnerMemberCollaborator(repository, user.ID) }, &keyMap) statuses, _, err := models.GetLatestCommitStatus(repository.ID, c.Commit.ID.String(), db.ListOptions{}) diff --git a/routers/web/repo/commit.go b/routers/web/repo/commit.go index 304f76158c..6b890ac484 100644 --- a/routers/web/repo/commit.go +++ b/routers/web/repo/commit.go @@ -351,7 +351,7 @@ func Diff(ctx *context.Context) { ctx.Data["DiffNotAvailable"] = diff.NumFiles == 0 if err := asymkey_model.CalculateTrustStatus(verification, ctx.Repo.Repository.GetTrustModel(), func(user *user_model.User) (bool, error) { - return models.IsUserRepoAdmin(ctx.Repo.Repository, user) + return models.IsOwnerMemberCollaborator(ctx.Repo.Repository, user.ID) }, nil); err != nil { ctx.ServerError("CalculateTrustStatus", err) return diff --git a/routers/web/repo/view.go b/routers/web/repo/view.go index e8c02b64b8..4c0e881f17 100644 --- a/routers/web/repo/view.go +++ b/routers/web/repo/view.go @@ -800,7 +800,7 @@ func renderDirectoryFiles(ctx *context.Context, timeout time.Duration) git.Entri verification := asymkey_model.ParseCommitWithSignature(latestCommit) if err := asymkey_model.CalculateTrustStatus(verification, ctx.Repo.Repository.GetTrustModel(), func(user *user_model.User) (bool, error) { - return models.IsUserRepoAdmin(ctx.Repo.Repository, user) + return models.IsOwnerMemberCollaborator(ctx.Repo.Repository, user.ID) }, nil); err != nil { ctx.ServerError("CalculateTrustStatus", err) return nil From 70ffec450909ed9de4d9d02d99bd2d90566a54c5 Mon Sep 17 00:00:00 2001 From: zeripath Date: Thu, 3 Feb 2022 21:46:24 +0000 Subject: [PATCH 030/240] Fix pushing to 1-x-dev docker tag (#18578) (#18579) * Fix pushing to 1-x-dev docker tag It appears that #18551 and #18573 have a mistake in that raymond does not have an {{else}} on {{#equal}}. This PR notes that Sprig has a hasPrefix function and so we use this with another if. Signed-off-by: Andrew Thornton * Fix pushing to 1-x-dev docker tag (part 2) Although we now have the manifest working, we need to create the images. Here we adjust the .drone.yml to force building of the images Signed-off-by: Andrew Thornton * Fix pushing to 1-x-dev docker tag OK now we have the images building we should make sure that the main ones stays dev and the release/v* ones become *-dev-* Signed-off-by: Andrew Thornton --- .drone.yml | 127 ++++++++++++++++++++++++++++++++++ docker/manifest.rootless.tmpl | 6 +- docker/manifest.tmpl | 6 +- 3 files changed, 133 insertions(+), 6 deletions(-) diff --git a/.drone.yml b/.drone.yml index 98e325ad54..d9de559039 100644 --- a/.drone.yml +++ b/.drone.yml @@ -850,6 +850,67 @@ steps: exclude: - pull_request +--- +kind: pipeline +name: docker-linux-amd64-release-branch + +platform: + os: linux + arch: amd64 + +depends_on: + - testing-amd64 + - testing-arm64 + +trigger: + ref: + - "refs/heads/release/v*" + event: + exclude: + - cron + +steps: + - name: fetch-tags + image: docker:git + commands: + - git fetch --tags --force + + - name: publish + pull: always + image: techknowlogick/drone-docker:latest + settings: + auto_tag: false + tags: ${DRONE_BRANCH##release/v}-dev-linux-amd64 + repo: gitea/gitea + build_args: + - GOPROXY=https://goproxy.cn + password: + from_secret: docker_password + username: + from_secret: docker_username + when: + event: + exclude: + - pull_request + + - name: publish-rootless + image: techknowlogick/drone-docker:latest + settings: + dockerfile: Dockerfile.rootless + auto_tag: false + tags: ${DRONE_BRANCH##release/v}-dev-linux-amd64-rootless + repo: gitea/gitea + build_args: + - GOPROXY=https://goproxy.cn + password: + from_secret: docker_password + username: + from_secret: docker_username + when: + event: + exclude: + - pull_request + --- kind: pipeline type: docker @@ -1006,6 +1067,68 @@ steps: event: exclude: - pull_request + +--- +kind: pipeline +name: docker-linux-arm64-release-branch + +platform: + os: linux + arch: arm64 + +depends_on: + - testing-amd64 + - testing-arm64 + +trigger: + ref: + - "refs/heads/release/v*" + event: + exclude: + - cron + +steps: + - name: fetch-tags + image: docker:git + commands: + - git fetch --tags --force + + - name: publish + pull: always + image: techknowlogick/drone-docker:latest + settings: + auto_tag: false + tags: ${DRONE_BRANCH##release/v}-dev-linux-arm64 + repo: gitea/gitea + build_args: + - GOPROXY=https://goproxy.cn + password: + from_secret: docker_password + username: + from_secret: docker_username + when: + event: + exclude: + - pull_request + + - name: publish-rootless + image: techknowlogick/drone-docker:latest + settings: + dockerfile: Dockerfile.rootless + auto_tag: false + tags: ${DRONE_BRANCH##release/v}-dev-linux-arm64-rootless + repo: gitea/gitea + build_args: + - GOPROXY=https://goproxy.cn + password: + from_secret: docker_password + username: + from_secret: docker_username + when: + event: + exclude: + - pull_request + --- kind: pipeline type: docker @@ -1094,6 +1217,8 @@ trigger: depends_on: - docker-linux-amd64-release - docker-linux-arm64-release + - docker-linux-amd64-release-branch + - docker-linux-arm64-release-branch --- kind: pipeline @@ -1127,6 +1252,8 @@ depends_on: - docker-linux-arm64-release - docker-linux-amd64-release-version - docker-linux-arm64-release-version + - docker-linux-amd64-release-branch + - docker-linux-arm64-release-branch - docker-manifest - docker-manifest-version - docs diff --git a/docker/manifest.rootless.tmpl b/docker/manifest.rootless.tmpl index c488934ea3..9559416470 100644 --- a/docker/manifest.rootless.tmpl +++ b/docker/manifest.rootless.tmpl @@ -1,4 +1,4 @@ -image: gitea/gitea:{{#if build.tag}}{{trimPrefix "v" build.tag}}{{else}}{{#equal build.ref "refs/heads/main"}}dev{{else}}{{trimPrefix "refs/heads/release/v" build.ref}}-dev{{/equal}}{{/if}}-rootless +image: gitea/gitea:{{#if build.tag}}{{trimPrefix "v" build.tag}}{{else}}{{#if (hasPrefix "refs/heads/release/v" build.ref)}}{{trimPrefix "refs/heads/release/v" build.ref}}-{{/if}}dev{{/if}}-rootless {{#if build.tags}} tags: {{#each build.tags}} @@ -8,12 +8,12 @@ tags: {{/if}} manifests: - - image: gitea/gitea:{{#if build.tag}}{{trimPrefix "v" build.tag}}{{else}}{{#equal build.ref "refs/heads/main"}}dev{{else}}{{trimPrefix "refs/heads/release/v" build.ref}}-dev{{/equal}}{{/if}}-linux-amd64-rootless + image: gitea/gitea:{{#if build.tag}}{{trimPrefix "v" build.tag}}{{else}}{{#if (hasPrefix "refs/heads/release/v" build.ref)}}{{trimPrefix "refs/heads/release/v" build.ref}}-{{/if}}dev{{/if}}-linux-amd64-rootless platform: architecture: amd64 os: linux - - image: gitea/gitea:{{#if build.tag}}{{trimPrefix "v" build.tag}}{{else}}{{#equal build.ref "refs/heads/main"}}dev{{else}}{{trimPrefix "refs/heads/release/v" build.ref}}-dev{{/equal}}{{/if}}-linux-arm64-rootless + image: gitea/gitea:{{#if build.tag}}{{trimPrefix "v" build.tag}}{{else}}{{#if (hasPrefix "refs/heads/release/v" build.ref)}}{{trimPrefix "refs/heads/release/v" build.ref}}-{{/if}}dev{{/if}}-linux-arm64-rootless platform: architecture: arm64 os: linux diff --git a/docker/manifest.tmpl b/docker/manifest.tmpl index 2d125c96ca..4cd4ea4ea2 100644 --- a/docker/manifest.tmpl +++ b/docker/manifest.tmpl @@ -1,4 +1,4 @@ -image: gitea/gitea:{{#if build.tag}}{{trimPrefix "v" build.tag}}{{else}}{{#equal build.ref "refs/heads/main"}}dev{{else}}{{trimPrefix "refs/heads/release/v" build.ref}}-dev{{/equal}}{{/if}} +image: gitea/gitea:{{#if build.tag}}{{trimPrefix "v" build.tag}}{{else}}{{#if (hasPrefix "refs/heads/release/v" build.ref)}}{{trimPrefix "refs/heads/release/v" build.ref}}-{{/if}}dev{{/if}} {{#if build.tags}} tags: {{#each build.tags}} @@ -8,12 +8,12 @@ tags: {{/if}} manifests: - - image: gitea/gitea:{{#if build.tag}}{{trimPrefix "v" build.tag}}{{else}}{{#equal build.ref "refs/heads/main"}}dev{{else}}{{trimPrefix "refs/heads/release/v" build.ref}}-dev{{/equal}}{{/if}}-linux-amd64 + image: gitea/gitea:{{#if build.tag}}{{trimPrefix "v" build.tag}}{{else}}{{#if (hasPrefix "refs/heads/release/v" build.ref)}}{{trimPrefix "refs/heads/release/v" build.ref}}-{{/if}}dev{{/if}}-linux-amd64 platform: architecture: amd64 os: linux - - image: gitea/gitea:{{#if build.tag}}{{trimPrefix "v" build.tag}}{{else}}{{#equal build.ref "refs/heads/main"}}dev{{else}}{{trimPrefix "refs/heads/release/v" build.ref}}-dev{{/equal}}{{/if}}-linux-arm64 + image: gitea/gitea:{{#if build.tag}}{{trimPrefix "v" build.tag}}{{else}}{{#if (hasPrefix "refs/heads/release/v" build.ref)}}{{trimPrefix "refs/heads/release/v" build.ref}}-{{/if}}dev{{/if}}-linux-arm64 platform: architecture: arm64 os: linux From 18c1edf15cf0dc5b3181cd1fc16db74dc3604f8b Mon Sep 17 00:00:00 2001 From: zeripath Date: Fri, 4 Feb 2022 08:30:36 +0000 Subject: [PATCH 031/240] Prevent merge messages from being sorted to the top of email chains (#18566) (#18588) Backport #18566 Gitea will currrently resend the same message-id for the closed/merged/reopened messages for issues. This will cause the merged message to leap to the top of an email chain and become out of sync. This PR adds specific suffices for these actions. Fix #18560 Signed-off-by: Andrew Thornton --- services/mailer/mail.go | 20 +++++- services/mailer/mail_test.go | 115 ++++++++++++++++++++++++++++++++++- 2 files changed, 131 insertions(+), 4 deletions(-) diff --git a/services/mailer/mail.go b/services/mailer/mail.go index 20552be584..3d93f1bd69 100644 --- a/services/mailer/mail.go +++ b/services/mailer/mail.go @@ -14,6 +14,7 @@ import ( "strconv" "strings" texttmpl "text/template" + "time" "code.gitea.io/gitea/models" repo_model "code.gitea.io/gitea/models/repo" @@ -297,13 +298,15 @@ func composeIssueCommentMessages(ctx *mailCommentContext, lang string, recipient } // Make sure to compose independent messages to avoid leaking user emails + msgID := createReference(ctx.Issue, ctx.Comment, ctx.ActionType) + reference := createReference(ctx.Issue, nil, models.ActionType(0)) + msgs := make([]*Message, 0, len(recipients)) for _, recipient := range recipients { msg := NewMessageFrom([]string{recipient.Email}, ctx.Doer.DisplayName(), setting.MailService.FromEmail, subject, mailBody.String()) msg.Info = fmt.Sprintf("Subject: %s, %s", subject, info) - msg.SetHeader("Message-ID", "<"+createReference(ctx.Issue, ctx.Comment)+">") - reference := createReference(ctx.Issue, nil) + msg.SetHeader("Message-ID", "<"+msgID+">") msg.SetHeader("In-Reply-To", "<"+reference+">") msg.SetHeader("References", "<"+reference+">") @@ -317,7 +320,7 @@ func composeIssueCommentMessages(ctx *mailCommentContext, lang string, recipient return msgs, nil } -func createReference(issue *models.Issue, comment *models.Comment) string { +func createReference(issue *models.Issue, comment *models.Comment, actionType models.ActionType) string { var path string if issue.IsPull { path = "pulls" @@ -328,6 +331,17 @@ func createReference(issue *models.Issue, comment *models.Comment) string { var extra string if comment != nil { extra = fmt.Sprintf("/comment/%d", comment.ID) + } else { + switch actionType { + case models.ActionCloseIssue, models.ActionClosePullRequest: + extra = fmt.Sprintf("/close/%d", time.Now().UnixNano()/1e6) + case models.ActionReopenIssue, models.ActionReopenPullRequest: + extra = fmt.Sprintf("/reopen/%d", time.Now().UnixNano()/1e6) + case models.ActionMergePullRequest: + extra = fmt.Sprintf("/merge/%d", time.Now().UnixNano()/1e6) + case models.ActionPullRequestReadyForReview: + extra = fmt.Sprintf("/ready/%d", time.Now().UnixNano()/1e6) + } } return fmt.Sprintf("%s/%s/%d%s@%s", issue.Repo.FullName(), path, issue.Index, extra, setting.Domain) diff --git a/services/mailer/mail_test.go b/services/mailer/mail_test.go index 6a175337ad..753c7adb7b 100644 --- a/services/mailer/mail_test.go +++ b/services/mailer/mail_test.go @@ -6,7 +6,9 @@ package mailer import ( "bytes" + "fmt" "html/template" + "strings" "testing" texttmpl "text/template" @@ -15,7 +17,6 @@ import ( "code.gitea.io/gitea/models/unittest" user_model "code.gitea.io/gitea/models/user" "code.gitea.io/gitea/modules/setting" - "github.com/stretchr/testify/assert" ) @@ -236,3 +237,115 @@ func TestGenerateAdditionalHeaders(t *testing.T) { } } } + +func Test_createReference(t *testing.T) { + _, _, issue, comment := prepareMailerTest(t) + _, _, pullIssue, _ := prepareMailerTest(t) + pullIssue.IsPull = true + + type args struct { + issue *models.Issue + comment *models.Comment + actionType models.ActionType + } + tests := []struct { + name string + args args + prefix string + suffix string + }{ + { + name: "Open Issue", + args: args{ + issue: issue, + actionType: models.ActionCreateIssue, + }, + prefix: fmt.Sprintf("%s/issues/%d@%s", issue.Repo.FullName(), issue.Index, setting.Domain), + }, + { + name: "Open Pull", + args: args{ + issue: pullIssue, + actionType: models.ActionCreatePullRequest, + }, + prefix: fmt.Sprintf("%s/pulls/%d@%s", issue.Repo.FullName(), issue.Index, setting.Domain), + }, + { + name: "Comment Issue", + args: args{ + issue: issue, + comment: comment, + actionType: models.ActionCommentIssue, + }, + prefix: fmt.Sprintf("%s/issues/%d/comment/%d@%s", issue.Repo.FullName(), issue.Index, comment.ID, setting.Domain), + }, + { + name: "Comment Pull", + args: args{ + issue: pullIssue, + comment: comment, + actionType: models.ActionCommentPull, + }, + prefix: fmt.Sprintf("%s/pulls/%d/comment/%d@%s", issue.Repo.FullName(), issue.Index, comment.ID, setting.Domain), + }, + { + name: "Close Issue", + args: args{ + issue: issue, + actionType: models.ActionCloseIssue, + }, + prefix: fmt.Sprintf("%s/issues/%d/close/", issue.Repo.FullName(), issue.Index), + }, + { + name: "Close Pull", + args: args{ + issue: pullIssue, + actionType: models.ActionClosePullRequest, + }, + prefix: fmt.Sprintf("%s/pulls/%d/close/", issue.Repo.FullName(), issue.Index), + }, + { + name: "Reopen Issue", + args: args{ + issue: issue, + actionType: models.ActionReopenIssue, + }, + prefix: fmt.Sprintf("%s/issues/%d/reopen/", issue.Repo.FullName(), issue.Index), + }, + { + name: "Reopen Pull", + args: args{ + issue: pullIssue, + actionType: models.ActionReopenPullRequest, + }, + prefix: fmt.Sprintf("%s/pulls/%d/reopen/", issue.Repo.FullName(), issue.Index), + }, + { + name: "Merge Pull", + args: args{ + issue: pullIssue, + actionType: models.ActionMergePullRequest, + }, + prefix: fmt.Sprintf("%s/pulls/%d/merge/", issue.Repo.FullName(), issue.Index), + }, + { + name: "Ready Pull", + args: args{ + issue: pullIssue, + actionType: models.ActionPullRequestReadyForReview, + }, + prefix: fmt.Sprintf("%s/pulls/%d/ready/", issue.Repo.FullName(), issue.Index), + }, + } + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + got := createReference(tt.args.issue, tt.args.comment, tt.args.actionType) + if !strings.HasPrefix(got, tt.prefix) { + t.Errorf("createReference() = %v, want %v", got, tt.prefix) + } + if !strings.HasSuffix(got, tt.suffix) { + t.Errorf("createReference() = %v, want %v", got, tt.prefix) + } + }) + } +} From 69b7776af5f7d2a7c158cae02ca2e806cb26d124 Mon Sep 17 00:00:00 2001 From: zeripath Date: Fri, 4 Feb 2022 17:03:41 +0000 Subject: [PATCH 032/240] Ensure commit-statuses box is sized correctly in headers (#18538) (#18606) * Ensure commit-statuses box is sized correctly in headers (#18538) Backport #18538 Backport #18605 * Ensure commit-statuses box is sized correctly in headers When viewing commits as commits the commit-status box will be fixed at 30px in height due to being forced to be this size by a fomantic selector. This PR simply adds a few more selectors to force this to have height auto. Fix #18498 Signed-off-by: Andrew Thornton Co-authored-by: wxiaoguang * Remove the spurious space in the .ui.right additional selector Somehow a spurious space sneaked in to #18538 this PR simply removes it. Signed-off-by: Andrew Thornton Co-authored-by: wxiaoguang --- web_src/less/_repository.less | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/web_src/less/_repository.less b/web_src/less/_repository.less index 76ca5dff7d..6cf70abdf7 100644 --- a/web_src/less/_repository.less +++ b/web_src/less/_repository.less @@ -4,6 +4,13 @@ // otherwise some part of the popup will be hidden by viewport boundary max-height: 45vh; max-width: 60vw; + + &.ui.right { + // Override `.ui.attached.header .right:not(.dropdown) height: 30px;` which would otherwise lead to + // the status popup box having its height fixed at 30px. See https://github.com/go-gitea/gitea/issues/18498 + height: auto; + } + overflow: auto; padding: 0; From a97c8a89660d39b4f8b73649e1bd7da3c153ae99 Mon Sep 17 00:00:00 2001 From: zeripath Date: Sat, 5 Feb 2022 20:49:53 +0000 Subject: [PATCH 033/240] Attempt to prevent intermittent failure TestGit/xxx/BranchProtectMerge/MergePR (#18451) (#18619) Backport #18451 One of the repeated intermittent failures we see in testing is a failure due to branches not being ready to merge. Prior to the immediate queue implementation we would attempt to flush all the queues and this would prevent the issue. However, the immediate queue is not flushable so the flushall is not successful at preventing this. This PR proposes an alternative solution - wait some time and try again up to 5 times. If this fails then there is a genuine issue and we should fail. Related #17719 Signed-off-by: Andrew Thornton --- .../api_helper_for_declarative_test.go | 24 +++++++++++-------- 1 file changed, 14 insertions(+), 10 deletions(-) diff --git a/integrations/api_helper_for_declarative_test.go b/integrations/api_helper_for_declarative_test.go index 9c6adaf084..7f2cd787c3 100644 --- a/integrations/api_helper_for_declarative_test.go +++ b/integrations/api_helper_for_declarative_test.go @@ -8,6 +8,7 @@ import ( "context" "fmt" "net/http" + "net/http/httptest" "net/url" "os" "testing" @@ -262,23 +263,26 @@ func doAPIMergePullRequest(ctx APITestContext, owner, repo string, index int64) return func(t *testing.T) { urlStr := fmt.Sprintf("/api/v1/repos/%s/%s/pulls/%d/merge?token=%s", owner, repo, index, ctx.Token) - req := NewRequestWithJSON(t, http.MethodPost, urlStr, &forms.MergePullRequestForm{ - MergeMessageField: "doAPIMergePullRequest Merge", - Do: string(repo_model.MergeStyleMerge), - }) - resp := ctx.Session.MakeRequest(t, req, NoExpectedStatus) + var req *http.Request + var resp *httptest.ResponseRecorder - if resp.Code == http.StatusMethodNotAllowed { - err := api.APIError{} - DecodeJSON(t, resp, &err) - assert.EqualValues(t, "Please try again later", err.Message) - queue.GetManager().FlushAll(context.Background(), 5*time.Second) + for i := 0; i < 6; i++ { req = NewRequestWithJSON(t, http.MethodPost, urlStr, &forms.MergePullRequestForm{ MergeMessageField: "doAPIMergePullRequest Merge", Do: string(repo_model.MergeStyleMerge), }) + resp = ctx.Session.MakeRequest(t, req, NoExpectedStatus) + + if resp.Code != http.StatusMethodNotAllowed { + break + } + err := api.APIError{} + DecodeJSON(t, resp, &err) + assert.EqualValues(t, "Please try again later", err.Message) + queue.GetManager().FlushAll(context.Background(), 5*time.Second) + <-time.After(1 * time.Second) } expected := ctx.ExpectedCode From f65e29c077f3df3822d7b7f874ba719fc08d267e Mon Sep 17 00:00:00 2001 From: zeripath Date: Sun, 6 Feb 2022 04:22:20 +0000 Subject: [PATCH 034/240] Ensure that blob-excerpt links work for wiki (#18587) (#18624) Backport #18587 It appears that the blob-excerpt links do not work on the wiki - likely since their introduction. This PR adds support for the wiki on these links. Signed-off-by: Andrew Thornton --- routers/web/repo/compare.go | 9 +++++++++ routers/web/web.go | 21 ++++++++++++++++++++- templates/repo/diff/blob_excerpt.tmpl | 12 ++++++------ templates/repo/diff/section_split.tmpl | 6 +++--- templates/repo/diff/section_unified.tmpl | 6 +++--- 5 files changed, 41 insertions(+), 13 deletions(-) diff --git a/routers/web/repo/compare.go b/routers/web/repo/compare.go index 3b07c35cb0..7ddeee8ab5 100644 --- a/routers/web/repo/compare.go +++ b/routers/web/repo/compare.go @@ -786,6 +786,15 @@ func ExcerptBlob(ctx *context.Context) { direction := ctx.FormString("direction") filePath := ctx.FormString("path") gitRepo := ctx.Repo.GitRepo + if ctx.FormBool("wiki") { + var err error + gitRepo, err = git.OpenRepositoryCtx(ctx, ctx.Repo.Repository.WikiPath()) + if err != nil { + ctx.ServerError("OpenRepository", err) + return + } + defer gitRepo.Close() + } chunkSize := gitdiff.BlobExcerptChunkSize commit, err := gitRepo.GetCommit(commitID) if err != nil { diff --git a/routers/web/web.go b/routers/web/web.go index 55a64ee7d5..1eea2794b0 100644 --- a/routers/web/web.go +++ b/routers/web/web.go @@ -5,6 +5,7 @@ package web import ( + gocontext "context" "net/http" "os" "path" @@ -952,7 +953,25 @@ func RegisterRoutes(m *web.Route) { m.Group("/blob_excerpt", func() { m.Get("/{sha}", repo.SetEditorconfigIfExists, repo.SetDiffViewStyle, repo.ExcerptBlob) - }, repo.MustBeNotEmpty, context.RepoRef(), reqRepoCodeReader) + }, func(ctx *context.Context) (cancel gocontext.CancelFunc) { + if ctx.FormBool("wiki") { + ctx.Data["PageIsWiki"] = true + repo.MustEnableWiki(ctx) + return + } + + reqRepoCodeReader(ctx) + if ctx.Written() { + return + } + cancel = context.RepoRef()(ctx) + if ctx.Written() { + return + } + + repo.MustBeNotEmpty(ctx) + return + }) m.Group("/pulls/{index}", func() { m.Get(".diff", repo.DownloadPullDiff) diff --git a/templates/repo/diff/blob_excerpt.tmpl b/templates/repo/diff/blob_excerpt.tmpl index 9bf0a7f990..ebfae2795c 100644 --- a/templates/repo/diff/blob_excerpt.tmpl +++ b/templates/repo/diff/blob_excerpt.tmpl @@ -4,17 +4,17 @@ {{if eq .GetType 4}} {{if or (eq $line.GetExpandDirection 3) (eq $line.GetExpandDirection 5) }} - + {{svg "octicon-fold-down"}} {{end}} {{if or (eq $line.GetExpandDirection 3) (eq $line.GetExpandDirection 4) }} - + {{svg "octicon-fold-up"}} {{end}} {{if eq $line.GetExpandDirection 2}} - + {{svg "octicon-fold"}} {{end}} @@ -43,17 +43,17 @@ {{if eq .GetType 4}} {{if or (eq $line.GetExpandDirection 3) (eq $line.GetExpandDirection 5) }} - + {{svg "octicon-fold-down"}} {{end}} {{if or (eq $line.GetExpandDirection 3) (eq $line.GetExpandDirection 4) }} - + {{svg "octicon-fold-up"}} {{end}} {{if eq $line.GetExpandDirection 2}} - + {{svg "octicon-fold"}} {{end}} diff --git a/templates/repo/diff/section_split.tmpl b/templates/repo/diff/section_split.tmpl index 754f7cec10..1f7b0d459c 100644 --- a/templates/repo/diff/section_split.tmpl +++ b/templates/repo/diff/section_split.tmpl @@ -7,17 +7,17 @@ {{if eq .GetType 4}} {{if or (eq $line.GetExpandDirection 3) (eq $line.GetExpandDirection 5) }} - + {{svg "octicon-fold-down"}} {{end}} {{if or (eq $line.GetExpandDirection 3) (eq $line.GetExpandDirection 4) }} - + {{svg "octicon-fold-up"}} {{end}} {{if eq $line.GetExpandDirection 2}} - + {{svg "octicon-fold"}} {{end}} diff --git a/templates/repo/diff/section_unified.tmpl b/templates/repo/diff/section_unified.tmpl index 93f9af52b4..dbd0ca269f 100644 --- a/templates/repo/diff/section_unified.tmpl +++ b/templates/repo/diff/section_unified.tmpl @@ -6,17 +6,17 @@ {{if eq .GetType 4}} {{if or (eq $line.GetExpandDirection 3) (eq $line.GetExpandDirection 5) }} - + {{svg "octicon-fold-down"}} {{end}} {{if or (eq $line.GetExpandDirection 3) (eq $line.GetExpandDirection 4) }} - + {{svg "octicon-fold-up"}} {{end}} {{if eq $line.GetExpandDirection 2}} - + {{svg "octicon-fold"}} {{end}} From 36c66303dff79ae6b6e9a2023901d23b2ce9683a Mon Sep 17 00:00:00 2001 From: zeripath Date: Sun, 6 Feb 2022 06:55:44 +0000 Subject: [PATCH 035/240] Only attempt to flush queue if the underlying worker pool is not finished (#18593) (#18620) * Only attempt to flush queue if the underlying worker pool is not finished (#18593) Backport #18593 There is a possible race whereby a worker pool could be cancelled but yet the underlying queue is not empty. This will lead to flush-all cycling because it cannot empty the pool. * On shutdown of Persistant Channel Queues close datachan and empty Partial Backport #18415 Although we attempt to empty the datachan in queues - due to races we are better off just closing the channel and forcibly emptying it in shutdown. Fix #18618 Signed-off-by: Andrew Thornton * Move zero workers warning to debug Fix #18617 Signed-off-by: Andrew Thornton * Update modules/queue/manager.go Co-authored-by: Gusted * Update modules/queue/manager.go Co-authored-by: Gusted Co-authored-by: Gusted --- modules/queue/manager.go | 15 +++++++++++++-- modules/queue/queue_disk_channel.go | 16 +++++++--------- modules/queue/workerpool.go | 16 ++++++++++++---- 3 files changed, 32 insertions(+), 15 deletions(-) diff --git a/modules/queue/manager.go b/modules/queue/manager.go index 23e96155a9..310f3cd4e1 100644 --- a/modules/queue/manager.go +++ b/modules/queue/manager.go @@ -72,6 +72,8 @@ type ManagedPool interface { BoostWorkers() int // SetPoolSettings sets the user updatable settings for the pool SetPoolSettings(maxNumberOfWorkers, boostWorkers int, timeout time.Duration) + // Done returns a channel that will be closed when the Pool's baseCtx is closed + Done() <-chan struct{} } // ManagedQueueList implements the sort.Interface @@ -141,7 +143,6 @@ func (m *Manager) Remove(qid int64) { delete(m.Queues, qid) m.mutex.Unlock() log.Trace("Queue Manager removed: QID: %d", qid) - } // GetManagedQueue by qid @@ -193,6 +194,17 @@ func (m *Manager) FlushAll(baseCtx context.Context, timeout time.Duration) error wg.Done() continue } + + if pool, ok := mq.Managed.(ManagedPool); ok { + // No point into flushing pools when their base's ctx is already done. + select { + case <-pool.Done(): + wg.Done() + continue + default: + } + } + allEmpty = false if flushable, ok := mq.Managed.(Flushable); ok { log.Debug("Flushing (flushable) queue: %s", mq.Name) @@ -225,7 +237,6 @@ func (m *Manager) FlushAll(baseCtx context.Context, timeout time.Duration) error wg.Wait() } return nil - } // ManagedQueues returns the managed queues diff --git a/modules/queue/queue_disk_channel.go b/modules/queue/queue_disk_channel.go index c3a1c5781e..72f330670a 100644 --- a/modules/queue/queue_disk_channel.go +++ b/modules/queue/queue_disk_channel.go @@ -173,7 +173,6 @@ func (q *PersistableChannelQueue) Run(atShutdown, atTerminate func(func())) { q.internal.(*LevelQueue).Shutdown() GetManager().Remove(q.internal.(*LevelQueue).qid) } - } // Flush flushes the queue and blocks till the queue is empty @@ -252,14 +251,13 @@ func (q *PersistableChannelQueue) Shutdown() { q.channelQueue.Wait() q.internal.(*LevelQueue).Wait() // Redirect all remaining data in the chan to the internal channel - go func() { - log.Trace("PersistableChannelQueue: %s Redirecting remaining data", q.delayedStarter.name) - for data := range q.channelQueue.dataChan { - _ = q.internal.Push(data) - atomic.AddInt64(&q.channelQueue.numInQueue, -1) - } - log.Trace("PersistableChannelQueue: %s Done Redirecting remaining data", q.delayedStarter.name) - }() + close(q.channelQueue.dataChan) + log.Trace("PersistableChannelQueue: %s Redirecting remaining data", q.delayedStarter.name) + for data := range q.channelQueue.dataChan { + _ = q.internal.Push(data) + atomic.AddInt64(&q.channelQueue.numInQueue, -1) + } + log.Trace("PersistableChannelQueue: %s Done Redirecting remaining data", q.delayedStarter.name) log.Debug("PersistableChannelQueue: %s Shutdown", q.delayedStarter.name) } diff --git a/modules/queue/workerpool.go b/modules/queue/workerpool.go index 0176e2e0b2..dc6ff3b633 100644 --- a/modules/queue/workerpool.go +++ b/modules/queue/workerpool.go @@ -65,6 +65,11 @@ func NewWorkerPool(handle HandlerFunc, config WorkerPoolConfiguration) *WorkerPo return pool } +// Done returns when this worker pool's base context has been cancelled +func (p *WorkerPool) Done() <-chan struct{} { + return p.baseCtx.Done() +} + // Push pushes the data to the internal channel func (p *WorkerPool) Push(data Data) { atomic.AddInt64(&p.numInQueue, 1) @@ -90,7 +95,7 @@ func (p *WorkerPool) zeroBoost() { boost = p.maxNumberOfWorkers - p.numberOfWorkers } if mq != nil { - log.Warn("WorkerPool: %d (for %s) has zero workers - adding %d temporary workers for %s", p.qid, mq.Name, boost, p.boostTimeout) + log.Debug("WorkerPool: %d (for %s) has zero workers - adding %d temporary workers for %s", p.qid, mq.Name, boost, p.boostTimeout) start := time.Now() pid := mq.RegisterWorkers(boost, start, true, start.Add(p.boostTimeout), cancel, false) @@ -98,7 +103,7 @@ func (p *WorkerPool) zeroBoost() { mq.RemoveWorkers(pid) } } else { - log.Warn("WorkerPool: %d has zero workers - adding %d temporary workers for %s", p.qid, p.boostWorkers, p.boostTimeout) + log.Debug("WorkerPool: %d has zero workers - adding %d temporary workers for %s", p.qid, p.boostWorkers, p.boostTimeout) } p.lock.Unlock() p.addWorkers(ctx, cancel, boost) @@ -326,7 +331,10 @@ func (p *WorkerPool) FlushWithContext(ctx context.Context) error { log.Trace("WorkerPool: %d Flush", p.qid) for { select { - case data := <-p.dataChan: + case data, ok := <-p.dataChan: + if !ok { + return nil + } p.handle(data) atomic.AddInt64(&p.numInQueue, -1) case <-p.baseCtx.Done(): @@ -341,7 +349,7 @@ func (p *WorkerPool) FlushWithContext(ctx context.Context) error { func (p *WorkerPool) doWork(ctx context.Context) { delay := time.Millisecond * 300 - var data = make([]Data, 0, p.batchLength) + data := make([]Data, 0, p.batchLength) for { select { case <-ctx.Done(): From a13fb154ae2a58ee5f69763b7e6ba93a487dcad5 Mon Sep 17 00:00:00 2001 From: zeripath Date: Sun, 6 Feb 2022 09:43:15 +0000 Subject: [PATCH 036/240] Stop logging an error when notes are not found (#18626) (#18635) Backport #18626 This is an unnecessary logging event. Fix #18616 Signed-off-by: Andrew Thornton --- modules/git/notes_gogit.go | 3 +++ modules/git/notes_nogogit.go | 3 +++ 2 files changed, 6 insertions(+) diff --git a/modules/git/notes_gogit.go b/modules/git/notes_gogit.go index 6cb719ce92..b1e5e453e4 100644 --- a/modules/git/notes_gogit.go +++ b/modules/git/notes_gogit.go @@ -22,6 +22,9 @@ func GetNote(ctx context.Context, repo *Repository, commitID string, note *Note) log.Trace("Searching for git note corresponding to the commit %q in the repository %q", commitID, repo.Path) notes, err := repo.GetCommit(NotesRef) if err != nil { + if IsErrNotExist(err) { + return err + } log.Error("Unable to get commit from ref %q. Error: %v", NotesRef, err) return err } diff --git a/modules/git/notes_nogogit.go b/modules/git/notes_nogogit.go index 13b4b7b36a..bbc8ee1371 100644 --- a/modules/git/notes_nogogit.go +++ b/modules/git/notes_nogogit.go @@ -21,6 +21,9 @@ func GetNote(ctx context.Context, repo *Repository, commitID string, note *Note) log.Trace("Searching for git note corresponding to the commit %q in the repository %q", commitID, repo.Path) notes, err := repo.GetCommit(NotesRef) if err != nil { + if IsErrNotExist(err) { + return err + } log.Error("Unable to get commit from ref %q. Error: %v", NotesRef, err) return err } From fabc0ad157dd306beefbcff8f89be710d84f467d Mon Sep 17 00:00:00 2001 From: singuliere <35190819+singuliere@users.noreply.github.com> Date: Sun, 6 Feb 2022 12:40:08 +0100 Subject: [PATCH 037/240] comments on migrated issues/prs must link to the comment ID (#18637) Instead of the issue ID which is not a valid anchor. Signed-off-by: singuliere Co-authored-by: Lunny Xiao --- templates/repo/issue/view_content/comments.tmpl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/templates/repo/issue/view_content/comments.tmpl b/templates/repo/issue/view_content/comments.tmpl index 73057248c7..a0ab487a5b 100644 --- a/templates/repo/issue/view_content/comments.tmpl +++ b/templates/repo/issue/view_content/comments.tmpl @@ -28,7 +28,7 @@ {{ .OriginalAuthor }} - {{$.i18n.Tr "repo.issues.commented_at" (.Issue.HashTag|Escape) $createdStr | Safe}} {{if $.Repository.OriginalURL}} + {{$.i18n.Tr "repo.issues.commented_at" (.HashTag|Escape) $createdStr | Safe}} {{if $.Repository.OriginalURL}} ({{$.i18n.Tr "repo.migrated_from" ($.Repository.OriginalURL|Escape) ($.Repository.GetOriginalURLHostname|Escape) | Safe }}){{end}} From bb77e6c12dd0c261e56d15ee0d6db7cae4d3d6f7 Mon Sep 17 00:00:00 2001 From: Lunny Xiao Date: Sun, 6 Feb 2022 20:35:24 +0800 Subject: [PATCH 038/240] Add changelog for v1.16.1 (#18614) Add changelog for v1.16.1 Co-authored-by: 6543 <6543@obermui.de> Co-authored-by: zeripath --- CHANGELOG.md | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 3108893c2a..37fc43a2c7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,35 @@ This changelog goes through all the changes that have been made in each release without substantial changes to our git log; to see the highlights of what has been added to each release, please refer to the [blog](https://blog.gitea.io). +## [1.16.1](https://github.com/go-gitea/gitea/releases/tag/v1.16.1) - 2022-02-06 + +* SECURITY + * Update JS dependencies, fix lint (#18389) (#18540) +* ENHANCEMENTS + * Add dropdown icon to label set template dropdown (#18564) (#18571) +* BUGFIXES + * Comments on migrated issues/prs must link to the comment ID (#18630) (#18637) + * Stop logging an error when notes are not found (#18626) (#18635) + * Ensure that blob-excerpt links work for wiki (#18587) (#18624) + * Only attempt to flush queue if the underlying worker pool is not finished (#18593) (#18620) + * Ensure commit-statuses box is sized correctly in headers (#18538) (#18606) + * Prevent merge messages from being sorted to the top of email chains (#18566) (#18588) + * Prevent panic on prohibited user login with oauth2 (#18562) (#18563) + * Collaborator trust model should trust collaborators (#18539) (#18557) + * Detect conflicts with 3way merge (#18536) (#18537) + * In docker rootless use $GITEA_APP_INI if provided (#18524) (#18535) + * Add `GetUserTeams` (#18499) (#18531) + * Fix review excerpt (#18502) (#18530) + * Fix for AvatarURL database type (#18487) (#18529) + * Use `ImagedProvider` for gplus oauth2 provider (#18504) (#18505) + * Fix OAuth Source Edit Page (#18495) (#18503) + * Use "read" value for General Access (#18496) (#18500) + * Prevent NPE on partial match of compare URL and allow short SHA1 compare URLs (#18472) (#18473) +* BUILD + * Make docker gitea/gitea:v1.16-dev etc refer to the latest build on that branch (#18551) (#18569) +* DOCS + * Update 1.16.0 changelog to set #17846 as breaking (#18533) (#18534) + ## [1.16.0](https://github.com/go-gitea/gitea/releases/tag/v1.16.0) - 2022-01-30 * BREAKING From d4a075d73815c3bc0591deae5171a14401dc3f66 Mon Sep 17 00:00:00 2001 From: zeripath Date: Mon, 7 Feb 2022 01:25:05 +0000 Subject: [PATCH 039/240] If rendering has failed due to a net.OpError stop rendering (#18642) (#18645) Backport #18642 When a net.OpError occurs during rendering the underlying connection is essentially dead and therefore attempting to render further data will only cause further errors. Therefore in serverErrorInternal detect if the passed in error is an OpError and if so do not attempt any further rendering. Fix #18629 Signed-off-by: Andrew Thornton --- modules/context/context.go | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/modules/context/context.go b/modules/context/context.go index dd571b4d78..c7b9c0615c 100644 --- a/modules/context/context.go +++ b/modules/context/context.go @@ -9,9 +9,11 @@ import ( "context" "crypto/sha256" "encoding/hex" + "errors" "html" "html/template" "io" + "net" "net/http" "net/url" "path" @@ -264,6 +266,12 @@ func (ctx *Context) ServerError(logMsg string, logErr error) { func (ctx *Context) serverErrorInternal(logMsg string, logErr error) { if logErr != nil { log.ErrorWithSkip(2, "%s: %v", logMsg, logErr) + if errors.Is(logErr, &net.OpError{}) { + // This is an error within the underlying connection + // and further rendering will not work so just return + return + } + if !setting.IsProd { ctx.Data["ErrorMsg"] = logErr } From 3d08e3a08c04d5abdca15ddcb3eef32362ee5946 Mon Sep 17 00:00:00 2001 From: wxiaoguang Date: Mon, 7 Feb 2022 22:07:11 +0800 Subject: [PATCH 040/240] No longer show the db-downgrade SQL in production (#18654) --- .gitignore | 2 ++ models/migrations/migrations.go | 9 ++++++--- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/.gitignore b/.gitignore index 98975fab49..eab92b49ad 100644 --- a/.gitignore +++ b/.gitignore @@ -36,6 +36,8 @@ _testmain.go coverage.all cpu.out +/modules/migration/bindata.go +/modules/migration/bindata.go.hash /modules/options/bindata.go /modules/options/bindata.go.hash /modules/public/bindata.go diff --git a/models/migrations/migrations.go b/models/migrations/migrations.go index 5aaf283bd3..0aa9c7c7ea 100644 --- a/models/migrations/migrations.go +++ b/models/migrations/migrations.go @@ -450,9 +450,12 @@ Please try upgrading to a lower version first (suggested v1.6.4), then upgrade t // Downgrading Gitea's database version not supported if int(v-minDBVersion) > len(migrations) { - msg := fmt.Sprintf("Downgrading database version from '%d' to '%d' is not supported and may result in loss of data integrity.\nIf you really know what you're doing, execute `UPDATE version SET version=%d WHERE id=1;`\n", - v, minDBVersion+len(migrations), minDBVersion+len(migrations)) - fmt.Fprint(os.Stderr, msg) + msg := fmt.Sprintf("Your database (migration version: %d) is for a newer Gita, you can not use the newer database for this old Gitea release (%d).", v, minDBVersion+len(migrations)) + msg += "\nGitea will exit to keep your database safe and unchanged. Please use the correct Gitea release, do not change the migration version manually (incorrect manual operation may lose data)." + if !setting.IsProd { + msg += fmt.Sprintf("\nIf you are in development and really know what you're doing, you can force changing the migration version by executing: UPDATE version SET version=%d WHERE id=1;", minDBVersion+len(migrations)) + } + _, _ = fmt.Fprintln(os.Stderr, msg) log.Fatal(msg) return nil } From 8671602ba9eb76190a401d969451908f76eef835 Mon Sep 17 00:00:00 2001 From: wxiaoguang Date: Tue, 8 Feb 2022 17:03:47 +0800 Subject: [PATCH 041/240] Backport: fix the missing i18n key for update checker (#18646) (#18665) --- options/locale/locale_en-US.ini | 1 + 1 file changed, 1 insertion(+) diff --git a/options/locale/locale_en-US.ini b/options/locale/locale_en-US.ini index d8398f6d9f..1d0a5a2f0d 100644 --- a/options/locale/locale_en-US.ini +++ b/options/locale/locale_en-US.ini @@ -2407,6 +2407,7 @@ dashboard.last_gc_pause = Last GC Pause dashboard.gc_times = GC Times dashboard.delete_old_actions = Delete all old actions from database dashboard.delete_old_actions.started = Delete all old actions from database started. +dashboard.update_checker = Update checker users.user_manage_panel = User Account Management users.new_account = Create User Account From 38fc6c75f3023215cbf7092452d72eb60663bc46 Mon Sep 17 00:00:00 2001 From: zeripath Date: Tue, 8 Feb 2022 21:28:21 +0000 Subject: [PATCH 042/240] Restart zero worker if there is still work to do (#18658) (#18672) * Restart zero worker if there is still work to do (#18658) Backport #18658 It is possible for the zero worker to timeout before all the work is finished. This may mean that work may take a long time to complete because a worker will only be induced on repushing. Also ensure that requested count is reset after pulls and push mirror sync requests and add some more trace logging to the queue push. Fix #18607 Signed-off-by: Andrew Thornton * Update modules/queue/workerpool.go --- modules/queue/workerpool.go | 29 +++++++++++++++++++++++++++++ services/mirror/mirror.go | 28 ++++++++++++++++++---------- 2 files changed, 47 insertions(+), 10 deletions(-) diff --git a/modules/queue/workerpool.go b/modules/queue/workerpool.go index dc6ff3b633..37d518aa86 100644 --- a/modules/queue/workerpool.go +++ b/modules/queue/workerpool.go @@ -87,6 +87,20 @@ func (p *WorkerPool) Push(data Data) { } } +// HasNoWorkerScaling will return true if the queue has no workers, and has no worker boosting +func (p *WorkerPool) HasNoWorkerScaling() bool { + p.lock.Lock() + defer p.lock.Unlock() + return p.hasNoWorkerScaling() +} + +func (p *WorkerPool) hasNoWorkerScaling() bool { + return p.numberOfWorkers == 0 && (p.boostTimeout == 0 || p.boostWorkers == 0 || p.maxNumberOfWorkers == 0) +} + +// zeroBoost will add a temporary boost worker for a no worker queue +// p.lock must be locked at the start of this function BUT it will be unlocked by the end of this function +// (This is because addWorkers has to be called whilst unlocked) func (p *WorkerPool) zeroBoost() { ctx, cancel := context.WithTimeout(p.baseCtx, p.boostTimeout) mq := GetManager().GetManagedQueue(p.qid) @@ -277,6 +291,21 @@ func (p *WorkerPool) addWorkers(ctx context.Context, cancel context.CancelFunc, p.cond.Broadcast() cancel() } + + select { + case <-p.baseCtx.Done(): + // Don't warn if the baseCtx is shutdown + default: + if p.hasNoWorkerScaling() { + log.Warn( + "Queue: %d is configured to be non-scaling and has no workers - this configuration is likely incorrect.", p.qid) + } else if p.numberOfWorkers == 0 && atomic.LoadInt64(&p.numInQueue) > 0 { + // OK there are no workers but... there's still work to be done -> Reboost + p.zeroBoost() + // p.lock will be unlocked by zeroBoost + return + } + } p.lock.Unlock() }() } diff --git a/services/mirror/mirror.go b/services/mirror/mirror.go index 2643200174..4234457b0b 100644 --- a/services/mirror/mirror.go +++ b/services/mirror/mirror.go @@ -59,11 +59,13 @@ func Update(ctx context.Context, pullLimit, pushLimit int) error { handler := func(idx int, bean interface{}, limit int) error { var item SyncRequest + var repo *repo_model.Repository if m, ok := bean.(*repo_model.Mirror); ok { if m.Repo == nil { log.Error("Disconnected mirror found: %d", m.ID) return nil } + repo = m.Repo item = SyncRequest{ Type: PullMirrorType, RepoID: m.RepoID, @@ -73,6 +75,7 @@ func Update(ctx context.Context, pullLimit, pushLimit int) error { log.Error("Disconnected push-mirror found: %d", m.ID) return nil } + repo = m.Repo item = SyncRequest{ Type: PushMirrorType, RepoID: m.RepoID, @@ -89,17 +92,16 @@ func Update(ctx context.Context, pullLimit, pushLimit int) error { default: } - // Check if this request is already in the queue - has, err := mirrorQueue.Has(&item) - if err != nil { - return err - } - if has { - return nil - } - // Push to the Queue if err := mirrorQueue.Push(&item); err != nil { + if err == queue.ErrAlreadyInQueue { + if item.Type == PushMirrorType { + log.Trace("PushMirrors for %-v already queued for sync", repo) + } else { + log.Trace("PullMirrors for %-v already queued for sync", repo) + } + return nil + } return err } @@ -110,23 +112,29 @@ func Update(ctx context.Context, pullLimit, pushLimit int) error { return nil } + pullMirrorsRequested := 0 if pullLimit != 0 { + requested = 0 if err := repo_model.MirrorsIterate(func(idx int, bean interface{}) error { return handler(idx, bean, pullLimit) }); err != nil && err != errLimit { log.Error("MirrorsIterate: %v", err) return err } + pullMirrorsRequested, requested = requested, 0 } + pushMirrorsRequested := 0 if pushLimit != 0 { + requested = 0 if err := repo_model.PushMirrorsIterate(func(idx int, bean interface{}) error { return handler(idx, bean, pushLimit) }); err != nil && err != errLimit { log.Error("PushMirrorsIterate: %v", err) return err } + pushMirrorsRequested, requested = requested, 0 } - log.Trace("Finished: Update") + log.Trace("Finished: Update: %d pull mirrors and %d push mirrors queued", pullMirrorsRequested, pushMirrorsRequested) return nil } From 4cfd62cddf509c184012a13f84986e3e15082717 Mon Sep 17 00:00:00 2001 From: Gusted Date: Wed, 9 Feb 2022 21:19:48 +0100 Subject: [PATCH 043/240] Let return correct perm (#18675) (#18689) Backport of #18675 --- models/unit/unit.go | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/models/unit/unit.go b/models/unit/unit.go index eb71276786..a6a47eb1f3 100644 --- a/models/unit/unit.go +++ b/models/unit/unit.go @@ -328,7 +328,12 @@ func AllUnitKeyNames() []string { // MinUnitAccessMode returns the minial permission of the permission map func MinUnitAccessMode(unitsMap map[Type]perm.AccessMode) perm.AccessMode { res := perm.AccessModeNone - for _, mode := range unitsMap { + for t, mode := range unitsMap { + // Don't allow `TypeExternal{Tracker,Wiki}` to influence this as they can only be set to READ perms. + if t == TypeExternalTracker || t == TypeExternalWiki { + continue + } + // get the minial permission great than AccessModeNone except all are AccessModeNone if mode > perm.AccessModeNone && (res == perm.AccessModeNone || mode < res) { res = mode From 649abeda40cf1fc7cb55437d288d8e8adcae5019 Mon Sep 17 00:00:00 2001 From: silverwind Date: Thu, 10 Feb 2022 03:12:03 +0100 Subject: [PATCH 044/240] C preprocessor colors improvement (#18671) (#18696) * C preprocessor colors improvement Fixes #18670 * Update web_src/less/chroma/light.less Co-authored-by: KN4CK3R * typo missing semi * add color for #include filenames Co-authored-by: KN4CK3R Co-authored-by: Lunny Xiao Co-authored-by: Bruno Raoult Co-authored-by: KN4CK3R Co-authored-by: Lunny Xiao --- web_src/less/chroma/dark.less | 2 +- web_src/less/chroma/light.less | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/web_src/less/chroma/dark.less b/web_src/less/chroma/dark.less index 24a3b6568d..536d21963d 100644 --- a/web_src/less/chroma/dark.less +++ b/web_src/less/chroma/dark.less @@ -54,7 +54,7 @@ .chroma .c1 { color: #6a737d; } /* CommentSingle */ .chroma .cs { color: #637d; } /* CommentSpecial */ .chroma .cp { color: #fc6; } /* CommentPreproc */ -.chroma .cpf { color: #fc6; } /* CommentPreprocFile */ +.chroma .cpf { color: #03dfff; } /* CommentPreprocFile */ .chroma .gd { color: #fff; background-color: #5f3737; } /* GenericDeleted */ .chroma .ge { color: #ef5; } /* GenericEmph */ .chroma .gr { color: #f33; } /* GenericError */ diff --git a/web_src/less/chroma/light.less b/web_src/less/chroma/light.less index 9e8cb59052..9728800765 100644 --- a/web_src/less/chroma/light.less +++ b/web_src/less/chroma/light.less @@ -53,8 +53,8 @@ .chroma .cm { color: #999988; } /* CommentMultiline */ .chroma .c1 { color: #6a737d; } /* CommentSingle */ .chroma .cs { color: #999999; } /* CommentSpecial */ -.chroma .cp { color: #999999; } /* CommentPreproc */ -.chroma .cpf { color: #999999; } /* CommentPreprocFile */ +.chroma .cp { color: #109295; } /* CommentPreproc */ +.chroma .cpf { color: #4c4dbc; } /* CommentPreprocFile */ .chroma .gd { color: #000000; background-color: #ffdddd; } /* GenericDeleted */ .chroma .ge { color: #000000; } /* GenericEmph */ .chroma .gr { color: #aa0000; } /* GenericError */ From ce69882180bb07d07d4e95ac0398b580484d27b5 Mon Sep 17 00:00:00 2001 From: zeripath Date: Thu, 10 Feb 2022 11:37:53 +0000 Subject: [PATCH 045/240] Fix issue with docker-rootless shimming script (#18690) (#18699) Backport #18690 There is a problem with the current shimming script in that it will double quote the provided GITEA_APP_INI due to a mistake in the bash. Here we change this to use a bash array. Fix https://gitea.com/gitea/helm-chart/issues/287 Signed-off-by: Andrew Thornton --- contrib/fhs-compliant-script/gitea | 6 ++---- docker/rootless/usr/local/bin/gitea | 6 ++---- 2 files changed, 4 insertions(+), 8 deletions(-) diff --git a/contrib/fhs-compliant-script/gitea b/contrib/fhs-compliant-script/gitea index ae1ae3cf14..ea033b0f2d 100755 --- a/contrib/fhs-compliant-script/gitea +++ b/contrib/fhs-compliant-script/gitea @@ -33,10 +33,8 @@ for i in "$@"; do done if [ -z "$APP_INI_SET" ]; then - CONF_ARG="-c \"$APP_INI\"" + CONF_ARG=("-c" "${GITEA_APP_INI:-$APP_INI}") fi # Provide FHS compliant defaults -GITEA_WORK_DIR="${GITEA_WORK_DIR:-$WORK_DIR}" exec -a "$0" "$GITEA" $CONF_ARG "$@" - - +GITEA_WORK_DIR="${GITEA_WORK_DIR:-$WORK_DIR}" exec -a "$0" "$GITEA" "${CONF_ARG[@]}" "$@" diff --git a/docker/rootless/usr/local/bin/gitea b/docker/rootless/usr/local/bin/gitea index 1b33ca8547..9a9a569b12 100644 --- a/docker/rootless/usr/local/bin/gitea +++ b/docker/rootless/usr/local/bin/gitea @@ -32,11 +32,9 @@ for i in "$@"; do done if [ -z "$APP_INI_SET" ]; then - CONF_ARG="-c \"${GITEA_APP_INI:-$APP_INI}\"" + CONF_ARG=("-c" "${GITEA_APP_INI:-$APP_INI}") fi # Provide docker defaults -GITEA_WORK_DIR="${GITEA_WORK_DIR:-$WORK_DIR}" exec -a "$0" "$GITEA" $CONF_ARG "$@" - - +GITEA_WORK_DIR="${GITEA_WORK_DIR:-$WORK_DIR}" exec -a "$0" "$GITEA" "${CONF_ARG[@]}" "$@" From 2e317d3f6e2a613c2eeee6f6c69d990ec24cad3a Mon Sep 17 00:00:00 2001 From: zeripath Date: Thu, 10 Feb 2022 15:17:44 +0000 Subject: [PATCH 046/240] Prevent security failure due to bad APP_ID (#18678) (#18682) Backport #18678 WebAuthn may cause a security exception if the provided APP_ID is not allowed for the current origin. Therefore we should reattempt authentication without the appid extension. Also we should allow [u2f] as-well as [U2F] sections. Signed-off-by: Andrew Thornton Co-authored-by: Lunny Xiao --- modules/setting/setting.go | 10 +++++++--- web_src/js/features/user-auth-webauthn.js | 13 +++++++++++++ 2 files changed, 20 insertions(+), 3 deletions(-) diff --git a/modules/setting/setting.go b/modules/setting/setting.go index abd6716c74..3b21bcc768 100644 --- a/modules/setting/setting.go +++ b/modules/setting/setting.go @@ -1022,8 +1022,13 @@ func loadFromConf(allowEmpty bool, extraConfig string) { UI.CustomEmojisMap[emoji] = ":" + emoji + ":" } - sec = Cfg.Section("U2F") - U2F.AppID = sec.Key("APP_ID").MustString(strings.TrimSuffix(AppURL, "/")) + // FIXME: DEPRECATED to be removed in v1.18.0 + U2F.AppID = strings.TrimSuffix(AppURL, "/") + if Cfg.Section("U2F").HasKey("APP_ID") { + U2F.AppID = Cfg.Section("U2F").Key("APP_ID").MustString(strings.TrimSuffix(AppURL, "/")) + } else if Cfg.Section("u2f").HasKey("APP_ID") { + U2F.AppID = Cfg.Section("u2f").Key("APP_ID").MustString(strings.TrimSuffix(AppURL, "/")) + } } func parseAuthorizedPrincipalsAllow(values []string) ([]string, bool) { @@ -1162,7 +1167,6 @@ func MakeManifestData(appName, appURL, absoluteAssetURL string) []byte { }, }, }) - if err != nil { log.Error("unable to marshal manifest JSON. Error: %v", err) return make([]byte, 0) diff --git a/web_src/js/features/user-auth-webauthn.js b/web_src/js/features/user-auth-webauthn.js index cf60535d40..1c774d6b1d 100644 --- a/web_src/js/features/user-auth-webauthn.js +++ b/web_src/js/features/user-auth-webauthn.js @@ -24,6 +24,19 @@ export function initUserAuthWebAuthn() { .then((credential) => { verifyAssertion(credential); }).catch((err) => { + // Try again... without the appid + if (makeAssertionOptions.publicKey.extensions && makeAssertionOptions.publicKey.extensions.appid) { + delete makeAssertionOptions.publicKey.extensions['appid']; + navigator.credentials.get({ + publicKey: makeAssertionOptions.publicKey + }) + .then((credential) => { + verifyAssertion(credential); + }).catch((err) => { + webAuthnError('general', err.message); + }); + return; + } webAuthnError('general', err.message); }); }).fail(() => { From 63628fdf1ce42a9d29942016f00ef2428601b7e1 Mon Sep 17 00:00:00 2001 From: Lunny Xiao Date: Fri, 11 Feb 2022 02:35:24 +0800 Subject: [PATCH 047/240] Fix bug for version update hint (#18701) (#18705) * Fix bug for version update hint (#18701) * Add translation for zh-CN Co-authored-by: silverwind --- options/locale/locale_en-US.ini | 1 + options/locale/locale_zh-CN.ini | 7 ++++--- templates/admin/dashboard.tmpl | 2 +- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/options/locale/locale_en-US.ini b/options/locale/locale_en-US.ini index 1d0a5a2f0d..2fbf7e79bc 100644 --- a/options/locale/locale_en-US.ini +++ b/options/locale/locale_en-US.ini @@ -2334,6 +2334,7 @@ first_page = First last_page = Last total = Total: %d +dashboard.new_version_hint = Gitea %s is now available, you are running %s. Check the blog for more details. dashboard.statistic = Summary dashboard.operations = Maintenance Operations dashboard.system_status = System Status diff --git a/options/locale/locale_zh-CN.ini b/options/locale/locale_zh-CN.ini index e78abd05d5..6d1af67216 100644 --- a/options/locale/locale_zh-CN.ini +++ b/options/locale/locale_zh-CN.ini @@ -673,8 +673,8 @@ last_used=上次使用在 no_activity=没有最近活动 can_read_info=读取 can_write_info=写入 -key_state_desc=7 天内使用过该密钥 -token_state_desc=7 天内使用过该密钥 +key_state_desc=7 天内使用过该密钥 +token_state_desc=7 天内使用过该密钥 principal_state_desc=7 天内使用过该规则 show_openid=在个人信息上显示 hide_openid=在个人信息上隐藏 @@ -855,7 +855,7 @@ watchers=关注者 stargazers=称赞者 forks=派生仓库 pick_reaction=选择你的表情 -reactions_more=再加载 %d +reactions_more=再加载 %d unit_disabled=站点管理员已禁用此仓库单元。 language_other=其它 adopt_search=输入用户名以搜索未被收录的仓库... (留空以查找全部) @@ -2334,6 +2334,7 @@ first_page=首页 last_page=末页 total=总计:%d +dashboard.new_version_hint = Gitea %s 可以更新了,您正在运行 %s。请检查 博客 查看更多详情。 dashboard.statistic=摘要 dashboard.operations=维护操作 dashboard.system_status=系统状态 diff --git a/templates/admin/dashboard.tmpl b/templates/admin/dashboard.tmpl index 35f45bd352..d9e056973a 100644 --- a/templates/admin/dashboard.tmpl +++ b/templates/admin/dashboard.tmpl @@ -5,7 +5,7 @@ {{template "base/alert" .}} {{if .NeedUpdate}}
-

"Gitea {{.RemoteVersion | Str2html}} is now available, you are running {{.AppVer | Str2html}}. Check the blog for more details.

+

{{.i18n.Tr "admin.dashboard.new_version_hint" (.RemoteVersion | Str2html) (AppVer | Str2html)}}

{{end}}

From fb26b01688fb44205062fdc34c8daba7655c7446 Mon Sep 17 00:00:00 2001 From: wxiaoguang Date: Sat, 12 Feb 2022 00:23:41 +0800 Subject: [PATCH 048/240] Update object repo with the migrated repository (#18684) (#18726) When migrating a repository (from GitHub) using the API (**POST** `repos/migrate`), the Code Indexer is not updated. Searching in the user interface will not return any results. When migrating the same repository using **+/New Migration** in the web interface, the search index is updated and searching works as expected. Caused by the fact that object `repo` is never updated with the migrated repo so `setting.Indexer.RepoIndexerEnabled && !repo.IsEmpty` in `modules/notification/indexer/indexer.go:NotifyMigrateRepository` always evaluates to `false`. Tested with gitea:1.16.1, MariaDB:10, Breve in `Run Mode: Dev`. Co-authored-by: Hugo Hoitink <10838836+hoitih@users.noreply.github.com> --- routers/api/v1/repo/migrate.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/routers/api/v1/repo/migrate.go b/routers/api/v1/repo/migrate.go index 8a6f421c87..44e188abc2 100644 --- a/routers/api/v1/repo/migrate.go +++ b/routers/api/v1/repo/migrate.go @@ -203,7 +203,7 @@ func Migrate(ctx *context.APIContext) { } }() - if _, err = migrations.MigrateRepository(graceful.GetManager().HammerContext(), ctx.User, repoOwner.Name, opts, nil); err != nil { + if repo, err = migrations.MigrateRepository(graceful.GetManager().HammerContext(), ctx.User, repoOwner.Name, opts, nil); err != nil { handleMigrateError(ctx, repoOwner, remoteAddr, err) return } From f9a0ae1dd4d171a5dfe50a5f38892142ab43b95e Mon Sep 17 00:00:00 2001 From: Lunny Xiao Date: Sat, 12 Feb 2022 09:15:34 +0800 Subject: [PATCH 049/240] Fix release typo (#18728) (#18731) --- templates/user/dashboard/feeds.tmpl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/templates/user/dashboard/feeds.tmpl b/templates/user/dashboard/feeds.tmpl index c21ac337ab..925ab40404 100644 --- a/templates/user/dashboard/feeds.tmpl +++ b/templates/user/dashboard/feeds.tmpl @@ -73,7 +73,7 @@ {{$.i18n.Tr "action.comment_pull" ((printf "%s/pulls/%s" .GetRepoLink $index) |Escape) $index (.ShortRepoPath|Escape) | Str2html}} {{else if eq .GetOpType 24}} {{ $linkText := .Content | RenderEmoji }} - {{$.i18n.Tr "action.publish_release" (.GetRepoLink|Escape) ((printf "%s/release/tag/%s" .GetRepoLink .GetTag)|Escape) (.ShortRepoPath|Escape) $linkText | Str2html}} + {{$.i18n.Tr "action.publish_release" (.GetRepoLink|Escape) ((printf "%s/releases/tag/%s" .GetRepoLink .GetTag)|Escape) (.ShortRepoPath|Escape) $linkText | Str2html}} {{else if eq .GetOpType 25}} {{ $index := index .GetIssueInfos 0}} {{ $reviewer := index .GetIssueInfos 1}} From 65ad6362d70c22802c93885af536a3e52da8afdf Mon Sep 17 00:00:00 2001 From: zeripath Date: Sat, 12 Feb 2022 03:40:55 +0000 Subject: [PATCH 050/240] Separate the details links of commit-statuses in headers (#18661) (#18730) Backport #18661 --- templates/repo/commit_statuses.tmpl | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/templates/repo/commit_statuses.tmpl b/templates/repo/commit_statuses.tmpl index d2e9f0bd16..f33635abff 100644 --- a/templates/repo/commit_statuses.tmpl +++ b/templates/repo/commit_statuses.tmpl @@ -2,11 +2,11 @@