Skip to content

Commit 01f59ec

Browse files
authored
Merge branch 'main' into fix_13283
2 parents 4831ada + 57d0461 commit 01f59ec

File tree

1,006 files changed

+34791
-28684
lines changed

Some content is hidden

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

1,006 files changed

+34791
-28684
lines changed

.drone.yml

Lines changed: 2 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -537,7 +537,7 @@ steps:
537537

538538
- name: static
539539
pull: always
540-
image: techknowlogick/xgo:go-1.16.x
540+
image: techknowlogick/xgo:go-1.17.x
541541
commands:
542542
- curl -sL https://deb.nodesource.com/setup_16.x | bash - && apt-get install -y nodejs
543543
- export PATH=$PATH:$GOPATH/bin
@@ -633,7 +633,7 @@ steps:
633633

634634
- name: static
635635
pull: always
636-
image: techknowlogick/xgo:go-1.16.x
636+
image: techknowlogick/xgo:go-1.17.x
637637
commands:
638638
- curl -sL https://deb.nodesource.com/setup_16.x | bash - && apt-get install -y nodejs
639639
- export PATH=$PATH:$GOPATH/bin
@@ -783,9 +783,6 @@ steps:
783783
from_secret: docker_password
784784
username:
785785
from_secret: docker_username
786-
environment:
787-
PLUGIN_MIRROR:
788-
from_secret: plugin_mirror
789786
when:
790787
event:
791788
exclude:
@@ -848,9 +845,6 @@ steps:
848845
from_secret: docker_password
849846
username:
850847
from_secret: docker_username
851-
environment:
852-
PLUGIN_MIRROR:
853-
from_secret: plugin_mirror
854848
when:
855849
event:
856850
exclude:
@@ -928,9 +922,6 @@ steps:
928922
from_secret: docker_password
929923
username:
930924
from_secret: docker_username
931-
environment:
932-
PLUGIN_MIRROR:
933-
from_secret: plugin_mirror
934925
when:
935926
event:
936927
exclude:
@@ -949,9 +940,6 @@ steps:
949940
from_secret: docker_password
950941
username:
951942
from_secret: docker_username
952-
environment:
953-
PLUGIN_MIRROR:
954-
from_secret: plugin_mirror
955943
when:
956944
event:
957945
exclude:
@@ -996,9 +984,6 @@ steps:
996984
from_secret: docker_password
997985
username:
998986
from_secret: docker_username
999-
environment:
1000-
PLUGIN_MIRROR:
1001-
from_secret: plugin_mirror
1002987
when:
1003988
event:
1004989
exclude:
@@ -1017,9 +1002,6 @@ steps:
10171002
from_secret: docker_password
10181003
username:
10191004
from_secret: docker_username
1020-
environment:
1021-
PLUGIN_MIRROR:
1022-
from_secret: plugin_mirror
10231005
when:
10241006
event:
10251007
exclude:

.eslintrc

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ ignorePatterns:
66

77
parserOptions:
88
sourceType: module
9-
ecmaVersion: 2021
9+
ecmaVersion: latest
1010

1111
plugins:
1212
- eslint-plugin-unicorn
@@ -109,7 +109,7 @@ rules:
109109
github/no-implicit-buggy-globals: [0]
110110
github/no-inner-html: [0]
111111
github/no-innerText: [2]
112-
github/no-then: [2]
112+
github/no-then: [0]
113113
github/no-useless-passive: [2]
114114
github/prefer-observers: [0]
115115
github/require-passive-events: [2]
@@ -384,6 +384,7 @@ rules:
384384
unicorn/no-array-instanceof: [0]
385385
unicorn/no-array-method-this-argument: [2]
386386
unicorn/no-array-push-push: [2]
387+
unicorn/no-await-expression-member: [0]
387388
unicorn/no-console-spaces: [0]
388389
unicorn/no-document-cookie: [2]
389390
unicorn/no-empty-file: [2]
@@ -419,6 +420,7 @@ rules:
419420
unicorn/prefer-array-index-of: [2]
420421
unicorn/prefer-array-some: [2]
421422
unicorn/prefer-at: [0]
423+
unicorn/prefer-code-point: [2]
422424
unicorn/prefer-dataset: [2]
423425
unicorn/prefer-date-now: [2]
424426
unicorn/prefer-default-parameters: [0]

.gitattributes

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,4 @@
55
/.eslintrc linguist-language=YAML
66
/.stylelintrc linguist-language=YAML
77
/web_src/fomantic/build/** linguist-generated
8+
Dockerfile.* linguist-language=Dockerfile

CHANGELOG.md

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,37 @@ This changelog goes through all 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.io).
66

7+
## [1.15.7](https://github.com/go-gitea/gitea/releases/tag/v1.15.7) - 2021-12-01
8+
9+
* ENHANCEMENTS
10+
* Only allow webhook to send requests to allowed hosts (#17482) (#17510)
11+
* Fix login redirection links (#17451) (#17473)
12+
* BUGFIXES
13+
* Fix database inconsistent when admin change user email (#17549) (#17840)
14+
* Use correct user on releases (#17806) (#17818)
15+
* Fix commit count in tag view (#17698) (#17790)
16+
* Fix close issue but time watcher still running (#17643) (#17761)
17+
* Fix Migrate Description (#17692) (#17727)
18+
* Fix bug when project board get open issue number (#17703) (#17726)
19+
* Return 400 but not 500 when request archive with wrong format (#17691) (#17700)
20+
* Fix bug when read mysql database max lifetime (#17682) (#17690)
21+
* Fix database deadlock when update issue labels (#17649) (#17665)
22+
* Fix bug on detect issue/comment writer (#17592)
23+
* Remove appSubUrl from pasted images (#17572) (#17588)
24+
* Make `ParsePatch` more robust (#17573) (#17580)
25+
* Fix stats upon searching issues (#17566) (#17578)
26+
* Escape issue titles in comments list (#17555) (#17556)
27+
* Fix zero created time bug on commit api (#17546) (#17547)
28+
* Fix database keyword quote problem on migration v161 (#17522) (#17523)
29+
* Fix email with + when active (#17518) (#17520)
30+
* Stop double encoding blame commit messages (#17498) (#17500)
31+
* Quote the table name in CountOrphanedObjects (#17487) (#17488)
32+
* Run Migrate in Install rather than just SyncTables (#17475) (#17486)
33+
* BUILD
34+
* Fix golangci-lint warnings (#17598 et al) (#17668)
35+
* MISC
36+
* Preserve color when inverting emojis (#17797) (#17799)
37+
738
## [1.15.6](https://github.com/go-gitea/gitea/releases/tag/v1.15.6) - 2021-10-28
839

940
* BUGFIXES

Dockerfile

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,5 @@ CMD ["/bin/s6-svscan", "/etc/s6"]
6666
COPY docker/root /
6767
COPY --from=build-env /go/src/code.gitea.io/gitea/gitea /app/gitea/gitea
6868
COPY --from=build-env /go/src/code.gitea.io/gitea/environment-to-ini /usr/local/bin/environment-to-ini
69-
RUN chmod 755 /usr/bin/entrypoint /app/gitea/gitea /usr/local/bin/environment-to-ini
69+
RUN chmod 755 /usr/bin/entrypoint /app/gitea/gitea /usr/local/bin/gitea /usr/local/bin/environment-to-ini
7070
RUN chmod 755 /etc/s6/gitea/* /etc/s6/openssh/* /etc/s6/.s6-svscan/*
71-
RUN ln -s /app/gitea/gitea /usr/local/bin/gitea

Dockerfile.rootless

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,9 +53,9 @@ RUN mkdir -p /var/lib/gitea /etc/gitea
5353
RUN chown git:git /var/lib/gitea /etc/gitea
5454

5555
COPY docker/rootless /
56-
COPY --from=build-env --chown=root:root /go/src/code.gitea.io/gitea/gitea /usr/local/bin/gitea
56+
COPY --from=build-env --chown=root:root /go/src/code.gitea.io/gitea/gitea /app/gitea/gitea
5757
COPY --from=build-env --chown=root:root /go/src/code.gitea.io/gitea/environment-to-ini /usr/local/bin/environment-to-ini
58-
RUN chmod 755 /usr/local/bin/docker-entrypoint.sh /usr/local/bin/docker-setup.sh /usr/local/bin/gitea /usr/local/bin/environment-to-ini
58+
RUN chmod 755 /usr/local/bin/docker-entrypoint.sh /usr/local/bin/docker-setup.sh /app/gitea/gitea /usr/local/bin/gitea /usr/local/bin/environment-to-ini
5959

6060
#git:git
6161
USER 1000:1000

build/code-batch-process.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -267,10 +267,10 @@ func main() {
267267
logVerbose("batch cmd: %s %v", subCmd, substArgs)
268268
switch subCmd {
269269
case "gitea-fmt":
270-
cmdErrors = append(cmdErrors, passThroughCmd("gofmt", substArgs))
271270
if containsString(subArgs, "-w") {
272271
cmdErrors = append(cmdErrors, giteaFormatGoImports(files))
273272
}
273+
cmdErrors = append(cmdErrors, passThroughCmd("gofmt", substArgs))
274274
case "misspell":
275275
cmdErrors = append(cmdErrors, passThroughCmd("misspell", substArgs))
276276
default:

build/generate-images.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,5 +80,5 @@ async function main() {
8080
]);
8181
}
8282

83-
main().then(exit).catch(exit); // eslint-disable-line github/no-then
83+
main().then(exit).catch(exit);
8484

build/generate-svg.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,5 +54,5 @@ async function main() {
5454
]);
5555
}
5656

57-
main().then(exit).catch(exit); // eslint-disable-line github/no-then
57+
main().then(exit).catch(exit);
5858

cmd/admin.go

Lines changed: 64 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ import (
1414
"text/tabwriter"
1515

1616
"code.gitea.io/gitea/models"
17+
asymkey_model "code.gitea.io/gitea/models/asymkey"
1718
"code.gitea.io/gitea/models/db"
1819
"code.gitea.io/gitea/models/login"
1920
user_model "code.gitea.io/gitea/models/user"
@@ -298,6 +299,36 @@ var (
298299
Name: "skip-local-2fa",
299300
Usage: "Set to true to skip local 2fa for users authenticated by this source",
300301
},
302+
cli.StringSliceFlag{
303+
Name: "scopes",
304+
Value: nil,
305+
Usage: "Scopes to request when to authenticate against this OAuth2 source",
306+
},
307+
cli.StringFlag{
308+
Name: "required-claim-name",
309+
Value: "",
310+
Usage: "Claim name that has to be set to allow users to login with this source",
311+
},
312+
cli.StringFlag{
313+
Name: "required-claim-value",
314+
Value: "",
315+
Usage: "Claim value that has to be set to allow users to login with this source",
316+
},
317+
cli.StringFlag{
318+
Name: "group-claim-name",
319+
Value: "",
320+
Usage: "Claim name providing group names for this source",
321+
},
322+
cli.StringFlag{
323+
Name: "admin-group",
324+
Value: "",
325+
Usage: "Group Claim value for administrator users",
326+
},
327+
cli.StringFlag{
328+
Name: "restricted-group",
329+
Value: "",
330+
Usage: "Group Claim value for restricted users",
331+
},
301332
}
302333

303334
microcmdAuthUpdateOauth = cli.Command{
@@ -348,6 +379,10 @@ func runChangePassword(c *cli.Context) error {
348379
if err := initDB(ctx); err != nil {
349380
return err
350381
}
382+
if len(c.String("password")) < setting.MinPasswordLength {
383+
return fmt.Errorf("Password is not long enough. Needs to be at least %d", setting.MinPasswordLength)
384+
}
385+
351386
if !pwd.IsComplexEnough(c.String("password")) {
352387
return errors.New("Password does not meet complexity requirements")
353388
}
@@ -625,7 +660,7 @@ func runRegenerateKeys(_ *cli.Context) error {
625660
if err := initDB(ctx); err != nil {
626661
return err
627662
}
628-
return models.RewriteAllPublicKeys()
663+
return asymkey_model.RewriteAllPublicKeys()
629664
}
630665

631666
func parseOAuth2Config(c *cli.Context) *oauth2.Source {
@@ -648,6 +683,12 @@ func parseOAuth2Config(c *cli.Context) *oauth2.Source {
648683
CustomURLMapping: customURLMapping,
649684
IconURL: c.String("icon-url"),
650685
SkipLocalTwoFA: c.Bool("skip-local-2fa"),
686+
Scopes: c.StringSlice("scopes"),
687+
RequiredClaimName: c.String("required-claim-name"),
688+
RequiredClaimValue: c.String("required-claim-value"),
689+
GroupClaimName: c.String("group-claim-name"),
690+
AdminGroup: c.String("admin-group"),
691+
RestrictedGroup: c.String("restricted-group"),
651692
}
652693
}
653694

@@ -710,6 +751,28 @@ func runUpdateOauth(c *cli.Context) error {
710751
oAuth2Config.IconURL = c.String("icon-url")
711752
}
712753

754+
if c.IsSet("scopes") {
755+
oAuth2Config.Scopes = c.StringSlice("scopes")
756+
}
757+
758+
if c.IsSet("required-claim-name") {
759+
oAuth2Config.RequiredClaimName = c.String("required-claim-name")
760+
761+
}
762+
if c.IsSet("required-claim-value") {
763+
oAuth2Config.RequiredClaimValue = c.String("required-claim-value")
764+
}
765+
766+
if c.IsSet("group-claim-name") {
767+
oAuth2Config.GroupClaimName = c.String("group-claim-name")
768+
}
769+
if c.IsSet("admin-group") {
770+
oAuth2Config.AdminGroup = c.String("admin-group")
771+
}
772+
if c.IsSet("restricted-group") {
773+
oAuth2Config.RestrictedGroup = c.String("restricted-group")
774+
}
775+
713776
// update custom URL mapping
714777
var customURLMapping = &oauth2.CustomURLMapping{}
715778

0 commit comments

Comments
 (0)