Skip to content

Commit de4c6fb

Browse files
committed
Merge remote-tracking branch 'upstream/release/v1.23' into release/dcs/v1.23
2 parents cb5dffd + 869ee4f commit de4c6fb

File tree

20 files changed

+131
-66
lines changed

20 files changed

+131
-66
lines changed

.github/workflows/pull-db-tests.yml

+3-4
Original file line numberDiff line numberDiff line change
@@ -202,12 +202,11 @@ jobs:
202202
test-mssql:
203203
if: needs.files-changed.outputs.backend == 'true' || needs.files-changed.outputs.actions == 'true'
204204
needs: files-changed
205-
# specifying the version of ubuntu in use as mssql fails on newer kernels
206-
# pending resolution from vendor
207-
runs-on: ubuntu-20.04
205+
# NOTE: mssql-2017 docker image will panic when run on hosts that have Ubuntu newer than 20.04
206+
runs-on: ubuntu-latest
208207
services:
209208
mssql:
210-
image: mcr.microsoft.com/mssql/server:2017-latest
209+
image: mcr.microsoft.com/mssql/server:2019-latest
211210
env:
212211
ACCEPT_EULA: Y
213212
MSSQL_PID: Standard

CHANGELOG.md

+21
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,27 @@ 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.5](https://github.com/go-gitea/gitea/releases/tag/v1.23.5) - 2025-03-03
8+
9+
* SECURITY
10+
* Bump x/oauth2 & x/crypto (#33704) (#33727)
11+
* PERFORMANCE
12+
* Optimize user dashboard loading (#33686) (#33708)
13+
* BUGFIXES
14+
* Fix navbar dropdown item align (#33782)
15+
* Fix inconsistent closed issue list icon (#33722) (#33728)
16+
* Fix for Maven Package Naming Convention Handling (#33678) (#33679)
17+
* Improve Open-with URL encoding (#33666) (#33680)
18+
* Deleting repository should unlink all related packages (#33653) (#33673)
19+
* Fix omitempty bug (#33663) (#33670)
20+
* Upgrade go-crypto from 1.1.4 to 1.1.6 (#33745) (#33754)
21+
* Fix OCI image.version annotation for releases to use full semver (#33698) (#33701)
22+
* Try to fix ACME path when renew (#33668) (#33693)
23+
* Fix mCaptcha bug (#33659) (#33661)
24+
* Git graph: don't show detached commits (#33645) (#33650)
25+
* Use MatchPhraseQuery for bleve code search (#33628)
26+
* Adjust appearence of commit status webhook (#33778) #33789
27+
728
## [1.23.4](https://github.com/go-gitea/gitea/releases/tag/v1.23.4) - 2025-02-16
829

930
* SECURITY

cmd/web_acme.go

+8-1
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ import (
1616
"code.gitea.io/gitea/modules/log"
1717
"code.gitea.io/gitea/modules/process"
1818
"code.gitea.io/gitea/modules/setting"
19+
"code.gitea.io/gitea/modules/util"
1920

2021
"github.com/caddyserver/certmagic"
2122
)
@@ -68,9 +69,15 @@ func runACME(listenAddr string, m http.Handler) error {
6869
// And one more thing, no idea why we should set the global default variables here
6970
// But it seems that the current ACME code needs these global variables to make renew work.
7071
// Otherwise, "renew" will use incorrect storage path
72+
oldDefaultACME := certmagic.DefaultACME
7173
certmagic.Default.Storage = &certmagic.FileStorage{Path: setting.AcmeLiveDirectory}
7274
certmagic.DefaultACME = certmagic.ACMEIssuer{
73-
CA: setting.AcmeURL,
75+
// try to use the default values provided by DefaultACME
76+
CA: util.IfZero(setting.AcmeURL, oldDefaultACME.CA),
77+
TestCA: oldDefaultACME.TestCA,
78+
Logger: oldDefaultACME.Logger,
79+
HTTPProxy: oldDefaultACME.HTTPProxy,
80+
7481
TrustedRoots: certPool,
7582
Email: setting.AcmeEmail,
7683
Agreed: setting.AcmeTOS,

custom/conf/app.example.ini

+4-1
Original file line numberDiff line numberDiff line change
@@ -784,10 +784,13 @@ LEVEL = Info
784784
;; Please note that setting this to false will not disable OAuth Basic or Basic authentication using a token
785785
;ENABLE_BASIC_AUTHENTICATION = true
786786
;;
787-
;; Show the password sign-in form (for password-based login), otherwise, only show OAuth2 login methods.
787+
;; Show the password sign-in form (for password-based login), otherwise, only show OAuth2 or passkey login methods if they are enabled.
788788
;; If you set it to false, maybe it also needs to set ENABLE_BASIC_AUTHENTICATION to false to completely disable password-based authentication.
789789
;ENABLE_PASSWORD_SIGNIN_FORM = true
790790
;;
791+
;; Allow users to sign-in with a passkey
792+
;ENABLE_PASSKEY_AUTHENTICATION = true
793+
;;
791794
;; More detail: https://github.com/gogits/gogs/issues/165
792795
;ENABLE_REVERSE_PROXY_AUTHENTICATION = false
793796
; Enable this to allow reverse proxy authentication for API requests, the reverse proxy is responsible for ensuring that no CSRF is possible.

go.mod

+1-1
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ require (
120120
github.com/yuin/goldmark-meta v1.1.0
121121
golang.org/x/crypto v0.35.0
122122
golang.org/x/image v0.21.0
123-
golang.org/x/net v0.34.0
123+
golang.org/x/net v0.36.0
124124
golang.org/x/oauth2 v0.27.0
125125
golang.org/x/sync v0.11.0
126126
golang.org/x/sys v0.30.0

go.sum

+2-2
Original file line numberDiff line numberDiff line change
@@ -869,8 +869,8 @@ golang.org/x/net v0.15.0/go.mod h1:idbUs1IY1+zTqbi8yxTbhexhEEk5ur9LInksu6HrEpk=
869869
golang.org/x/net v0.21.0/go.mod h1:bIjVDfnllIU7BJ2DNgfnXvpSvtn8VRwhlsaeUTyUS44=
870870
golang.org/x/net v0.22.0/go.mod h1:JKghWKKOSdJwpW2GEx0Ja7fmaKnMsbu+MWVZTokSYmg=
871871
golang.org/x/net v0.25.0/go.mod h1:JkAGAh7GEvH74S6FOH42FLoXpXbE/aqXSrIQjXgsiwM=
872-
golang.org/x/net v0.34.0 h1:Mb7Mrk043xzHgnRM88suvJFwzVrRfHEHJEl5/71CKw0=
873-
golang.org/x/net v0.34.0/go.mod h1:di0qlW3YNM5oh6GqDGQr92MyTozJPmybPK4Ev/Gm31k=
872+
golang.org/x/net v0.36.0 h1:vWF2fRbw4qslQsQzgFqZff+BItCvGFQqKzKIzx1rmoA=
873+
golang.org/x/net v0.36.0/go.mod h1:bFmbeoIPfrw4sMHNhb4J9f6+tPziuGjq7Jk/38fxi1I=
874874
golang.org/x/oauth2 v0.27.0 h1:da9Vo7/tDv5RH/7nZDz1eMGS/q1Vv1N/7FCrBhI9I3M=
875875
golang.org/x/oauth2 v0.27.0/go.mod h1:onh5ek6nERTohokkhCD/y2cV4Do3fxFHFuAejCkRWT8=
876876
golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=

modules/setting/service.go

+2
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ var Service = struct {
4646
RequireSignInView bool
4747
EnableNotifyMail bool
4848
EnableBasicAuth bool
49+
EnablePasskeyAuth bool
4950
EnableReverseProxyAuth bool
5051
EnableReverseProxyAuthAPI bool
5152
EnableReverseProxyAutoRegister bool
@@ -161,6 +162,7 @@ func loadServiceFrom(rootCfg ConfigProvider) {
161162
Service.RequireSignInView = sec.Key("REQUIRE_SIGNIN_VIEW").MustBool()
162163
Service.EnableBasicAuth = sec.Key("ENABLE_BASIC_AUTHENTICATION").MustBool(true)
163164
Service.EnablePasswordSignInForm = sec.Key("ENABLE_PASSWORD_SIGNIN_FORM").MustBool(true)
165+
Service.EnablePasskeyAuth = sec.Key("ENABLE_PASSKEY_AUTHENTICATION").MustBool(true)
164166
Service.EnableReverseProxyAuth = sec.Key("ENABLE_REVERSE_PROXY_AUTHENTICATION").MustBool()
165167
Service.EnableReverseProxyAuthAPI = sec.Key("ENABLE_REVERSE_PROXY_AUTHENTICATION_API").MustBool()
166168
Service.EnableReverseProxyAutoRegister = sec.Key("ENABLE_REVERSE_PROXY_AUTO_REGISTRATION").MustBool()

modules/structs/pull.go

+4-3
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,10 @@ type PullRequest struct {
2727
Comments int `json:"comments"`
2828
// number of review comments made on the diff of a PR review (not including comments on commits or issues in a PR)
2929
ReviewComments int `json:"review_comments"`
30-
Additions int `json:"additions"`
31-
Deletions int `json:"deletions"`
32-
ChangedFiles int `json:"changed_files"`
30+
31+
Additions *int `json:"additions,omitempty"`
32+
Deletions *int `json:"deletions,omitempty"`
33+
ChangedFiles *int `json:"changed_files,omitempty"`
3334

3435
HTMLURL string `json:"html_url"`
3536
DiffURL string `json:"diff_url"`

routers/web/auth/auth.go

+1
Original file line numberDiff line numberDiff line change
@@ -169,6 +169,7 @@ func prepareSignInPageData(ctx *context.Context) {
169169
ctx.Data["PageIsLogin"] = true
170170
ctx.Data["EnableSSPI"] = auth.IsSSPIEnabled(ctx)
171171
ctx.Data["EnablePasswordSignInForm"] = setting.Service.EnablePasswordSignInForm
172+
ctx.Data["EnablePasskeyAuth"] = setting.Service.EnablePasskeyAuth
172173

173174
if setting.Service.EnableCaptcha && setting.Service.RequireCaptchaForLogin {
174175
context.SetCaptchaData(ctx)

routers/web/auth/linkaccount.go

+3
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ func LinkAccount(ctx *context.Context) {
4646
ctx.Data["AllowOnlyInternalRegistration"] = setting.Service.AllowOnlyInternalRegistration
4747
ctx.Data["EnablePasswordSignInForm"] = setting.Service.EnablePasswordSignInForm
4848
ctx.Data["ShowRegistrationButton"] = false
49+
ctx.Data["EnablePasskeyAuth"] = setting.Service.EnablePasskeyAuth
4950

5051
// use this to set the right link into the signIn and signUp templates in the link_account template
5152
ctx.Data["SignInLink"] = setting.AppSubURL + "/user/link_account_signin"
@@ -145,6 +146,7 @@ func LinkAccountPostSignIn(ctx *context.Context) {
145146
ctx.Data["AllowOnlyInternalRegistration"] = setting.Service.AllowOnlyInternalRegistration
146147
ctx.Data["EnablePasswordSignInForm"] = setting.Service.EnablePasswordSignInForm
147148
ctx.Data["ShowRegistrationButton"] = false
149+
ctx.Data["EnablePasskeyAuth"] = setting.Service.EnablePasskeyAuth
148150

149151
// use this to set the right link into the signIn and signUp templates in the link_account template
150152
ctx.Data["SignInLink"] = setting.AppSubURL + "/user/link_account_signin"
@@ -235,6 +237,7 @@ func LinkAccountPostRegister(ctx *context.Context) {
235237
ctx.Data["AllowOnlyInternalRegistration"] = setting.Service.AllowOnlyInternalRegistration
236238
ctx.Data["EnablePasswordSignInForm"] = setting.Service.EnablePasswordSignInForm
237239
ctx.Data["ShowRegistrationButton"] = false
240+
ctx.Data["EnablePasskeyAuth"] = setting.Service.EnablePasskeyAuth
238241

239242
// use this to set the right link into the signIn and signUp templates in the link_account template
240243
ctx.Data["SignInLink"] = setting.AppSubURL + "/user/link_account_signin"

routers/web/auth/webauthn.go

+10
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,11 @@ func WebAuthn(ctx *context.Context) {
5050

5151
// WebAuthnPasskeyAssertion submits a WebAuthn challenge for the passkey login to the browser
5252
func WebAuthnPasskeyAssertion(ctx *context.Context) {
53+
if !setting.Service.EnablePasskeyAuth {
54+
ctx.Error(http.StatusForbidden)
55+
return
56+
}
57+
5358
assertion, sessionData, err := wa.WebAuthn.BeginDiscoverableLogin()
5459
if err != nil {
5560
ctx.ServerError("webauthn.BeginDiscoverableLogin", err)
@@ -66,6 +71,11 @@ func WebAuthnPasskeyAssertion(ctx *context.Context) {
6671

6772
// WebAuthnPasskeyLogin handles the WebAuthn login process using a Passkey
6873
func WebAuthnPasskeyLogin(ctx *context.Context) {
74+
if !setting.Service.EnablePasskeyAuth {
75+
ctx.Error(http.StatusForbidden)
76+
return
77+
}
78+
6979
sessionData, okData := ctx.Session.Get("webauthnPasskeyAssertion").(*webauthn.SessionData)
7080
if !okData || sessionData == nil {
7181
ctx.ServerError("ctx.Session.Get", errors.New("not in WebAuthn session"))

services/convert/pull.go

+3-17
Original file line numberDiff line numberDiff line change
@@ -242,9 +242,11 @@ func ToAPIPullRequest(ctx context.Context, pr *issues_model.PullRequest, doer *u
242242
// Calculate diff
243243
startCommitID = pr.MergeBase
244244

245-
apiPullRequest.ChangedFiles, apiPullRequest.Additions, apiPullRequest.Deletions, err = gitRepo.GetDiffShortStat(startCommitID, endCommitID)
245+
diffChangedFiles, diffAdditions, diffDeletions, err := gitRepo.GetDiffShortStat(startCommitID, endCommitID)
246246
if err != nil {
247247
log.Error("GetDiffShortStat: %v", err)
248+
} else {
249+
apiPullRequest.ChangedFiles, apiPullRequest.Additions, apiPullRequest.Deletions = &diffChangedFiles, &diffAdditions, &diffDeletions
248250
}
249251
}
250252

@@ -462,12 +464,6 @@ func ToAPIPullRequests(ctx context.Context, baseRepo *repo_model.Repository, prs
462464
return nil, err
463465
}
464466

465-
// Outer scope variables to be used in diff calculation
466-
var (
467-
startCommitID string
468-
endCommitID string
469-
)
470-
471467
if git.IsErrBranchNotExist(err) {
472468
headCommitID, err := headGitRepo.GetRefCommitID(apiPullRequest.Head.Ref)
473469
if err != nil && !git.IsErrNotExist(err) {
@@ -476,7 +472,6 @@ func ToAPIPullRequests(ctx context.Context, baseRepo *repo_model.Repository, prs
476472
}
477473
if err == nil {
478474
apiPullRequest.Head.Sha = headCommitID
479-
endCommitID = headCommitID
480475
}
481476
} else {
482477
commit, err := headBranch.GetCommit()
@@ -487,17 +482,8 @@ func ToAPIPullRequests(ctx context.Context, baseRepo *repo_model.Repository, prs
487482
if err == nil {
488483
apiPullRequest.Head.Ref = pr.HeadBranch
489484
apiPullRequest.Head.Sha = commit.ID.String()
490-
endCommitID = commit.ID.String()
491485
}
492486
}
493-
494-
// Calculate diff
495-
startCommitID = pr.MergeBase
496-
497-
apiPullRequest.ChangedFiles, apiPullRequest.Additions, apiPullRequest.Deletions, err = gitRepo.GetDiffShortStat(startCommitID, endCommitID)
498-
if err != nil {
499-
log.Error("GetDiffShortStat: %v", err)
500-
}
501487
}
502488

503489
if len(apiPullRequest.Head.Sha) == 0 && len(apiPullRequest.Head.Ref) != 0 {

services/webhook/general.go

+9-3
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,9 @@ import (
99
"net/url"
1010
"strings"
1111

12+
user_model "code.gitea.io/gitea/models/user"
1213
webhook_model "code.gitea.io/gitea/models/webhook"
14+
"code.gitea.io/gitea/modules/base"
1315
"code.gitea.io/gitea/modules/setting"
1416
api "code.gitea.io/gitea/modules/structs"
1517
"code.gitea.io/gitea/modules/util"
@@ -308,12 +310,16 @@ func getPackagePayloadInfo(p *api.PackagePayload, linkFormatter linkFormatter, w
308310
}
309311

310312
func getStatusPayloadInfo(p *api.CommitStatusPayload, linkFormatter linkFormatter, withSender bool) (text string, color int) {
311-
refLink := linkFormatter(p.TargetURL, p.Context+"["+p.SHA+"]:"+p.Description)
313+
refLink := linkFormatter(p.TargetURL, fmt.Sprintf("%s [%s]", p.Context, base.ShortSha(p.SHA)))
312314

313-
text = fmt.Sprintf("Commit Status changed: %s", refLink)
315+
text = fmt.Sprintf("Commit Status changed: %s - %s", refLink, p.Description)
314316
color = greenColor
315317
if withSender {
316-
text += fmt.Sprintf(" by %s", linkFormatter(setting.AppURL+url.PathEscape(p.Sender.UserName), p.Sender.UserName))
318+
if user_model.IsGiteaActionsUserName(p.Sender.UserName) {
319+
text += fmt.Sprintf(" by %s", p.Sender.FullName)
320+
} else {
321+
text += fmt.Sprintf(" by %s", linkFormatter(setting.AppURL+url.PathEscape(p.Sender.UserName), p.Sender.UserName))
322+
}
317323
}
318324

319325
return text, color

services/webhook/matrix.go

+3-2
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ import (
1515
"strings"
1616

1717
webhook_model "code.gitea.io/gitea/models/webhook"
18+
"code.gitea.io/gitea/modules/base"
1819
"code.gitea.io/gitea/modules/git"
1920
"code.gitea.io/gitea/modules/json"
2021
"code.gitea.io/gitea/modules/log"
@@ -245,8 +246,8 @@ func (m matrixConvertor) Package(p *api.PackagePayload) (MatrixPayload, error) {
245246
}
246247

247248
func (m matrixConvertor) Status(p *api.CommitStatusPayload) (MatrixPayload, error) {
248-
refLink := htmlLinkFormatter(p.TargetURL, p.Context+"["+p.SHA+"]:"+p.Description)
249-
text := fmt.Sprintf("Commit Status changed: %s", refLink)
249+
refLink := htmlLinkFormatter(p.TargetURL, fmt.Sprintf("%s [%s]", p.Context, base.ShortSha(p.SHA)))
250+
text := fmt.Sprintf("Commit Status changed: %s - %s", refLink, p.Description)
250251

251252
return m.newPayload(text)
252253
}

templates/user/auth/signin_inner.tmpl

+4-3
Original file line numberDiff line numberDiff line change
@@ -60,10 +60,11 @@
6060
</div>
6161

6262
<div class="ui container fluid">
63-
{{template "user/auth/webauthn_error" .}}
64-
6563
<div class="ui attached segment header top tw-max-w-2xl tw-m-auto tw-flex tw-flex-col tw-items-center">
66-
<a class="signin-passkey">{{ctx.Locale.Tr "auth.signin_passkey"}}</a>
64+
{{if .EnablePasskeyAuth}}
65+
{{template "user/auth/webauthn_error" .}}
66+
<a class="signin-passkey">{{ctx.Locale.Tr "auth.signin_passkey"}}</a>
67+
{{end}}
6768

6869
{{if .ShowRegistrationButton}}
6970
<div class="field">

0 commit comments

Comments
 (0)