Skip to content

Commit 0db387f

Browse files
committed
Merge branch 'main' into lunny/merge_duplicated_funcs
2 parents ace647d + 51d86ad commit 0db387f

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

67 files changed

+361
-232
lines changed

CHANGELOG.md

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,28 @@ This changelog goes through the changes that have been made in each release
44
without substantial changes to our git log; to see the highlights of what has
55
been added to each release, please refer to the [blog](https://blog.gitea.com).
66

7+
## [1.23.6](https://github.com/go-gitea/gitea/releases/tag/v1.23.6) - 2025-03-24
8+
9+
* SECURITY
10+
* Fix LFS URL (#33840) (#33843)
11+
* Update jwt and redis packages (#33984) (#33987)
12+
* Update golang crypto and net (#33989)
13+
* BUGFIXES
14+
* Drop timeout for requests made to the internal hook api (#33947) (#33970)
15+
* Fix maven panic when no package exists (#33888) (#33889)
16+
* Fix markdown render (#33870) (#33875)
17+
* Fix auto concurrency cancellation skips commit status updates (#33764) (#33849)
18+
* Fix oauth2 auth (#33961) (#33962)
19+
* Fix incorrect 1.23 translations (#33932)
20+
* Try to figure out attribute checker problem (#33901) (#33902)
21+
* Ignore trivial errors when updating push data (#33864) (#33887)
22+
* Fix some UI problems for 1.23 (#33856)
23+
* Removing unwanted ui container (#33833) (#33835)
24+
* Support disable passkey auth (#33348) (#33819)
25+
* Do not call "git diff" when listing PRs (#33817)
26+
* Try to fix ACME (3rd) (#33807) (#33808)
27+
* Fix incorrect code search indexer options (#33992) #33999
28+
729
## [1.23.5](https://github.com/go-gitea/gitea/releases/tag/v1.23.5) - 2025-03-04
830

931
* SECURITY

go.mod

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ require (
6464
github.com/gobwas/glob v0.2.3
6565
github.com/gogs/chardet v0.0.0-20211120154057-b7413eaefb8f
6666
github.com/gogs/go-gogs-client v0.0.0-20210131175652-1d7215cd8d85
67-
github.com/golang-jwt/jwt/v5 v5.2.1
67+
github.com/golang-jwt/jwt/v5 v5.2.2
6868
github.com/google/go-github/v61 v61.0.0
6969
github.com/google/licenseclassifier/v2 v2.0.0
7070
github.com/google/pprof v0.0.0-20250208200701-d0013a598941
@@ -99,7 +99,7 @@ require (
9999
github.com/pquerna/otp v1.4.0
100100
github.com/prometheus/client_golang v1.21.0
101101
github.com/quasoft/websspi v1.1.2
102-
github.com/redis/go-redis/v9 v9.7.0
102+
github.com/redis/go-redis/v9 v9.7.3
103103
github.com/robfig/cron/v3 v3.0.1
104104
github.com/santhosh-tekuri/jsonschema/v5 v5.3.1
105105
github.com/sassoftware/go-rpmutils v0.4.0
@@ -215,7 +215,7 @@ require (
215215
github.com/go-openapi/validate v0.24.0 // indirect
216216
github.com/go-webauthn/x v0.1.16 // indirect
217217
github.com/goccy/go-json v0.10.5 // indirect
218-
github.com/golang-jwt/jwt/v4 v4.5.1 // indirect
218+
github.com/golang-jwt/jwt/v4 v4.5.2 // indirect
219219
github.com/golang-sql/civil v0.0.0-20220223132316-b832511892a9 // indirect
220220
github.com/golang-sql/sqlexp v0.1.0 // indirect
221221
github.com/golang/geo v0.0.0-20230421003525-6adc56603217 // indirect

go.sum

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -374,10 +374,11 @@ github.com/gogs/chardet v0.0.0-20211120154057-b7413eaefb8f h1:3BSP1Tbs2djlpprl7w
374374
github.com/gogs/chardet v0.0.0-20211120154057-b7413eaefb8f/go.mod h1:Pcatq5tYkCW2Q6yrR2VRHlbHpZ/R4/7qyL1TCF7vl14=
375375
github.com/gogs/go-gogs-client v0.0.0-20210131175652-1d7215cd8d85 h1:UjoPNDAQ5JPCjlxoJd6K8ALZqSDDhk2ymieAZOVaDg0=
376376
github.com/gogs/go-gogs-client v0.0.0-20210131175652-1d7215cd8d85/go.mod h1:fR6z1Ie6rtF7kl/vBYMfgD5/G5B1blui7z426/sj2DU=
377-
github.com/golang-jwt/jwt/v4 v4.5.1 h1:JdqV9zKUdtaa9gdPlywC3aeoEsR681PlKC+4F5gQgeo=
378377
github.com/golang-jwt/jwt/v4 v4.5.1/go.mod h1:m21LjoU+eqJr34lmDMbreY2eSTRJ1cv77w39/MY0Ch0=
379-
github.com/golang-jwt/jwt/v5 v5.2.1 h1:OuVbFODueb089Lh128TAcimifWaLhJwVflnrgM17wHk=
380-
github.com/golang-jwt/jwt/v5 v5.2.1/go.mod h1:pqrtFR0X4osieyHYxtmOUWsAWrfe1Q5UVIyoH402zdk=
378+
github.com/golang-jwt/jwt/v4 v4.5.2 h1:YtQM7lnr8iZ+j5q71MGKkNw9Mn7AjHM68uc9g5fXeUI=
379+
github.com/golang-jwt/jwt/v4 v4.5.2/go.mod h1:m21LjoU+eqJr34lmDMbreY2eSTRJ1cv77w39/MY0Ch0=
380+
github.com/golang-jwt/jwt/v5 v5.2.2 h1:Rl4B7itRWVtYIHFrSNd7vhTiz9UpLdi6gZhZ3wEeDy8=
381+
github.com/golang-jwt/jwt/v5 v5.2.2/go.mod h1:pqrtFR0X4osieyHYxtmOUWsAWrfe1Q5UVIyoH402zdk=
381382
github.com/golang-sql/civil v0.0.0-20220223132316-b832511892a9 h1:au07oEsX2xN0ktxqI+Sida1w446QrXBRJ0nee3SNZlA=
382383
github.com/golang-sql/civil v0.0.0-20220223132316-b832511892a9/go.mod h1:8vg3r2VgvsThLBIFL93Qb5yWzgyZWhEmBwUJWevAkK0=
383384
github.com/golang-sql/sqlexp v0.1.0 h1:ZCD6MBpcuOVfGVqsEmY5/4FtYiKz6tSyUv9LPEDei6A=
@@ -655,8 +656,8 @@ github.com/prometheus/procfs v0.15.1/go.mod h1:fB45yRUv8NstnjriLhBQLuOUt+WW4BsoG
655656
github.com/quasoft/websspi v1.1.2 h1:/mA4w0LxWlE3novvsoEL6BBA1WnjJATbjkh1kFrTidw=
656657
github.com/quasoft/websspi v1.1.2/go.mod h1:HmVdl939dQ0WIXZhyik+ARdI03M6bQzaSEKcgpFmewk=
657658
github.com/rcrowley/go-metrics v0.0.0-20190826022208-cac0b30c2563/go.mod h1:bCqnVzQkZxMG4s8nGwiZ5l3QUCyqpo9Y+/ZMZ9VjZe4=
658-
github.com/redis/go-redis/v9 v9.7.0 h1:HhLSs+B6O021gwzl+locl0zEDnyNkxMtf/Z3NNBMa9E=
659-
github.com/redis/go-redis/v9 v9.7.0/go.mod h1:f6zhXITC7JUJIlPEiBOTXxJgPLdZcA93GewI7inzyWw=
659+
github.com/redis/go-redis/v9 v9.7.3 h1:YpPyAayJV+XErNsatSElgRZZVCwXX9QzkKYNvO7x0wM=
660+
github.com/redis/go-redis/v9 v9.7.3/go.mod h1:bGUrSggJ9X9GUmZpZNEOQKaANxSGgOEBRltRTZHSvrA=
660661
github.com/redis/rueidis v1.0.19 h1:s65oWtotzlIFN8eMPhyYwxlwLR1lUdhza2KtWprKYSo=
661662
github.com/redis/rueidis v1.0.19/go.mod h1:8B+r5wdnjwK3lTFml5VtxjzGOQAC+5UmujoD12pDrEo=
662663
github.com/remyoudompheng/bigfft v0.0.0-20200410134404-eec4a21b6bb0 h1:OdAsTTz6OkFY5QxjkYwrChwuRruF69c169dPK26NUlk=

models/repo/upload.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import (
1010
"io"
1111
"mime/multipart"
1212
"os"
13-
"path"
13+
"path/filepath"
1414

1515
"code.gitea.io/gitea/models/db"
1616
"code.gitea.io/gitea/modules/log"
@@ -53,7 +53,7 @@ func init() {
5353

5454
// UploadLocalPath returns where uploads is stored in local file system based on given UUID.
5555
func UploadLocalPath(uuid string) string {
56-
return path.Join(setting.Repository.Upload.TempPath, uuid[0:1], uuid[1:2], uuid)
56+
return filepath.Join(setting.Repository.Upload.TempPath, uuid[0:1], uuid[1:2], uuid)
5757
}
5858

5959
// LocalPath returns where uploads are temporarily stored in local file system.
@@ -69,7 +69,7 @@ func NewUpload(ctx context.Context, name string, buf []byte, file multipart.File
6969
}
7070

7171
localPath := upload.LocalPath()
72-
if err = os.MkdirAll(path.Dir(localPath), os.ModePerm); err != nil {
72+
if err = os.MkdirAll(filepath.Dir(localPath), os.ModePerm); err != nil {
7373
return nil, fmt.Errorf("MkdirAll: %w", err)
7474
}
7575

models/user/user_system.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@ import (
1010
)
1111

1212
const (
13-
GhostUserID = -1
14-
GhostUserName = "Ghost"
13+
GhostUserID int64 = -1
14+
GhostUserName = "Ghost"
1515
)
1616

1717
// NewGhostUser creates and returns a fake user for someone has deleted their account.
@@ -36,9 +36,9 @@ func (u *User) IsGhost() bool {
3636
}
3737

3838
const (
39-
ActionsUserID = -2
40-
ActionsUserName = "gitea-actions"
41-
ActionsUserEmail = "[email protected]"
39+
ActionsUserID int64 = -2
40+
ActionsUserName = "gitea-actions"
41+
ActionsUserEmail = "[email protected]"
4242
)
4343

4444
func IsGiteaActionsUserName(name string) bool {

modules/git/hook.go

Lines changed: 0 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,9 @@ package git
77
import (
88
"errors"
99
"os"
10-
"path"
1110
"path/filepath"
1211
"strings"
1312

14-
"code.gitea.io/gitea/modules/log"
1513
"code.gitea.io/gitea/modules/util"
1614
)
1715

@@ -134,28 +132,3 @@ func ListHooks(repoPath string) (_ []*Hook, err error) {
134132
}
135133
return hooks, nil
136134
}
137-
138-
const (
139-
// HookPathUpdate hook update path
140-
HookPathUpdate = "hooks/update"
141-
)
142-
143-
// SetUpdateHook writes given content to update hook of the repository.
144-
func SetUpdateHook(repoPath, content string) (err error) {
145-
log.Debug("Setting update hook: %s", repoPath)
146-
hookPath := path.Join(repoPath, HookPathUpdate)
147-
isExist, err := util.IsExist(hookPath)
148-
if err != nil {
149-
log.Debug("Unable to check if %s exists. Error: %v", hookPath, err)
150-
return err
151-
}
152-
if isExist {
153-
err = util.Remove(hookPath)
154-
} else {
155-
err = os.MkdirAll(path.Dir(hookPath), os.ModePerm)
156-
}
157-
if err != nil {
158-
return err
159-
}
160-
return os.WriteFile(hookPath, []byte(content), 0o777)
161-
}

modules/git/repo_commitgraph_gogit.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ package git
88

99
import (
1010
"os"
11-
"path"
11+
"path/filepath"
1212

1313
gitealog "code.gitea.io/gitea/modules/log"
1414

@@ -18,7 +18,7 @@ import (
1818

1919
// CommitNodeIndex returns the index for walking commit graph
2020
func (r *Repository) CommitNodeIndex() (cgobject.CommitNodeIndex, *os.File) {
21-
indexPath := path.Join(r.Path, "objects", "info", "commit-graph")
21+
indexPath := filepath.Join(r.Path, "objects", "info", "commit-graph")
2222

2323
file, err := os.Open(indexPath)
2424
if err == nil {

modules/indexer/code/bleve/bleve.go

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@ import (
3030
"github.com/blevesearch/bleve/v2"
3131
analyzer_custom "github.com/blevesearch/bleve/v2/analysis/analyzer/custom"
3232
analyzer_keyword "github.com/blevesearch/bleve/v2/analysis/analyzer/keyword"
33-
"github.com/blevesearch/bleve/v2/analysis/token/camelcase"
3433
"github.com/blevesearch/bleve/v2/analysis/token/lowercase"
3534
"github.com/blevesearch/bleve/v2/analysis/token/unicodenorm"
3635
"github.com/blevesearch/bleve/v2/analysis/tokenizer/letter"
@@ -72,7 +71,7 @@ const (
7271
filenameIndexerAnalyzer = "filenameIndexerAnalyzer"
7372
filenameIndexerTokenizer = "filenameIndexerTokenizer"
7473
repoIndexerDocType = "repoIndexerDocType"
75-
repoIndexerLatestVersion = 8
74+
repoIndexerLatestVersion = 9
7675
)
7776

7877
// generateBleveIndexMapping generates a bleve index mapping for the repo indexer
@@ -109,7 +108,7 @@ func generateBleveIndexMapping() (mapping.IndexMapping, error) {
109108
"type": analyzer_custom.Name,
110109
"char_filters": []string{},
111110
"tokenizer": letter.Name,
112-
"token_filters": []string{unicodeNormalizeName, camelcase.Name, lowercase.Name},
111+
"token_filters": []string{unicodeNormalizeName, lowercase.Name},
113112
}); err != nil {
114113
return nil, err
115114
}

modules/json/json.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -145,6 +145,12 @@ func Valid(data []byte) bool {
145145
// UnmarshalHandleDoubleEncode - due to a bug in xorm (see https://gitea.com/xorm/xorm/pulls/1957) - it's
146146
// possible that a Blob may be double encoded or gain an unwanted prefix of 0xff 0xfe.
147147
func UnmarshalHandleDoubleEncode(bs []byte, v any) error {
148+
if len(bs) == 0 {
149+
// json.Unmarshal will report errors if input is empty (nil or zero-length)
150+
// It seems that XORM ignores the nil but still passes zero-length string into this function
151+
// To be consistent, we should treat all empty inputs as success
152+
return nil
153+
}
148154
err := json.Unmarshal(bs, v)
149155
if err != nil {
150156
ok := true

modules/json/json_test.go

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
// Copyright 2025 The Gitea Authors. All rights reserved.
2+
// SPDX-License-Identifier: MIT
3+
4+
package json
5+
6+
import (
7+
"testing"
8+
9+
"github.com/stretchr/testify/assert"
10+
)
11+
12+
func TestGiteaDBJSONUnmarshal(t *testing.T) {
13+
var m map[any]any
14+
err := UnmarshalHandleDoubleEncode(nil, &m)
15+
assert.NoError(t, err)
16+
err = UnmarshalHandleDoubleEncode([]byte(""), &m)
17+
assert.NoError(t, err)
18+
}

0 commit comments

Comments
 (0)