Skip to content

Commit 024d528

Browse files
authored
Merge branch 'main' into lunny/move_wikipath
2 parents a7d5d97 + 355e9a9 commit 024d528

File tree

429 files changed

+7952
-3986
lines changed

Some content is hidden

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

429 files changed

+7952
-3986
lines changed

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

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,9 @@ jobs:
1212
uses: ./.github/workflows/files-changed.yml
1313

1414
test-e2e:
15-
if: needs.files-changed.outputs.backend == 'true' || needs.files-changed.outputs.frontend == 'true' || needs.files-changed.outputs.actions == 'true'
15+
# the "test-e2e" won't pass, and it seems that there is no useful test, so skip
16+
# if: needs.files-changed.outputs.backend == 'true' || needs.files-changed.outputs.frontend == 'true' || needs.files-changed.outputs.actions == 'true'
17+
if: false
1618
needs: files-changed
1719
runs-on: ubuntu-latest
1820
steps:

.github/workflows/release-nightly.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ jobs:
9999
uses: docker/build-push-action@v5
100100
with:
101101
context: .
102-
platforms: linux/amd64,linux/arm64
102+
platforms: linux/amd64,linux/arm64,linux/riscv64
103103
push: true
104104
tags: |-
105105
gitea/gitea:${{ steps.clean_name.outputs.branch }}

.github/workflows/release-tag-rc.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ jobs:
104104
uses: docker/build-push-action@v5
105105
with:
106106
context: .
107-
platforms: linux/amd64,linux/arm64
107+
platforms: linux/amd64,linux/arm64,linux/riscv64
108108
push: true
109109
tags: ${{ steps.meta.outputs.tags }}
110110
labels: ${{ steps.meta.outputs.labels }}
@@ -147,7 +147,7 @@ jobs:
147147
uses: docker/build-push-action@v5
148148
with:
149149
context: .
150-
platforms: linux/amd64,linux/arm64
150+
platforms: linux/amd64,linux/arm64,linux/riscv64
151151
push: true
152152
file: Dockerfile.rootless
153153
tags: ${{ steps.meta.outputs.tags }}

.github/workflows/release-tag-version.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ jobs:
112112
uses: docker/build-push-action@v5
113113
with:
114114
context: .
115-
platforms: linux/amd64,linux/arm64
115+
platforms: linux/amd64,linux/arm64,linux/riscv64
116116
push: true
117117
tags: ${{ steps.meta.outputs.tags }}
118118
labels: ${{ steps.meta.outputs.labels }}
@@ -158,7 +158,7 @@ jobs:
158158
uses: docker/build-push-action@v5
159159
with:
160160
context: .
161-
platforms: linux/amd64,linux/arm64
161+
platforms: linux/amd64,linux/arm64,linux/riscv64
162162
push: true
163163
file: Dockerfile.rootless
164164
tags: ${{ steps.meta.outputs.tags }}

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,9 @@ _test
2222
.vscode
2323
__debug_bin*
2424

25+
# Visual Studio
26+
/.vs/
27+
2528
*.cgo1.go
2629
*.cgo2.c
2730
_cgo_defun.c

MAINTAINERS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,3 +64,4 @@ Rowan Bohde <[email protected]> (@bohde)
6464
hiifong <[email protected]> (@hiifong)
6565
metiftikci <[email protected]> (@metiftikci)
6666
Christopher Homberger <[email protected]> (@ChristopherHX)
67+
Tobias Balle-Petersen <[email protected]> (@tobiasbp)

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ endif
110110

111111
LDFLAGS := $(LDFLAGS) -X "main.MakeVersion=$(MAKE_VERSION)" -X "main.Version=$(GITEA_VERSION)" -X "main.Tags=$(TAGS)"
112112

113-
LINUX_ARCHS ?= linux/amd64,linux/386,linux/arm-5,linux/arm-6,linux/arm64
113+
LINUX_ARCHS ?= linux/amd64,linux/386,linux/arm-5,linux/arm-6,linux/arm64,linux/riscv64
114114

115115
GO_TEST_PACKAGES ?= $(filter-out $(shell $(GO) list code.gitea.io/gitea/models/migrations/...) code.gitea.io/gitea/tests/integration/migration-test code.gitea.io/gitea/tests code.gitea.io/gitea/tests/integration code.gitea.io/gitea/tests/e2e,$(shell $(GO) list ./... | grep -v /vendor/))
116116
MIGRATE_TEST_PACKAGES ?= $(shell $(GO) list code.gitea.io/gitea/models/migrations/...)

assets/go-licenses.json

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

cmd/admin_auth_ldap.go

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ import (
99
"strings"
1010

1111
"code.gitea.io/gitea/models/auth"
12+
"code.gitea.io/gitea/modules/util"
1213
"code.gitea.io/gitea/services/auth/source/ldap"
1314

1415
"github.com/urfave/cli/v2"
@@ -210,8 +211,8 @@ func newAuthService() *authService {
210211
}
211212
}
212213

213-
// parseAuthSource assigns values on authSource according to command line flags.
214-
func parseAuthSource(c *cli.Context, authSource *auth.Source) {
214+
// parseAuthSourceLdap assigns values on authSource according to command line flags.
215+
func parseAuthSourceLdap(c *cli.Context, authSource *auth.Source) {
215216
if c.IsSet("name") {
216217
authSource.Name = c.String("name")
217218
}
@@ -227,6 +228,7 @@ func parseAuthSource(c *cli.Context, authSource *auth.Source) {
227228
if c.IsSet("disable-synchronize-users") {
228229
authSource.IsSyncEnabled = !c.Bool("disable-synchronize-users")
229230
}
231+
authSource.TwoFactorPolicy = util.Iif(c.Bool("skip-local-2fa"), "skip", "")
230232
}
231233

232234
// parseLdapConfig assigns values on config according to command line flags.
@@ -298,9 +300,6 @@ func parseLdapConfig(c *cli.Context, config *ldap.Source) error {
298300
if c.IsSet("allow-deactivate-all") {
299301
config.AllowDeactivateAll = c.Bool("allow-deactivate-all")
300302
}
301-
if c.IsSet("skip-local-2fa") {
302-
config.SkipLocalTwoFA = c.Bool("skip-local-2fa")
303-
}
304303
if c.IsSet("enable-groups") {
305304
config.GroupsEnabled = c.Bool("enable-groups")
306305
}
@@ -376,7 +375,7 @@ func (a *authService) addLdapBindDn(c *cli.Context) error {
376375
},
377376
}
378377

379-
parseAuthSource(c, authSource)
378+
parseAuthSourceLdap(c, authSource)
380379
if err := parseLdapConfig(c, authSource.Cfg.(*ldap.Source)); err != nil {
381380
return err
382381
}
@@ -398,7 +397,7 @@ func (a *authService) updateLdapBindDn(c *cli.Context) error {
398397
return err
399398
}
400399

401-
parseAuthSource(c, authSource)
400+
parseAuthSourceLdap(c, authSource)
402401
if err := parseLdapConfig(c, authSource.Cfg.(*ldap.Source)); err != nil {
403402
return err
404403
}
@@ -427,7 +426,7 @@ func (a *authService) addLdapSimpleAuth(c *cli.Context) error {
427426
},
428427
}
429428

430-
parseAuthSource(c, authSource)
429+
parseAuthSourceLdap(c, authSource)
431430
if err := parseLdapConfig(c, authSource.Cfg.(*ldap.Source)); err != nil {
432431
return err
433432
}
@@ -449,7 +448,7 @@ func (a *authService) updateLdapSimpleAuth(c *cli.Context) error {
449448
return err
450449
}
451450

452-
parseAuthSource(c, authSource)
451+
parseAuthSourceLdap(c, authSource)
453452
if err := parseLdapConfig(c, authSource.Cfg.(*ldap.Source)); err != nil {
454453
return err
455454
}

cmd/admin_auth_oauth.go

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ import (
99
"net/url"
1010

1111
auth_model "code.gitea.io/gitea/models/auth"
12+
"code.gitea.io/gitea/modules/util"
1213
"code.gitea.io/gitea/services/auth/source/oauth2"
1314

1415
"github.com/urfave/cli/v2"
@@ -156,7 +157,6 @@ func parseOAuth2Config(c *cli.Context) *oauth2.Source {
156157
OpenIDConnectAutoDiscoveryURL: c.String("auto-discover-url"),
157158
CustomURLMapping: customURLMapping,
158159
IconURL: c.String("icon-url"),
159-
SkipLocalTwoFA: c.Bool("skip-local-2fa"),
160160
Scopes: c.StringSlice("scopes"),
161161
RequiredClaimName: c.String("required-claim-name"),
162162
RequiredClaimValue: c.String("required-claim-value"),
@@ -185,10 +185,11 @@ func runAddOauth(c *cli.Context) error {
185185
}
186186

187187
return auth_model.CreateSource(ctx, &auth_model.Source{
188-
Type: auth_model.OAuth2,
189-
Name: c.String("name"),
190-
IsActive: true,
191-
Cfg: config,
188+
Type: auth_model.OAuth2,
189+
Name: c.String("name"),
190+
IsActive: true,
191+
Cfg: config,
192+
TwoFactorPolicy: util.Iif(c.Bool("skip-local-2fa"), "skip", ""),
192193
})
193194
}
194195

@@ -294,6 +295,6 @@ func runUpdateOauth(c *cli.Context) error {
294295

295296
oAuth2Config.CustomURLMapping = customURLMapping
296297
source.Cfg = oAuth2Config
297-
298+
source.TwoFactorPolicy = util.Iif(c.Bool("skip-local-2fa"), "skip", "")
298299
return auth_model.UpdateSource(ctx, source)
299300
}

0 commit comments

Comments
 (0)