Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/main' into uprof
Browse files Browse the repository at this point in the history
* 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)
  ...
  • Loading branch information
silverwind committed Jul 30, 2023
2 parents 25f6156 + 4244ce0 commit 6196e19
Show file tree
Hide file tree
Showing 461 changed files with 2,980 additions and 2,821 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/pull-compliance.yml
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ jobs:
node-version: 20
- run: make deps-frontend
- run: make lint-md
- run: make docs # test if build could succeed
- run: make docs

actions:
if: needs.files-changed.outputs.actions == 'true' || needs.files-changed.outputs.actions == 'true'
Expand Down
1 change: 1 addition & 0 deletions .ignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,5 @@
/modules/public/bindata.go
/modules/templates/bindata.go
/vendor
/public/assets
node_modules
28 changes: 28 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,34 @@ This changelog goes through all the changes that have been made in each release
without substantial changes to our git log; to see the highlights of what has
been added to each release, please refer to the [blog](https://blog.gitea.io).

## [1.20.2](https://github.com/go-gitea/gitea/releases/tag/1.20.2) - 2023-07-29

* ENHANCEMENTS
* Calculate MAX_WORKERS default value by CPU number (#26177) (#26183)
* Display deprecated warning in admin panel pages as well as in the log file (#26094) (#26154)
* BUGFIXES
* Fix allowed user types setting problem (#26200) (#26206)
* Fix handling of plenty Nuget package versions (#26075) (#26173)
* Fix UI regression of asciinema player (#26159) (#26162)
* Fix LFS object list style (#26133) (#26147)
* Fix allowed user types setting problem (#26200) (#26206)
* Prevent primary key update on migration (#26192) (#26199)
* Fix bug when pushing to a pull request which enabled dismiss approval automatically (#25882) (#26158)
* Fix bugs in LFS meta garbage collection (#26122) (#26157)
* Update xorm version (#26128) (#26150)
* Remove "misc" scope check from public API endpoints (#26134) (#26149)
* Fix CLI allowing creation of access tokens with existing name (#26071) (#26144)
* Fix incorrect router logger (#26137) (#26143)
* Improve commit graph alignment and truncating (#26112) (#26127)
* Avoid writing config file if not installed (#26107) (#26113)
* Fix escape problems in the branch selector (#25875) (#26103)
* Fix handling of Debian files with trailing slash (#26087) (#26098)
* Fix Missing 404 swagger response docs for /admin/users/{username} (#26086) (#26089)
* Use stderr as fallback if the log file can't be opened (#26074) (#26083)
* Increase table cell horizontal padding (#26140) (#26142)
* Fix wrong workflow status when rerun a job in an already finished workflow (#26119) (#26124)
* Fix duplicated url prefix on issue context menu (#26066) (#26067)

## [1.20.1](https://github.com/go-gitea/gitea/releases/tag/1.20.1) - 2023-07-22

* SECURITY
Expand Down
4 changes: 2 additions & 2 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
- [Backport PRs](#backport-prs)
- [Documentation](#documentation)
- [API v1](#api-v1)
- [GitHub API compatability](#github-api-compatability)
- [GitHub API compatibility](#github-api-compatibility)
- [Adding/Maintaining API routes](#addingmaintaining-api-routes)
- [When to use what HTTP method](#when-to-use-what-http-method)
- [Requirements for API routes](#requirements-for-api-routes)
Expand Down Expand Up @@ -339,7 +339,7 @@ If you add a new feature or change an existing aspect of Gitea, the documentatio

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).

### GitHub API compatability
### GitHub API compatibility

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. \
If Gitea provides functionality that GitHub does not, a new endpoint can be created. \
Expand Down
27 changes: 10 additions & 17 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,12 @@ AIR_PACKAGE ?= github.com/cosmtrek/air@v1.44.0
EDITORCONFIG_CHECKER_PACKAGE ?= github.com/editorconfig-checker/editorconfig-checker/cmd/editorconfig-checker@2.7.0
GOFUMPT_PACKAGE ?= mvdan.cc/gofumpt@v0.5.0
GOLANGCI_LINT_PACKAGE ?= github.com/golangci/golangci-lint/cmd/golangci-lint@v1.53.3
GXZ_PAGAGE ?= github.com/ulikunitz/xz/cmd/gxz@v0.5.11
GXZ_PACKAGE ?= github.com/ulikunitz/xz/cmd/gxz@v0.5.11
MISSPELL_PACKAGE ?= github.com/client9/misspell/cmd/misspell@v0.3.4
SWAGGER_PACKAGE ?= github.com/go-swagger/go-swagger/cmd/swagger@v0.30.5
XGO_PACKAGE ?= src.techknowlogick.com/xgo@latest
GO_LICENSES_PACKAGE ?= github.com/google/go-licenses@v1.6.0
GOVULNCHECK_PACKAGE ?= golang.org/x/vuln/cmd/govulncheck@v0.2.0
GOVULNCHECK_PACKAGE ?= golang.org/x/vuln/cmd/govulncheck@v1.0.0
ACTIONLINT_PACKAGE ?= github.com/rhysd/actionlint/cmd/actionlint@v1.6.25

DOCKER_IMAGE ?= gitea/gitea
Expand Down Expand Up @@ -197,7 +197,6 @@ help:
@echo " - clean delete backend and integration files"
@echo " - clean-all delete backend, frontend and integration files"
@echo " - deps install dependencies"
@echo " - deps-docs install docs dependencies"
@echo " - deps-frontend install frontend dependencies"
@echo " - deps-backend install backend dependencies"
@echo " - deps-tools install tool dependencies"
Expand Down Expand Up @@ -373,11 +372,11 @@ lint-backend-fix: lint-go-fix lint-go-vet lint-editorconfig

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

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

.PHONY: lint-css
lint-css: node_modules
Expand Down Expand Up @@ -865,7 +864,7 @@ release-check: | $(DIST_DIRS)

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

.PHONY: release-sources
release-sources: | $(DIST_DIRS)
Expand All @@ -879,20 +878,14 @@ release-sources: | $(DIST_DIRS)

.PHONY: release-docs
release-docs: | $(DIST_DIRS) docs
tar -czf $(DIST)/release/gitea-docs-$(VERSION).tar.gz -C ./docs/public .
tar -czf $(DIST)/release/gitea-docs-$(VERSION).tar.gz -C ./docs .

.PHONY: docs
docs: deps-docs
cd docs; make trans-copy clean build-offline;

.PHONY: deps-docs
deps-docs:
@hash hugo > /dev/null 2>&1; if [ $$? -ne 0 ]; then \
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; \
fi
docs:
cd docs; bash scripts/trans-copy.sh;

.PHONY: deps
deps: deps-frontend deps-backend deps-tools deps-docs deps-py
deps: deps-frontend deps-backend deps-tools deps-py

.PHONY: deps-py
deps-py: .venv
Expand All @@ -910,7 +903,7 @@ deps-tools:
$(GO) install $(EDITORCONFIG_CHECKER_PACKAGE)
$(GO) install $(GOFUMPT_PACKAGE)
$(GO) install $(GOLANGCI_LINT_PACKAGE)
$(GO) install $(GXZ_PAGAGE)
$(GO) install $(GXZ_PACKAGE)
$(GO) install $(MISSPELL_PACKAGE)
$(GO) install $(SWAGGER_PACKAGE)
$(GO) install $(XGO_PACKAGE)
Expand Down
21 changes: 16 additions & 5 deletions cmd/admin_user_generate_access_token.go
Original file line number Diff line number Diff line change
Expand Up @@ -57,17 +57,28 @@ func runGenerateAccessToken(c *cli.Context) error {
return err
}

accessTokenScope, err := auth_model.AccessTokenScope(c.String("scopes")).Normalize()
// construct token with name and user so we can make sure it is unique
t := &auth_model.AccessToken{
Name: c.String("token-name"),
UID: user.ID,
}

exist, err := auth_model.AccessTokenByNameExists(t)
if err != nil {
return err
}
if exist {
return fmt.Errorf("access token name has been used already")
}

t := &auth_model.AccessToken{
Name: c.String("token-name"),
UID: user.ID,
Scope: accessTokenScope,
// make sure the scopes are valid
accessTokenScope, err := auth_model.AccessTokenScope(c.String("scopes")).Normalize()
if err != nil {
return fmt.Errorf("invalid access token scope provided: %w", err)
}
t.Scope = accessTokenScope

// create the token
if err := auth_model.NewAccessToken(t); err != nil {
return err
}
Expand Down
4 changes: 2 additions & 2 deletions custom/conf/app.example.ini
Original file line number Diff line number Diff line change
Expand Up @@ -1420,8 +1420,8 @@ LEVEL = Info
;; Provides the suffix of the default redis/disk unique queue set name - specific queues can be overridden within in their [queue.name] sections.
;SET_NAME = "_unique"
;;
;; Dynamically scale the worker pool to at this many workers
;MAX_WORKERS = 10
;; Maximum number of worker go-routines for the queue. Default value is "CpuNum/2" clipped to between 1 and 10.
;MAX_WORKERS = ; (dynamic)

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
Expand Down
36 changes: 0 additions & 36 deletions docs/Makefile

This file was deleted.

31 changes: 1 addition & 30 deletions docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,36 +3,7 @@
[![Join the chat at https://img.shields.io/discord/322538954119184384.svg](https://img.shields.io/discord/322538954119184384.svg)](https://discord.gg/Gitea)
[![](https://images.microbadger.com/badges/image/gitea/docs.svg)](http://microbadger.com/images/gitea/docs "Get your own image badge on microbadger.com")

## Hosting

These pages are hosted using [netlifycms](https://www.netlifycms.org/) and get
automatically updated on every push to the `master` branch.

## Install

These pages use the [Hugo](https://gohugo.io/) static site generator.
If you are planning to contribute you'll want to download and install Hugo on
your local machine.

The installation of Hugo is out of the scope of this document, so please take
the [official install instructions](https://gohugo.io/installation/) to
get Hugo up and running.

## Development

To generate the website and serve it on [localhost:1313](http://localhost:1313)
just execute this command and stop it with `Ctrl+C`:

```
make server
```

When you are done with your changes just create a pull request, after merging
the pull request the website will be updated automatically.

## Contributing

Fork -> Patch -> Push -> Pull Request
These docs are ingested by our [docs repo](https://gitea.com/gitea/gitea-docusaurus).

## Authors

Expand Down
22 changes: 1 addition & 21 deletions docs/README_ZH.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,27 +4,7 @@
[![Join the chat at https://img.shields.io/discord/322538954119184384.svg](https://img.shields.io/discord/322538954119184384.svg)](https://discord.gg/Gitea)
[![](https://images.microbadger.com/badges/image/gitea/docs.svg)](http://microbadger.com/images/gitea/docs "Get your own image badge on microbadger.com")

## 关于托管方式

本页面托管在我们 Docker 容器内的基础设施上, 它会在每次推送到 `master` 分支的时候自动更新,如果你想自己管理这个页面,你可以从我们的 Docker 镜像 [gitea/docs](https://hub.docker.com/r/gitea/docs/) 中获取它。

## 安装 Hugo

本页面使用了 [Hugo](https://github.com/spf13/hugo) 静态页面生成工具,如果您有维护它的意愿,则需要在本地计算机上下载并安装 Hugo。Hugo 的安装教程不在本文档的讲述范围之内,详情请参见 [官方文档](https://gohugo.io/overview/installing/)

## 如何部署

[localhost:1313](http://localhost:1313) 处构建和运行网站的命令如下,如果需要停止可以使用组合键 `Ctrl+C`:

```
make server
```

完成更改后,只需创建一个 Pull Request (PR),该 PR 一经合并网站将自动更新。

## 如何贡献您的代码

Fork -> Patch -> Push -> Pull Request
https://gitea.com/gitea/gitea-docusaurus

## 关于我们

Expand Down
Loading

0 comments on commit 6196e19

Please sign in to comment.