Skip to content

Commit ffe6d80

Browse files
committed
Merge branch 'master' of https://github.com/go-gitea/gitea into milestones
2 parents 02c2bc4 + e6036d9 commit ffe6d80

File tree

742 files changed

+40202
-17777
lines changed

Some content is hidden

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

742 files changed

+40202
-17777
lines changed

.drone.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@ steps:
6060
commands:
6161
- make css
6262
- make js
63+
- bash -c '[ -z "$(git status --porcelain public/js public/css)" ] || (echo "Generated js/css files do not match" && git status --porcelain public/js public/css && exit 1)'
6364

6465
- name: build-without-gcc
6566
pull: always

.editorconfig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ indent_size = 2
2424

2525
[*.js]
2626
indent_style = space
27-
indent_size = 4
27+
indent_size = 2
2828

2929
[Makefile]
3030
indent_style = tab

.eslintignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
/web_src/js/semanticDropdown.js

.eslintrc

Lines changed: 33 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,53 @@
11
root: true
22

33
extends:
4+
- eslint-config-airbnb-base
45
- eslint:recommended
56

67
parserOptions:
7-
ecmaVersion: 2015
8+
ecmaVersion: 2020
89

910
env:
1011
browser: true
11-
jquery: true
1212
es6: true
13+
jquery: true
14+
node: true
1315

1416
globals:
17+
__webpack_public_path__: true
1518
Clipboard: false
1619
CodeMirror: false
20+
Dropzone: false
1721
emojify: false
22+
hljs: false
1823
SimpleMDE: false
19-
Vue: false
20-
Dropzone: false
2124
u2fApi: false
22-
hljs: false
25+
Vue: false
2326

2427
rules:
25-
no-unused-vars: [error, {args: all, argsIgnorePattern: ^_, varsIgnorePattern: ^_, ignoreRestSiblings: true}]
26-
prefer-const: [2, {destructuring: all}]
28+
arrow-body-style: [0]
29+
camelcase: [0]
30+
comma-dangle: [2, only-multiline]
31+
consistent-return: [0]
32+
default-case: [0]
33+
func-names: [0]
34+
import/extensions: [0]
35+
max-len: [0]
36+
newline-per-chained-call: [0]
37+
no-alert: [0]
38+
no-continue: [0]
39+
no-mixed-operators: [0]
40+
no-multi-assign: [0]
41+
no-new: [0]
42+
no-param-reassign: [0]
43+
no-plusplus: [0]
44+
no-restricted-syntax: [0]
45+
no-shadow: [0]
46+
no-unused-vars: [2, {args: all, argsIgnorePattern: ^_, varsIgnorePattern: ^_, ignoreRestSiblings: true}]
47+
no-use-before-define: [0]
2748
no-var: [2]
49+
one-var-declaration-per-line: [0]
50+
one-var: [0]
51+
prefer-const: [2, {destructuring: all}]
52+
prefer-destructuring: [0]
53+
radix: [2, as-needed]

.golangci.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,9 @@ issues:
7373
- path: routers/routes/routes.go
7474
linters:
7575
- dupl
76+
- path: routers/api/v1/repo/issue_subscription.go
77+
linters:
78+
- dupl
7679
- path: routers/repo/view.go
7780
linters:
7881
- dupl

CHANGELOG.md

Lines changed: 42 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,44 @@ 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.10.0-RC2](https://github.com/go-gitea/gitea/releases/tag/v1.10.0-rc2) - 2019-10-30
7+
## [1.10.0](https://github.com/go-gitea/gitea/releases/tag/v1.10.0) - 2019-11-13
88
* BREAKING
99
* Fix deadline on update issue or PR via API (#8698)
1010
* Hide some user information via API if user doesn't have enough permission (#8655) (#8657)
11+
* Remove legacy handling of drone token (#8191)
12+
* Change repo search to use exact match for topic search. (#7941)
13+
* Add pagination for admin api get orgs and fix only list public orgs bug (#7742)
14+
* Implement the ability to change the ssh port to match what is in the gitea config (#7286)
15+
* SECURITY
16+
* Fix issue with user.fullname (#8903)
17+
* Ignore mentions for users with no access (#8395)
18+
* Be more strict with git arguments (#7715)
19+
* Extract the username and password from the mirror url (#7651)
20+
* reserve .well-known username (#7637)
21+
* FEATURE
22+
* Org/Members: display 2FA members states + optimize sql requests (#7621)
23+
* SetDefaultBranch on pushing to empty repository (#7610)
24+
* Adds side-by-side diff for images (#6784)
25+
* API method to list all commits of a repository (#6408)
26+
* Password Complexity Checks (#6230)
27+
* Add option to initialize repository with labels (#6061)
28+
* Add additional password hash algorithms (#6023)
1129
* BUGFIXES
30+
* Allow to merge if file path contains " or \ (#8629) (#8771)
31+
* On windows set core.longpaths true (#8776) (#8786)
32+
* Fix 500 when edit hook (#8782) (#8789)
33+
* Fix Checkbox at RepoSettings Protected Branch (#8799) (#8801)
34+
* Fix SSH2 conditional in key parsing code (#8806) (#8810)
35+
* Fix commit expand button to not go to commit link (#8745) (#8825)
36+
* Fix new user form for non-local users (#8826) (#8828)
37+
* Fix to close opened io resources as soon as not needed (#8839) (#8846)
38+
* Fix edit content button on migrated issue content (#8877) (#8884)
39+
* Fix require external registration password (#8885) (#8890)
40+
* Fix password complexity check on registration (#8887) (#8888)
41+
* Update Github Migration Tests (#8896) (#8938) (#8945)
42+
* Enable punctuations ending mentions (#8889) (#8894)
43+
* Add Close() method to gogitRepository (#8901) (#8956)
44+
* Hotfix for review actions and notifications (#8965)
1245
* Expose db.SetMaxOpenConns and allow non MySQL dbs to set conn pool params (#8528) (#8618)
1346
* Fix milestone close timestamp (#8728) (#8730)
1447
* Fix 500 when getting user as unauthenticated user (#8653) (#8663)
@@ -29,22 +62,6 @@ been added to each release, please refer to the [blog](https://blog.gitea.io).
2962
* Fix password complexity regex for special characters (#8524)
3063
* Prevent .code-view from overriding font on icon fonts (#8614) (#8627)
3164
* Allow more than 255 characters for tokens in external_login_user table (#8554)
32-
33-
## [1.10.0-RC1](https://github.com/go-gitea/gitea/releases/tag/v1.10.0-rc1) - 2019-10-14
34-
* BREAKING
35-
* Remove legacy handling of drone token (#8191)
36-
* Change repo search to use exact match for topic search. (#7941)
37-
* Add pagination for admin api get orgs and fix only list public orgs bug (#7742)
38-
* Implement the ability to change the ssh port to match what is in the gitea config (#7286)
39-
* FEATURE
40-
* Org/Members: display 2FA members states + optimize sql requests (#7621)
41-
* SetDefaultBranch on pushing to empty repository (#7610)
42-
* Adds side-by-side diff for images (#6784)
43-
* API method to list all commits of a repository (#6408)
44-
* Password Complexity Checks (#6230)
45-
* Add option to initialize repository with labels (#6061)
46-
* Add additional password hash algorithms (#6023)
47-
* BUGFIXES
4865
* Fix errors in create org UI regarding team access permission (#8506)
4966
* Fix bug on FindExternalUsersByProvider (#8504)
5067
* Create .ssh dir as necessary (#8486)
@@ -244,10 +261,6 @@ been added to each release, please refer to the [blog](https://blog.gitea.io).
244261
* Support setting cookie domain (#6288)
245262
* Move migrating repository from frontend to backend (#6200)
246263
* Delete releases attachments if release is deleted (#6068)
247-
* SECURITY
248-
* Ignore mentions for users with no access (#8395)
249-
* Be more strict with git arguments (#7715)
250-
* reserve .well-known username (#7637)
251264
* TRANSLATION
252265
* Latvian translation for home page (#8468)
253266
* Add home template italian translation (#8352)
@@ -276,7 +289,6 @@ been added to each release, please refer to the [blog](https://blog.gitea.io).
276289
* Fix global search result CSS, misc CSS tweaks (#7789)
277290
* Tweak label border CSS (#7739)
278291
* Fix create menu item widths (#7708)
279-
* Extract the username and password from the mirror url (#7651)
280292
* [Branch View] Delete duplicate protection symbol (#7624)
281293
* [Branch View] Delete Table Header (#7622)
282294
* [Branch View] icons to buttons (#7602)
@@ -289,6 +301,14 @@ been added to each release, please refer to the [blog](https://blog.gitea.io).
289301
* wiki - editor - add buttons 'inline code', 'empty checkbox', 'checked checkbox' (#7243)
290302
* Fix Statuses API only shows first 10 statuses: Add paging and extend API GetCommitStatuses (#7141)
291303

304+
## [1.9.6](https://github.com/go-gitea/gitea/releases/tag/v1.9.6) - 2019-11-13
305+
* BUGFIXES
306+
* Allow to merge if file path contains " or \ (#8629) (#8772)
307+
* Fix 500 when edit hook (#8782) (#8790)
308+
* Fix issue with user.fullname (#8904)
309+
* Update Github Migration Test (#8897) (#8946)
310+
* Add Close() method to gogitRepository (#8901) (#8958)
311+
292312
## [1.9.5](https://github.com/go-gitea/gitea/releases/tag/v1.9.5) - 2019-10-30
293313
* BREAKING
294314
* Hide some user information via API if user doesn't have enough permission (#8655) (#8658)

Makefile

Lines changed: 6 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -434,22 +434,16 @@ npm-update: npm-check
434434

435435
.PHONY: js
436436
js: npm
437-
npx eslint public/js
437+
npx eslint web_src/js webpack.config.js
438+
npx webpack
438439

439440
.PHONY: css
440441
css: npm
441-
npx stylelint public/less
442-
npx lessc --clean-css="--s0 -b" public/less/index.less public/css/index.css
443-
$(foreach file, $(filter-out public/less/themes/_base.less, $(wildcard public/less/themes/*)),npx lessc --clean-css="--s0 -b" public/less/themes/$(notdir $(file)) > public/css/theme-$(notdir $(call strip-suffix,$(file))).css;)
442+
npx stylelint web_src/less
443+
npx lessc --clean-css="--s0 -b" web_src/less/index.less public/css/index.css
444+
$(foreach file, $(filter-out web_src/less/themes/_base.less, $(wildcard web_src/less/themes/*)),npx lessc --clean-css="--s0 -b" web_src/less/themes/$(notdir $(file)) > public/css/theme-$(notdir $(call strip-suffix,$(file))).css;)
444445
npx postcss --use autoprefixer --no-map --replace public/css/*
445446

446-
@diff=$$(git diff public/css/*); \
447-
if ([ -n "$$CI" ] && [ -n "$$diff" ]); then \
448-
echo "Generated files in public/css have changed, please commit the result:"; \
449-
echo "$${diff}"; \
450-
exit 1; \
451-
fi;
452-
453447
.PHONY: javascripts
454448
javascripts:
455449
echo "'make javascripts' is deprecated, please use 'make js'"
@@ -521,4 +515,4 @@ golangci-lint:
521515
export BINARY="golangci-lint"; \
522516
curl -sfL https://install.goreleaser.com/github.com/golangci/golangci-lint.sh | sh -s -- -b $(GOPATH)/bin v1.20.0; \
523517
fi
524-
golangci-lint run
518+
golangci-lint run --timeout 5m

README.md

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
[简体中文](https://github.com/go-gitea/gitea/blob/master/README_ZH.md)
1+
[简体中文](README_ZH.md)
22

33
<h1> <img src="https://raw.githubusercontent.com/go-gitea/gitea/master/public/img/gitea-192.png" alt="logo" width="30" height="30"> Gitea - Git with a cup of tea</h1>
44

@@ -105,9 +105,8 @@ for the full license text.
105105
## Screenshots
106106
Looking for an overview of the interface? Check it out!
107107

108-
| | | |
108+
|![Dashboard](https://dl.gitea.io/screenshots/home_timeline.png)|![User Profile](https://dl.gitea.io/screenshots/user_profile.png)|![Global Issues](https://dl.gitea.io/screenshots/global_issues.png)|
109109
|:---:|:---:|:---:|
110-
|![Dashboard](https://image.ibb.co/dms6DG/1.png)|![Repository](https://image.ibb.co/m6MSLw/2.png)|![Commits History](https://image.ibb.co/cjrSLw/3.png)|
111-
|![Branches](https://image.ibb.co/e6vbDG/4.png)|![Issues](https://image.ibb.co/bJTJSb/5.png)|![Pull Request View](https://image.ibb.co/e02dSb/6.png)|
112-
|![Releases](https://image.ibb.co/cUzgfw/7.png)|![Activity](https://image.ibb.co/eZgGDG/8.png)|![Uncyclo](https://image.ibb.co/dYV9YG/9.png)|
113-
|![Diff](https://image.ibb.co/ewA9YG/10.png)|![Organization](https://image.ibb.co/ceOwDG/11.png)|![Profile](https://image.ibb.co/c44Q7b/12.png)|
110+
|![Branches](https://dl.gitea.io/screenshots/branches.png)|![Web Editor](https://dl.gitea.io/screenshots/web_editor.png)|![Activity](https://dl.gitea.io/screenshots/activity.png)|
111+
|![New Migration](https://dl.gitea.io/screenshots/migration.png)|![Migrating](https://dl.gitea.io/screenshots/migration.gif)|![Pull Request View](https://image.ibb.co/e02dSb/6.png)
112+
![Pull Request Dark](https://dl.gitea.io/screenshots/pull_requests_dark.png)|![Diff Review Dark](https://dl.gitea.io/screenshots/review_dark.png)|![Diff Dark](https://dl.gitea.io/screenshots/diff_dark.png)|

README_ZH.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,15 @@
1-
[English](https://github.com/go-gitea/gitea/blob/master/README.md)
1+
[English](README.md)
22

3-
# Gitea - Git with a cup of tea
3+
<h1> <img src="https://raw.githubusercontent.com/go-gitea/gitea/master/public/img/gitea-192.png" alt="logo" width="30" height="30"> Gitea - Git with a cup of tea</h1>
44

55
[![Build Status](https://drone.gitea.io/api/badges/go-gitea/gitea/status.svg)](https://drone.gitea.io/go-gitea/gitea)
6-
[![Join the chat at https://img.shields.io/discord/322538954119184384.svg](https://img.shields.io/discord/322538954119184384.svg)](https://discord.gg/gitea)
6+
[![Join the Discord chat at https://discord.gg/NsatcWJ](https://img.shields.io/discord/322538954119184384.svg)](https://discord.gg/NsatcWJ)
77
[![](https://images.microbadger.com/badges/image/gitea/gitea.svg)](https://microbadger.com/images/gitea/gitea "Get your own image badge on microbadger.com")
88
[![codecov](https://codecov.io/gh/go-gitea/gitea/branch/master/graph/badge.svg)](https://codecov.io/gh/go-gitea/gitea)
99
[![Go Report Card](https://goreportcard.com/badge/code.gitea.io/gitea)](https://goreportcard.com/report/code.gitea.io/gitea)
1010
[![GoDoc](https://godoc.org/code.gitea.io/gitea?status.svg)](https://godoc.org/code.gitea.io/gitea)
1111
[![GitHub release](https://img.shields.io/github/release/go-gitea/gitea.svg)](https://github.com/go-gitea/gitea/releases/latest)
12+
[![Help Contribute to Open Source](https://www.codetriage.com/go-gitea/gitea/badges/users.svg)](https://www.codetriage.com/go-gitea/gitea)
1213
[![Become a backer/sponsor of gitea](https://opencollective.com/gitea/tiers/backers/badge.svg?label=backers&color=brightgreen)](https://opencollective.com/gitea)
1314
[![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](https://opensource.org/licenses/MIT)
1415
[![Crowdin](https://badges.crowdin.net/gitea/localized.svg)](https://crowdin.com/project/gitea)
@@ -45,9 +46,8 @@ Fork -> Patch -> Push -> Pull Request
4546

4647
## 截图
4748

48-
| | | |
49+
|![Dashboard](https://dl.gitea.io/screenshots/home_timeline.png)|![User Profile](https://dl.gitea.io/screenshots/user_profile.png)|![Global Issues](https://dl.gitea.io/screenshots/global_issues.png)|
4950
|:---:|:---:|:---:|
50-
|![Dashboard](https://image.ibb.co/dms6DG/1.png)|![Repository](https://image.ibb.co/m6MSLw/2.png)|![Commits History](https://image.ibb.co/cjrSLw/3.png)|
51-
|![Branches](https://image.ibb.co/e6vbDG/4.png)|![Issues](https://image.ibb.co/bJTJSb/5.png)|![Pull Request View](https://image.ibb.co/e02dSb/6.png)|
52-
|![Releases](https://image.ibb.co/cUzgfw/7.png)|![Activity](https://image.ibb.co/eZgGDG/8.png)|![Uncyclo](https://image.ibb.co/dYV9YG/9.png)|
53-
|![Diff](https://image.ibb.co/ewA9YG/10.png)|![Organization](https://image.ibb.co/ceOwDG/11.png)|![Profile](https://image.ibb.co/c44Q7b/12.png)|
51+
|![Branches](https://dl.gitea.io/screenshots/branches.png)|![Web Editor](https://dl.gitea.io/screenshots/web_editor.png)|![Activity](https://dl.gitea.io/screenshots/activity.png)|
52+
|![New Migration](https://dl.gitea.io/screenshots/migration.png)|![Migrating](https://dl.gitea.io/screenshots/migration.gif)|![Pull Request View](https://image.ibb.co/e02dSb/6.png)
53+
![Pull Request Dark](https://dl.gitea.io/screenshots/pull_requests_dark.png)|![Diff Review Dark](https://dl.gitea.io/screenshots/review_dark.png)|![Diff Dark](https://dl.gitea.io/screenshots/diff_dark.png)|

cmd/admin.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -375,17 +375,20 @@ func runRepoSyncReleases(c *cli.Context) error {
375375

376376
if err = models.SyncReleasesWithTags(repo, gitRepo); err != nil {
377377
log.Warn(" SyncReleasesWithTags: %v", err)
378+
gitRepo.Close()
378379
continue
379380
}
380381

381382
count, err = getReleaseCount(repo.ID)
382383
if err != nil {
383384
log.Warn(" GetReleaseCountByRepoID: %v", err)
385+
gitRepo.Close()
384386
continue
385387
}
386388

387389
log.Trace(" repo %s releases synchronized to tags: from %d to %d",
388390
repo.FullName(), oldnum, count)
391+
gitRepo.Close()
389392
}
390393
}
391394

cmd/hook.go

Lines changed: 22 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ import (
1616
"code.gitea.io/gitea/models"
1717
"code.gitea.io/gitea/modules/git"
1818
"code.gitea.io/gitea/modules/private"
19+
"code.gitea.io/gitea/modules/setting"
1920

2021
"github.com/urfave/cli"
2122
)
@@ -55,7 +56,13 @@ var (
5556

5657
func runHookPreReceive(c *cli.Context) error {
5758
if len(os.Getenv("SSH_ORIGINAL_COMMAND")) == 0 {
58-
return nil
59+
if setting.OnlyAllowPushIfGiteaEnvironmentSet {
60+
fail(`Rejecting changes as Gitea environment not set.
61+
If you are pushing over SSH you must push with a key managed by
62+
Gitea or set your environment appropriately.`, "")
63+
} else {
64+
return nil
65+
}
5966
}
6067

6168
setup("hooks/pre-receive.log")
@@ -115,7 +122,13 @@ func runHookPreReceive(c *cli.Context) error {
115122

116123
func runHookUpdate(c *cli.Context) error {
117124
if len(os.Getenv("SSH_ORIGINAL_COMMAND")) == 0 {
118-
return nil
125+
if setting.OnlyAllowPushIfGiteaEnvironmentSet {
126+
fail(`Rejecting changes as Gitea environment not set.
127+
If you are pushing over SSH you must push with a key managed by
128+
Gitea or set your environment appropriately.`, "")
129+
} else {
130+
return nil
131+
}
119132
}
120133

121134
setup("hooks/update.log")
@@ -125,7 +138,13 @@ func runHookUpdate(c *cli.Context) error {
125138

126139
func runHookPostReceive(c *cli.Context) error {
127140
if len(os.Getenv("SSH_ORIGINAL_COMMAND")) == 0 {
128-
return nil
141+
if setting.OnlyAllowPushIfGiteaEnvironmentSet {
142+
fail(`Rejecting changes as Gitea environment not set.
143+
If you are pushing over SSH you must push with a key managed by
144+
Gitea or set your environment appropriately.`, "")
145+
} else {
146+
return nil
147+
}
129148
}
130149

131150
setup("hooks/post-receive.log")

cmd/web.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -227,7 +227,8 @@ func runWeb(ctx *cli.Context) error {
227227
log.Critical("Failed to start server: %v", err)
228228
}
229229
log.Info("HTTP Listener: %s Closed", listenAddr)
230-
graceful.WaitForServers()
230+
graceful.Manager.WaitForServers()
231+
graceful.Manager.WaitForTerminate()
231232
log.Close()
232233
return nil
233234
}

cmd/web_graceful.go

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
// +build !windows
2-
31
// Copyright 2016 The Gitea Authors. All rights reserved.
42
// Use of this source code is governed by a MIT-style
53
// license that can be found in the LICENSE file.
@@ -27,11 +25,11 @@ func runHTTPSWithTLSConfig(listenAddr string, tlsConfig *tls.Config, m http.Hand
2725

2826
// NoHTTPRedirector tells our cleanup routine that we will not be using a fallback http redirector
2927
func NoHTTPRedirector() {
30-
graceful.InformCleanup()
28+
graceful.Manager.InformCleanup()
3129
}
3230

3331
// NoMainListener tells our cleanup routine that we will not be using a possibly provided listener
3432
// for our main HTTP/HTTPS service
3533
func NoMainListener() {
36-
graceful.InformCleanup()
34+
graceful.Manager.InformCleanup()
3735
}

0 commit comments

Comments
 (0)