Skip to content

Commit 69a3e81

Browse files
authored
Merge branch 'main' into cache-last-commit-data-as-found
2 parents b8693a4 + d9ef43a commit 69a3e81

File tree

109 files changed

+6956
-696
lines changed

Some content is hidden

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

109 files changed

+6956
-696
lines changed

.drone.yml

+7-7
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,12 @@ trigger:
1515
steps:
1616
- name: deps-frontend
1717
pull: always
18-
image: node:14
18+
image: node:16
1919
commands:
2020
- make node_modules
2121

2222
- name: lint-frontend
23-
image: node:14
23+
image: node:16
2424
commands:
2525
- make lint-frontend
2626
depends_on: [deps-frontend]
@@ -58,7 +58,7 @@ steps:
5858
TAGS: bindata gogit sqlite sqlite_unlock_notify
5959

6060
- name: checks-frontend
61-
image: node:14
61+
image: node:16
6262
commands:
6363
- make checks-frontend
6464
depends_on: [deps-frontend]
@@ -71,13 +71,13 @@ steps:
7171
depends_on: [lint-backend]
7272

7373
- name: test-frontend
74-
image: node:14
74+
image: node:16
7575
commands:
7676
- make test-frontend
7777
depends_on: [lint-frontend]
7878

7979
- name: build-frontend
80-
image: node:14
80+
image: node:16
8181
commands:
8282
- make frontend
8383
depends_on: [test-frontend]
@@ -514,7 +514,7 @@ steps:
514514
pull: always
515515
image: techknowlogick/xgo:go-1.16.x
516516
commands:
517-
- curl -sL https://deb.nodesource.com/setup_14.x | bash - && apt-get install -y nodejs
517+
- curl -sL https://deb.nodesource.com/setup_16.x | bash - && apt-get install -y nodejs
518518
- export PATH=$PATH:$GOPATH/bin
519519
- make release
520520
environment:
@@ -610,7 +610,7 @@ steps:
610610
pull: always
611611
image: techknowlogick/xgo:go-1.16.x
612612
commands:
613-
- curl -sL https://deb.nodesource.com/setup_14.x | bash - && apt-get install -y nodejs
613+
- curl -sL https://deb.nodesource.com/setup_16.x | bash - && apt-get install -y nodejs
614614
- export PATH=$PATH:$GOPATH/bin
615615
- make release
616616
environment:

.eslintrc

+1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ root: true
22
reportUnusedDisableDirectives: true
33

44
ignorePatterns:
5+
- /web_src/js/vendor
56
- /templates/base/head.tmpl
67
- /templates/repo/activity.tmpl
78
- /templates/repo/view_file.tmpl

CHANGELOG.md

+41
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.0-rc3](https://github.com/go-gitea/gitea/releases/tag/v1.15.0-rc3) - 2021-08-06
8+
9+
* BREAKING
10+
* Upgrade to the latest version of golang-jwt and increase minimum go to 1.15 (#16590) (#16606)
11+
* SECURITY
12+
* Upgrade to the latest version of golang-jwt and increase minimum go to 1.15 (#16590) (#16606)
13+
* Correctly create of git-daemon-export-ok files (#16508) (#16514)
14+
* Don't show private user's repo in explore view (#16550) (#16554)
15+
* Update node tar dependency to 6.1.6 (#16622) (#16623)
16+
* API
17+
* Swagger AccessToken fixes (#16574) (#16597)
18+
* Set AllowedHeaders on API CORS handler (#16524) (#16618)
19+
* BUGFIXES
20+
* Restore Accessibility for Dropdown (#16576) (#16617)
21+
* Pass down SignedUserName down to AccessLogger context (#16605) (#16616)
22+
* Fix table alignment in markdown (#16596) (#16602)
23+
* Fix 500 on first wiki page (#16586) (#16598)
24+
* Lock goth/gothic and Re-attempt OAuth2 registration on login if registration failed at startup (#16564) (#16570)
25+
* Upgrade levelqueue to v0.4.0 (#16560) (#16561)
26+
* Handle too long PR titles correctly (#16517) (#16549)
27+
* Fix data race in bleve indexer (#16474) (#16509)
28+
* Restore CORS on git smart http protocol (#16496) (#16506)
29+
* Fix race in log (#16490) (#16505)
30+
* Fix prepareWikiFileName to respect existing unescaped files (#16487) (#16498)
31+
* Make cancel from CatFileBatch and CatFileBatchCheck wait for the command to end (#16479) (#16480)
32+
* Update notification table with only latest data (#16445) (#16469)
33+
* Revert to use alpine 3.13 (#16451) (#16452)
34+
* Fix crash following ldap authentication update (#16447) (#16448)
35+
* Fix direct creation of external users on admin page (partial #16612) (#16613)
36+
* Prevent 500 on draft releases without tag (#16634) (#16636)
37+
738
## [1.15.0-rc2](https://github.com/go-gitea/gitea/releases/tag/v1.15.0-rc2) - 2021-07-22
839

940
* BUGFIXES
@@ -229,6 +260,16 @@ been added to each release, please refer to the [blog](https://blog.gitea.io).
229260
* Remove utf8 option from installation page (#16126)
230261
* Use Wants= over Requires= in systemd file (#15897)
231262

263+
## [1.14.6](https://github.com/go-gitea/gitea/releases/tag/v1.14.6) - 2021-08-04
264+
265+
* SECURITY
266+
* Bump github.com/markbates/goth from v1.67.1 to v1.68.0 (#16538) (#16540)
267+
* Switch to maintained JWT lib (#16532) (#16535)
268+
* Upgrade to latest version of golang-jwt (as forked for 1.14) (#16590) (#16607)
269+
* BUGFIXES
270+
* Add basic edit ldap auth test & actually fix #16252 (#16465) (#16495)
271+
* Make cancel from CatFileBatch and CatFileBatchCheck wait for the command to end (#16479) (#16481)
272+
232273
## [1.14.5](https://github.com/go-gitea/gitea/releases/tag/v1.14.5) - 2021-07-16
233274

234275
* SECURITY

Makefile

+1
Original file line numberDiff line numberDiff line change
@@ -699,6 +699,7 @@ fomantic:
699699
cd $(FOMANTIC_WORK_DIR) && npm install --no-save
700700
cp -f $(FOMANTIC_WORK_DIR)/theme.config.less $(FOMANTIC_WORK_DIR)/node_modules/fomantic-ui/src/theme.config
701701
cp -rf $(FOMANTIC_WORK_DIR)/_site $(FOMANTIC_WORK_DIR)/node_modules/fomantic-ui/src/
702+
cp -f web_src/js/vendor/dropdown.js $(FOMANTIC_WORK_DIR)/node_modules/fomantic-ui/src/definitions/modules
702703
cd $(FOMANTIC_WORK_DIR) && npx gulp -f node_modules/fomantic-ui/gulpfile.js build
703704

704705
.PHONY: webpack

custom/conf/app.example.ini

+3
Original file line numberDiff line numberDiff line change
@@ -993,6 +993,9 @@ PATH =
993993
;;
994994
;; allow request with credentials
995995
;ALLOW_CREDENTIALS = false
996+
;;
997+
;; set X-FRAME-OPTIONS header
998+
;X_FRAME_OPTIONS = SAMEORIGIN
996999

9971000
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
9981001
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

docs/config.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ params:
1818
description: Git with a cup of tea
1919
author: The Gitea Authors
2020
website: https://docs.gitea.io
21-
version: 1.14.5
21+
version: 1.14.6
2222
minGoVersion: 1.16
2323
goVersion: 1.16
2424
minNodeVersion: 12.17

docs/content/doc/advanced/config-cheat-sheet.en-us.md

+1
Original file line numberDiff line numberDiff line change
@@ -162,6 +162,7 @@ The following configuration set `Content-Type: application/vnd.android.package-a
162162
- `METHODS`: **GET,HEAD,POST,PUT,PATCH,DELETE,OPTIONS**: list of methods allowed to request
163163
- `MAX_AGE`: **10m**: max time to cache response
164164
- `ALLOW_CREDENTIALS`: **false**: allow request with credentials
165+
- `X_FRAME_OPTIONS`: **SAMEORIGIN**: Set the `X-Frame-Options` header value.
165166

166167
## UI (`ui`)
167168

docs/content/doc/features/authentication.en-us.md

+2
Original file line numberDiff line numberDiff line change
@@ -170,6 +170,8 @@ To configure PAM, set the 'PAM Service Name' to a filename in `/etc/pam.d/`. To
170170
work with normal Linux passwords, the user running Gitea must have read access
171171
to `/etc/shadow`.
172172

173+
**Note**: PAM support is added via [build-time flags](https://docs.gitea.io/en-us/install-from-source/#build), and the official binaries provided do not have this enabled.
174+
173175
## SMTP (Simple Mail Transfer Protocol)
174176

175177
This option allows Gitea to log in to an SMTP host as a Gitea user. To

go.sum

+1
Original file line numberDiff line numberDiff line change
@@ -762,6 +762,7 @@ github.com/mailru/easyjson v0.7.1/go.mod h1:KAzv3t3aY1NaHWoQz1+4F1ccyAH66Jk7yos7
762762
github.com/mailru/easyjson v0.7.6/go.mod h1:xzfreul335JAWq5oZzymOObrkdz5UnU4kGfJJLY9Nlc=
763763
github.com/mailru/easyjson v0.7.7 h1:UGYAvKxe3sBsEDzO8ZeWOSlIQfWFlxbzLZe7hwFURr0=
764764
github.com/mailru/easyjson v0.7.7/go.mod h1:xzfreul335JAWq5oZzymOObrkdz5UnU4kGfJJLY9Nlc=
765+
github.com/markbates/going v1.0.0 h1:DQw0ZP7NbNlFGcKbcE/IVSOAFzScxRtLpd0rLMzLhq0=
765766
github.com/markbates/going v1.0.0/go.mod h1:I6mnB4BPnEeqo85ynXIx1ZFLLbtiLHNXVgWeFO9OGOA=
766767
github.com/markbates/goth v1.68.0 h1:90sKvjRAKHcl9V2uC9x/PJXeD78cFPiBsyP1xVhoQfA=
767768
github.com/markbates/goth v1.68.0/go.mod h1:V2VcDMzDiMHW+YmqYl7i0cMiAUeCkAe4QE6jRKBhXZw=

models/commit.go

+20
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
// Copyright 2021 Gitea. All rights reserved.
2+
// Use of this source code is governed by a MIT-style
3+
// license that can be found in the LICENSE file.
4+
5+
package models
6+
7+
import (
8+
"code.gitea.io/gitea/modules/git"
9+
)
10+
11+
// ConvertFromGitCommit converts git commits into SignCommitWithStatuses
12+
func ConvertFromGitCommit(commits []*git.Commit, repo *Repository) []*SignCommitWithStatuses {
13+
return ParseCommitsWithStatus(
14+
ParseCommitsWithSignature(
15+
ValidateCommitsWithEmails(commits),
16+
repo,
17+
),
18+
repo,
19+
)
20+
}

models/commit_status.go

+7-13
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
package models
66

77
import (
8-
"container/list"
98
"crypto/sha1"
109
"fmt"
1110
"strings"
@@ -257,16 +256,12 @@ type SignCommitWithStatuses struct {
257256
}
258257

259258
// ParseCommitsWithStatus checks commits latest statuses and calculates its worst status state
260-
func ParseCommitsWithStatus(oldCommits *list.List, repo *Repository) *list.List {
261-
var (
262-
newCommits = list.New()
263-
e = oldCommits.Front()
264-
)
265-
266-
for e != nil {
267-
c := e.Value.(SignCommit)
268-
commit := SignCommitWithStatuses{
269-
SignCommit: &c,
259+
func ParseCommitsWithStatus(oldCommits []*SignCommit, repo *Repository) []*SignCommitWithStatuses {
260+
newCommits := make([]*SignCommitWithStatuses, 0, len(oldCommits))
261+
262+
for _, c := range oldCommits {
263+
commit := &SignCommitWithStatuses{
264+
SignCommit: c,
270265
}
271266
statuses, err := GetLatestCommitStatus(repo.ID, commit.ID.String(), ListOptions{})
272267
if err != nil {
@@ -276,8 +271,7 @@ func ParseCommitsWithStatus(oldCommits *list.List, repo *Repository) *list.List
276271
commit.Status = CalcCommitStatus(statuses)
277272
}
278273

279-
newCommits.PushBack(commit)
280-
e = e.Next()
274+
newCommits = append(newCommits, commit)
281275
}
282276
return newCommits
283277
}

models/gpg_key_commit_verification.go

+6-12
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
package models
66

77
import (
8-
"container/list"
98
"fmt"
109
"hash"
1110
"strings"
@@ -68,24 +67,19 @@ const (
6867
)
6968

7069
// ParseCommitsWithSignature checks if signaute of commits are corresponding to users gpg keys.
71-
func ParseCommitsWithSignature(oldCommits *list.List, repository *Repository) *list.List {
72-
var (
73-
newCommits = list.New()
74-
e = oldCommits.Front()
75-
)
70+
func ParseCommitsWithSignature(oldCommits []*UserCommit, repository *Repository) []*SignCommit {
71+
newCommits := make([]*SignCommit, 0, len(oldCommits))
7672
keyMap := map[string]bool{}
7773

78-
for e != nil {
79-
c := e.Value.(UserCommit)
80-
signCommit := SignCommit{
81-
UserCommit: &c,
74+
for _, c := range oldCommits {
75+
signCommit := &SignCommit{
76+
UserCommit: c,
8277
Verification: ParseCommitWithSignature(c.Commit),
8378
}
8479

8580
_ = CalculateTrustStatus(signCommit.Verification, repository, &keyMap)
8681

87-
newCommits.PushBack(signCommit)
88-
e = e.Next()
82+
newCommits = append(newCommits, signCommit)
8983
}
9084
return newCommits
9185
}

0 commit comments

Comments
 (0)