Skip to content

Commit d3d1b45

Browse files
authored
Merge branch 'main' into bugfix/zeripath_metacommit_merging
2 parents 8e44c6e + b7c6ec9 commit d3d1b45

File tree

46 files changed

+10463
-7593
lines changed

Some content is hidden

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

46 files changed

+10463
-7593
lines changed

.spectral.yaml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
extends: [[spectral:oas, all]]
2+
3+
rules:
4+
info-contact: off
5+
oas2-api-host: off
6+
oas2-parameter-description: off
7+
oas2-schema: off
8+
oas2-valid-schema-example: off
9+
openapi-tags: off
10+
operation-description: off
11+
operation-singular-tag: off
12+
operation-tag-defined: off

CHANGELOG.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,15 @@ 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.16.9](https://github.com/go-gitea/gitea/releases/tag/v1.16.9) - 2022-06-21
7+
## [1.16.9](https://github.com/go-gitea/gitea/releases/tag/v1.16.9) - 2022-07-12
88

9+
* SECURITY
10+
* Add write check for creating Commit status (#20332) (#20334)
11+
* Check for permission when fetching user controlled issues (#20133) (#20196)
912
* BUGFIXES
13+
* Hide notify mail setting ui if not enabled (#20138) (#20337)
14+
* Add write check for creating Commit status (#20332) (#20334)
15+
* Only show Followers that current user can access (#20220) (#20253)
1016
* Release page show all tags in compare dropdown (#20070) (#20071)
1117
* Fix permission check for delete tag (#19985) (#20001)
1218
* Only log non ErrNotExist errors in git.GetNote (#19884) (#19905)

Dockerfile.rootless

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ ENV GITEA_CUSTOM /var/lib/gitea/custom
6262
ENV GITEA_TEMP /tmp/gitea
6363
ENV TMPDIR /tmp/gitea
6464

65-
#TODO add to docs the ability to define the ini to load (usefull to test and revert a config)
65+
#TODO add to docs the ability to define the ini to load (useful to test and revert a config)
6666
ENV GITEA_APP_INI /etc/gitea/app.ini
6767
ENV HOME "/var/lib/gitea/git"
6868
VOLUME ["/var/lib/gitea", "/etc/gitea"]

Makefile

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -312,6 +312,7 @@ lint: lint-frontend lint-backend
312312
lint-frontend: node_modules
313313
npx eslint --color --max-warnings=0 web_src/js build templates *.config.js docs/assets/js
314314
npx stylelint --color --max-warnings=0 web_src/less
315+
npx spectral lint -q -F hint $(SWAGGER_SPEC)
315316

316317
.PHONY: lint-backend
317318
lint-backend: golangci-lint vet editorconfig-checker
@@ -770,7 +771,7 @@ generate-manpage:
770771
@mkdir -p man/man1/ man/man5
771772
@./gitea docs --man > man/man1/gitea.1
772773
@gzip -9 man/man1/gitea.1 && echo man/man1/gitea.1.gz created
773-
@#TODO A smal script witch format config-cheat-sheet.en-us.md nicely to suit as config man page
774+
@#TODO A small script that formats config-cheat-sheet.en-us.md nicely for use as a config man page
774775

775776
.PHONY: pr\#%
776777
pr\#%: clean-all

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ NOTES:
102102

103103
Translations are done through Crowdin. If you want to translate to a new language ask one of the managers in the Crowdin project to add a new language there.
104104

105-
You can also just create an issue for adding a language or ask on discord on the #translation channel. If you need context or find some translation issues, you can leave a comment on the string or ask on Discord. For general translation questions there is a section in the docs. Currently a bit empty but we hope fo fill it as questions pop up.
105+
You can also just create an issue for adding a language or ask on discord on the #translation channel. If you need context or find some translation issues, you can leave a comment on the string or ask on Discord. For general translation questions there is a section in the docs. Currently a bit empty but we hope to fill it as questions pop up.
106106

107107
https://docs.gitea.io/en-us/translation-guidelines/
108108

cmd/manager.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ var (
8282
},
8383
cli.BoolFlag{
8484
Name: "no-system",
85-
Usage: "Do not show system proceses",
85+
Usage: "Do not show system processes",
8686
},
8787
cli.BoolFlag{
8888
Name: "stacktraces",

custom/conf/app.example.ini

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2232,6 +2232,7 @@ ROUTER = console
22322232
;BLOCKED_DOMAINS =
22332233
;;
22342234
;; Allow private addresses defined by RFC 1918, RFC 1122, RFC 4632 and RFC 4291 (false by default)
2235+
;; If a domain is allowed by ALLOWED_DOMAINS, this option will be ignored.
22352236
;ALLOW_LOCALNETWORKS = false
22362237

22372238
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1083,7 +1083,7 @@ Task queue configuration has been moved to `queue.task`. However, the below conf
10831083
- `RETRY_BACKOFF`: **3**: Backoff time per http/https request retry (seconds)
10841084
- `ALLOWED_DOMAINS`: **\<empty\>**: Domains allowlist for migrating repositories, default is blank. It means everything will be allowed. Multiple domains could be separated by commas. Wildcard is supported: `github.com, *.github.com`.
10851085
- `BLOCKED_DOMAINS`: **\<empty\>**: Domains blocklist for migrating repositories, default is blank. Multiple domains could be separated by commas. When `ALLOWED_DOMAINS` is not blank, this option has a higher priority to deny domains. Wildcard is supported.
1086-
- `ALLOW_LOCALNETWORKS`: **false**: Allow private addresses defined by RFC 1918, RFC 1122, RFC 4632 and RFC 4291
1086+
- `ALLOW_LOCALNETWORKS`: **false**: Allow private addresses defined by RFC 1918, RFC 1122, RFC 4632 and RFC 4291. If a domain is allowed by `ALLOWED_DOMAINS`, this option will be ignored.
10871087
- `SKIP_TLS_VERIFY`: **false**: Allow skip tls verify
10881088

10891089
## Federation (`federation`)

docs/content/doc/advanced/config-cheat-sheet.zh-cn.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -346,7 +346,7 @@ ALLOW_DATA_URI_IMAGES = true
346346
- `ALLOW_DATA_URI_IMAGES`: **false** 允许 data uri 图片 (`<img src="data:image/png;base64,..."/>`)。
347347

348348
多个净化规则可以被同时定义,只要section名称最后一位不重复即可。如: `[markup.sanitizer.TeX-2]`
349-
为了针对一种渲染类型进行一个特殊的净化策略,必须使用形如 `[markup.sanitizer.asciidoc.rule-1]` 的方式来命名 seciton
349+
为了针对一种渲染类型进行一个特殊的净化策略,必须使用形如 `[markup.sanitizer.asciidoc.rule-1]` 的方式来命名 section
350350
如果此规则没有匹配到任何渲染类型,它将会被应用到所有的渲染类型。
351351

352352
## Time (`time`)

docs/content/doc/advanced/customizing-gitea.en-us.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,7 @@ You can display STL file directly in Gitea by adding:
202202

203203
to the file `templates/custom/footer.tmpl`
204204

205-
You also need to download the content of the library [Madeleine.js](https://jinjunho.github.io/Madeleine.js/) and place it under `$GITEA_CUSTOM/public/` folder.
205+
You also need to download the content of the library [Madeleine.js](https://github.com/beige90/Madeleine.js) and place it under `$GITEA_CUSTOM/public/` folder.
206206

207207
You should end-up with a folder structure similar to:
208208

docs/content/doc/packages/nuget.en-us.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ Publish [NuGet](https://www.nuget.org/) packages for your user or organization.
2323
## Requirements
2424

2525
To work with the NuGet package registry, you can use command-line interface tools as well as NuGet features in various IDEs like Visual Studio.
26-
More informations about NuGet clients can be found in [the official documentation](https://docs.microsoft.com/en-us/nuget/install-nuget-client-tools).
26+
More information about NuGet clients can be found in [the official documentation](https://docs.microsoft.com/en-us/nuget/install-nuget-client-tools).
2727
The following examples use the `dotnet nuget` tool.
2828

2929
## Configuring the package registry

integrations/dump_restore_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -201,7 +201,7 @@ func (c *compareDump) assertEquals(repoBefore, repoAfter *repo_model.Repository)
201201
"Assignees": {ignore: true}, // not implemented yet
202202
"Head": {nested: comparePullRequestBranch},
203203
"Base": {nested: comparePullRequestBranch},
204-
"Labels": {ignore: true}, // because org labels are not handled propery
204+
"Labels": {ignore: true}, // because org labels are not handled properly
205205
}).([]*base.PullRequest)
206206
assert.True(c.t, ok)
207207
assert.GreaterOrEqual(c.t, len(prs), 1)

models/db/context.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ func TxContext() (*Context, Committer, error) {
100100
}
101101

102102
// WithTx represents executing database operations on a transaction
103-
// you can optionally change the context to a parrent one
103+
// you can optionally change the context to a parent one
104104
func WithTx(f func(ctx context.Context) error, stdCtx ...context.Context) error {
105105
parentCtx := DefaultContext
106106
if len(stdCtx) != 0 && stdCtx[0] != nil {

models/issues/pull_list.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ func GetUnmergedPullRequestsByHeadInfo(repoID int64, branch string) ([]*PullRequ
6262
Find(&prs)
6363
}
6464

65-
// CanMaintainerWriteToBranch check whether user is a matainer and could write to the branch
65+
// CanMaintainerWriteToBranch check whether user is a maintainer and could write to the branch
6666
func CanMaintainerWriteToBranch(p access_model.Permission, branch string, user *user_model.User) bool {
6767
if p.CanWrite(unit.TypeCode) {
6868
return true

models/organization/team_repo.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ func GetTeamRepositories(ctx context.Context, opts *SearchTeamRepoOptions) ([]*r
5555
Find(&repos)
5656
}
5757

58-
// AddTeamRepo addes a repo for an organization's team
58+
// AddTeamRepo adds a repo for an organization's team
5959
func AddTeamRepo(ctx context.Context, orgID, teamID, repoID int64) error {
6060
_, err := db.GetEngine(ctx).Insert(&TeamRepo{
6161
OrgID: orgID,

modules/charset/charset.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ import (
2323
// UTF8BOM is the utf-8 byte-order marker
2424
var UTF8BOM = []byte{'\xef', '\xbb', '\xbf'}
2525

26-
// ToUTF8WithFallbackReader detects the encoding of content and coverts to UTF-8 reader if possible
26+
// ToUTF8WithFallbackReader detects the encoding of content and converts to UTF-8 reader if possible
2727
func ToUTF8WithFallbackReader(rd io.Reader) io.Reader {
2828
buf := make([]byte, 2048)
2929
n, err := util.ReadAtMost(rd, buf)
@@ -76,7 +76,7 @@ func ToUTF8WithErr(content []byte) (string, error) {
7676
return string(result), err
7777
}
7878

79-
// ToUTF8WithFallback detects the encoding of content and coverts to UTF-8 if possible
79+
// ToUTF8WithFallback detects the encoding of content and converts to UTF-8 if possible
8080
func ToUTF8WithFallback(content []byte) []byte {
8181
bs, _ := io.ReadAll(ToUTF8WithFallbackReader(bytes.NewReader(content)))
8282
return bs
@@ -191,7 +191,7 @@ func DetectEncoding(content []byte) (string, error) {
191191
break
192192
}
193193

194-
// Otherwise check if this results is earlier in the DetectedCharsetOrder than our current top guesss
194+
// Otherwise check if this results is earlier in the DetectedCharsetOrder than our current top guess
195195
resultPriority, resultHas := setting.Repository.DetectedCharsetScore[strings.ToLower(strings.TrimSpace(result.Charset))]
196196
if resultHas && (!has || resultPriority < priority) {
197197
topResult = result

modules/doctor/breaking.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,8 @@ func iterateUserAccounts(ctx context.Context, each func(*user.User) error) error
3232
// Ref: https://github.com/go-gitea/gitea/pull/19085 & https://github.com/go-gitea/gitea/pull/17688
3333
func checkUserEmail(ctx context.Context, logger log.Logger, _ bool) error {
3434
// We could use quirky SQL to get all users that start without a [a-zA-Z0-9], but that would mean
35-
// DB provider-specific SQL and only works _now_. So instead we iterate trough all user accounts and
36-
// use the user.ValidateEmail function to be future-proof.
35+
// DB provider-specific SQL and only works _now_. So instead we iterate through all user accounts
36+
// and use the user.ValidateEmail function to be future-proof.
3737
var invalidUserCount int64
3838
if err := iterateUserAccounts(ctx, func(u *user.User) error {
3939
// Only check for users, skip

modules/hostmatcher/hostmatcher.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -125,14 +125,14 @@ func (hl *HostMatchList) checkIP(ip net.IP) bool {
125125

126126
// MatchHostName checks if the host matches an allow/deny(block) list
127127
func (hl *HostMatchList) MatchHostName(host string) bool {
128+
if hl == nil {
129+
return false
130+
}
131+
128132
hostname, _, err := net.SplitHostPort(host)
129133
if err != nil {
130134
hostname = host
131135
}
132-
133-
if hl == nil {
134-
return false
135-
}
136136
if hl.checkPattern(hostname) {
137137
return true
138138
}

modules/nosql/manager_leveldb.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ func (m *Manager) getLevelDB(connection string) (*leveldb.DB, error) {
103103
db, ok = m.LevelDBConnections[dataDir]
104104
if ok {
105105
db.count++
106-
log.Warn("Duplicate connnection to level db: %s with different connection strings. Initial connection: %s. This connection: %s", dataDir, db.name[0], connection)
106+
log.Warn("Duplicate connection to level db: %s with different connection strings. Initial connection: %s. This connection: %s", dataDir, db.name[0], connection)
107107
db.name = append(db.name, connection)
108108
m.LevelDBConnections[connection] = db
109109
return db.db, nil

modules/setting/database.go

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -156,6 +156,12 @@ func parsePostgreSQLHostPort(info string) (string, string) {
156156
} else if len(info) > 0 {
157157
host = info
158158
}
159+
if host == "" {
160+
host = "127.0.0.1"
161+
}
162+
if port == "" {
163+
port = "5432"
164+
}
159165
return host, port
160166
}
161167

@@ -173,6 +179,7 @@ func getPostgreSQLConnectionString(dbHost, dbUser, dbPasswd, dbName, dbParam, db
173179

174180
// ParseMSSQLHostPort splits the host into host and port
175181
func ParseMSSQLHostPort(info string) (string, string) {
182+
// the default port "0" might be related to MSSQL's dynamic port, maybe it should be double-confirmed in the future
176183
host, port := "127.0.0.1", "0"
177184
if strings.Contains(info, ":") {
178185
host = strings.Split(info, ":")[0]
@@ -183,5 +190,11 @@ func ParseMSSQLHostPort(info string) (string, string) {
183190
} else if len(info) > 0 {
184191
host = info
185192
}
193+
if host == "" {
194+
host = "127.0.0.1"
195+
}
196+
if port == "" {
197+
port = "0"
198+
}
186199
return host, port
187200
}

modules/web/middleware/locale.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ func SetLocaleCookie(resp http.ResponseWriter, lang string, expiry int) {
6060
}
6161

6262
// DeleteLocaleCookie convenience function to delete the locale cookie consistently
63-
// Setting the lang cookie will trigger the middleware to reset the language ot previous state.
63+
// Setting the lang cookie will trigger the middleware to reset the language to previous state.
6464
func DeleteLocaleCookie(resp http.ResponseWriter) {
6565
SetCookie(resp, "lang", "",
6666
-1,

modules/web/routing/context.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ func UpdateFuncInfo(ctx context.Context, funcInfo *FuncInfo) {
2525
record.lock.Unlock()
2626
}
2727

28-
// MarkLongPolling marks the reuqest is a long-polling request, and the logger may output different message for it
28+
// MarkLongPolling marks the request is a long-polling request, and the logger may output different message for it
2929
func MarkLongPolling(resp http.ResponseWriter, req *http.Request) {
3030
record, ok := req.Context().Value(contextKey).(*requestRecord)
3131
if !ok {

options/gitignore/Bazel

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
/bazel-*
77

88
# Directories for the Bazel IntelliJ plugin containing the generated
9-
# IntelliJ project files and plugin configuration. Seperate directories are
9+
# IntelliJ project files and plugin configuration. Separate directories are
1010
# for the IntelliJ, Android Studio and CLion versions of the plugin.
1111
/.ijwb/
1212
/.aswb/

options/locale/locale_en-US.ini

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -932,7 +932,7 @@ form.name_pattern_not_allowed = The pattern '%s' is not allowed in a repository
932932
need_auth = Authorization
933933
migrate_options = Migration Options
934934
migrate_service = Migration Service
935-
migrate_options_mirror_helper = This repository will be a <span class="text blue">mirror</span>
935+
migrate_options_mirror_helper = This repository will be a mirror
936936
migrate_options_lfs = Migrate LFS files
937937
migrate_options_lfs_endpoint.label = LFS Endpoint
938938
migrate_options_lfs_endpoint.description = Migration will attempt to use your Git remote to <a target="_blank" rel="noopener noreferrer" href="%s">determine the LFS server</a>. You can also specify a custom endpoint if the repository LFS data is stored somewhere else.

options/locale/locale_zh-CN.ini

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -861,7 +861,9 @@ default_branch=默认分支
861861
default_branch_helper=默认分支是用于合并请求和代码提交的基础分支。
862862
mirror_prune=修剪
863863
mirror_prune_desc=删除过时的远程跟踪引用
864+
mirror_interval=镜像间隔 (有效的时间单位是 'h', 'm', 's')。0 禁用自动定期同步 (最短间隔: %s)
864865
mirror_interval_invalid=镜像间隔无效。
866+
mirror_sync_on_commit=推送提交时同步
865867
mirror_address=从URL克隆
866868
mirror_address_desc=在授权框中输入必要的凭据。
867869
mirror_address_url_invalid=URL无效。请检查您所输入的URL是否正确。
@@ -1301,6 +1303,7 @@ issues.previous=上一页
13011303
issues.next=下一页
13021304
issues.open_title=开启中
13031305
issues.closed_title=已关闭
1306+
issues.draft_title=草稿
13041307
issues.num_comments=%d 条评论
13051308
issues.commented_at=`评论于 <a href="#%s">%s</a>`
13061309
issues.delete_comment_confirm=您确定要删除该条评论吗?

0 commit comments

Comments
 (0)