Skip to content

Commit 6196e19

Browse files
committed
Merge remote-tracking branch 'origin/main' into uprof
* origin/main: (43 commits) Add `/public/assets` to `.ignore` (go-gitea#26232) Fix attachment clipboard copy on insecure origin (go-gitea#26224) Fix commit compare style (go-gitea#26209) Fix unable to display individual-level project (go-gitea#26198) Fix access check for org-level project (go-gitea#26182) Fixed incorrect locale references (go-gitea#26218) Use calendar icon for `Joined on...` in profiles (go-gitea#26215) Add changelog for 1.20.2 (go-gitea#26208) Add commits dropdown in PR files view and allow commit by commit review (go-gitea#25528) Warn instead of reporting an error when a webhook cannot be found (go-gitea#26039) Fixing the align of commit stats in commit_page template. (go-gitea#26161) Fix allowed user types setting problem (go-gitea#26200) Hide branch/tag icon if branches/tags are empty (go-gitea#26204) Prevent primary key update on migration (go-gitea#26192) improve unit test for caching (go-gitea#26185) Render plaintext task list items for markdown files (go-gitea#26186) Add tooltip to describe LFS table column and color `delete LFS file` button red (go-gitea#26181) Show branches and tags that contain a commit (go-gitea#25180) Release attachments duplicated check (go-gitea#26176) Calculate MAX_WORKERS default value by CPU number (go-gitea#26177) ...
2 parents 25f6156 + 4244ce0 commit 6196e19

File tree

461 files changed

+2980
-2821
lines changed

Some content is hidden

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

461 files changed

+2980
-2821
lines changed

.github/workflows/pull-compliance.yml

+1-1
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'

.ignore

+1
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

+28
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,34 @@ 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.20.2](https://github.com/go-gitea/gitea/releases/tag/1.20.2) - 2023-07-29
8+
9+
* ENHANCEMENTS
10+
* Calculate MAX_WORKERS default value by CPU number (#26177) (#26183)
11+
* Display deprecated warning in admin panel pages as well as in the log file (#26094) (#26154)
12+
* BUGFIXES
13+
* Fix allowed user types setting problem (#26200) (#26206)
14+
* Fix handling of plenty Nuget package versions (#26075) (#26173)
15+
* Fix UI regression of asciinema player (#26159) (#26162)
16+
* Fix LFS object list style (#26133) (#26147)
17+
* Fix allowed user types setting problem (#26200) (#26206)
18+
* Prevent primary key update on migration (#26192) (#26199)
19+
* Fix bug when pushing to a pull request which enabled dismiss approval automatically (#25882) (#26158)
20+
* Fix bugs in LFS meta garbage collection (#26122) (#26157)
21+
* Update xorm version (#26128) (#26150)
22+
* Remove "misc" scope check from public API endpoints (#26134) (#26149)
23+
* Fix CLI allowing creation of access tokens with existing name (#26071) (#26144)
24+
* Fix incorrect router logger (#26137) (#26143)
25+
* Improve commit graph alignment and truncating (#26112) (#26127)
26+
* Avoid writing config file if not installed (#26107) (#26113)
27+
* Fix escape problems in the branch selector (#25875) (#26103)
28+
* Fix handling of Debian files with trailing slash (#26087) (#26098)
29+
* Fix Missing 404 swagger response docs for /admin/users/{username} (#26086) (#26089)
30+
* Use stderr as fallback if the log file can't be opened (#26074) (#26083)
31+
* Increase table cell horizontal padding (#26140) (#26142)
32+
* Fix wrong workflow status when rerun a job in an already finished workflow (#26119) (#26124)
33+
* Fix duplicated url prefix on issue context menu (#26066) (#26067)
34+
735
## [1.20.1](https://github.com/go-gitea/gitea/releases/tag/1.20.1) - 2023-07-22
836

937
* SECURITY

CONTRIBUTING.md

+2-2
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

+10-17
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)

cmd/admin_user_generate_access_token.go

+16-5
Original file line numberDiff line numberDiff line change
@@ -57,17 +57,28 @@ func runGenerateAccessToken(c *cli.Context) error {
5757
return err
5858
}
5959

60-
accessTokenScope, err := auth_model.AccessTokenScope(c.String("scopes")).Normalize()
60+
// construct token with name and user so we can make sure it is unique
61+
t := &auth_model.AccessToken{
62+
Name: c.String("token-name"),
63+
UID: user.ID,
64+
}
65+
66+
exist, err := auth_model.AccessTokenByNameExists(t)
6167
if err != nil {
6268
return err
6369
}
70+
if exist {
71+
return fmt.Errorf("access token name has been used already")
72+
}
6473

65-
t := &auth_model.AccessToken{
66-
Name: c.String("token-name"),
67-
UID: user.ID,
68-
Scope: accessTokenScope,
74+
// make sure the scopes are valid
75+
accessTokenScope, err := auth_model.AccessTokenScope(c.String("scopes")).Normalize()
76+
if err != nil {
77+
return fmt.Errorf("invalid access token scope provided: %w", err)
6978
}
79+
t.Scope = accessTokenScope
7080

81+
// create the token
7182
if err := auth_model.NewAccessToken(t); err != nil {
7283
return err
7384
}

custom/conf/app.example.ini

+2-2
Original file line numberDiff line numberDiff line change
@@ -1420,8 +1420,8 @@ LEVEL = Info
14201420
;; Provides the suffix of the default redis/disk unique queue set name - specific queues can be overridden within in their [queue.name] sections.
14211421
;SET_NAME = "_unique"
14221422
;;
1423-
;; Dynamically scale the worker pool to at this many workers
1424-
;MAX_WORKERS = 10
1423+
;; Maximum number of worker go-routines for the queue. Default value is "CpuNum/2" clipped to between 1 and 10.
1424+
;MAX_WORKERS = ; (dynamic)
14251425

14261426
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
14271427
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

docs/Makefile

-36
This file was deleted.

docs/README.md

+1-30
Original file line numberDiff line numberDiff line change
@@ -3,36 +3,7 @@
33
[![Join the chat at https://img.shields.io/discord/322538954119184384.svg](https://img.shields.io/discord/322538954119184384.svg)](https://discord.gg/Gitea)
44
[![](https://images.microbadger.com/badges/image/gitea/docs.svg)](http://microbadger.com/images/gitea/docs "Get your own image badge on microbadger.com")
55

6-
## Hosting
7-
8-
These pages are hosted using [netlifycms](https://www.netlifycms.org/) and get
9-
automatically updated on every push to the `master` branch.
10-
11-
## Install
12-
13-
These pages use the [Hugo](https://gohugo.io/) static site generator.
14-
If you are planning to contribute you'll want to download and install Hugo on
15-
your local machine.
16-
17-
The installation of Hugo is out of the scope of this document, so please take
18-
the [official install instructions](https://gohugo.io/installation/) to
19-
get Hugo up and running.
20-
21-
## Development
22-
23-
To generate the website and serve it on [localhost:1313](http://localhost:1313)
24-
just execute this command and stop it with `Ctrl+C`:
25-
26-
```
27-
make server
28-
```
29-
30-
When you are done with your changes just create a pull request, after merging
31-
the pull request the website will be updated automatically.
32-
33-
## Contributing
34-
35-
Fork -> Patch -> Push -> Pull Request
6+
These docs are ingested by our [docs repo](https://gitea.com/gitea/gitea-docusaurus).
367

378
## Authors
389

docs/README_ZH.md

+1-21
Original file line numberDiff line numberDiff line change
@@ -4,27 +4,7 @@
44
[![Join the chat at https://img.shields.io/discord/322538954119184384.svg](https://img.shields.io/discord/322538954119184384.svg)](https://discord.gg/Gitea)
55
[![](https://images.microbadger.com/badges/image/gitea/docs.svg)](http://microbadger.com/images/gitea/docs "Get your own image badge on microbadger.com")
66

7-
## 关于托管方式
8-
9-
本页面托管在我们 Docker 容器内的基础设施上, 它会在每次推送到 `master` 分支的时候自动更新,如果你想自己管理这个页面,你可以从我们的 Docker 镜像 [gitea/docs](https://hub.docker.com/r/gitea/docs/) 中获取它。
10-
11-
## 安装 Hugo
12-
13-
本页面使用了 [Hugo](https://github.com/spf13/hugo) 静态页面生成工具,如果您有维护它的意愿,则需要在本地计算机上下载并安装 Hugo。Hugo 的安装教程不在本文档的讲述范围之内,详情请参见 [官方文档](https://gohugo.io/overview/installing/)
14-
15-
## 如何部署
16-
17-
[localhost:1313](http://localhost:1313) 处构建和运行网站的命令如下,如果需要停止可以使用组合键 `Ctrl+C`:
18-
19-
```
20-
make server
21-
```
22-
23-
完成更改后,只需创建一个 Pull Request (PR),该 PR 一经合并网站将自动更新。
24-
25-
## 如何贡献您的代码
26-
27-
Fork -> Patch -> Push -> Pull Request
7+
https://gitea.com/gitea/gitea-docusaurus
288

299
## 关于我们
3010

0 commit comments

Comments
 (0)