]> source.dussan.org Git - gitea.git/log
gitea.git
2 years agoAdded comment for changing issue ref (#17672)
Gusted [Fri, 19 Nov 2021 09:54:31 +0000 (09:54 +0000)]
Added comment for changing issue ref (#17672)

* Added comment for changing issue ref
- Add a comment when someone changes the ref(erence?) of a issue.

2 years agoRemove unused `user` paramater (#17723)
Gusted [Fri, 19 Nov 2021 08:37:13 +0000 (08:37 +0000)]
Remove unused `user` paramater (#17723)

As title

2 years agoPrepare and check test env during CI (#17725)
wxiaoguang [Fri, 19 Nov 2021 05:58:34 +0000 (13:58 +0800)]
Prepare and check test env during CI (#17725)

This PR should resolve the permission problems during CI, if the uid doesn't match, a more clear message is shown.

*  CI fails with unknown permission problems #17710

The new drone step dependencies:

(root)prepare-test-env -> (gitea)build -> (gitea)test

2 years agoFix bug when project board get open issue number (#17703)
Lunny Xiao [Fri, 19 Nov 2021 04:00:18 +0000 (12:00 +0800)]
Fix bug when project board get open issue number (#17703)

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
Co-authored-by: techknowlogick <techknowlogick@gitea.io>
2 years agoperf: sent `data-path` once for each file (#17657)
Gusted [Fri, 19 Nov 2021 02:28:27 +0000 (02:28 +0000)]
perf: sent `data-path` once for each file (#17657)

- Don't sent it with each line, instead send it at the top-element for each file.
- Related:
https://github.com/go-gitea/gitea/pull/17618#issuecomment-968192761

2.5K Additions:
No-Patch:
Unified: 2.14 MB (2.14 MB size)
Split: 2.59 MB (2.59 MB size)

Patch:
Unified: 2.10 MB (2.10 MB size) (-1.8%)
Split: 2.55 MB (2.55 MB size) (-1.5%)

2 years agoPrevent deadlock in TestPersistableChannelQueue (#17717)
zeripath [Fri, 19 Nov 2021 01:13:25 +0000 (01:13 +0000)]
Prevent deadlock in TestPersistableChannelQueue (#17717)

* Prevent deadlock in TestPersistableChannelQueue

There is a potential deadlock in TestPersistableChannelQueue due to attempting to
shutdown the test queue before it is ready.

Signed-off-by: Andrew Thornton <art27@cantab.net>
* prevent npe

Signed-off-by: Andrew Thornton <art27@cantab.net>
2 years ago[skip ci] Updated translations via Crowdin
GiteaBot [Fri, 19 Nov 2021 00:25:46 +0000 (00:25 +0000)]
[skip ci] Updated translations via Crowdin

2 years agoMove user/org deletion to services (#17673)
KN4CK3R [Thu, 18 Nov 2021 17:42:27 +0000 (18:42 +0100)]
Move user/org deletion to services (#17673)

2 years agoRefactor repo-legacy.js, remove messy global variables. Fix errors. (#17646)
wxiaoguang [Thu, 18 Nov 2021 16:45:00 +0000 (00:45 +0800)]
Refactor repo-legacy.js, remove messy global variables. Fix errors. (#17646)

Refactor repo-legacy.js, remove messy global variables. Fix errors.
Fix an error in Sortable
Fix a incorrect call assignMenuAttributes from the template

2 years agoFix Migrate Description (#17692)
99rgosse [Thu, 18 Nov 2021 15:28:10 +0000 (16:28 +0100)]
Fix Migrate Description (#17692)

Co-authored-by: 6543 <6543@obermui.de>
Co-authored-by: techknowlogick <techknowlogick@gitea.io>
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
2 years agoAdd pagination to fork list (#17639)
Gusted [Thu, 18 Nov 2021 14:45:56 +0000 (14:45 +0000)]
Add pagination to fork list (#17639)

- Resolves #14574
- Adds the necessary code to have pagination working in the forks list of
a repo. The code is mostly in par with the stars/watcher implementation.

2 years agoFix possible panic (#17694)
Gusted [Thu, 18 Nov 2021 13:25:56 +0000 (13:25 +0000)]
Fix possible panic (#17694)

- The code will get the first and second character `link[{0,1]]`.
However in a rare case the `link` could have 1 character and thus the
`link[1]` will create a panic.

2 years agoSimplify code for wrting SHA to name-rev (#17696)
Gusted [Thu, 18 Nov 2021 09:50:22 +0000 (09:50 +0000)]
Simplify code for wrting SHA to name-rev (#17696)

2 years agoPrevent NPE due to missing repo in regression in #17551 (#17697)
zeripath [Thu, 18 Nov 2021 08:18:12 +0000 (08:18 +0000)]
Prevent NPE due to missing repo in regression in #17551 (#17697)

2 years agoMove task from modules to services (#17680)
Lunny Xiao [Thu, 18 Nov 2021 06:47:57 +0000 (14:47 +0800)]
Move task from modules to services (#17680)

2 years agoMove user functions into user.go (#17659)
Lunny Xiao [Thu, 18 Nov 2021 05:58:42 +0000 (13:58 +0800)]
Move user functions into user.go (#17659)

* Move user functions into user.go

* Fix test

2 years agoCleanup and use global style on popups (#17674)
silverwind [Thu, 18 Nov 2021 03:26:50 +0000 (04:26 +0100)]
Cleanup and use global style on popups (#17674)

* Cleanup and use global style on popups

- Fix typo 'poping' to 'popping'
- Remove most inline 'data-variation' attributes
- Initialize all popups with 'inverted tiny' variation

* misc tweaks

* rename to .tooltip, use jQuery

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
2 years agoRemove unnecessary variable assignments (#17695)
Gusted [Thu, 18 Nov 2021 01:33:06 +0000 (01:33 +0000)]
Remove unnecessary variable assignments (#17695)

* Remove unnecessary variable assignments

As title

* enable ineffassign

Co-authored-by: zeripath <art27@cantab.net>
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
2 years ago[skip ci] Updated translations via Crowdin
GiteaBot [Thu, 18 Nov 2021 00:25:14 +0000 (00:25 +0000)]
[skip ci] Updated translations via Crowdin

2 years agoFixed commit count. (#17698)
KN4CK3R [Wed, 17 Nov 2021 23:50:17 +0000 (00:50 +0100)]
Fixed commit count. (#17698)

Added "Tag" label.
Unified branch, tag and commit name.

2 years agoAdd .gitattribute assisted language detection to blame, diff and render (#17590)
zeripath [Wed, 17 Nov 2021 20:37:00 +0000 (20:37 +0000)]
Add .gitattribute assisted language detection to blame, diff and render (#17590)

Use check attribute code to check the assigned language of a file and send that in to
chroma as a hint for the language of the file.

Signed-off-by: Andrew Thornton <art27@cantab.net>
2 years agoReturn 400 but not 500 when request archive with wrong format (#17691)
Lunny Xiao [Wed, 17 Nov 2021 19:47:35 +0000 (03:47 +0800)]
Return 400 but not 500 when request archive with wrong format (#17691)

2 years agoSanitize user-input on file name (#17666)
Gusted [Wed, 17 Nov 2021 18:08:25 +0000 (18:08 +0000)]
Sanitize user-input on file name (#17666)

* Sanitize user-input on file name

- Sanitize user-input before it get passed into the DOM.
- Prevent things like "<iframe onload=alert(1)></iframe>" from being
executed. This isn't a XSS attack as the server seems to be santizing
the path as well.

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
2 years agoMove some functions into services/repository (#17677)
Lunny Xiao [Wed, 17 Nov 2021 15:17:31 +0000 (23:17 +0800)]
Move some functions into services/repository (#17677)

2 years agoA better go code formatter, and now `make fmt` can run in Windows (#17684)
wxiaoguang [Wed, 17 Nov 2021 12:34:35 +0000 (20:34 +0800)]
A better go code formatter, and now `make fmt` can run in Windows (#17684)

* go build / format tools
* re-format imports

2 years agoFix bug when read mysql database max lifetime (#17682)
Lunny Xiao [Wed, 17 Nov 2021 10:59:23 +0000 (18:59 +0800)]
Fix bug when read mysql database max lifetime (#17682)

2 years agoMove user follow and openid into models/user/ (#17613)
Lunny Xiao [Wed, 17 Nov 2021 09:58:31 +0000 (17:58 +0800)]
Move user follow and openid into models/user/ (#17613)

* Move UserRedirect into models/user/

* Fix lint & test

* Fix lint

* Fix lint

* remove nolint comment

* Fix lint

* Move user follow and openid into models/user

* Ignore the lint

* Ignore the lint

* Fix test

* ignore stutters lint on UserOpenID

2 years agoEnable bidichk (#17610)
Gusted [Wed, 17 Nov 2021 08:47:28 +0000 (08:47 +0000)]
Enable bidichk (#17610)

- https://github.com/breml/bidichk

Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
Co-authored-by: 6543 <6543@obermui.de>
2 years agofix migrations documents (#17679)
Lunny Xiao [Wed, 17 Nov 2021 07:17:37 +0000 (15:17 +0800)]
fix migrations documents (#17679)

Co-authored-by: techknowlogick <techknowlogick@gitea.io>
2 years agoUpdate golangci-lint in Makefile (#17647)
Gusted [Wed, 17 Nov 2021 05:41:01 +0000 (05:41 +0000)]
Update golangci-lint in Makefile (#17647)

* Update golangci-lint in Makefile

- Partially resolvess #17596
- Download specific version(v1.43.0) by default.
- If current installed version is older than the minium version, it will
download the mininium required version.
- Update the install script to avoid deprecated error
`golangci/golangci-lint err this script is deprecated, please do not use
it anymore. check https://github.com/goreleaser/godownloader/issues/207`

* Simplify golangci-lint version check

* Fix version conversion

* Add version that's downloading

Co-authored-by: zeripath <art27@cantab.net>
* Consistency

Co-authored-by: zeripath <art27@cantab.net>
Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
Co-authored-by: techknowlogick <techknowlogick@gitea.io>
2 years agoSet unit test timeout to 20 minutes (#17664)
Lunny Xiao [Wed, 17 Nov 2021 02:54:05 +0000 (10:54 +0800)]
Set unit test timeout to 20 minutes (#17664)

* Set unit test timeout to 15 minutes

* Update Makefile

Co-authored-by: silverwind <me@silverwind.io>
Co-authored-by: silverwind <me@silverwind.io>
Co-authored-by: techknowlogick <techknowlogick@gitea.io>
2 years agoUpdate for reverse proxying static resources (#17670)
rstular [Wed, 17 Nov 2021 02:53:15 +0000 (03:53 +0100)]
Update for reverse proxying static resources (#17670)

Gitea fetches static resources from /assets, so nginx configuration has to be updated accordingly.

Co-authored-by: zeripath <art27@cantab.net>
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
2 years ago[skip ci] Updated translations via Crowdin
GiteaBot [Wed, 17 Nov 2021 00:25:11 +0000 (00:25 +0000)]
[skip ci] Updated translations via Crowdin

2 years agoAllow admins to change user avatars (#17661)
qwerty287 [Tue, 16 Nov 2021 19:13:13 +0000 (20:13 +0100)]
Allow admins to change user avatars (#17661)

Adds the avatar change panel to the edit user page (bottom) and allows admins to change it this way

Co-authored-by: Gusted <williamzijl7@hotmail.com>
Co-authored-by: zeripath <art27@cantab.net>
2 years agoMultiple Escaping Improvements (#17551)
zeripath [Tue, 16 Nov 2021 18:18:25 +0000 (18:18 +0000)]
Multiple Escaping Improvements (#17551)

There are multiple places where Gitea does not properly escape URLs that it is building and there are multiple places where it builds urls when there is already a simpler function available to use this.

This is an extensive PR attempting to fix these issues.

1. The first commit in this PR looks through all href, src and links in the Gitea codebase and has attempted to catch all the places where there is potentially incomplete escaping.
2. Whilst doing this we will prefer to use functions that create URLs over recreating them by hand.
3. All uses of strings should be directly escaped - even if they are not currently expected to contain escaping characters. The main benefit to doing this will be that we can consider relaxing the constraints on user names and reponames in future.
4. The next commit looks at escaping in the wiki and re-considers the urls that are used there. Using the improved escaping here wiki files containing '/'. (This implementation will currently still place all of the wiki files the root directory of the repo but this would not be difficult to change.)
5. The title generation in feeds is now properly escaped.
6. EscapePound is no longer needed - urls should be PathEscaped / QueryEscaped as necessary but then re-escaped with Escape when creating html with locales Signed-off-by: Andrew Thornton <art27@cantab.net>

Signed-off-by: Andrew Thornton <art27@cantab.net>
2 years agoMove migrations into services and base into modules/migration (#17663)
Lunny Xiao [Tue, 16 Nov 2021 15:25:33 +0000 (23:25 +0800)]
Move migrations into services and base into modules/migration (#17663)

* Move migrtions into services and base into modules/migration

* Fix imports

* Fix lint

2 years agoMove some functions into services/repository (#17660)
Lunny Xiao [Tue, 16 Nov 2021 13:30:11 +0000 (21:30 +0800)]
Move some functions into services/repository (#17660)

2 years agoRemove superfluous argument (#17667)
Gusted [Tue, 16 Nov 2021 11:36:03 +0000 (11:36 +0000)]
Remove superfluous argument (#17667)

As title.

2 years agoDecouple unit test, remove intermediate `unittestbridge` package (#17662)
wxiaoguang [Tue, 16 Nov 2021 08:53:21 +0000 (16:53 +0800)]
Decouple unit test, remove intermediate `unittestbridge` package (#17662)

Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
2 years agoAdd copy button to markdown code blocks (#17638)
silverwind [Tue, 16 Nov 2021 08:16:05 +0000 (09:16 +0100)]
Add copy button to markdown code blocks (#17638)

* Add copy button to markdown code blocks

Done mostly in JS because I think it's better not to try getting buttons
past the markup sanitizer.

* add svg module tests

* fix sanitizer regexp

* remove outdated comment

* vertically center button in issue comments as well

* add comment to css

* fix undefined on view file line copy

* combine animation less files

* Update modules/markup/markdown/markdown.go

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
* add test for different sizes

* add cloneNode and add tests for it

* use deep clone

* remove useless optional chaining

* remove the svg node cache

* unify clipboard copy string and i18n

* remove unused var

* remove unused localization

* minor css tweaks to the button

* comment tweak

* remove useless attribute

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
2 years agoMigrating wiki don't require token, so we should move it out of the require form...
Lunny Xiao [Tue, 16 Nov 2021 06:17:21 +0000 (14:17 +0800)]
Migrating wiki don't require token, so we should move it out of the require form (#17645)

* Migrating wiki don't require token, so we should move it out of the require form

* Fix lint

2 years agoFix GitBucket icon (#17644)
silverwind [Tue, 16 Nov 2021 04:24:22 +0000 (05:24 +0100)]
Fix GitBucket icon (#17644)

Partial fix for https://github.com/go-gitea/gitea/issues/17642.

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
2 years agoFix database deadlock when update issue labels (#17649)
wxiaoguang [Tue, 16 Nov 2021 02:21:13 +0000 (10:21 +0800)]
Fix database deadlock when update issue labels (#17649)

This fix updates issue labels one by one, and won't cause database deadlock.
In future, we can use a batch API to update all changed labels by one request.

2 years ago[skip ci] Updated translations via Crowdin
GiteaBot [Tue, 16 Nov 2021 00:25:21 +0000 (00:25 +0000)]
[skip ci] Updated translations via Crowdin

2 years agoChanged migration text. (#17654)
KN4CK3R [Mon, 15 Nov 2021 23:12:09 +0000 (00:12 +0100)]
Changed migration text. (#17654)

2 years agoFix nil checking on typed interface (#17598)
Gusted [Mon, 15 Nov 2021 13:16:11 +0000 (13:16 +0000)]
Fix nil checking on typed interface (#17598)

* Fix nil checking on typed interface

- Partially resoles #17596
- Resolves SA4023 errors.
- Ensure correctly that typed interface are nil.

* Remove unnecessary code

`NewBleveIndexer` will never return nil, even on errors.

* Patch `NewBleveIndexer`

* Fix low-level functions

* Remove deadcode

* Fix GetSession

* Close Elastic search when err isn't nil

* Update elastic_search.go

Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
2 years agoRemove unnecassary calls to `filepath.Join` (#17608)
Gusted [Mon, 15 Nov 2021 06:02:53 +0000 (06:02 +0000)]
Remove unnecassary calls to `filepath.Join` (#17608)

- Partialy resolvess #17596
- Resolves `badCall` errors from go-critic `badCall: suspicious Join on
1 argument`
- When only 1 argument is passed into `filepath.Join`, it won't do
anything special other than `filepath.Clean(...)` will be applied over
it.

Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
Co-authored-by: 6543 <6543@obermui.de>
2 years agoAdd download button for file viewer (#17640)
Gusted [Mon, 15 Nov 2021 01:05:12 +0000 (01:05 +0000)]
Add download button for file viewer (#17640)

- Resolves #17286
- Use the `download` attribute such that the browser will natively
initate a download dialog for the given URL.

Co-authored-by: 6543 <6543@obermui.de>
Co-authored-by: techknowlogick <techknowlogick@gitea.io>
2 years ago[skip ci] Updated translations via Crowdin
GiteaBot [Mon, 15 Nov 2021 00:24:54 +0000 (00:24 +0000)]
[skip ci] Updated translations via Crowdin

2 years agofix typo (#17614)
缘生 [Sun, 14 Nov 2021 22:32:48 +0000 (06:32 +0800)]
fix typo (#17614)

2 years agoAdd icon to vscode clone link (#17641)
silverwind [Sun, 14 Nov 2021 21:48:26 +0000 (22:48 +0100)]
Add icon to vscode clone link (#17641)

2 years agoAdd migration from GitBucket (#16767)
KN4CK3R [Sun, 14 Nov 2021 19:11:10 +0000 (20:11 +0100)]
Add migration from GitBucket (#16767)

This PR adds [GitBucket](https://gitbucket.github.io/) as migration source.

Supported:
- Milestones
- Issues
- Pull Requests
- Comments
- Reviews
- Labels

There is no public usable instance so no integration tests added.

2 years agoFix offBy1 errors (#17606)
Gusted [Sun, 14 Nov 2021 08:11:49 +0000 (08:11 +0000)]
Fix offBy1 errors (#17606)

* Fix offBy1 errors

- Partially resolves #17596
- Resolve errors from go-critic `offBy1: Index() can return -1; maybe
you wanted to do Index()+1`.

* Match golang spec

* Remove comments

* Update migrations.go

* Apply suggestions from code review

Co-authored-by: delvh <dev.lh@web.de>
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
Co-authored-by: delvh <dev.lh@web.de>
Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
2 years agoperf: only generate data-comment-url once (#17618)
Gusted [Sun, 14 Nov 2021 05:28:57 +0000 (05:28 +0000)]
perf: only generate data-comment-url once (#17618)

2 years ago[skip ci] Updated licenses and gitignores
GiteaBot [Sun, 14 Nov 2021 00:26:06 +0000 (00:26 +0000)]
[skip ci] Updated licenses and gitignores

2 years agoCorrectly handle failed migrations (#17575)
zeripath [Sat, 13 Nov 2021 11:28:50 +0000 (11:28 +0000)]
Correctly handle failed migrations (#17575)

* Correctly handle failed migrations

There is a bug in handling failed migrations whereby the migration task gets decoupled
from the migration repository. This leads to a failure of the task to get deleted with
the repository and also leads to the migration failed page resulting in a ISE.

This PR removes the zeroing out of the task id from the migration but also makes
the migration handler tolerate missing tasks much nicer.

Fix #17571

Signed-off-by: Andrew Thornton <art27@cantab.net>
2 years agoMinor readability patch. (#17627)
Michael Grigoryan [Fri, 12 Nov 2021 23:27:18 +0000 (03:27 +0400)]
Minor readability patch. (#17627)

2 years agoDecouple unit test code from business code (#17623)
wxiaoguang [Fri, 12 Nov 2021 14:36:47 +0000 (22:36 +0800)]
Decouple unit test code from business code (#17623)

2 years agoFix some incorrect async functions, improve frontend document. (#17597)
wxiaoguang [Fri, 12 Nov 2021 12:37:45 +0000 (20:37 +0800)]
Fix some incorrect async functions, improve frontend document. (#17597)

2 years agounbind the CheckConsistency for some structs so that they can be moved to sub package...
Lunny Xiao [Fri, 12 Nov 2021 00:56:45 +0000 (08:56 +0800)]
unbind the CheckConsistency for some structs so that they can be moved to sub packages easier (#17612)

* unbind the CheckConsistency for some structs so that they can be moved to sub packages easier

* Fix functions name

* Fix typo

2 years agoMove EmailAddress & UserRedirect into models/user/ (#17607)
Lunny Xiao [Thu, 11 Nov 2021 07:03:30 +0000 (15:03 +0800)]
Move EmailAddress & UserRedirect into models/user/ (#17607)

* Move EmailAddress into models/user/

* Fix test

* rename user_mail to user_email

* Fix test

* Move UserRedirect into models/user/

* Fix lint & test

* Fix lint

* Fix lint

* remove nolint comment

* Fix lint

2 years agoRefactor commentTags functionality (#17558)
Gusted [Thu, 11 Nov 2021 06:29:30 +0000 (07:29 +0100)]
Refactor commentTags functionality (#17558)

* feat: Allow multiple tags on comments

- Allow for multiples tags(Currently Poster + {Owner, Writer}).
- Utilize the Poster tag within the commentTag function and remove the
checking from templates.
- Use bitwise on CommentTags to enable specific tags.
- Don't show poster tag(view_content.tmpl) on the initial issue comment.

* Change parameters naming

* Change function name

* refactor variable wording

* Merge 'master' branch into 'tags-comments' branch

* Change naming

* `tag` -> `role`

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
2 years agoRemove `golint` as linter (#17609)
Gusted [Thu, 11 Nov 2021 05:28:45 +0000 (06:28 +0100)]
Remove `golint` as linter (#17609)

- Partialy resolvess #17596
- In the newer versions of `golangci-lint`, golint is  deprecated and
replaced by the `revive` linter. Thus removing the `golint` linter is a
good idea, as we're already using the `revive` linter which covers all
the current `golint` cases.

Co-authored-by: techknowlogick <techknowlogick@gitea.io>
Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
2 years agoUpdate JS dependencies (#17611)
silverwind [Thu, 11 Nov 2021 01:52:16 +0000 (02:52 +0100)]
Update JS dependencies (#17611)

- Update monaco, adapting to breaking changes
- Update dropzone, adapting to breaking changes
- Update linters, fix new issues, disable opinionated stylelint rules
- Rebuild SVGs and images
- Tested Dropzone and Monaco

Replaces: https://github.com/go-gitea/gitea/pull/17574

2 years agoMove oauth2 error to oauth2 service package (#17603)
Lunny Xiao [Wed, 10 Nov 2021 17:51:09 +0000 (01:51 +0800)]
Move oauth2 error to oauth2 service package (#17603)

2 years agoFix 500 when a comment was deleted which has a notification (#17550)
Lunny Xiao [Wed, 10 Nov 2021 05:48:45 +0000 (13:48 +0800)]
Fix 500 when a comment was deleted which has a notification (#17550)

* Fix 500 when a comment was deleted which has a notification

* Tolerate missing Comment in other places too

Signed-off-by: Andrew Thornton <art27@cantab.net>
Co-authored-by: Andrew Thornton <art27@cantab.net>
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
2 years agoMove webhook into models/webhook/ (#17579)
Lunny Xiao [Wed, 10 Nov 2021 05:13:16 +0000 (13:13 +0800)]
Move webhook into models/webhook/ (#17579)

2 years agoAdded GetUserByIDCtx. (#17602)
KN4CK3R [Wed, 10 Nov 2021 03:21:01 +0000 (04:21 +0100)]
Added GetUserByIDCtx. (#17602)

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
2 years ago[skip ci] Updated translations via Crowdin
GiteaBot [Wed, 10 Nov 2021 00:25:15 +0000 (00:25 +0000)]
[skip ci] Updated translations via Crowdin

2 years agoMove unit into models/unit/ (#17576)
Lunny Xiao [Tue, 9 Nov 2021 19:57:58 +0000 (03:57 +0800)]
Move unit into models/unit/ (#17576)

* Move unit into models/unit/

* Rename unit.UnitType as unit.Type

2 years agotune sqlite3 message (#17601)
wxiaoguang [Tue, 9 Nov 2021 18:55:24 +0000 (02:55 +0800)]
tune sqlite3 message (#17601)

2 years agoRemove me from the maintainers (#17599)
Andrey Nering [Tue, 9 Nov 2021 14:40:16 +0000 (11:40 -0300)]
Remove me from the maintainers (#17599)

I haven't being involved in a while.

2 years agoFix 500 when review pull request with anonymous (#17594)
Lunny Xiao [Tue, 9 Nov 2021 13:14:12 +0000 (21:14 +0800)]
Fix 500 when review pull request with anonymous (#17594)

2 years agoMove merge-section to `> .content` (#17582)
Gusted [Tue, 9 Nov 2021 11:56:15 +0000 (12:56 +0100)]
Move merge-section to `> .content` (#17582)

* Move `> .merge-section` to `> .content` scope

- Fixes a issue that started from
https://github.com/go-gitea/gitea/pull/17317
- Move `> .merge-section` to the `> .content` scope.
- Resolves #17480

* Move `.merge-section` back to outside scope

Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
2 years agoUpdate `User` model comments about permissions (#17583)
wxiaoguang [Tue, 9 Nov 2021 10:42:58 +0000 (18:42 +0800)]
Update `User` model comments about permissions (#17583)

2 years agoImprove async/await usage, and sort init calls in `index.js` (#17386)
wxiaoguang [Tue, 9 Nov 2021 09:27:25 +0000 (17:27 +0800)]
Improve async/await usage, and sort init calls in `index.js` (#17386)

* clean up async/await, and sort init calls in `index.js
* use `const _promise` to indicate that we do not need await an async function

2 years agoUse provided database Engine (#17595)
Gusted [Tue, 9 Nov 2021 08:54:46 +0000 (09:54 +0100)]
Use provided database Engine (#17595)

- Don't get the engine from `db.DefaultContext`, instead use the
provided one which is passed as paramater `e`.

2 years agoFix bug on detect issue/comment writer (#17591)
Lunny Xiao [Tue, 9 Nov 2021 07:44:12 +0000 (15:44 +0800)]
Fix bug on detect issue/comment writer (#17591)

2 years agoAllow U2F 2FA without TOTP (#11573)
Kamil Domański [Mon, 8 Nov 2021 22:47:19 +0000 (23:47 +0100)]
Allow U2F 2FA without TOTP (#11573)

This change enables the usage of U2F without being forced to enroll an TOTP authenticator.
The `/user/auth/u2f` has been changed to hide the "use TOTP instead" bar if TOTP is not enrolled.

Fixes #5410
Fixes #17495

2 years agoFix stats upon searching issues (#17566)
Gusted [Mon, 8 Nov 2021 21:14:46 +0000 (22:14 +0100)]
Fix stats upon searching issues (#17566)

* Fix stat chunks searching

- Fixes a issue whereby the given chunk of issueIDs wasn't respected and
thus the returned results where not the correct results.

* Add tests

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
Co-authored-by: zeripath <art27@cantab.net>
2 years agoOnly allow returned deleted branche to be on repo (#17570)
Gusted [Mon, 8 Nov 2021 15:45:37 +0000 (16:45 +0100)]
Only allow returned deleted branche to be on repo (#17570)

- This will only allow `GetDeletedBranchByID` to return deletedBranch
which are on the repo, and thus don't return a deletedBranch from
another repo.
- This just should prevent possible bugs in the futher when a code is
passing the wrong ID into this function.

2 years agoAvoid double imports (#17569)
Gusted [Mon, 8 Nov 2021 07:04:13 +0000 (08:04 +0100)]
Avoid double imports (#17569)

Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
Co-authored-by: techknowlogick <techknowlogick@gitea.io>
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
2 years agoRemove appSubUrl from pasted images (#17572)
zeripath [Mon, 8 Nov 2021 06:27:40 +0000 (06:27 +0000)]
Remove appSubUrl from pasted images (#17572)

* Remove appSubUrl from pasted images

Since we fixed the url base for the links in repositories we no longer need to add
the appsuburl to pasted image links.

Fix #17057

Signed-off-by: Andrew Thornton <art27@cantab.net>
2 years agoFix documents for ALLOWED_HOST_LIST, its default value differs between 1.15 and 1...
wxiaoguang [Mon, 8 Nov 2021 03:25:41 +0000 (11:25 +0800)]
Fix documents for ALLOWED_HOST_LIST, its default value differs between 1.15 and 1.16 (#17530)

* fix documents for ALLOWED_HOST_LIST, its default value differs between 1.15 and 1.16

2 years agoAdd @Gusted to maintainers filer (#17581)
Gusted [Sun, 7 Nov 2021 19:23:39 +0000 (20:23 +0100)]
Add @Gusted to maintainers filer (#17581)

2 years agoMake ParsePatch more robust (#17573)
Gusted [Sun, 7 Nov 2021 17:52:50 +0000 (18:52 +0100)]
Make ParsePatch more robust (#17573)

2 years agoFix bug on admin subcommand (#17533)
Lunny Xiao [Sun, 7 Nov 2021 03:11:27 +0000 (11:11 +0800)]
Fix bug on admin subcommand (#17533)

* Fix bug on admin subcommand

* Add signals for all initDB

Co-authored-by: Lauris BH <lauris@nix.lv>
2 years ago[skip ci] Updated translations via Crowdin
GiteaBot [Sun, 7 Nov 2021 00:25:43 +0000 (00:25 +0000)]
[skip ci] Updated translations via Crowdin

2 years agoFix ipv6 parsing for builtin ssh server (#17561)
Wim [Sat, 6 Nov 2021 06:23:32 +0000 (07:23 +0100)]
Fix ipv6 parsing for builtin ssh server (#17561)

2 years agoUpdate locale_en-US.ini (#17553)
Yuwei Ba [Fri, 5 Nov 2021 19:23:55 +0000 (06:23 +1100)]
Update locale_en-US.ini (#17553)

2 years agoEscape issue titles in comments list (#17555)
zeripath [Fri, 5 Nov 2021 14:56:40 +0000 (14:56 +0000)]
Escape issue titles in comments list (#17555)

Signed-off-by: Andrew Thornton <art27@cantab.net>
2 years agoUse correct defaultValue for stracktrace (#17552)
Gusted [Fri, 5 Nov 2021 11:25:05 +0000 (12:25 +0100)]
Use correct defaultValue for stracktrace (#17552)

2 years agoFix zero created time bug on commit api (#17546)
Lunny Xiao [Fri, 5 Nov 2021 05:30:46 +0000 (13:30 +0800)]
Fix zero created time bug on commit api (#17546)

Fix #17543

2 years ago[skip ci] Updated translations via Crowdin
GiteaBot [Fri, 5 Nov 2021 00:25:11 +0000 (00:25 +0000)]
[skip ci] Updated translations via Crowdin

2 years agoFix database keyword quote problem on migration v161 (#17522)
Lunny Xiao [Thu, 4 Nov 2021 22:47:01 +0000 (06:47 +0800)]
Fix database keyword quote problem on migration v161 (#17522)

* support rerun migration v161

Co-authored-by: Lauris BH <lauris@nix.lv>
Co-authored-by: techknowlogick <techknowlogick@gitea.io>
2 years agoHide label comments if labels were added and removed immediately (#17455)
qwerty287 [Thu, 4 Nov 2021 14:51:30 +0000 (15:51 +0100)]
Hide label comments if labels were added and removed immediately (#17455)

* Hide label comments if labels were added and removed immediately

* Add comment and rename var

* Fix unit test

* Add test case

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
2 years agoShow correct "No" icon (#17537)
delvh [Thu, 4 Nov 2021 02:09:03 +0000 (03:09 +0100)]
Show correct "No" icon (#17537)

2 years agoUse exec -a in the FHS compliant script (#17513)
zeripath [Wed, 3 Nov 2021 08:13:07 +0000 (08:13 +0000)]
Use exec -a in the FHS compliant script (#17513)

2 years agoFix list for options under cli->user->admin->create (#17382)
SahAssar [Wed, 3 Nov 2021 05:27:35 +0000 (06:27 +0100)]
Fix list for options under cli->user->admin->create (#17382)

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
2 years agohide note message for pull request template (#17529)
a1012112796 [Wed, 3 Nov 2021 03:43:16 +0000 (11:43 +0800)]
hide note message for pull request template (#17529)

Co-authored-by: John Olheiser <john.olheiser@gmail.com>