Skip to content

Commit 1ec10b8

Browse files
authored
Merge branch 'main' into acme-provider
2 parents 7ea21e9 + cafd19c commit 1ec10b8

File tree

307 files changed

+5544
-1680
lines changed

Some content is hidden

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

307 files changed

+5544
-1680
lines changed

.drone.yml

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -305,7 +305,7 @@ steps:
305305

306306
- name: coverage-codecov
307307
pull: always
308-
image: plugins/codecov
308+
image: woodpeckerci/plugin-codecov:next-alpine
309309
settings:
310310
files:
311311
- coverage.all
@@ -567,7 +567,7 @@ steps:
567567
settings:
568568
acl: public-read
569569
bucket: gitea-artifacts
570-
endpoint: https://storage.gitea.io
570+
endpoint: https://ams3.digitaloceanspaces.com
571571
path_style: true
572572
source: "dist/release/*"
573573
strip_prefix: dist/release/
@@ -588,7 +588,7 @@ steps:
588588
settings:
589589
acl: public-read
590590
bucket: gitea-artifacts
591-
endpoint: https://storage.gitea.io
591+
endpoint: https://ams3.digitaloceanspaces.com
592592
path_style: true
593593
source: "dist/release/*"
594594
strip_prefix: dist/release/
@@ -641,6 +641,7 @@ steps:
641641
environment:
642642
GOPROXY: https://goproxy.cn # proxy.golang.org is blocked in China, this proxy is not
643643
TAGS: bindata sqlite sqlite_unlock_notify
644+
depends_on: [fetch-tags]
644645

645646
- name: gpg-sign
646647
pull: always
@@ -656,14 +657,15 @@ steps:
656657
from_secret: gpgsign_key
657658
GPGSIGN_PASSPHRASE:
658659
from_secret: gpgsign_passphrase
660+
depends_on: [static]
659661

660662
- name: release-tag
661663
pull: always
662664
image: woodpeckerci/plugin-s3:latest
663665
settings:
664666
acl: public-read
665667
bucket: gitea-artifacts
666-
endpoint: https://storage.gitea.io
668+
endpoint: https://ams3.digitaloceanspaces.com
667669
path_style: true
668670
source: "dist/release/*"
669671
strip_prefix: dist/release/
@@ -673,6 +675,7 @@ steps:
673675
from_secret: aws_access_key_id
674676
AWS_SECRET_ACCESS_KEY:
675677
from_secret: aws_secret_access_key
678+
depends_on: [gpg-sign]
676679

677680
- name: github
678681
pull: always
@@ -683,6 +686,7 @@ steps:
683686
environment:
684687
GITHUB_TOKEN:
685688
from_secret: github_token
689+
depends_on: [gpg-sign]
686690

687691
---
688692
kind: pipeline
@@ -1086,6 +1090,7 @@ steps:
10861090
trigger:
10871091
ref:
10881092
- refs/heads/main
1093+
- "refs/heads/release/v*"
10891094
event:
10901095
exclude:
10911096
- cron

.eslintrc

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,6 @@ env:
2323

2424
globals:
2525
__webpack_public_path__: true
26-
CodeMirror: false
27-
Dropzone: false
28-
SimpleMDE: false
2926

3027
settings:
3128
html/html-extensions: [".tmpl"]
@@ -34,7 +31,6 @@ overrides:
3431
- files: ["web_src/**/*.js", "web_src/**/*.vue", "templates/**/*.tmpl"]
3532
env:
3633
browser: true
37-
jquery: true
3834
node: false
3935
- files: ["templates/**/*.tmpl"]
4036
rules:

.gitattributes

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
* text=auto eol=lf
2-
/vendor/** -text -eol linguist-vendored
3-
/public/vendor/** -text -eol linguist-vendored
4-
/web_src/js/vendor/** -text -eol linguist-vendored
5-
/templates/**/*.tmpl linguist-language=Handlebars
2+
*.tmpl linguist-language=Handlebars
63
/.eslintrc linguist-language=YAML
74
/.stylelintrc linguist-language=YAML
5+
/public/vendor/** -text -eol linguist-vendored
6+
/vendor/** -text -eol linguist-vendored
87
/web_src/fomantic/build/** linguist-generated
8+
/web_src/js/vendor/** -text -eol linguist-vendored
99
Dockerfile.* linguist-language=Dockerfile

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,8 @@ _testmain.go
3636
coverage.all
3737
cpu.out
3838

39+
/modules/migration/bindata.go
40+
/modules/migration/bindata.go.hash
3941
/modules/options/bindata.go
4042
/modules/options/bindata.go.hash
4143
/modules/public/bindata.go

CHANGELOG.md

Lines changed: 27 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,16 @@ 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.0-rc1](https://github.com/go-gitea/gitea/releases/tag/v1.16.0-rc1) - 2022-01-19
7+
## [1.16.0](https://github.com/go-gitea/gitea/releases/tag/v1.16.0) - 2022-01-30
88

99
* BREAKING
1010
* Remove golang vendored directory (#18277)
1111
* Paginate releases page & set default page size to 10 (#16857)
12+
* Use shadowing script for docker (#17846)
1213
* Only allow webhook to send requests to allowed hosts (#17482)
1314
* SECURITY
15+
* Disable content sniffing on `PlainTextBytes` (#18359) (#18365)
16+
* Only view milestones from current repo (#18414) (#18417)
1417
* Sanitize user-input on file name (#17666)
1518
* Use `hostmatcher` to replace `matchlist` to improve blocking of bad hosts in Webhooks (#17605)
1619
* FEATURES
@@ -228,6 +231,16 @@ been added to each release, please refer to the [blog](https://blog.gitea.io).
228231
* Add left padding for chunk header of split diff view (#13397)
229232
* Allow U2F 2FA without TOTP (#11573)
230233
* BUGFIXES
234+
* GitLab reviews may not have the updated_at field set (#18450) (#18461)
235+
* Fix detection of no commits when the default branch is not master (#18422) (#18423)
236+
* Fix broken oauth2 authentication source edit page (#18412) (#18419)
237+
* Place inline diff comment dialogs on split diff in 4th and 8th columns (#18403) (#18404)
238+
* Fix restore without topic failure (#18387) (#18400)
239+
* Fix commit's time (#18375) (#18392)
240+
* Fix partial cloning a repo (#18373) (#18377)
241+
* Stop trimming preceding and suffixing spaces from editor filenames (#18334)
242+
* Prevent showing webauthn error for every time visiting `/user/settings/security` (#18386)
243+
* Fix mime-type detection for HTTP server (#18370) (#18371)
231244
* Stop trimming preceding and suffixing spaces from editor filenames (#18334)
232245
* Restore propagation of ErrDependenciesLeft (#18325)
233246
* Fix PR comments UI (#18323)
@@ -295,10 +308,22 @@ been added to each release, please refer to the [blog](https://blog.gitea.io).
295308
* BUILD
296309
* Add lockfile-check (#18285)
297310
* Don't store assets modified time into generated files (#18193)
298-
* Use shadowing script for docker (#17846)
299311
* MISC
300312
* Update JS dependencies (#17611)
301313

314+
## [1.15.11](https://github.com/go-gitea/gitea/releases/tag/v1.15.11) - 2022-01-29
315+
316+
* SECURITY
317+
* Only view milestones from current repo (#18414) (#18418)
318+
* BUGFIXES
319+
* Fix broken when no commits and default branch is not master (#18422) (#18424)
320+
* Fix commit's time (#18375) (#18409)
321+
* Fix restore without topic failure (#18387) (#18401)
322+
* Fix mermaid import in 1.15 (it uses ESModule now) (#18382)
323+
* Update to go/text 0.3.7 (#18336)
324+
* MISC
325+
* Upgrade EasyMDE to 2.16.1 (#18278) (#18279)
326+
302327
## [1.15.10](https://github.com/go-gitea/gitea/releases/tag/v1.15.10) - 2022-01-14
303328

304329
* BUGFIXES

CONTRIBUTING.md

Lines changed: 75 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -134,15 +134,24 @@ Some of the key points:
134134
if that is not related to your PR, please make *another* PR for that.
135135
* Split big pull requests into multiple small ones. An incremental change
136136
will be faster to review than a huge PR.
137+
* Use the first comment as a summary explainer of your PR and you should keep this up-to-date as the PR evolves.
138+
139+
If your PR could cause a breaking change you must add a BREAKING section to this comment e.g.:
140+
141+
```
142+
## :warning: BREAKING :warning:
143+
```
144+
145+
To explain how this could affect users and how to mitigate these changes.
137146

138147
## Styleguide
139148

140149
For imports you should use the following format (_without_ the comments)
141150
```go
142151
import (
143152
// stdlib
144-
"encoding/json"
145153
"fmt"
154+
"math"
146155

147156
// local packages
148157
"code.gitea.io/gitea/models"
@@ -203,13 +212,74 @@ In general, HTTP methods are chosen as follows:
203212
* **PUT** endpoints return status **No Content (204)**, used to **add/assign** existing Objects (e.g. User) to something (e.g. Org-Team)
204213
* **PATCH** endpoints return changed object and status **OK (200)**, used to **edit/change** an existing object
205214

206-
207215
An endpoint which changes/edits an object expects all fields to be optional (except ones to identify the object, which are required).
208-
209216
### Endpoints returning lists should
210217
* support pagination (`page` & `limit` options in query)
211218
* set `X-Total-Count` header via **SetTotalCountHeader** ([example](https://github.com/go-gitea/gitea/blob/7aae98cc5d4113f1e9918b7ee7dd09f67c189e3e/routers/api/v1/repo/issue.go#L444))
212219

220+
## Large Character Comments
221+
222+
Throughout the codebase there are large-text comments for sections of code, e.g.:
223+
224+
```go
225+
// __________ .__
226+
// \______ \ _______ _|__| ______ _ __
227+
// | _// __ \ \/ / |/ __ \ \/ \/ /
228+
// | | \ ___/\ /| \ ___/\ /
229+
// |____|_ /\___ >\_/ |__|\___ >\/\_/
230+
// \/ \/ \/
231+
```
232+
233+
These were created using the `figlet` tool with the `graffiti` font.
234+
235+
A simple way of creating these is to use the following:
236+
237+
```bash
238+
figlet -f graffiti Review | sed -e's+^+// +' - | xclip -sel clip -in
239+
```
240+
241+
## Backports and Frontports
242+
243+
Occasionally backports of PRs are required.
244+
245+
The backported PR title should be:
246+
247+
```
248+
Title of backported PR (#ORIGINAL_PR_NUMBER)
249+
```
250+
251+
The first two lines of the summary of the backporting PR should be:
252+
253+
```
254+
Backport #ORIGINAL_PR_NUMBER
255+
256+
```
257+
258+
with the rest of the summary matching the original PR. Similarly for frontports
259+
260+
---
261+
262+
The below is a script that may be helpful in creating backports. YMMV.
263+
264+
```bash
265+
#!/bin/sh
266+
PR="$1"
267+
SHA="$2"
268+
VERSION="$3"
269+
270+
if [ -z "$SHA" ]; then
271+
SHA=$(gh api /repos/go-gitea/gitea/pulls/$PR -q '.merge_commit_sha')
272+
fi
273+
274+
if [ -z "$VERSION" ]; then
275+
VERSION="v1.16"
276+
fi
277+
278+
echo git checkout origin/release/"$VERSION" -b backport-$PR-$VERSION
279+
git checkout origin/release/"$VERSION" -b backport-$PR-$VERSION
280+
git cherry-pick $SHA && git commit --amend && git push zeripath backport-$PR-$VERSION && xdg-open https://github.com/go-gitea/gitea/compare/release/"$VERSION"...zeripath:backport-$PR-$VERSION
281+
282+
```
213283

214284
## Developer Certificate of Origin (DCO)
215285

@@ -351,15 +421,15 @@ be reviewed by two maintainers and must pass the automatic tests.
351421
* If it is bugfix version create PR for changelog on branch `release/v$vmaj.$vmin` and wait till it is reviewed and merged.
352422
* Add a tag as `git tag -s -F release.notes v$vmaj.$vmin.$`, release.notes file could be a temporary file to only include the changelog this version which you added to `CHANGELOG.md`.
353423
* And then push the tag as `git push origin v$vmaj.$vmin.$`. Drone CI will automatically create a release and upload all the compiled binary. (But currently it doesn't add the release notes automatically. Maybe we should fix that.)
354-
* If needed send PR for changelog on branch `main`.
424+
* If needed send a frontport PR for the changelog to branch `main` and update the version in `docs/config.yaml` to refer to the new version.
355425
* Send PR to [blog repository](https://gitea.com/gitea/blog) announcing the release.
356426

357427
## Copyright
358428

359429
Code that you contribute should use the standard copyright header:
360430

361431
```
362-
// Copyright 2020 The Gitea Authors. All rights reserved.
432+
// Copyright 2022 The Gitea Authors. All rights reserved.
363433
// Use of this source code is governed by a MIT-style
364434
// license that can be found in the LICENSE file.
365435
```

Makefile

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ COMMA := ,
2727
XGO_VERSION := go-1.17.x
2828
MIN_GO_VERSION := 001016000
2929
MIN_NODE_VERSION := 012017000
30-
MIN_GOLANGCI_LINT_VERSION := 001043000
30+
MIN_GOLANGCI_LINT_VERSION := 001044000
3131

3232
DOCKER_IMAGE ?= gitea/gitea
3333
DOCKER_TAG ?= latest
@@ -231,10 +231,13 @@ clean:
231231

232232
.PHONY: fmt
233233
fmt:
234-
@hash xgogofumpt > /dev/null 2>&1; if [ $$? -ne 0 ]; then \
234+
@echo "Running gitea-fmt(with gofmt)..."
235+
@$(GO) run build/code-batch-process.go gitea-fmt -s -w '{file-list}'
236+
@echo "Running gofumpt"
237+
@hash gofumpt > /dev/null 2>&1; if [ $$? -ne 0 ]; then \
235238
$(GO) install mvdan.cc/gofumpt@latest; \
236239
fi
237-
gofumpt -w -l -extra -lang 1.16 .
240+
@gofumpt -w -l -extra -lang 1.16 .
238241

239242
.PHONY: vet
240243
vet:

cmd/restore_repo.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,10 @@ var CmdRestoreRepository = cli.Command{
4343
Usage: `Which items will be restored, one or more units should be separated as comma.
4444
wiki, issues, labels, releases, release_assets, milestones, pull_requests, comments are allowed. Empty means all units.`,
4545
},
46+
cli.BoolFlag{
47+
Name: "validation",
48+
Usage: "Sanity check the content of the files before trying to load them",
49+
},
4650
},
4751
}
4852

@@ -58,6 +62,7 @@ func runRestoreRepository(c *cli.Context) error {
5862
c.String("owner_name"),
5963
c.String("repo_name"),
6064
c.StringSlice("units"),
65+
c.Bool("validation"),
6166
)
6267
if statusCode == http.StatusOK {
6368
return nil

contrib/ide/vscode/launch.json

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,10 @@
77
"request": "launch",
88
"mode": "debug",
99
"buildFlags": "",
10-
"port": 2345,
11-
"host": "127.0.0.1",
1210
"program": "${workspaceRoot}/main.go",
13-
"env": {},
11+
"env": {
12+
"GITEA_WORK_DIR": "${workspaceRoot}",
13+
},
1414
"args": ["web"],
1515
"showLog": true
1616
},
@@ -20,10 +20,10 @@
2020
"request": "launch",
2121
"mode": "debug",
2222
"buildFlags": "-tags='sqlite sqlite_unlock_notify'",
23-
"port": 2345,
24-
"host": "127.0.0.1",
2523
"program": "${workspaceRoot}/main.go",
26-
"env": {},
24+
"env": {
25+
"GITEA_WORK_DIR": "${workspaceRoot}",
26+
},
2727
"args": ["web"],
2828
"showLog": true
2929
}

custom/conf/app.example.ini

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -241,8 +241,6 @@ RUN_MODE = ; prod
241241
;; Enables git-lfs support. true or false, default is false.
242242
;LFS_START_SERVER = false
243243
;;
244-
;; Where your lfs files reside, default is data/lfs.
245-
;LFS_CONTENT_PATH = data/lfs
246244
;;
247245
;; LFS authentication secret, change this yourself
248246
LFS_JWT_SECRET =
@@ -2213,6 +2211,9 @@ PATH =
22132211
;;
22142212
;[lfs]
22152213
;STORAGE_TYPE = local
2214+
;;
2215+
;; Where your lfs files reside, default is data/lfs.
2216+
;PATH = data/lfs
22162217

22172218
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
22182219
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

0 commit comments

Comments
 (0)