Skip to content

Commit 03b37ce

Browse files
authored
Merge branch 'main' into 18883_bulk_selected_issues
2 parents 5d9fb50 + 17ce5f8 commit 03b37ce

File tree

179 files changed

+11829
-8074
lines changed

Some content is hidden

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

179 files changed

+11829
-8074
lines changed

.drone.yml

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ volumes:
1919

2020
steps:
2121
- name: deps-frontend
22-
image: node:16
22+
image: node:18
2323
pull: always
2424
commands:
2525
- make deps-frontend
@@ -34,7 +34,7 @@ steps:
3434
path: /go
3535

3636
- name: lint-frontend
37-
image: node:16
37+
image: node:18
3838
commands:
3939
- make lint-frontend
4040
depends_on: [deps-frontend]
@@ -82,7 +82,7 @@ steps:
8282
path: /go
8383

8484
- name: checks-frontend
85-
image: node:16
85+
image: node:18
8686
commands:
8787
- make checks-frontend
8888
depends_on: [deps-frontend]
@@ -97,13 +97,13 @@ steps:
9797
path: /go
9898

9999
- name: test-frontend
100-
image: node:16
100+
image: node:18
101101
commands:
102102
- make test-frontend
103103
depends_on: [lint-frontend]
104104

105105
- name: build-frontend
106-
image: node:16
106+
image: node:18
107107
commands:
108108
- make frontend
109109
depends_on: [test-frontend]
@@ -634,7 +634,7 @@ steps:
634634
- git fetch --tags --force
635635

636636
- name: deps-frontend
637-
image: node:16
637+
image: node:18
638638
pull: always
639639
commands:
640640
- make deps-frontend
@@ -652,6 +652,7 @@ steps:
652652
image: techknowlogick/xgo:go-1.18.x
653653
pull: always
654654
commands:
655+
# Upgrade to node 18 once https://github.com/techknowlogick/xgo/issues/163 is resolved
655656
- curl -sL https://deb.nodesource.com/setup_16.x | bash - && apt-get install -y nodejs
656657
- export PATH=$PATH:$GOPATH/bin
657658
- make release
@@ -753,7 +754,7 @@ steps:
753754
- git fetch --tags --force
754755

755756
- name: deps-frontend
756-
image: node:16
757+
image: node:18
757758
pull: always
758759
commands:
759760
- make deps-frontend
@@ -771,6 +772,7 @@ steps:
771772
image: techknowlogick/xgo:go-1.18.x
772773
pull: always
773774
commands:
775+
# Upgrade to node 18 once https://github.com/techknowlogick/xgo/issues/163 is resolved
774776
- curl -sL https://deb.nodesource.com/setup_16.x | bash - && apt-get install -y nodejs
775777
- export PATH=$PATH:$GOPATH/bin
776778
- make release

.eslintrc.yaml

Lines changed: 1 addition & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -11,32 +11,20 @@ parserOptions:
1111
plugins:
1212
- eslint-plugin-unicorn
1313
- eslint-plugin-import
14-
- eslint-plugin-vue
15-
- eslint-plugin-html
1614
- eslint-plugin-jquery
1715

18-
extends:
19-
- plugin:vue/recommended
20-
2116
env:
2217
es2022: true
2318
node: true
2419

2520
globals:
2621
__webpack_public_path__: true
2722

28-
settings:
29-
html/html-extensions: [".tmpl"]
30-
3123
overrides:
32-
- files: ["web_src/**/*.js", "web_src/**/*.vue", "templates/**/*.tmpl"]
24+
- files: ["web_src/**/*.js", "docs/**/*.js"]
3325
env:
3426
browser: true
3527
node: false
36-
- files: ["templates/**/*.tmpl"]
37-
rules:
38-
no-tabs: [0]
39-
indent: [2, tab, {SwitchCase: 1}]
4028
- files: ["web_src/**/*worker.js"]
4129
env:
4230
worker: true
@@ -502,11 +490,6 @@ rules:
502490
use-isnan: [2]
503491
valid-typeof: [2, {requireStringLiterals: true}]
504492
vars-on-top: [0]
505-
vue/attributes-order: [0]
506-
vue/component-definition-name-casing: [0]
507-
vue/html-closing-bracket-spacing: [0]
508-
vue/max-attributes-per-line: [0]
509-
vue/one-component-per-file: [0]
510493
wrap-iife: [2, inside]
511494
wrap-regex: [0]
512495
yield-star-spacing: [2, after]

.spectral.yaml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
extends: [[spectral:oas, all]]
2+
3+
rules:
4+
info-contact: off
5+
oas2-api-host: off
6+
oas2-parameter-description: off
7+
oas2-schema: off
8+
oas2-valid-schema-example: off
9+
openapi-tags: off
10+
operation-description: off
11+
operation-singular-tag: off
12+
operation-tag-defined: off

CHANGELOG.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,15 @@ 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.9](https://github.com/go-gitea/gitea/releases/tag/v1.16.9) - 2022-06-21
7+
## [1.16.9](https://github.com/go-gitea/gitea/releases/tag/v1.16.9) - 2022-07-12
88

9+
* SECURITY
10+
* Add write check for creating Commit status (#20332) (#20334)
11+
* Check for permission when fetching user controlled issues (#20133) (#20196)
912
* BUGFIXES
13+
* Hide notify mail setting ui if not enabled (#20138) (#20337)
14+
* Add write check for creating Commit status (#20332) (#20334)
15+
* Only show Followers that current user can access (#20220) (#20253)
1016
* Release page show all tags in compare dropdown (#20070) (#20071)
1117
* Fix permission check for delete tag (#19985) (#20001)
1218
* Only log non ErrNotExist errors in git.GetNote (#19884) (#19905)

Dockerfile.rootless

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ ENV GITEA_CUSTOM /var/lib/gitea/custom
6262
ENV GITEA_TEMP /tmp/gitea
6363
ENV TMPDIR /tmp/gitea
6464

65-
#TODO add to docs the ability to define the ini to load (usefull to test and revert a config)
65+
#TODO add to docs the ability to define the ini to load (useful to test and revert a config)
6666
ENV GITEA_APP_INI /etc/gitea/app.ini
6767
ENV HOME "/var/lib/gitea/git"
6868
VOLUME ["/var/lib/gitea", "/etc/gitea"]

Makefile

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ else
1717
DIST := dist
1818
DIST_DIRS := $(DIST)/binaries $(DIST)/release
1919
IMPORT := code.gitea.io/gitea
20-
export GO111MODULE=on
2120

2221
GO ?= go
2322
SHASUM ?= shasum -a 256
@@ -202,9 +201,9 @@ help:
202201

203202
.PHONY: go-check
204203
go-check:
205-
$(eval MIN_GO_VERSION_STR := $(shell grep -Eo '^go\s+[0-9]+\.[0-9.]+' go.mod | cut -d' ' -f2))
206-
$(eval MIN_GO_VERSION := $(shell printf "%03d%03d%03d" $(shell echo '$(MIN_GO_VERSION_STR)' | tr '.' ' ')))
207-
$(eval GO_VERSION := $(shell printf "%03d%03d%03d" $(shell $(GO) version | grep -Eo '[0-9]+\.[0-9.]+' | tr '.' ' ');))
204+
$(eval MIN_GO_VERSION_STR := $(shell grep -Eo '^go\s+[0-9]+\.[0-9]+' go.mod | cut -d' ' -f2))
205+
$(eval MIN_GO_VERSION := $(shell printf "%03d%03d" $(shell echo '$(MIN_GO_VERSION_STR)' | tr '.' ' ')))
206+
$(eval GO_VERSION := $(shell printf "%03d%03d" $(shell $(GO) version | grep -Eo '[0-9]+\.[0-9]+' | tr '.' ' ');))
208207
@if [ "$(GO_VERSION)" -lt "$(MIN_GO_VERSION)" ]; then \
209208
echo "Gitea requires Go $(MIN_GO_VERSION_STR) or greater to build. You can get it at https://go.dev/dl/"; \
210209
exit 1; \
@@ -311,8 +310,9 @@ lint: lint-frontend lint-backend
311310

312311
.PHONY: lint-frontend
313312
lint-frontend: node_modules
314-
npx eslint --color --max-warnings=0 web_src/js build templates *.config.js docs/assets/js
313+
npx eslint --color --max-warnings=0 --ext js,vue web_src/js build *.config.js docs/assets/js
315314
npx stylelint --color --max-warnings=0 web_src/less
315+
npx spectral lint -q -F hint $(SWAGGER_SPEC)
316316

317317
.PHONY: lint-backend
318318
lint-backend: golangci-lint vet editorconfig-checker
@@ -363,7 +363,7 @@ test\#%:
363363
coverage:
364364
grep '^\(mode: .*\)\|\(.*:[0-9]\+\.[0-9]\+,[0-9]\+\.[0-9]\+ [0-9]\+ [0-9]\+\)$$' coverage.out > coverage-bodged.out
365365
grep '^\(mode: .*\)\|\(.*:[0-9]\+\.[0-9]\+,[0-9]\+\.[0-9]\+ [0-9]\+ [0-9]\+\)$$' integration.coverage.out > integration.coverage-bodged.out
366-
GO111MODULE=on $(GO) run build/gocovmerge.go integration.coverage-bodged.out coverage-bodged.out > coverage.all || (echo "gocovmerge failed"; echo "integration.coverage.out"; cat integration.coverage.out; echo "coverage.out"; cat coverage.out; exit 1)
366+
$(GO) run build/gocovmerge.go integration.coverage-bodged.out coverage-bodged.out > coverage.all || (echo "gocovmerge failed"; echo "integration.coverage.out"; cat integration.coverage.out; echo "coverage.out"; cat coverage.out; exit 1)
367367

368368
.PHONY: unit-test-coverage
369369
unit-test-coverage:
@@ -754,11 +754,11 @@ update-translations:
754754

755755
.PHONY: generate-license
756756
generate-license:
757-
GO111MODULE=on $(GO) run build/generate-licenses.go
757+
$(GO) run build/generate-licenses.go
758758

759759
.PHONY: generate-gitignore
760760
generate-gitignore:
761-
GO111MODULE=on $(GO) run build/generate-gitignores.go
761+
$(GO) run build/generate-gitignores.go
762762

763763
.PHONY: generate-images
764764
generate-images: | node_modules
@@ -771,7 +771,7 @@ generate-manpage:
771771
@mkdir -p man/man1/ man/man5
772772
@./gitea docs --man > man/man1/gitea.1
773773
@gzip -9 man/man1/gitea.1 && echo man/man1/gitea.1.gz created
774-
@#TODO A smal script witch format config-cheat-sheet.en-us.md nicely to suit as config man page
774+
@#TODO A small script that formats config-cheat-sheet.en-us.md nicely for use as a config man page
775775

776776
.PHONY: pr\#%
777777
pr\#%: clean-all

README.md

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -45,21 +45,21 @@
4545
</p>
4646

4747
<p align="center">
48-
<a href="README_ZH.md">View the chinese version of this document</a>
48+
<a href="README_ZH.md">View this document in Chinese</a>
4949
</p>
5050

5151
## Purpose
5252

5353
The goal of this project is to make the easiest, fastest, and most
5454
painless way of setting up a self-hosted Git service.
55-
Using Go, this can be done with an independent binary distribution across
56-
**all platforms** which Go supports, including Linux, macOS, and Windows
57-
on x86, amd64, ARM and PowerPC architectures.
58-
Want to try it before doing anything else?
59-
Do it [with the online demo](https://try.gitea.io/)!
55+
56+
As Gitea is written in Go, it works across **all** the platforms and
57+
architectures that are supported by Go, including Linux, macOS, and
58+
Windows on x86, amd64, ARM and PowerPC architectures.
59+
You can try it out using [the online demo](https://try.gitea.io/).
6060
This project has been
6161
[forked](https://blog.gitea.io/2016/12/welcome-to-gitea/) from
62-
[Gogs](https://gogs.io) since 2016.11 but changed a lot.
62+
[Gogs](https://gogs.io) since November of 2016, but a lot has changed.
6363

6464
## Building
6565

@@ -102,7 +102,7 @@ NOTES:
102102

103103
Translations are done through Crowdin. If you want to translate to a new language ask one of the managers in the Crowdin project to add a new language there.
104104

105-
You can also just create an issue for adding a language or ask on discord on the #translation channel. If you need context or find some translation issues, you can leave a comment on the string or ask on Discord. For general translation questions there is a section in the docs. Currently a bit empty but we hope fo fill it as questions pop up.
105+
You can also just create an issue for adding a language or ask on discord on the #translation channel. If you need context or find some translation issues, you can leave a comment on the string or ask on Discord. For general translation questions there is a section in the docs. Currently a bit empty but we hope to fill it as questions pop up.
106106

107107
https://docs.gitea.io/en-us/translation-guidelines/
108108

@@ -114,7 +114,7 @@ For more information and instructions about how to install Gitea, please look at
114114
If you have questions that are not covered by the documentation, you can get in contact with us on our [Discord server](https://discord.gg/Gitea) or create a post in the [discourse forum](https://discourse.gitea.io/).
115115

116116
We maintain a list of Gitea-related projects at [gitea/awesome-gitea](https://gitea.com/gitea/awesome-gitea).
117-
The hugo-based documentation theme is hosted at [gitea/theme](https://gitea.com/gitea/theme).
117+
The Hugo-based documentation theme is hosted at [gitea/theme](https://gitea.com/gitea/theme).
118118
The official Gitea CLI is developed at [gitea/tea](https://gitea.com/gitea/tea).
119119

120120
## Authors

README_ZH.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@
4545
</p>
4646

4747
<p align="center">
48-
<a href="README.md">View the english version of this document</a>
48+
<a href="README.md">View this document in English</a>
4949
</p>
5050

5151
## 目标

cmd/admin.go

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -157,6 +157,10 @@ var (
157157
Name: "email,e",
158158
Usage: "Email of the user to delete",
159159
},
160+
cli.BoolFlag{
161+
Name: "purge",
162+
Usage: "Purge user, all their repositories, organizations and comments",
163+
},
160164
},
161165
Action: runDeleteUser,
162166
}
@@ -675,7 +679,7 @@ func runDeleteUser(c *cli.Context) error {
675679
return fmt.Errorf("The user %s does not match the provided id %d", user.Name, c.Int64("id"))
676680
}
677681

678-
return user_service.DeleteUser(user)
682+
return user_service.DeleteUser(ctx, user, c.Bool("purge"))
679683
}
680684

681685
func runGenerateAccessToken(c *cli.Context) error {

cmd/admin_auth_ldap.go

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,10 @@ var (
3434
Name: "not-active",
3535
Usage: "Deactivate the authentication source.",
3636
},
37+
cli.BoolFlag{
38+
Name: "active",
39+
Usage: "Activate the authentication source.",
40+
},
3741
cli.StringFlag{
3842
Name: "security-protocol",
3943
Usage: "Security protocol name.",
@@ -117,6 +121,10 @@ var (
117121
Name: "synchronize-users",
118122
Usage: "Enable user synchronization.",
119123
},
124+
cli.BoolFlag{
125+
Name: "disable-synchronize-users",
126+
Usage: "Disable user synchronization.",
127+
},
120128
cli.UintFlag{
121129
Name: "page-size",
122130
Usage: "Search page size.",
@@ -183,9 +191,15 @@ func parseAuthSource(c *cli.Context, authSource *auth.Source) {
183191
if c.IsSet("not-active") {
184192
authSource.IsActive = !c.Bool("not-active")
185193
}
194+
if c.IsSet("active") {
195+
authSource.IsActive = c.Bool("active")
196+
}
186197
if c.IsSet("synchronize-users") {
187198
authSource.IsSyncEnabled = c.Bool("synchronize-users")
188199
}
200+
if c.IsSet("disable-synchronize-users") {
201+
authSource.IsSyncEnabled = !c.Bool("disable-synchronize-users")
202+
}
189203
}
190204

191205
// parseLdapConfig assigns values on config according to command line flags.

0 commit comments

Comments
 (0)