Skip to content

Commit 8d70d57

Browse files
authored
Merge branch 'main' into lunny/support_render_openapi
2 parents 767ea4e + 3c91b09 commit 8d70d57

File tree

770 files changed

+10888
-7358
lines changed

Some content is hidden

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

770 files changed

+10888
-7358
lines changed

.eslintrc.yaml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -422,7 +422,6 @@ rules:
422422
no-restricted-imports: [0]
423423
no-restricted-syntax: [2, WithStatement, ForInStatement, LabeledStatement, SequenceExpression]
424424
no-return-assign: [0]
425-
no-return-await: [0]
426425
no-script-url: [2]
427426
no-self-assign: [2, {props: true}]
428427
no-self-compare: [2]

.github/workflows/pull-compliance.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,7 @@ jobs:
154154
node-version: 20
155155
- run: make deps-frontend
156156
- run: make lint-md
157-
- run: make docs # test if build could succeed
157+
- run: make docs
158158

159159
actions:
160160
if: needs.files-changed.outputs.actions == 'true' || needs.files-changed.outputs.actions == 'true'

.github/workflows/pull-db-tests.yml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,12 @@ jobs:
9898
discovery.type: single-node
9999
ports:
100100
- "9200:9200"
101+
meilisearch:
102+
image: getmeili/meilisearch:v1.2.0
103+
env:
104+
MEILI_ENV: development # disable auth
105+
ports:
106+
- "7700:7700"
101107
smtpimap:
102108
image: tabascoterrier/docker-imap-devel:latest
103109
ports:
@@ -128,7 +134,7 @@ jobs:
128134
go-version: ">=1.20"
129135
check-latest: true
130136
- name: Add hosts to /etc/hosts
131-
run: '[ -e "/.dockerenv" ] || [ -e "/run/.containerenv" ] || echo "127.0.0.1 mysql elasticsearch smtpimap" | sudo tee -a /etc/hosts'
137+
run: '[ -e "/.dockerenv" ] || [ -e "/run/.containerenv" ] || echo "127.0.0.1 mysql elasticsearch meilisearch smtpimap" | sudo tee -a /etc/hosts'
132138
- run: make deps-backend
133139
- run: make backend
134140
env:

.ignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,5 @@
55
/modules/public/bindata.go
66
/modules/templates/bindata.go
77
/vendor
8+
/public/assets
89
node_modules

CHANGELOG.md

Lines changed: 59 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,66 @@
22

33
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
5-
been added to each release, please refer to the [blog](https://blog.gitea.io).
5+
been added to each release, please refer to the [blog](https://blog.gitea.com).
66

7-
## [1.20.1](https://github.com/go-gitea/gitea/releases/tag/1.20.1) - 2023-07-22
7+
## [1.20.3](https://github.com/go-gitea/gitea/releases/tag/v1.20.3) - 2023-08-07
8+
9+
* BREAKING
10+
* Fix the wrong derive path (#26271) (#26318)
11+
* SECURITY
12+
* Fix API leaking Usermail if not logged in (#25097) (#26350)
13+
* ENHANCEMENTS
14+
* Display human-readable text instead of cryptic filemodes (#26352) (#26358)
15+
* Hide `last indexed SHA` when a repo could not be indexed yet (#26340) (#26345)
16+
* Fix the topic validation rule and suport dots (#26286) (#26303)
17+
* Fix due date rendering the wrong date in issue (#26268) (#26274)
18+
* Don't autosize textarea in diff view (#26233) (#26244)
19+
* Fix commit compare style (#26209) (#26226)
20+
* Warn instead of reporting an error when a webhook cannot be found (#26039) (#26211)
21+
* BUGFIXES
22+
* Bypass MariaDB performance bug of the "IN" sub-query, fix incorrect IssueIndex (#26279) (#26368)
23+
* Fix incorrect CLI exit code and duplicate error message (#26346) (#26347)
24+
* Prevent newline errors with Debian packages (#26332) (#26342)
25+
* Fix bug with sqlite load read (#26305) (#26339)
26+
* Make git batch operations use parent context timeout instead of default timeout (#26325) (#26330)
27+
* Support getting changed files when commit ID is `EmptySHA` (#26290) (#26316)
28+
* Clarify the logger's MODE config option (#26267) (#26281)
29+
* Use shared template for webhook icons (#26242) (#26246)
30+
* Fix pull request check list is limited (#26179) (#26245)
31+
* Fix attachment clipboard copy on insecure origin (#26224) (#26231)
32+
* Fix access check for org-level project (#26182) (#26223)
33+
* MISC
34+
* Upgrade x/net to 0.13.0 (#26301)
35+
36+
## [1.20.2](https://github.com/go-gitea/gitea/releases/tag/v1.20.2) - 2023-07-29
37+
38+
* ENHANCEMENTS
39+
* Calculate MAX_WORKERS default value by CPU number (#26177) (#26183)
40+
* Display deprecated warning in admin panel pages as well as in the log file (#26094) (#26154)
41+
* BUGFIXES
42+
* Fix allowed user types setting problem (#26200) (#26206)
43+
* Fix handling of plenty Nuget package versions (#26075) (#26173)
44+
* Fix UI regression of asciinema player (#26159) (#26162)
45+
* Fix LFS object list style (#26133) (#26147)
46+
* Fix allowed user types setting problem (#26200) (#26206)
47+
* Prevent primary key update on migration (#26192) (#26199)
48+
* Fix bug when pushing to a pull request which enabled dismiss approval automatically (#25882) (#26158)
49+
* Fix bugs in LFS meta garbage collection (#26122) (#26157)
50+
* Update xorm version (#26128) (#26150)
51+
* Remove "misc" scope check from public API endpoints (#26134) (#26149)
52+
* Fix CLI allowing creation of access tokens with existing name (#26071) (#26144)
53+
* Fix incorrect router logger (#26137) (#26143)
54+
* Improve commit graph alignment and truncating (#26112) (#26127)
55+
* Avoid writing config file if not installed (#26107) (#26113)
56+
* Fix escape problems in the branch selector (#25875) (#26103)
57+
* Fix handling of Debian files with trailing slash (#26087) (#26098)
58+
* Fix Missing 404 swagger response docs for /admin/users/{username} (#26086) (#26089)
59+
* Use stderr as fallback if the log file can't be opened (#26074) (#26083)
60+
* Increase table cell horizontal padding (#26140) (#26142)
61+
* Fix wrong workflow status when rerun a job in an already finished workflow (#26119) (#26124)
62+
* Fix duplicated url prefix on issue context menu (#26066) (#26067)
63+
64+
## [1.20.1](https://github.com/go-gitea/gitea/releases/tag/v1.20.1) - 2023-07-22
865

966
* SECURITY
1067
* Disallow dangerous URL schemes (#25960) (#25964)

CONTRIBUTING.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434
- [Backport PRs](#backport-prs)
3535
- [Documentation](#documentation)
3636
- [API v1](#api-v1)
37-
- [GitHub API compatability](#github-api-compatability)
37+
- [GitHub API compatibility](#github-api-compatibility)
3838
- [Adding/Maintaining API routes](#addingmaintaining-api-routes)
3939
- [When to use what HTTP method](#when-to-use-what-http-method)
4040
- [Requirements for API routes](#requirements-for-api-routes)
@@ -339,7 +339,7 @@ If you add a new feature or change an existing aspect of Gitea, the documentatio
339339

340340
The API is documented by [swagger](http://try.gitea.io/api/swagger) and is based on [the GitHub API](https://docs.github.com/en/rest).
341341

342-
### GitHub API compatability
342+
### GitHub API compatibility
343343

344344
Gitea's API should use the same endpoints and fields as the GitHub API as far as possible, unless there are good reasons to deviate. \
345345
If Gitea provides functionality that GitHub does not, a new endpoint can be created. \

Makefile

Lines changed: 10 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -29,12 +29,12 @@ AIR_PACKAGE ?= github.com/cosmtrek/air@v1.44.0
2929
EDITORCONFIG_CHECKER_PACKAGE ?= github.com/editorconfig-checker/editorconfig-checker/cmd/editorconfig-checker@2.7.0
3030
GOFUMPT_PACKAGE ?= mvdan.cc/gofumpt@v0.5.0
3131
GOLANGCI_LINT_PACKAGE ?= github.com/golangci/golangci-lint/cmd/golangci-lint@v1.53.3
32-
GXZ_PAGAGE ?= github.com/ulikunitz/xz/cmd/gxz@v0.5.11
32+
GXZ_PACKAGE ?= github.com/ulikunitz/xz/cmd/gxz@v0.5.11
3333
MISSPELL_PACKAGE ?= github.com/client9/misspell/cmd/misspell@v0.3.4
3434
SWAGGER_PACKAGE ?= github.com/go-swagger/go-swagger/cmd/swagger@v0.30.5
3535
XGO_PACKAGE ?= src.techknowlogick.com/xgo@latest
3636
GO_LICENSES_PACKAGE ?= github.com/google/go-licenses@v1.6.0
37-
GOVULNCHECK_PACKAGE ?= golang.org/x/vuln/cmd/govulncheck@v0.2.0
37+
GOVULNCHECK_PACKAGE ?= golang.org/x/vuln/cmd/govulncheck@v1.0.0
3838
ACTIONLINT_PACKAGE ?= github.com/rhysd/actionlint/cmd/actionlint@v1.6.25
3939

4040
DOCKER_IMAGE ?= gitea/gitea
@@ -197,7 +197,6 @@ help:
197197
@echo " - clean delete backend and integration files"
198198
@echo " - clean-all delete backend, frontend and integration files"
199199
@echo " - deps install dependencies"
200-
@echo " - deps-docs install docs dependencies"
201200
@echo " - deps-frontend install frontend dependencies"
202201
@echo " - deps-backend install backend dependencies"
203202
@echo " - deps-tools install tool dependencies"
@@ -373,11 +372,11 @@ lint-backend-fix: lint-go-fix lint-go-vet lint-editorconfig
373372

374373
.PHONY: lint-js
375374
lint-js: node_modules
376-
npx eslint --color --max-warnings=0 --ext js,vue web_src/js build *.config.js docs/assets/js tests/e2e
375+
npx eslint --color --max-warnings=0 --ext js,vue web_src/js build *.config.js tests/e2e
377376

378377
.PHONY: lint-js-fix
379378
lint-js-fix: node_modules
380-
npx eslint --color --max-warnings=0 --ext js,vue web_src/js build *.config.js docs/assets/js tests/e2e --fix
379+
npx eslint --color --max-warnings=0 --ext js,vue web_src/js build *.config.js tests/e2e --fix
381380

382381
.PHONY: lint-css
383382
lint-css: node_modules
@@ -865,7 +864,7 @@ release-check: | $(DIST_DIRS)
865864

866865
.PHONY: release-compress
867866
release-compress: | $(DIST_DIRS)
868-
cd $(DIST)/release/; for file in `find . -type f -name "*"`; do echo "compressing $${file}" && $(GO) run $(GXZ_PAGAGE) -k -9 $${file}; done;
867+
cd $(DIST)/release/; for file in `find . -type f -name "*"`; do echo "compressing $${file}" && $(GO) run $(GXZ_PACKAGE) -k -9 $${file}; done;
869868

870869
.PHONY: release-sources
871870
release-sources: | $(DIST_DIRS)
@@ -879,20 +878,14 @@ release-sources: | $(DIST_DIRS)
879878

880879
.PHONY: release-docs
881880
release-docs: | $(DIST_DIRS) docs
882-
tar -czf $(DIST)/release/gitea-docs-$(VERSION).tar.gz -C ./docs/public .
881+
tar -czf $(DIST)/release/gitea-docs-$(VERSION).tar.gz -C ./docs .
883882

884883
.PHONY: docs
885-
docs: deps-docs
886-
cd docs; make trans-copy clean build-offline;
887-
888-
.PHONY: deps-docs
889-
deps-docs:
890-
@hash hugo > /dev/null 2>&1; if [ $$? -ne 0 ]; then \
891-
curl -sL https://github.com/gohugoio/hugo/releases/download/v$(HUGO_VERSION)/hugo_$(HUGO_VERSION)_Linux-64bit.tar.gz | tar zxf - -C /tmp && mkdir -p ~/go/bin && mv /tmp/hugo ~/go/bin/hugo && chmod +x ~/go/bin/hugo; \
892-
fi
884+
docs:
885+
cd docs; bash scripts/trans-copy.sh;
893886

894887
.PHONY: deps
895-
deps: deps-frontend deps-backend deps-tools deps-docs deps-py
888+
deps: deps-frontend deps-backend deps-tools deps-py
896889

897890
.PHONY: deps-py
898891
deps-py: .venv
@@ -910,7 +903,7 @@ deps-tools:
910903
$(GO) install $(EDITORCONFIG_CHECKER_PACKAGE)
911904
$(GO) install $(GOFUMPT_PACKAGE)
912905
$(GO) install $(GOLANGCI_LINT_PACKAGE)
913-
$(GO) install $(GXZ_PAGAGE)
906+
$(GO) install $(GXZ_PACKAGE)
914907
$(GO) install $(MISSPELL_PACKAGE)
915908
$(GO) install $(SWAGGER_PACKAGE)
916909
$(GO) install $(XGO_PACKAGE)

assets/go-licenses.json

Lines changed: 10 additions & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

cmd/admin.go

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
package cmd
66

77
import (
8+
"context"
89
"errors"
910
"fmt"
1011
"net/url"
@@ -297,10 +298,12 @@ var (
297298
&cli.BoolFlag{
298299
Name: "force-smtps",
299300
Usage: "SMTPS is always used on port 465. Set this to force SMTPS on other ports.",
301+
Value: true,
300302
},
301303
&cli.BoolFlag{
302304
Name: "skip-verify",
303305
Usage: "Skip TLS verify.",
306+
Value: true,
304307
},
305308
&cli.StringFlag{
306309
Name: "helo-hostname",
@@ -310,6 +313,7 @@ var (
310313
&cli.BoolFlag{
311314
Name: "disable-helo",
312315
Usage: "Disable SMTP helo.",
316+
Value: true,
313317
},
314318
&cli.StringFlag{
315319
Name: "allowed-domains",
@@ -319,10 +323,12 @@ var (
319323
&cli.BoolFlag{
320324
Name: "skip-local-2fa",
321325
Usage: "Skip 2FA to log on.",
326+
Value: true,
322327
},
323328
&cli.BoolFlag{
324329
Name: "active",
325330
Usage: "This Authentication Source is Activated.",
331+
Value: true,
326332
},
327333
}
328334

@@ -373,7 +379,7 @@ func runRepoSyncReleases(_ *cli.Context) error {
373379
continue
374380
}
375381

376-
oldnum, err := getReleaseCount(repo.ID)
382+
oldnum, err := getReleaseCount(ctx, repo.ID)
377383
if err != nil {
378384
log.Warn(" GetReleaseCountByRepoID: %v", err)
379385
}
@@ -385,7 +391,7 @@ func runRepoSyncReleases(_ *cli.Context) error {
385391
continue
386392
}
387393

388-
count, err = getReleaseCount(repo.ID)
394+
count, err = getReleaseCount(ctx, repo.ID)
389395
if err != nil {
390396
log.Warn(" GetReleaseCountByRepoID: %v", err)
391397
gitRepo.Close()
@@ -401,9 +407,9 @@ func runRepoSyncReleases(_ *cli.Context) error {
401407
return nil
402408
}
403409

404-
func getReleaseCount(id int64) (int64, error) {
410+
func getReleaseCount(ctx context.Context, id int64) (int64, error) {
405411
return repo_model.GetReleaseCountByRepoID(
406-
db.DefaultContext,
412+
ctx,
407413
id,
408414
repo_model.FindReleasesOptions{
409415
IncludeTags: true,

0 commit comments

Comments
 (0)