Skip to content

Commit 928ff50

Browse files
authored
Merge branch 'release/v1.25' into lunny/frontport_35339
2 parents 528fbea + cb338a2 commit 928ff50

File tree

114 files changed

+1394
-830
lines changed

Some content is hidden

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

114 files changed

+1394
-830
lines changed

assets/go-licenses.json

Lines changed: 9 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

cmd/serv.go

Lines changed: 2 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ import (
1313
"path/filepath"
1414
"strconv"
1515
"strings"
16-
"time"
1716
"unicode"
1817

1918
asymkey_model "code.gitea.io/gitea/models/asymkey"
@@ -32,7 +31,6 @@ import (
3231
"code.gitea.io/gitea/modules/setting"
3332
"code.gitea.io/gitea/services/lfs"
3433

35-
"github.com/golang-jwt/jwt/v5"
3634
"github.com/kballard/go-shellquote"
3735
"github.com/urfave/cli/v3"
3836
)
@@ -133,27 +131,6 @@ func getAccessMode(verb, lfsVerb string) perm.AccessMode {
133131
return perm.AccessModeNone
134132
}
135133

136-
func getLFSAuthToken(ctx context.Context, lfsVerb string, results *private.ServCommandResults) (string, error) {
137-
now := time.Now()
138-
claims := lfs.Claims{
139-
RegisteredClaims: jwt.RegisteredClaims{
140-
ExpiresAt: jwt.NewNumericDate(now.Add(setting.LFS.HTTPAuthExpiry)),
141-
NotBefore: jwt.NewNumericDate(now),
142-
},
143-
RepoID: results.RepoID,
144-
Op: lfsVerb,
145-
UserID: results.UserID,
146-
}
147-
token := jwt.NewWithClaims(jwt.SigningMethodHS256, claims)
148-
149-
// Sign and get the complete encoded token as a string using the secret
150-
tokenString, err := token.SignedString(setting.LFS.JWTSecretBytes)
151-
if err != nil {
152-
return "", fail(ctx, "Failed to sign JWT Token", "Failed to sign JWT token: %v", err)
153-
}
154-
return "Bearer " + tokenString, nil
155-
}
156-
157134
func runServ(ctx context.Context, c *cli.Command) error {
158135
// FIXME: This needs to internationalised
159136
setup(ctx, c.Bool("debug"))
@@ -283,7 +260,7 @@ func runServ(ctx context.Context, c *cli.Command) error {
283260

284261
// LFS SSH protocol
285262
if verb == git.CmdVerbLfsTransfer {
286-
token, err := getLFSAuthToken(ctx, lfsVerb, results)
263+
token, err := lfs.GetLFSAuthTokenWithBearer(lfs.AuthTokenOptions{Op: lfsVerb, UserID: results.UserID, RepoID: results.RepoID})
287264
if err != nil {
288265
return err
289266
}
@@ -294,7 +271,7 @@ func runServ(ctx context.Context, c *cli.Command) error {
294271
if verb == git.CmdVerbLfsAuthenticate {
295272
url := fmt.Sprintf("%s%s/%s.git/info/lfs", setting.AppURL, url.PathEscape(results.OwnerName), url.PathEscape(results.RepoName))
296273

297-
token, err := getLFSAuthToken(ctx, lfsVerb, results)
274+
token, err := lfs.GetLFSAuthTokenWithBearer(lfs.AuthTokenOptions{Op: lfsVerb, UserID: results.UserID, RepoID: results.RepoID})
298275
if err != nil {
299276
return err
300277
}

custom/conf/app.example.ini

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1343,6 +1343,10 @@ LEVEL = Info
13431343
;; Dont mistake it for Reactions.
13441344
;CUSTOM_EMOJIS = gitea, codeberg, gitlab, git, github, gogs
13451345
;;
1346+
;; Comma separated list of enabled emojis, for example: smile, thumbsup, thumbsdown
1347+
;; Leave it empty to enable all emojis.
1348+
;ENABLED_EMOJIS =
1349+
;;
13461350
;; Whether the full name of the users should be shown where possible. If the full name isn't set, the username will be used.
13471351
;DEFAULT_SHOW_FULL_NAME = false
13481352
;;

go.mod

Lines changed: 16 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ require (
3535
github.com/bohde/codel v0.2.0
3636
github.com/buildkite/terminal-to-html/v3 v3.16.8
3737
github.com/caddyserver/certmagic v0.24.0
38-
github.com/charmbracelet/git-lfs-transfer v0.2.0
38+
github.com/charmbracelet/git-lfs-transfer v0.1.1-0.20251013092601-6327009efd21
3939
github.com/chi-middleware/proxy v1.1.1
4040
github.com/dimiro1/reply v0.0.0-20200315094148-d0136a4c9e21
4141
github.com/djherbis/buffer v1.2.0
@@ -56,7 +56,7 @@ require (
5656
github.com/go-co-op/gocron v1.37.0
5757
github.com/go-enry/go-enry/v2 v2.9.2
5858
github.com/go-git/go-billy/v5 v5.6.2
59-
github.com/go-git/go-git/v5 v5.16.2
59+
github.com/go-git/go-git/v5 v5.16.3
6060
github.com/go-ldap/ldap/v3 v3.4.11
6161
github.com/go-redsync/redsync/v4 v4.13.0
6262
github.com/go-sql-driver/mysql v1.9.3
@@ -84,7 +84,7 @@ require (
8484
github.com/mattn/go-isatty v0.0.20
8585
github.com/mattn/go-sqlite3 v1.14.32
8686
github.com/meilisearch/meilisearch-go v0.33.2
87-
github.com/mholt/archives v0.1.3
87+
github.com/mholt/archives v0.1.5-0.20251009205813-e30ac6010726
8888
github.com/microcosm-cc/bluemonday v1.0.27
8989
github.com/microsoft/go-mssqldb v1.9.3
9090
github.com/minio/minio-go/v7 v7.0.95
@@ -116,13 +116,13 @@ require (
116116
github.com/yuin/goldmark-highlighting/v2 v2.0.0-20230729083705-37449abec8cc
117117
github.com/yuin/goldmark-meta v1.1.0
118118
gitlab.com/gitlab-org/api/client-go v0.142.4
119-
golang.org/x/crypto v0.41.0
119+
golang.org/x/crypto v0.42.0
120120
golang.org/x/image v0.30.0
121-
golang.org/x/net v0.43.0
121+
golang.org/x/net v0.44.0
122122
golang.org/x/oauth2 v0.30.0
123-
golang.org/x/sync v0.16.0
124-
golang.org/x/sys v0.35.0
125-
golang.org/x/text v0.28.0
123+
golang.org/x/sync v0.17.0
124+
golang.org/x/sys v0.37.0
125+
golang.org/x/text v0.30.0
126126
google.golang.org/grpc v1.75.0
127127
google.golang.org/protobuf v1.36.8
128128
gopkg.in/ini.v1 v1.67.0
@@ -142,7 +142,7 @@ require (
142142
github.com/DataDog/zstd v1.5.7 // indirect
143143
github.com/Microsoft/go-winio v0.6.2 // indirect
144144
github.com/RoaringBitmap/roaring/v2 v2.10.0 // indirect
145-
github.com/STARRY-S/zip v0.2.1 // indirect
145+
github.com/STARRY-S/zip v0.2.3 // indirect
146146
github.com/andybalholm/brotli v1.2.0 // indirect
147147
github.com/andybalholm/cascadia v1.3.3 // indirect
148148
github.com/anmitsu/go-shlex v0.0.0-20200514113438-38f4b401e2be // indirect
@@ -172,7 +172,7 @@ require (
172172
github.com/blevesearch/zapx/v16 v16.2.4 // indirect
173173
github.com/bmatcuk/doublestar/v4 v4.9.1 // indirect
174174
github.com/bodgit/plumbing v1.3.0 // indirect
175-
github.com/bodgit/sevenzip v1.6.0 // indirect
175+
github.com/bodgit/sevenzip v1.6.1 // indirect
176176
github.com/bodgit/windows v1.0.1 // indirect
177177
github.com/boombuler/barcode v1.1.0 // indirect
178178
github.com/bradfitz/gomemcache v0.0.0-20250403215159-8d39553ac7cf // indirect
@@ -233,14 +233,14 @@ require (
233233
github.com/mikelolasagasti/xz v1.0.1 // indirect
234234
github.com/minio/crc64nvme v1.1.1 // indirect
235235
github.com/minio/md5-simd v1.1.2 // indirect
236-
github.com/minio/minlz v1.0.0 // indirect
236+
github.com/minio/minlz v1.0.1 // indirect
237237
github.com/mitchellh/mapstructure v1.5.0 // indirect
238238
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
239239
github.com/modern-go/reflect2 v1.0.2 // indirect
240240
github.com/mrjones/oauth v0.0.0-20190623134757-126b35219450 // indirect
241241
github.com/mschoch/smat v0.2.0 // indirect
242242
github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect
243-
github.com/nwaples/rardecode/v2 v2.1.0 // indirect
243+
github.com/nwaples/rardecode/v2 v2.2.0 // indirect
244244
github.com/olekukonko/cat v0.0.0-20250817074551-3280053e4e00 // indirect
245245
github.com/olekukonko/errors v1.1.0 // indirect
246246
github.com/olekukonko/ll v0.1.0 // indirect
@@ -259,7 +259,8 @@ require (
259259
github.com/russross/blackfriday/v2 v2.1.0 // indirect
260260
github.com/sirupsen/logrus v1.9.3 // indirect
261261
github.com/skeema/knownhosts v1.3.1 // indirect
262-
github.com/sorairolake/lzip-go v0.3.5 // indirect
262+
github.com/sorairolake/lzip-go v0.3.8 // indirect
263+
github.com/spf13/afero v1.15.0 // indirect
263264
github.com/ssor/bom v0.0.0-20170718123548-6386211fdfcf // indirect
264265
github.com/tinylib/msgp v1.4.0 // indirect
265266
github.com/unknwon/com v1.0.1 // indirect
@@ -278,9 +279,9 @@ require (
278279
go.uber.org/zap/exp v0.3.0 // indirect
279280
go4.org v0.0.0-20230225012048-214862532bf5 // indirect
280281
golang.org/x/exp v0.0.0-20250305212735-054e65f0b394 // indirect
281-
golang.org/x/mod v0.27.0 // indirect
282+
golang.org/x/mod v0.28.0 // indirect
282283
golang.org/x/time v0.12.0 // indirect
283-
golang.org/x/tools v0.36.0 // indirect
284+
golang.org/x/tools v0.37.0 // indirect
284285
google.golang.org/genproto/googleapis/rpc v0.0.0-20250826171959-ef028d996bc1 // indirect
285286
gopkg.in/warnings.v0 v0.1.2 // indirect
286287
gopkg.in/yaml.v2 v2.4.0 // indirect
@@ -297,9 +298,6 @@ replace github.com/hashicorp/go-version => github.com/6543/go-version v1.3.1
297298

298299
replace github.com/nektos/act => gitea.com/gitea/act v0.261.7-0.20251003180512-ac6e4b751763
299300

300-
// TODO: the only difference is in `PutObject`: the fork doesn't use `NewVerifyingReader(r, sha256.New(), oid, expectedSize)`, need to figure out why
301-
replace github.com/charmbracelet/git-lfs-transfer => gitea.com/gitea/git-lfs-transfer v0.2.0
302-
303301
replace git.sr.ht/~mariusor/go-xsd-duration => gitea.com/gitea/go-xsd-duration v0.0.0-20220703122237-02e73435a078
304302

305303
exclude github.com/gofrs/uuid v3.2.0+incompatible

0 commit comments

Comments
 (0)