]> source.dussan.org Git - gitea.git/log
gitea.git
3 years agoLimit stdout tracelog to actual stdout (#16258)
zeripath [Sat, 26 Jun 2021 12:47:56 +0000 (13:47 +0100)]
Limit stdout tracelog to actual stdout (#16258)

Related #16243

Signed-off-by: Andrew Thornton <art27@cantab.net>
3 years agoLet package git depend on setting but not opposite (#15241)
Lunny Xiao [Sat, 26 Jun 2021 11:28:55 +0000 (19:28 +0800)]
Let package git depend on setting but not opposite (#15241)

* Let package git depend on setting but not opposite

* private some package variables

3 years agoFixed issues not updated by commits (#16254)
KN4CK3R [Sat, 26 Jun 2021 09:13:51 +0000 (11:13 +0200)]
Fixed issues not updated by commits (#16254)

`UpdateIssuesCommit` may get called with fewer commits because of `FeedMaxCommitNum` and therefore may miss some commands.

3 years agoAdd better errors for disabled account recovery (#15117)
John Olheiser [Sat, 26 Jun 2021 04:16:36 +0000 (23:16 -0500)]
Add better errors for disabled account recovery (#15117)

Signed-off-by: jolheiser <john.olheiser@gmail.com>
Co-authored-by: Andrew Thornton <art27@cantab.net>
Co-authored-by: 6543 <6543@obermui.de>
3 years agoImprove efficiency in FindRenderizableReferenceNumeric and getReferences (#16251)
zeripath [Fri, 25 Jun 2021 23:11:33 +0000 (00:11 +0100)]
Improve efficiency in FindRenderizableReferenceNumeric and getReferences (#16251)

* Fuzzer finds an NPE due to incorrect URLPrefix

The Fuzzer is running on a non-repo urlprefix which is incorrect for RenderRaw

* Make FindRenderizableReferenceNumeric and getReferences more efficient

Signed-off-by: Andrew Thornton <art27@cantab.net>
Co-authored-by: techknowlogick <techknowlogick@gitea.io>
3 years agoAdded support for gopher URLs. (#14749)
ayb [Fri, 25 Jun 2021 22:38:27 +0000 (00:38 +0200)]
Added support for gopher URLs. (#14749)

* Added support for gopher URLs.

* Add setting and make this user settable instead

Signed-off-by: Andrew Thornton <art27@cantab.net>
Co-authored-by: Andrew Thornton <art27@cantab.net>
3 years agoFuzzer finds an NPE due to incorrect URLPrefix (#16249)
zeripath [Fri, 25 Jun 2021 18:14:49 +0000 (19:14 +0100)]
Fuzzer finds an NPE due to incorrect URLPrefix (#16249)

The Fuzzer is running on a non-repo urlprefix which is incorrect for RenderRaw

Signed-off-by: Andrew Thornton <art27@cantab.net>
Co-authored-by: 6543 <6543@obermui.de>
3 years agoAppend to existing trailers in generated squash commit message (#15980)
Jimmy Praet [Fri, 25 Jun 2021 17:01:43 +0000 (19:01 +0200)]
Append to existing trailers in generated squash commit message (#15980)

* Remove superfluous newline before Co-authored-by trailers

* Append to existing PR description trailer section

If the existing PR description message already contains a trailer section (e.g. Signed-off-by: ),
append to it instead of creating a new trailer section.

* Reuse compiled regexp

* Simplify regex and deal with trailing \n in PR description

* Add tests for CommitMessageTrailersPattern

- add support for Key:Value (no space after colon)
- add support for whitespace "folding"

* Update services/pull/pull_test.go

Co-authored-by: Norwin <noerw@users.noreply.github.com>
Co-authored-by: zeripath <art27@cantab.net>
Co-authored-by: Norwin <noerw@users.noreply.github.com>
Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
Co-authored-by: techknowlogick <techknowlogick@gitea.io>
3 years agoPrevent webhook action buttons from shifting (#16087)
Steven [Fri, 25 Jun 2021 17:00:09 +0000 (19:00 +0200)]
Prevent webhook action buttons from shifting (#16087)

On long webhook urls the action buttons (edit, delete) have been shifted
by the url text.

Signed-off-by: Steven Kriegler <61625851+justusbunsi@users.noreply.github.com>
Co-authored-by: 6543 <6543@obermui.de>
Co-authored-by: techknowlogick <techknowlogick@gitea.io>
3 years agoFix heatmap activity (#15252)
siddweiker [Fri, 25 Jun 2021 16:59:25 +0000 (12:59 -0400)]
Fix heatmap activity (#15252)

* Group heatmap actions by 15 minute intervals

Signed-off-by: Sidd Weiker <siddweiker@gmail.com>
* Add multi-contribution test for user heatmap

Signed-off-by: Sidd Weiker <siddweiker@gmail.com>
* Add timezone aware summation for activity heatmap

Signed-off-by: Sidd Weiker <siddweiker@gmail.com>
* Fix api user heatmap test

Signed-off-by: Sidd Weiker <siddweiker@gmail.com>
* Update variable declaration style

Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
Co-authored-by: 6543 <6543@obermui.de>
Co-authored-by: techknowlogick <techknowlogick@gitea.io>
3 years agoUse gitea logging module for git module (#16243)
6543 [Fri, 25 Jun 2021 16:54:08 +0000 (18:54 +0200)]
Use gitea logging module for git module (#16243)

remove log() func from gogs times and switch to proper logging

Signed-off-by: Andrew Thornton <art27@cantab.net>
Co-authored-by: Andrew Thornton <art27@cantab.net>
3 years agoAdd tag protection (#15629)
KN4CK3R [Fri, 25 Jun 2021 14:28:55 +0000 (16:28 +0200)]
Add tag protection (#15629)

* Added tag protection in hook.

* Prevent UI tag creation if protected.

* Added settings page.

* Added tests.

* Added suggestions.

* Moved tests.

* Use individual errors.

* Removed unneeded methods.

* Switched delete selector.

* Changed method names.

* No reason to be unique.

* Allow editing of protected tags.

* Removed unique key from migration.

* Added docs page.

* Changed date.

* Respond with 404 to not found tags.

* Replaced glob with regex pattern.

* Added support for glob and regex pattern.

* Updated documentation.

* Changed white* to allow*.

* Fixed edit button link.

* Added cancel button.

Co-authored-by: zeripath <art27@cantab.net>
Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
3 years agofix IIS reverse proxy doc (#16246)
Martin Strob [Fri, 25 Jun 2021 12:38:41 +0000 (14:38 +0200)]
fix IIS reverse proxy doc (#16246)

3 years ago[skip ci] Updated translations via Crowdin
GiteaBot [Fri, 25 Jun 2021 00:11:36 +0000 (00:11 +0000)]
[skip ci] Updated translations via Crowdin

3 years agoAPI: Allow COMMENT reviews to not specify a body (#16229)
sebastian-sauer [Thu, 24 Jun 2021 22:05:51 +0000 (00:05 +0200)]
API: Allow COMMENT reviews to not specify a body (#16229)

* Allow COMMENT reviews to not specify a body

when using web ui there is no need to specify a body.
so we don't need to specify a body if adding a COMMENT-review
via our api.

* Ensure comments or Body is provided

and add some integration tests for reviewtype COMMENT.

Signed-off-by: Sebastian Sauer <sauer.sebastian@gmail.com>
3 years agoReplace ARCCache with TwoQueueCache to avoid patent issue (#16240)
Mura Li [Thu, 24 Jun 2021 18:37:07 +0000 (02:37 +0800)]
Replace ARCCache with TwoQueueCache to avoid patent issue (#16240)

Co-authored-by: Mura Li <typeless@users.noreply.github.com>
Co-authored-by: techknowlogick <techknowlogick@gitea.io>
3 years agoFix diff expansion is missing final line in a file (#16222)
KN4CK3R [Thu, 24 Jun 2021 15:47:46 +0000 (17:47 +0200)]
Fix diff expansion is missing final line in a file (#16222)

* Fixed down offset.

* Fixed wrong line count result.

3 years ago[skip ci] Updated translations via Crowdin
GiteaBot [Thu, 24 Jun 2021 00:11:37 +0000 (00:11 +0000)]
[skip ci] Updated translations via Crowdin

3 years agoDo not show No match found for tribute (#16231)
zeripath [Wed, 23 Jun 2021 23:02:23 +0000 (00:02 +0100)]
Do not show No match found for tribute (#16231)

Tribute.js will show an untranslated no match found if no emoji or mentions.

Further the mentions should really require a preceding space.

This PR fixes both of these.

Signed-off-by: Andrew Thornton <art27@cantab.net>
3 years agoDon't WARN log UserNotExist errors on ExternalUserLogin failure (#16238)
zeripath [Wed, 23 Jun 2021 21:41:39 +0000 (22:41 +0100)]
Don't WARN log UserNotExist errors on ExternalUserLogin failure (#16238)

Instead log these at debug - with warn logging for other errors.

Fix #16235

Signed-off-by: Andrew Thornton <art27@cantab.net>
3 years agoRework repository archive (#14723)
Lunny Xiao [Wed, 23 Jun 2021 21:12:38 +0000 (05:12 +0800)]
Rework repository archive (#14723)

* Use storage to store archive files

* Fix backend lint

* Add archiver table on database

* Finish archive download

* Fix test

* Add database migrations

* Add status for archiver

* Fix lint

* Add queue

* Add doctor to check and delete old archives

* Improve archive queue

* Fix tests

* improve archive storage

* Delete repo archives

* Add missing fixture

* fix fixture

* Fix fixture

* Fix test

* Fix archiver cleaning

* Fix bug

* Add docs for repository archive storage

* remove repo-archive configuration

* Fix test

* Fix test

* Fix lint

Co-authored-by: 6543 <6543@obermui.de>
Co-authored-by: techknowlogick <techknowlogick@gitea.io>
3 years agoAdd sanitizer rules per renderer (#16110)
KN4CK3R [Wed, 23 Jun 2021 21:09:51 +0000 (23:09 +0200)]
Add sanitizer rules per renderer (#16110)

* Added sanitizer rules per renderer.

* Updated documentation.

Co-authored-by: techknowlogick <techknowlogick@gitea.io>
3 years ago[API] Add repoGetTag (#16166)
6543 [Wed, 23 Jun 2021 21:08:47 +0000 (23:08 +0200)]
[API] Add repoGetTag (#16166)

* GetTag -> GetAnnotatedTag

* API: Add repoGetTag

* fix swagger docs

* support "/" as tag name char

Co-authored-by: techknowlogick <techknowlogick@gitea.io>
3 years agoFix 500 Error with branch and tag sharing the same name #15592 (#16040)
Viktor Yakovchuk [Wed, 23 Jun 2021 21:08:26 +0000 (00:08 +0300)]
Fix 500 Error with branch and tag sharing the same name #15592 (#16040)

* Fix 500 Error with branch and tag sharing the same name #15592

Fixed 500 error while create Pull request when there are more
than one sources (branch, tag) with the same name

Fix #15592

Signed-off-by: Viktor Yakovchuk <viktor@yakovchuk.net>
* fix logging

Co-authored-by: techknowlogick <techknowlogick@gitea.io>
Co-authored-by: 6543 <6543@obermui.de>
3 years agoAdd code block highlight to orgmode back (#14222)
Lunny Xiao [Wed, 23 Jun 2021 20:45:47 +0000 (04:45 +0800)]
Add code block highlight to orgmode back (#14222)

Fix missed orgmode code block hightlight

Co-authored-by: zeripath <art27@cantab.net>
3 years ago[API] GET / SET User Settings (#16169)
6543 [Wed, 23 Jun 2021 19:58:44 +0000 (21:58 +0200)]
[API] GET / SET User Settings (#16169)

* API: GET/SET User Settings

* linter

* Apply suggestions from code review

* Update modules/structs/user.go

* lint

* fix swagger

* move User2UserSettings to convert

* as per @zeripath "preferences" -> "settings"

Co-authored-by: techknowlogick <matti@mdranta.net>
Co-authored-by: techknowlogick <techknowlogick@gitea.io>
3 years agoAdd docs for windows env vars (#16236)
techknowlogick [Wed, 23 Jun 2021 19:57:56 +0000 (15:57 -0400)]
Add docs for windows env vars (#16236)

* Add docs for windows env vars

Fix #16213

* Fix docs/content/doc/developers/hacking-on-gitea.en-us.md

Co-authored-by: John Olheiser <john.olheiser@gmail.com>
Co-authored-by: 6543 <6543@obermui.de>
Co-authored-by: John Olheiser <john.olheiser@gmail.com>
3 years agoSmall refactoring of modules/private (#15947)
KN4CK3R [Wed, 23 Jun 2021 19:38:19 +0000 (21:38 +0200)]
Small refactoring of modules/private (#15947)

* Use correct variable name.

* doer is never nil here.

* Use status code constants.

* Replaced generic map with concrete struct.

* Fixed windows lint.

* Removed unused method.

* Changed error codes.

Co-authored-by: techknowlogick <techknowlogick@gitea.io>
3 years agoFix Nits (#16234)
6543 [Wed, 23 Jun 2021 17:43:33 +0000 (19:43 +0200)]
Fix Nits (#16234)

* template fix

* nits

* add doer to "created issue/pull"

3 years agoUse data path instead of config path (#16227)
KN4CK3R [Wed, 23 Jun 2021 14:56:25 +0000 (16:56 +0200)]
Use data path instead of config path (#16227)

3 years agoLocalize Email Templates (#16200)
6543 [Wed, 23 Jun 2021 12:33:21 +0000 (14:33 +0200)]
Localize Email Templates (#16200)

close #14822

3 years agoRun compliance on amd64 infra (#16232)
techknowlogick [Wed, 23 Jun 2021 05:36:27 +0000 (01:36 -0400)]
Run compliance on amd64 infra (#16232)

* Run compliance on amd64 infra

* Update .drone.yml

3 years agoImprove notifications for WIP draft PR's (#14663)
Jimmy Praet [Wed, 23 Jun 2021 04:14:22 +0000 (06:14 +0200)]
Improve notifications for WIP draft PR's (#14663)

* #14559 Reduce amount of email notifications for WIP draft PR's

don't notify repo watchers of WIP draft PR's

* #13190 Notification when WIP Pull Request is ready for review

* Send email notification to repo watchers when WIP PR is created

* Send ui notification to repo watchers when WIP PR is created

* send specific email notification when PR is marked ready for review

instead of reusing the CreatePullRequest action

* Fix lint error

Co-authored-by: techknowlogick <techknowlogick@gitea.io>
3 years agoUse pulls url if issue is a pull request (#16230)
sebastian-sauer [Tue, 22 Jun 2021 20:13:31 +0000 (22:13 +0200)]
Use pulls url if issue is a pull request (#16230)

if a pull request is displayed use the /pulls path
if a pull requests diff is displayed use the /pulls/{id}/files url
if an issue is displayed use the issues url

Fixes #16102

Signed-off-by: Sebastian Sauer <sauer.sebastian@gmail.com>
3 years agoUse html.Parse rather than html.ParseFragment (#16223)
zeripath [Mon, 21 Jun 2021 22:12:22 +0000 (23:12 +0100)]
Use html.Parse rather than html.ParseFragment (#16223)

* Use html.Parse rather than html.ParseFragment
  There have been a few issues with html.ParseFragment - just use html.Parse instead.

* Skip document node

Signed-off-by: Andrew Thornton <art27@cantab.net>
3 years agoUpdate milestone counters on new issue. (#16183)
KN4CK3R [Mon, 21 Jun 2021 18:34:58 +0000 (20:34 +0200)]
Update milestone counters on new issue. (#16183)

Co-authored-by: 6543 <6543@obermui.de>
Co-authored-by: zeripath <art27@cantab.net>
3 years agoUpdate documentation for Implicit TLS (#16220)
zeripath [Mon, 21 Jun 2021 18:34:37 +0000 (19:34 +0100)]
Update documentation for Implicit TLS (#16220)

As per RFC 8314, it is now recommended to prefer TLS over STARTTLS.

Fix #16160

Signed-off-by: Andrew Thornton <art27@cantab.net>
3 years agoreqOrgMembership calls need to be preceded by reqToken (#16198)
zeripath [Mon, 21 Jun 2021 13:01:44 +0000 (14:01 +0100)]
reqOrgMembership calls need to be preceded by reqToken (#16198)

ReqOrgMembership calls need to be preceded by reqToken

Fix #16192

Signed-off-by: Andrew Thornton <art27@cantab.net>
Co-authored-by: 6543 <6543@obermui.de>
3 years agoAdd tests for all webhooks (#16214)
KN4CK3R [Mon, 21 Jun 2021 02:12:19 +0000 (04:12 +0200)]
Add tests for all webhooks (#16214)

* Added tests for MS Teams.

* Added tests for Dingtalk.

* Added tests for Telegram.

* Added tests for Feishu.

* Added tests for Discord.

* Added tests for closed issue and pullrequest comment.

* Added tests for Matrix.

* Trim all spaces.

* Added tests for Slack.

* Added JSONPayload tests.

* Added general tests.

* Replaced duplicated code.

Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
3 years ago[skip ci] Updated translations via Crowdin
GiteaBot [Mon, 21 Jun 2021 00:11:34 +0000 (00:11 +0000)]
[skip ci] Updated translations via Crowdin

3 years agoMore efficiently parse shas for shaPostProcessor (#16101)
zeripath [Sun, 20 Jun 2021 22:39:12 +0000 (23:39 +0100)]
More efficiently parse shas for shaPostProcessor (#16101)

* More efficiently parse shas for shaPostProcessor

The shaPostProcessor currently repeatedly calls git rev-parse --verify on both backends
which is fine if there is only one thing that matches a sha - however if there are
multiple things then this becomes wildly inefficient.

This PR provides functions for both backends which are much faster to use.

Fix #16092

* Add ShaExistCache to RenderContext

Signed-off-by: Andrew Thornton <art27@cantab.net>
Co-authored-by: 6543 <6543@obermui.de>
3 years agoUse git log name-status in get last commit (#16059)
zeripath [Sun, 20 Jun 2021 22:00:46 +0000 (23:00 +0100)]
Use git log name-status in get last commit (#16059)

* Improve get last commit using git log --name-status

git log --name-status -c provides information about the diff between a
commit and its parents. Using this and adjusting the algorithm to use
the first change to a path allows for a much faster generation of commit
info.

There is a subtle change in the results generated but this will cause
the results to more closely match those from elsewhere.

Signed-off-by: Andrew Thornton <art27@cantab.net>
Co-authored-by: 6543 <6543@obermui.de>
Co-authored-by: techknowlogick <techknowlogick@gitea.io>
Co-authored-by: Lauris BH <lauris@nix.lv>
3 years ago[skip ci] Updated translations via Crowdin
GiteaBot [Sun, 20 Jun 2021 00:11:36 +0000 (00:11 +0000)]
[skip ci] Updated translations via Crowdin

3 years ago[skip ci] Updated translations via Crowdin
GiteaBot [Sat, 19 Jun 2021 00:11:34 +0000 (00:11 +0000)]
[skip ci] Updated translations via Crowdin

3 years agoReintroduce squash merge default comment as a config setting (#16134)
parnic [Fri, 18 Jun 2021 22:08:22 +0000 (17:08 -0500)]
Reintroduce squash merge default comment as a config setting (#16134)

* Reinstate most of commit 09304db9a5d88c035a96f74a4544572bc8c5dac0

* Move the behaviour behind a config setting

* Also fix the initial #12365

3 years agoRemove User.GetOrganizations() (#14032)
6543 [Fri, 18 Jun 2021 17:00:53 +0000 (19:00 +0200)]
Remove User.GetOrganizations() (#14032)

as title

3 years agoChangelog v1.14.3 (#16131) (#16196)
6543 [Fri, 18 Jun 2021 15:54:08 +0000 (17:54 +0200)]
Changelog v1.14.3 (#16131) (#16196)

Co-authored-by: Lauris BH <lauris@nix.lv>
Co-authored-by: zeripath <art27@cantab.net>
Co-authored-by: Lauris BH <lauris@nix.lv>
Co-authored-by: zeripath <art27@cantab.net>
3 years agofix TestAPIRepoTransfer (#16189)
6543 [Fri, 18 Jun 2021 14:46:22 +0000 (16:46 +0200)]
fix TestAPIRepoTransfer (#16189)

3 years ago[skip ci] Updated translations via Crowdin
GiteaBot [Fri, 18 Jun 2021 00:12:01 +0000 (00:12 +0000)]
[skip ci] Updated translations via Crowdin

3 years agoFix some API bugs (#16184)
6543 [Thu, 17 Jun 2021 23:24:55 +0000 (01:24 +0200)]
Fix some API bugs (#16184)

* Repository object only count releases as releases (fix #16144)

* EditOrg respect RepoAdminChangeTeamAccess option (fix #16013)

3 years agoAdd asymmetric JWT signing (#16010)
KN4CK3R [Thu, 17 Jun 2021 21:56:46 +0000 (23:56 +0200)]
Add asymmetric JWT signing (#16010)

* Added asymmetric token signing.

* Load signing key from settings.

* Added optional kid parameter.

* Updated documentation.

* Add "kid" to token header.

3 years ago[API] Add repoCreateTag (#16165)
6543 [Thu, 17 Jun 2021 16:04:10 +0000 (18:04 +0200)]
[API] Add repoCreateTag (#16165)

* Add API CreateTag

* Add Test

* API: expose Tag Message

3 years agoSpeed up git diff highlight generation (#16180)
Mura Li [Thu, 17 Jun 2021 14:55:16 +0000 (22:55 +0800)]
Speed up git diff highlight generation (#16180)

Co-authored-by: Mura Li <typeless@users.noreply.github.com>
Co-authored-by: 6543 <6543@obermui.de>
3 years ago[API] expose repo.GetReviewers() & repo.GetAssignees() (#16168)
6543 [Thu, 17 Jun 2021 14:02:34 +0000 (16:02 +0200)]
[API] expose repo.GetReviewers() & repo.GetAssignees() (#16168)

* API: expose repo.GetReviewers() & repo.GetAssignees()

* Add tests

* fix unrelated swagger query type

3 years agoRun processors on whole of text (#16155)
zeripath [Thu, 17 Jun 2021 10:35:05 +0000 (11:35 +0100)]
Run processors on whole of text (#16155)

There is an inefficiency in the design of our processors which means that Emoji
and other processors run in order n^2 time.

This PR forces the processors to process the entirety of text node before passing
back up. The fundamental inefficiency remains but it should be significantly
ameliorated.

Signed-off-by: Andrew Thornton <art27@cantab.net>
3 years ago[API] ListReleases add filter for draft and pre-releases (#16175)
6543 [Thu, 17 Jun 2021 08:58:10 +0000 (10:58 +0200)]
[API] ListReleases add filter for draft and pre-releases (#16175)

* invent ctx.QueryOptionalBool

* [API] ListReleases add draft and pre-release filter

* Add X-Total-Count header

* Add a release to fixtures

* Add TEST for API ListReleases

3 years ago[API] User expose counters (#16167)
6543 [Thu, 17 Jun 2021 07:17:35 +0000 (09:17 +0200)]
[API] User expose counters (#16167)

3 years ago[API] Issue Search Add filter for MilestoneNames (#16173)
6543 [Thu, 17 Jun 2021 06:40:59 +0000 (08:40 +0200)]
[API] Issue Search Add filter for MilestoneNames (#16173)

3 years ago[skip ci] Updated translations via Crowdin
GiteaBot [Thu, 17 Jun 2021 00:11:43 +0000 (00:11 +0000)]
[skip ci] Updated translations via Crowdin

3 years agoEnsure settings for Service and Mailer are read on the install page (#15943)
zeripath [Wed, 16 Jun 2021 23:32:57 +0000 (00:32 +0100)]
Ensure settings for Service and Mailer are read on the install page (#15943)

* Ensure settings for Service and Mailer are read on the install page

NewContext does not set the mailer or service settings so add
a new function that will run this.

Fix #15894

Signed-off-by: Andrew Thornton <art27@cantab.net>
* placate lint

Signed-off-by: Andrew Thornton <art27@cantab.net>
3 years ago [API] ListIssues add more filters (#16174)
6543 [Wed, 16 Jun 2021 22:33:37 +0000 (00:33 +0200)]
 [API] ListIssues add more filters (#16174)

* [API] ListIssues add more filters:
optional filter repo issues by:
 - since
 - before
 - created_by
 - assigned_by
 - mentioned_by

* Add Tests

* Update routers/api/v1/repo/issue.go

Co-authored-by: Lanre Adelowo <adelowomailbox@gmail.com>
* Apply suggestions from code review

Co-authored-by: Lanre Adelowo <adelowomailbox@gmail.com>
Co-authored-by: techknowlogick <techknowlogick@gitea.io>
3 years agoClean-up the settings hierarchy for issue_indexer queue (#16001)
zeripath [Wed, 16 Jun 2021 22:19:20 +0000 (23:19 +0100)]
Clean-up the settings hierarchy for issue_indexer queue (#16001)

There are a couple of settings in `[indexer]` relating to the `issue_indexer` queue
which override settings in unpredictable ways. This PR adjusts this hierarchy and makes
explicit that these settings are deprecated.

Signed-off-by: Andrew Thornton <art27@cantab.net>
Co-authored-by: techknowlogick <techknowlogick@gitea.io>
3 years agoFix missing discard in repo_language_stats (#16030)
zeripath [Wed, 16 Jun 2021 22:16:47 +0000 (23:16 +0100)]
Fix missing discard in repo_language_stats (#16030)

Set the missing discard(1) in repo_language_stats.

Signed-off-by: Andrew Thornton <art27@cantab.net>
Co-authored-by: 6543 <6543@obermui.de>
3 years agoAdd Status Updates whilst Gitea migrations are occurring (#15076)
zeripath [Wed, 16 Jun 2021 22:02:24 +0000 (23:02 +0100)]
Add Status Updates whilst Gitea migrations are occurring (#15076)

* Add migrating message

Signed-off-by: Andrew Thornton <art27@cantab.net>
* simplify messenger

Signed-off-by: Andrew Thornton <art27@cantab.net>
* make messenger an interface

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

Signed-off-by: Andrew Thornton <art27@cantab.net>
* prepare for merge

Signed-off-by: Andrew Thornton <art27@cantab.net>
* as per tech

Signed-off-by: Andrew Thornton <art27@cantab.net>
Co-authored-by: 6543 <6543@obermui.de>
3 years agoFix spelling (#16179)
Jonathan Tran [Wed, 16 Jun 2021 21:56:43 +0000 (17:56 -0400)]
Fix spelling (#16179)

Co-authored-by: Jonathan Tran <jon@allspice.io>
3 years agoAdd subject-type filter to list notification API endpoints (#16177)
6543 [Wed, 16 Jun 2021 17:04:37 +0000 (19:04 +0200)]
Add subject-type filter to list notification API endpoints (#16177)

Close #15886

3 years agoissue-keyword class is being incorrectly stripped off spans (#16163)
zeripath [Wed, 16 Jun 2021 01:02:03 +0000 (02:02 +0100)]
issue-keyword class is being incorrectly stripped off spans (#16163)

Bluemonday sanitizer regexp rules are not additive, so the addition of the icons,
emojis and chroma syntax policy has led to this being stripped.

Signed-off-by: Andrew Thornton <art27@cantab.net>
3 years ago[skip ci] Updated translations via Crowdin
GiteaBot [Wed, 16 Jun 2021 00:11:33 +0000 (00:11 +0000)]
[skip ci] Updated translations via Crowdin

3 years agoOnly check access tokens if they are likely to be tokens (#16164)
zeripath [Tue, 15 Jun 2021 22:29:25 +0000 (23:29 +0100)]
Only check access tokens if they are likely to be tokens (#16164)

* Only check access tokens if they are likely to be tokens

Gitea will currently check every if every password is an access token even though
most passwords are not and cannot be access tokens.

By creation access tokens are 40 byte hexadecimal strings therefore only these should
be checked.

Signed-off-by: Andrew Thornton <art27@cantab.net>
3 years agoUpdate MAINTAINERS (#16162)
Steven [Tue, 15 Jun 2021 19:16:18 +0000 (21:16 +0200)]
Update MAINTAINERS (#16162)

3 years agoUse milestone deadline when sorting issues (#14551)
koalp [Tue, 15 Jun 2021 01:15:56 +0000 (03:15 +0200)]
Use milestone deadline when sorting issues (#14551)

When sorting issues by deadline, the deadline of the milestone the issue
is attached to wasn't taken into account.

It have been changed and the nearest deadline is taken into account for
sorting.

Co-authored-by: techknowlogick <techknowlogick@gitea.io>
Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
3 years agoMake command in authorized keys a template (#16003)
zeripath [Tue, 15 Jun 2021 01:15:12 +0000 (02:15 +0100)]
Make command in authorized keys a template (#16003)

Fix #15595
Replaces #15978

Signed-off-by: Andrew Thornton <art27@cantab.net>
Co-authored-by: techknowlogick <techknowlogick@gitea.io>
3 years agoAdd attachments for PR reviews (#16075)
KN4CK3R [Tue, 15 Jun 2021 01:12:33 +0000 (03:12 +0200)]
Add attachments for PR reviews (#16075)

* First step for multiple dropzones per page.

* Allow attachments on review comments.

* Lint.

* Fixed accidental initialize of the review textarea.

* Initialize SimpleMDE textarea.

Co-authored-by: techknowlogick <techknowlogick@gitea.io>
3 years ago[skip ci] Updated translations via Crowdin
GiteaBot [Tue, 15 Jun 2021 00:11:35 +0000 (00:11 +0000)]
[skip ci] Updated translations via Crowdin

3 years agoFixed setting of wrong position (#16148)
KN4CK3R [Mon, 14 Jun 2021 20:42:58 +0000 (22:42 +0200)]
Fixed setting of wrong position (#16148)

3 years agov180 migration should be standalone (#16151)
zeripath [Mon, 14 Jun 2021 19:07:49 +0000 (20:07 +0100)]
v180 migration should be standalone (#16151)

Unfortunately the v180 migration picked up a few non-standalone dependencies. This PR
forcibly copies the important parts back into the migration.

Fix #16150

Signed-off-by: Andrew Thornton <art27@cantab.net>
Co-authored-by: techknowlogick <techknowlogick@gitea.io>
3 years agoFix private repo permission problem (#16142)
Nils Dralle [Mon, 14 Jun 2021 18:30:35 +0000 (20:30 +0200)]
Fix private repo permission problem (#16142)

* Change user access permission

* Add string 'transfer_notices_3'

* Add 3rd transfer note to transfer dialog

* Add test

Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
Co-authored-by: techknowlogick <techknowlogick@gitea.io>
3 years agoAdd push to remote mirror repository (#15157)
KN4CK3R [Mon, 14 Jun 2021 17:20:43 +0000 (19:20 +0200)]
Add push to remote mirror repository (#15157)

* Added push mirror model.

* Integrated push mirror into queue.

* Moved methods into own file.

* Added basic implementation.

* Mirror wiki too.

* Removed duplicated method.

* Get url for different remotes.

* Added migration.

* Unified remote url access.

* Add/Remove push mirror remotes.

* Prevent hangs with missing credentials.

* Moved code between files.

* Changed sanitizer interface.

* Added push mirror backend methods.

* Only update the mirror remote.

* Limit refs on push.

* Added UI part.

* Added missing table.

* Delete mirror if repository gets removed.

* Changed signature. Handle object errors.

* Added upload method.

* Added "upload" unit tests.

* Added transfer adapter unit tests.

* Send correct headers.

* Added pushing of LFS objects.

* Added more logging.

* Simpler body handling.

* Process files in batches to reduce HTTP calls.

* Added created timestamp.

* Fixed invalid column name.

* Changed name to prevent xorm auto setting.

* Remove table header im empty.

* Strip exit code from error message.

* Added docs page about mirroring.

* Fixed date.

* Fixed merge errors.

* Moved test to integrations.

* Added push mirror test.

* Added test.

3 years agoImprove performance of dashboard list orgs (#16099)
Lunny Xiao [Mon, 14 Jun 2021 12:18:09 +0000 (20:18 +0800)]
Improve performance of dashboard list orgs (#16099)

* Improve performance of dashboard list orgs

* Fix wrong error description

* unexport queryUserOrgIDs method

* SimpleOrg -> MinimalOrg

* .

Co-authored-by: 6543 <6543@obermui.de>
3 years agoAdd OpenID claims "profile" and "email". (#16141)
KN4CK3R [Mon, 14 Jun 2021 10:33:16 +0000 (12:33 +0200)]
Add OpenID claims "profile" and "email". (#16141)

* Added OpenID claims "profile" and "email".

* Splitted error.

* Added scopes_supported and claims_supported.

* Added more metadata.

Co-authored-by: techknowlogick <techknowlogick@gitea.io>
Co-authored-by: Lauris BH <lauris@nix.lv>
3 years agoFixed sanitize errors. (#15240)
KN4CK3R [Mon, 14 Jun 2021 03:06:52 +0000 (05:06 +0200)]
Fixed sanitize errors. (#15240)

Co-authored-by: 6543 <6543@obermui.de>
Co-authored-by: Lauris BH <lauris@nix.lv>
Co-authored-by: techknowlogick <techknowlogick@gitea.io>
3 years agoAdd a new table issue_index to store the max issue index so that issue could be delet...
Lunny Xiao [Mon, 14 Jun 2021 02:22:55 +0000 (10:22 +0800)]
Add a new table issue_index to store the max issue index so that issue could be deleted with no duplicated index (#15599)

* Add a new table issue_index to store the max issue index so that issue could be deleted with no duplicated index

* Fix pull index

* Add tests for concurrent creating issues

* Fix lint

* Fix tests

* Fix postgres test

* Add test for migration v180

* Rename wrong test file name

Co-authored-by: 6543 <6543@obermui.de>
Co-authored-by: Lauris BH <lauris@nix.lv>
3 years agosmall refactor for retry downloader (#16137)
a1012112796 [Sun, 13 Jun 2021 14:59:19 +0000 (22:59 +0800)]
small refactor for retry downloader (#16137)

Signed-off-by: a1012112796 <1012112796@qq.com>
3 years ago[skip ci] Updated licenses and gitignores
GiteaBot [Sun, 13 Jun 2021 00:11:23 +0000 (00:11 +0000)]
[skip ci] Updated licenses and gitignores

3 years agoRemovable media support (#16136)
Andrei Yankovich [Fri, 11 Jun 2021 18:51:05 +0000 (21:51 +0300)]
Removable media support (#16136)

Add support removable media for snap version of gitia.
for get more info about removable media interface see the snapcraft [documentation](https://snapcraft.io/docs/removable-media-interface)

3 years agoSet self-adjusting deadline for connection writing (#16068)
zeripath [Thu, 10 Jun 2021 21:25:25 +0000 (22:25 +0100)]
Set self-adjusting deadline for connection writing (#16068)

* Set self-adjusting deadline for connection writing

In #16055 it appears that the simple 5s deadline doesn't work for large
file writes. Now we can't - or at least shouldn't just set no deadline
as go will happily let these connections block indefinitely. However,
what seems reasonable is to set some minimum rate we expect for writing.

This PR suggests the following algorithm:

* Every write has a minimum timeout of 5s (adjustable at compile time.)
* If there has been a previous write - then consider its previous
deadline, add half of the minimum timeout + 2s per kb about to written.
* If that new deadline is after the minimum timeout use that.

Fix #16055

* Linearly increase timeout

* Make PerWriteTimeout, PerWritePerKbTimeouts configurable

Signed-off-by: Andrew Thornton <art27@cantab.net>
Co-authored-by: 6543 <6543@obermui.de>
3 years agoVendor Update (#16121)
6543 [Thu, 10 Jun 2021 14:44:25 +0000 (16:44 +0200)]
Vendor Update (#16121)

* update github.com/PuerkitoBio/goquery

* update github.com/alecthomas/chroma

* update github.com/blevesearch/bleve/v2

* update github.com/caddyserver/certmagic

* update github.com/go-enry/go-enry/v2

* update github.com/go-git/go-billy/v5

* update github.com/go-git/go-git/v5

* update github.com/go-redis/redis/v8

* update github.com/go-testfixtures/testfixtures/v3

* update github.com/jaytaylor/html2text

* update github.com/json-iterator/go

* update github.com/klauspost/compress

* update github.com/markbates/goth

* update github.com/mattn/go-isatty

* update github.com/mholt/archiver/v3

* update github.com/microcosm-cc/bluemonday

* update github.com/minio/minio-go/v7

* update github.com/prometheus/client_golang

* update github.com/unrolled/render

* update github.com/xanzy/go-gitlab

* update github.com/yuin/goldmark

* update github.com/yuin/goldmark-highlighting

Co-authored-by: techknowlogick <techknowlogick@gitea.io>
3 years agoRemove utf8 option from installation page (#16126)
Lunny Xiao [Thu, 10 Jun 2021 08:52:37 +0000 (16:52 +0800)]
Remove utf8 option from installation page (#16126)

3 years ago[skip ci] Updated translations via Crowdin
GiteaBot [Thu, 10 Jun 2021 00:11:49 +0000 (00:11 +0000)]
[skip ci] Updated translations via Crowdin

3 years agoFix bug on getIssueIDsByRepoID (#16119)
Lunny Xiao [Thu, 10 Jun 2021 00:08:19 +0000 (08:08 +0800)]
Fix bug on getIssueIDsByRepoID (#16119)

* Fix bug on getIssueIDsByRepoID

* Add test

3 years agoRemove unnecessary goroutine (#16080)
Lunny Xiao [Wed, 9 Jun 2021 19:52:55 +0000 (03:52 +0800)]
Remove unnecessary goroutine (#16080)

Co-authored-by: techknowlogick <techknowlogick@gitea.io>
3 years agoAdd sso.Group, context.Auth, context.APIAuth to allow auth special routes (#16086)
Lunny Xiao [Wed, 9 Jun 2021 17:53:16 +0000 (01:53 +0800)]
Add sso.Group, context.Auth, context.APIAuth to allow auth special routes (#16086)

* Add sso.Group, context.Auth, context.APIAuth to allow auth special routes

* Remove unnecessary check

* Rename sso -> auth

* remove unused method of Auth interface

3 years agoFix http path bug (#16117)
Lunny Xiao [Wed, 9 Jun 2021 12:53:12 +0000 (20:53 +0800)]
Fix http path bug (#16117)

* Fix http path bug

* Add missed request

* add tests

Co-authored-by: 6543 <6543@obermui.de>
3 years agoRefactor routers directory (#15800)
Lunny Xiao [Tue, 8 Jun 2021 23:33:54 +0000 (07:33 +0800)]
Refactor routers directory (#15800)

* refactor routers directory

* move func used for web and api to common

* make corsHandler a function to prohibit side efects

* rm unused func

Co-authored-by: 6543 <6543@obermui.de>
3 years agoRemove spurious AppSubUrl in serviceworker request. (#16047)
zeripath [Tue, 8 Jun 2021 17:46:13 +0000 (18:46 +0100)]
Remove spurious AppSubUrl in serviceworker request. (#16047)

There is another spurious AppSubUrl placement in the serviceworker registration.
This PR removes it.

Signed-off-by: Andrew Thornton <art27@cantab.net>
3 years agoFix `doctor --run check-db-consistency --fix` with label fix (#16094)
Lunny Xiao [Tue, 8 Jun 2021 04:36:23 +0000 (12:36 +0800)]
Fix `doctor --run check-db-consistency --fix` with label fix (#16094)

* Add doctor for wrong label and issue_label data

* Fix labels and issue labels check

* Remove unnecessary functions

3 years agoAlways store primary email address into email_address table and also the state (...
Lunny Xiao [Tue, 8 Jun 2021 03:52:51 +0000 (11:52 +0800)]
Always store primary email address into email_address table and also the state (#15956)

* Always store primary email address into email_address table and also the state

* Add lower_email to not convert email to lower as what's added

* Fix fixture

* Fix tests

* Use BeforeInsert to save lower email

* Fix v180 migration

* fix tests

* Fix test

* Remove wrong submited codes

* Fix test

* Fix test

* Fix test

* Add test for v181 migration

* remove change user's email to lower

* Revert change on user's email column

* Fix lower email

* Fix test

* Fix test

3 years agoFix data URI scramble (#16098)
KN4CK3R [Mon, 7 Jun 2021 16:55:26 +0000 (18:55 +0200)]
Fix data URI scramble (#16098)

* Removed unused method.

* No prefix for data uris.

* Added test to prevent regressions.

3 years agoMerge all deleteBranch as one function and also fix bug when delete branch don't...
Lunny Xiao [Mon, 7 Jun 2021 14:52:59 +0000 (22:52 +0800)]
Merge all deleteBranch as one function and also fix bug when delete branch don't close related PRs (#16067)

* Fix bug when delete branch don't close related PRs

* Merge all deletebranch as one method

* Add missed branch.go

* fix comment

Co-authored-by: Lauris BH <lauris@nix.lv>
3 years agoFixed assert statements. (#16089)
KN4CK3R [Mon, 7 Jun 2021 05:27:09 +0000 (07:27 +0200)]
Fixed assert statements. (#16089)