Skip to content

Commit 41dae97

Browse files
authored
Merge branch 'main' into reattempt-a11y-fixes
2 parents 42ceef7 + 35735bb commit 41dae97

File tree

27 files changed

+284
-100
lines changed

27 files changed

+284
-100
lines changed

.drone.yml

Lines changed: 8 additions & 8 deletions
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:16
18+
image: node:14
1919
commands:
2020
- make node_modules
2121

2222
- name: lint-frontend
23-
image: node:16
23+
image: node:14
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:16
61+
image: node:14
6262
commands:
6363
- make checks-frontend
6464
depends_on: [deps-frontend]
@@ -71,20 +71,20 @@ steps:
7171
depends_on: [lint-backend]
7272

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

7979
- name: build-frontend
80-
image: node:16
80+
image: node:14
8181
commands:
8282
- make frontend
8383
depends_on: [test-frontend]
8484

8585
- name: build-backend-no-gcc
8686
pull: always
87-
image: golang:1.14 # this step is kept as the lowest version of golang that we support
87+
image: golang:1.16 # this step is kept as the lowest version of golang that we support
8888
environment:
8989
GO111MODULE: on
9090
GOPROXY: off
@@ -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_16.x | bash - && apt-get install -y nodejs
517+
- curl -sL https://deb.nodesource.com/setup_14.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_16.x | bash - && apt-get install -y nodejs
613+
- curl -sL https://deb.nodesource.com/setup_14.x | bash - && apt-get install -y nodejs
614614
- export PATH=$PATH:$GOPATH/bin
615615
- make release
616616
environment:

Makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ HAS_GO = $(shell hash $(GO) > /dev/null 2>&1 && echo "GO" || echo "NOGO" )
2525
COMMA := ,
2626

2727
XGO_VERSION := go-1.16.x
28-
MIN_GO_VERSION := 001014000
28+
MIN_GO_VERSION := 001016000
2929
MIN_NODE_VERSION := 012017000
3030

3131
DOCKER_IMAGE ?= gitea/gitea
@@ -200,7 +200,7 @@ help:
200200
go-check:
201201
$(eval GO_VERSION := $(shell printf "%03d%03d%03d" $(shell $(GO) version | grep -Eo '[0-9]+\.[0-9.]+' | tr '.' ' ');))
202202
@if [ "$(GO_VERSION)" -lt "$(MIN_GO_VERSION)" ]; then \
203-
echo "Gitea requires Go 1.14 or greater to build. You can get it at https://golang.org/dl/"; \
203+
echo "Gitea requires Go 1.16 or greater to build. You can get it at https://golang.org/dl/"; \
204204
exit 1; \
205205
fi
206206

docs/config.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ params:
1919
author: The Gitea Authors
2020
website: https://docs.gitea.io
2121
version: 1.14.5
22-
minGoVersion: 1.14
22+
minGoVersion: 1.16
2323
goVersion: 1.16
2424
minNodeVersion: 12.17
2525

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -300,7 +300,7 @@ The following configuration set `Content-Type: application/vnd.android.package-a
300300
- `LANDING_PAGE`: **home**: Landing page for unauthenticated users \[home, explore, organizations, login\].
301301

302302
- `LFS_START_SERVER`: **false**: Enables git-lfs support.
303-
- `LFS_CONTENT_PATH`: **%(APP_DATA_PATH)/lfs**: DEPRECATED: Default LFS content path. (if it is on local storage.)
303+
- `LFS_CONTENT_PATH`: **%(APP_DATA_PATH)/lfs**: Default LFS content path. (if it is on local storage.) **DEPRECATED** use settings in `[lfs]`.
304304
- `LFS_JWT_SECRET`: **\<empty\>**: LFS authentication secret, change this a unique string.
305305
- `LFS_HTTP_AUTH_EXPIRY`: **20m**: LFS authentication validity period in time.Duration, pushes taking longer than this may fail.
306306
- `LFS_MAX_FILE_SIZE`: **0**: Maximum allowed LFS file size in bytes (Set to 0 for no limit).

go.mod

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ require (
5050
github.com/gogs/chardet v0.0.0-20191104214054-4b6791f73a28
5151
github.com/gogs/cron v0.0.0-20171120032916-9f6c956d3e14
5252
github.com/gogs/go-gogs-client v0.0.0-20210131175652-1d7215cd8d85
53-
github.com/golang-jwt/jwt v3.2.1+incompatible
53+
github.com/golang-jwt/jwt v3.2.2+incompatible
5454
github.com/golang/snappy v0.0.4 // indirect
5555
github.com/google/go-github/v32 v32.1.0
5656
github.com/google/go-querystring v1.1.0 // indirect
@@ -143,3 +143,5 @@ require (
143143
)
144144

145145
replace github.com/hashicorp/go-version => github.com/6543/go-version v1.3.1
146+
147+
replace github.com/golang-jwt/jwt v3.2.1+incompatible => github.com/golang-jwt/jwt v3.2.2+incompatible

go.sum

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -49,8 +49,6 @@ gitea.com/go-chi/captcha v0.0.0-20210110083842-e7696c336a1e h1:YjaQU6XFicdhPN+Ml
4949
gitea.com/go-chi/captcha v0.0.0-20210110083842-e7696c336a1e/go.mod h1:nfA7JaGv3hbGQ1ktdhAsZhdS84qKffI8NMlHr+Opsog=
5050
gitea.com/go-chi/session v0.0.0-20210108030337-0cb48c5ba8ee h1:9U6HuKUBt/cGK6T/64dEuz0r7Yp97WAAEJvXHDlY3ws=
5151
gitea.com/go-chi/session v0.0.0-20210108030337-0cb48c5ba8ee/go.mod h1:Ozg8IchVNb/Udg+ui39iHRYqVHSvf3C99ixdpLR8Vu0=
52-
gitea.com/lunny/levelqueue v0.3.0 h1:MHn1GuSZkxvVEDMyAPqlc7A3cOW+q8RcGhRgH/xtm6I=
53-
gitea.com/lunny/levelqueue v0.3.0/go.mod h1:HBqmLbz56JWpfEGG0prskAV97ATNRoj5LDmPicD22hU=
5452
gitea.com/lunny/levelqueue v0.4.0 h1:v+bCR1lwLTBpZMshguWNhGIFLkUj+R04pgaU3TcJFS8=
5553
gitea.com/lunny/levelqueue v0.4.0/go.mod h1:HBqmLbz56JWpfEGG0prskAV97ATNRoj5LDmPicD22hU=
5654
gitea.com/xorm/sqlfiddle v0.0.0-20180821085327-62ce714f951a h1:lSA0F4e9A2NcQSqGqTOXqu2aRi/XEQxDCBwM8yJtE6s=
@@ -477,8 +475,8 @@ github.com/gogs/cron v0.0.0-20171120032916-9f6c956d3e14 h1:yXtpJr/LV6PFu4nTLgfjQ
477475
github.com/gogs/cron v0.0.0-20171120032916-9f6c956d3e14/go.mod h1:jPoNZLWDAqA5N3G5amEoiNbhVrmM+ZQEcnQvNQ2KaZk=
478476
github.com/gogs/go-gogs-client v0.0.0-20210131175652-1d7215cd8d85 h1:UjoPNDAQ5JPCjlxoJd6K8ALZqSDDhk2ymieAZOVaDg0=
479477
github.com/gogs/go-gogs-client v0.0.0-20210131175652-1d7215cd8d85/go.mod h1:fR6z1Ie6rtF7kl/vBYMfgD5/G5B1blui7z426/sj2DU=
480-
github.com/golang-jwt/jwt v3.2.1+incompatible h1:73Z+4BJcrTC+KczS6WvTPvRGOp1WmfEP4Q1lOd9Z/+c=
481-
github.com/golang-jwt/jwt v3.2.1+incompatible/go.mod h1:8pz2t5EyA70fFQQSrl6XZXzqecmYZeUEB8OUGHkxJ+I=
478+
github.com/golang-jwt/jwt v3.2.2+incompatible h1:IfV12K8xAKAnZqdXVzCZ+TOjboZ2keLg81eXfW3O+oY=
479+
github.com/golang-jwt/jwt v3.2.2+incompatible/go.mod h1:8pz2t5EyA70fFQQSrl6XZXzqecmYZeUEB8OUGHkxJ+I=
482480
github.com/golang-sql/civil v0.0.0-20190719163853-cb61b32ac6fe h1:lXe2qZdvpiX5WZkZR4hgp4KJVfY3nMkvmwbVkpv1rVY=
483481
github.com/golang-sql/civil v0.0.0-20190719163853-cb61b32ac6fe/go.mod h1:8vg3r2VgvsThLBIFL93Qb5yWzgyZWhEmBwUJWevAkK0=
484482
github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q=

modules/markup/markdown/markdown.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,9 @@ func newParserContext(ctx *markup.RenderContext) parser.Context {
8787
func actualRender(ctx *markup.RenderContext, input io.Reader, output io.Writer) error {
8888
once.Do(func() {
8989
converter = goldmark.New(
90-
goldmark.WithExtensions(extension.Table,
90+
goldmark.WithExtensions(
91+
extension.NewTable(
92+
extension.WithTableCellAlignMethod(extension.TableCellAlignAttribute)),
9193
extension.Strikethrough,
9294
extension.TaskList,
9395
extension.DefinitionList,

options/locale/locale_en-US.ini

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1437,10 +1437,10 @@ pulls.no_merge_helper = Enable merge options in the repository settings or merge
14371437
pulls.no_merge_wip = This pull request can not be merged because it is marked as being a work in progress.
14381438
pulls.no_merge_not_ready = This pull request is not ready to be merged, check review status and status checks.
14391439
pulls.no_merge_access = You are not authorized to merge this pull request.
1440-
pulls.merge_pull_request = Merge Pull Request
1441-
pulls.rebase_merge_pull_request = Rebase and Merge
1442-
pulls.rebase_merge_commit_pull_request = Rebase and Merge (--no-ff)
1443-
pulls.squash_merge_pull_request = Squash and Merge
1440+
pulls.merge_pull_request = Create merge commit
1441+
pulls.rebase_merge_pull_request = Rebase then fast-forward
1442+
pulls.rebase_merge_commit_pull_request = Rebase then create merge commit
1443+
pulls.squash_merge_pull_request = Create squash commit
14441444
pulls.merge_manually = Manually merged
14451445
pulls.merge_commit_id = The merge commit ID
14461446
pulls.require_signed_wont_sign = The branch requires signed commits but this merge will not be signed

options/locale/locale_ja-JP.ini

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1040,6 +1040,7 @@ editor.require_signed_commit=ブランチでは署名されたコミットが必
10401040
commits.desc=ソースコードの変更履歴を参照します。
10411041
commits.commits=コミット
10421042
commits.no_commits=共通のコミットはありません。 '%s''%s' の履歴はすべて異なっています。
1043+
commits.nothing_to_compare=二つのブランチは同じ内容です。
10431044
commits.search=コミットの検索…
10441045
commits.search.tooltip=キーワード "author:""committer:""after:""before:" を付けて指定できます。 例 "revert author:Alice before:2019-04-01"
10451046
commits.find=検索

options/locale/locale_pt-PT.ini

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1040,6 +1040,7 @@ editor.require_signed_commit=O ramo requer um cometimento assinado
10401040
commits.desc=Navegar pelo histórico de modificações no código fonte.
10411041
commits.commits=Cometimentos
10421042
commits.no_commits=Não há cometimentos em comum. '%s' e '%s' têm históricos completamente diferentes.
1043+
commits.nothing_to_compare=Estes ramos são iguais.
10431044
commits.search=Procurar cometimentos…
10441045
commits.search.tooltip=Pode prefixar palavras-chave com "author:", "committer:", "after:", ou "before:". Por exemplo: "revert author:Alice before:2019-04-01".
10451046
commits.find=Procurar
@@ -1828,8 +1829,8 @@ settings.event_pull_request_review=Pedido de integração revisto
18281829
settings.event_pull_request_review_desc=Pedido de integração aprovado, rejeitado ou comentado na revisão.
18291830
settings.event_pull_request_sync=Pedido de integração sincronizado
18301831
settings.event_pull_request_sync_desc=Pedido de integração sincronizado.
1831-
settings.branch_filter=Filtro por ramo
1832-
settings.branch_filter_desc=Lista de permissões do ramo para eventos de envio e de criação e eliminação de ramos, especificada como um padrão glob. Se estiver em branco ou for <code>*</code>, serão reportados eventos para todos os ramos. Veja a documentação <a href="https://pkg.go.dev/github.com/gobwas/glob#Compile">github.com/gobwas/glob</a> para ver os detalhes da sintaxe. Exemplos: <code>trunk</code>, <code>{trunk,release*}</code>.
1832+
settings.branch_filter=Filtro de ramos
1833+
settings.branch_filter_desc=Lista dos ramos a serem considerados nos eventos de envio e de criação e eliminação de ramos, especificada como um padrão glob. Se estiver em branco ou for <code>*</code>, serão reportados eventos para todos os ramos. Veja a documentação <a href="https://pkg.go.dev/github.com/gobwas/glob#Compile">github.com/gobwas/glob</a> para ver os detalhes da sintaxe. Exemplos: <code>trunk</code>, <code>{trunk,release*}</code>.
18331834
settings.active=Em funcionamento
18341835
settings.active_helper=Informação sobre eventos despoletados será enviada para o URL deste automatismo web.
18351836
settings.add_hook_success=O automatismo web foi adicionado.

options/locale/locale_zh-TW.ini

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1040,6 +1040,7 @@ editor.require_signed_commit=分支僅接受經簽署的提交
10401040
commits.desc=瀏覽原始碼修改歷程。
10411041
commits.commits=次程式碼提交
10421042
commits.no_commits=沒有共同的提交。「%s」和「%s」的歷史完全不同。
1043+
commits.nothing_to_compare=這些分支是相同的。
10431044
commits.search=搜尋提交歷史...
10441045
commits.search.tooltip=你可以用「author:」、「committer:」、「after:」或「before:」作為關鍵詞的前綴,例如:「revert author:Alice before:2019-04-01」。
10451046
commits.find=搜尋

routers/api/v1/repo/topic.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ func UpdateTopics(ctx *context.APIContext) {
126126

127127
// AddTopic adds a topic name to a repo
128128
func AddTopic(ctx *context.APIContext) {
129-
// swagger:operation PUT /repos/{owner}/{repo}/topics/{topic} repository repoAddTopíc
129+
// swagger:operation PUT /repos/{owner}/{repo}/topics/{topic} repository repoAddTopic
130130
// ---
131131
// summary: Add a topic to a repository
132132
// produces:

routers/api/v1/swagger/app.go

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,3 +14,10 @@ type swaggerResponseOAuth2Application struct {
1414
// in:body
1515
Body api.OAuth2Application `json:"body"`
1616
}
17+
18+
// AccessToken represents an API access token.
19+
// swagger:response AccessToken
20+
type swaggerResponseAccessToken struct {
21+
// in:body
22+
Body api.AccessToken `json:"body"`
23+
}

routers/api/v1/swagger/options.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -164,6 +164,9 @@ type swaggerParameterBodies struct {
164164
// in:body
165165
CreateTagOption api.CreateTagOption
166166

167+
// in:body
168+
CreateAccessTokenOption api.CreateAccessTokenOption
169+
167170
// in:body
168171
UserSettingsOptions api.UserSettingsOptions
169172
}

routers/api/v1/user/app.go

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -76,15 +76,10 @@ func CreateAccessToken(ctx *context.APIContext) {
7676
// description: username of user
7777
// type: string
7878
// required: true
79-
// - name: accessToken
79+
// - name: userCreateToken
8080
// in: body
8181
// schema:
82-
// type: object
83-
// required:
84-
// - name
85-
// properties:
86-
// name:
87-
// type: string
82+
// "$ref": "#/definitions/CreateAccessTokenOption"
8883
// responses:
8984
// "201":
9085
// "$ref": "#/responses/AccessToken"

services/wiki/wiki.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,9 @@ func prepareWikiFileName(gitRepo *git.Repository, wikiName string) (bool, string
9090
// Look for both files
9191
filesInIndex, err := gitRepo.LsTree("master", unescaped, escaped)
9292
if err != nil {
93+
if strings.Contains(err.Error(), "Not a valid object name master") {
94+
return false, escaped, nil
95+
}
9396
log.Error("%v", err)
9497
return false, escaped, err
9598
}

services/wiki/wiki_test.go

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,15 @@
55
package wiki
66

77
import (
8+
"io/ioutil"
9+
"os"
810
"path/filepath"
911
"testing"
1012

1113
"code.gitea.io/gitea/models"
1214
"code.gitea.io/gitea/modules/git"
15+
"code.gitea.io/gitea/modules/util"
16+
1317
"github.com/stretchr/testify/assert"
1418
)
1519

@@ -261,3 +265,28 @@ func TestPrepareWikiFileName(t *testing.T) {
261265
})
262266
}
263267
}
268+
269+
func TestPrepareWikiFileName_FirstPage(t *testing.T) {
270+
models.PrepareTestEnv(t)
271+
272+
// Now create a temporaryDirectory
273+
tmpDir, err := ioutil.TempDir("", "empty-wiki")
274+
assert.NoError(t, err)
275+
defer func() {
276+
if _, err := os.Stat(tmpDir); !os.IsNotExist(err) {
277+
_ = util.RemoveAll(tmpDir)
278+
}
279+
}()
280+
281+
err = git.InitRepository(tmpDir, true)
282+
assert.NoError(t, err)
283+
284+
gitRepo, err := git.OpenRepository(tmpDir)
285+
defer gitRepo.Close()
286+
assert.NoError(t, err)
287+
288+
existence, newWikiPath, err := prepareWikiFileName(gitRepo, "Home")
289+
assert.False(t, existence)
290+
assert.NoError(t, err)
291+
assert.Equal(t, "Home.md", newWikiPath)
292+
}

templates/swagger/v1_json.tmpl

Lines changed: 16 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -9651,7 +9651,7 @@
96519651
"repository"
96529652
],
96539653
"summary": "Add a topic to a repository",
9654-
"operationId": "repoAddTopíc",
9654+
"operationId": "repoAddTopic",
96559655
"parameters": [
96569656
{
96579657
"type": "string",
@@ -11917,18 +11917,10 @@
1191711917
"required": true
1191811918
},
1191911919
{
11920-
"name": "accessToken",
11920+
"name": "userCreateToken",
1192111921
"in": "body",
1192211922
"schema": {
11923-
"type": "object",
11924-
"required": [
11925-
"name"
11926-
],
11927-
"properties": {
11928-
"name": {
11929-
"type": "string"
11930-
}
11931-
}
11923+
"$ref": "#/definitions/CreateAccessTokenOption"
1193211924
}
1193311925
}
1193411926
],
@@ -12654,6 +12646,17 @@
1265412646
},
1265512647
"x-go-package": "code.gitea.io/gitea/modules/structs"
1265612648
},
12649+
"CreateAccessTokenOption": {
12650+
"description": "CreateAccessTokenOption options when create access token",
12651+
"type": "object",
12652+
"properties": {
12653+
"name": {
12654+
"type": "string",
12655+
"x-go-name": "Name"
12656+
}
12657+
},
12658+
"x-go-package": "code.gitea.io/gitea/modules/structs"
12659+
},
1265712660
"CreateBranchProtectionOption": {
1265812661
"description": "CreateBranchProtectionOption options for creating a branch protection",
1265912662
"type": "object",
@@ -17045,20 +17048,8 @@
1704517048
"responses": {
1704617049
"AccessToken": {
1704717050
"description": "AccessToken represents an API access token.",
17048-
"headers": {
17049-
"id": {
17050-
"type": "integer",
17051-
"format": "int64"
17052-
},
17053-
"name": {
17054-
"type": "string"
17055-
},
17056-
"sha1": {
17057-
"type": "string"
17058-
},
17059-
"token_last_eight": {
17060-
"type": "string"
17061-
}
17051+
"schema": {
17052+
"$ref": "#/definitions/AccessToken"
1706217053
}
1706317054
},
1706417055
"AccessTokenList": {

vendor/github.com/golang-jwt/jwt/.travis.yml

Lines changed: 0 additions & 11 deletions
This file was deleted.

0 commit comments

Comments
 (0)