]> source.dussan.org Git - gitea.git/log
gitea.git
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)

3 years agoMake commit info cancelable (#16032)
zeripath [Sun, 6 Jun 2021 23:44:58 +0000 (00:44 +0100)]
Make commit info cancelable (#16032)

* Make modules/context.Context a context.Context

Signed-off-by: Andrew Thornton <art27@cantab.net>
* Simplify context calls

Signed-off-by: Andrew Thornton <art27@cantab.net>
* Set the base context for requests to the HammerContext

Signed-off-by: Andrew Thornton <art27@cantab.net>
* pass context into get-last-commit

Signed-off-by: Andrew Thornton <art27@cantab.net>
* Make commit_info cancellable

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

Signed-off-by: Andrew Thornton <art27@cantab.net>
Co-authored-by: 6543 <6543@obermui.de>
3 years agoFix regression of renderer (#16091)
Lunny Xiao [Sun, 6 Jun 2021 22:50:07 +0000 (06:50 +0800)]
Fix regression of renderer (#16091)

* Fix regression of renderer

* Fix render setting load twice bug

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

3 years agoRewrite of the LFS server (#15523)
KN4CK3R [Sat, 5 Jun 2021 23:59:27 +0000 (01:59 +0200)]
Rewrite of the LFS server (#15523)

* Restructured code. Moved static checks out of loop.

* Restructured batch api. Add support for individual errors.

* Let router decide if LFS is enabled.

* Renamed methods.

* Return correct status from verify handler.

* Unified media type check in router.

* Changed error code according to spec.

* Moved checks into router.

* Removed invalid v1 api methods.

* Unified methods.

* Display better error messages.

* Added size parameter. Create meta object on upload.

* Use object error on invalid size.

* Skip upload if object exists.

* Moved methods.

* Suppress fields in response.

* Changed error on accept.

* Added tests.

* Use ErrorResponse object.

* Test against message property.

* Add support for the old invalid lfs client.

* Fixed the check because MinIO wraps the error.

* Use individual repositories.

Co-authored-by: 6543 <6543@obermui.de>
Co-authored-by: Lauris BH <lauris@nix.lv>
3 years agoChange default TMPDIR path in rootless containers (#16077)
Steven [Sat, 5 Jun 2021 22:04:56 +0000 (00:04 +0200)]
Change default TMPDIR path in rootless containers (#16077)

Signed-off-by: Steven Kriegler <61625851+justusbunsi@users.noreply.github.com>
3 years agoFix panic (#16072)
zeripath [Sat, 5 Jun 2021 14:23:22 +0000 (15:23 +0100)]
Fix panic (#16072)

There is an incorrect casting in the wrapped queue.

Fix #16071

Signed-off-by: Andrew Thornton <art27@cantab.net>
3 years agoFix typo and add TODO notice (#16064)
NekoBit [Sat, 5 Jun 2021 13:33:34 +0000 (09:33 -0400)]
Fix typo and add TODO notice (#16064)

Co-authored-by: 6543 <6543@obermui.de>
Co-authored-by: Lauris BH <lauris@nix.lv>
3 years agoAdd Image Diff for SVG files (#14867)
KN4CK3R [Sat, 5 Jun 2021 12:32:19 +0000 (14:32 +0200)]
Add Image Diff for SVG files (#14867)

* Added type sniffer.

* Switched content detection from base to typesniffer.

* Added GuessContentType to Blob.

* Moved image info logic to client.
Added support for SVG images in diff.

* Restore old blocked svg behaviour.

* Added missing image formats.

* Execute image diff only when container is visible.

* add margin to spinner

* improve BIN tag on image diffs

* Default to render view.

* Show image diff on incomplete diff.

Co-authored-by: silverwind <me@silverwind.io>
Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
Co-authored-by: Lauris BH <lauris@nix.lv>
3 years agoCopy git data from disk when restore repository (#16066)
Lunny Xiao [Fri, 4 Jun 2021 13:14:20 +0000 (21:14 +0800)]
Copy git data from disk when restore repository (#16066)

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

3 years agoFixed unknown translation key. (#16057)
KN4CK3R [Thu, 3 Jun 2021 22:50:31 +0000 (00:50 +0200)]
Fixed unknown translation key. (#16057)

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

3 years agouse "true" for RACE_ENABLED (#15261)
6543 [Wed, 2 Jun 2021 15:34:11 +0000 (17:34 +0200)]
use "true" for RACE_ENABLED (#15261)

3 years agoFix case change in ownernames (#16045)
zeripath [Wed, 2 Jun 2021 12:03:59 +0000 (13:03 +0100)]
Fix case change in ownernames (#16045)

If you change the case of a username the change needs to be propagated to their
repositories.

Signed-off-by: Andrew Thornton <art27@cantab.net>
3 years agoFix bug due to missing MaxStartups and MaxSessions (#16046)
zeripath [Tue, 1 Jun 2021 19:55:17 +0000 (20:55 +0100)]
Fix bug due to missing MaxStartups and MaxSessions (#16046)

Unforunately #16009 makes these settings mandatory. This PR uses the same technique
as used for the certificates to make these settings non-mandatory.

Fix #16044

Signed-off-by: Andrew Thornton <art27@cantab.net>
Co-authored-by: 6543 <6543@obermui.de>
3 years agoFix language switch for install page (#16043)
a1012112796 [Tue, 1 Jun 2021 19:12:50 +0000 (03:12 +0800)]
Fix language switch for install page (#16043)

Signed-off-by: a1012112796 <1012112796@qq.com>
3 years agoupdate ``.raw-content`` when edit issue/comment content (#16021)
a1012112796 [Tue, 1 Jun 2021 02:22:49 +0000 (10:22 +0800)]
update ``.raw-content`` when edit issue/comment content (#16021)

* update ``.raw-content`` when edit issue/comment content

fix #16000

Signed-off-by: a1012112796 <1012112796@qq.com>
* handle empty content

Co-authored-by: techknowlogick <techknowlogick@gitea.io>
3 years agoMake sshd_config more flexible regarding connections (#16009)
Dario Louzado [Tue, 1 Jun 2021 01:33:50 +0000 (22:33 -0300)]
Make sshd_config more flexible regarding connections (#16009)

* Make sshd_config more flexible regarding
MaxStartups and MaxSessions.

See https://man.openbsd.org/sshd_config
for more information.

* make property prefix equals
other existing Gitea SSH properties.

Co-authored-by: dlouzado <dlouzado@senado.leg.br>
3 years ago[skip ci] Updated translations via Crowdin
GiteaBot [Tue, 1 Jun 2021 00:11:31 +0000 (00:11 +0000)]
[skip ci] Updated translations via Crowdin

3 years agoAdd missing SameSite settings for the i_like_gitea cookie (#16037)
zeripath [Mon, 31 May 2021 18:22:36 +0000 (19:22 +0100)]
Add missing SameSite settings for the i_like_gitea cookie (#16037)

The i_like_gitea cookie appears to be missing the SameSite settings. I think they
were present at some point but may have been removed in a merge.

This PR ensures that they are set.

Fix #15972

Signed-off-by: Andrew Thornton <art27@cantab.net>
3 years agoHide mirror passwords on repo settings page (#16022)
zeripath [Mon, 31 May 2021 10:46:20 +0000 (11:46 +0100)]
Hide mirror passwords on repo settings page (#16022)

This PR simply hides mirror passwords from being displayed on the repo settings page.

Signed-off-by: Andrew Thornton <art27@cantab.net>
Co-authored-by: techknowlogick <techknowlogick@gitea.io>
3 years agoEncrypt migration credentials at rest (#15895)
Norwin [Mon, 31 May 2021 08:25:47 +0000 (08:25 +0000)]
Encrypt migration credentials at rest (#15895)

* encrypt migration credentials in task persistence

Not sure this is the best approach, we could encrypt the entire
`PayloadContent` instead. Also instead of clearing individual fields in
payload content, we could just delete the task once it has
(successfully) finished..?

* remove credentials of past migrations

* only run DB migration for completed tasks

* fix binding

* add omitempty

* never serialize unencrypted credentials

* fix import order

Co-authored-by: techknowlogick <techknowlogick@gitea.io>
Co-authored-by: zeripath <art27@cantab.net>
Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
3 years agoFix bug in reverse proxy (#16026)
zeripath [Mon, 31 May 2021 06:54:16 +0000 (07:54 +0100)]
Fix bug in reverse proxy (#16026)

Unfortunately go panics you try to cast a nil interface{} as another primitive
therefore you need to check interfaces are not nil before casting.

Fix #16025

Signed-off-by: Andrew Thornton <art27@cantab.net>
Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
Co-authored-by: techknowlogick <techknowlogick@gitea.io>
3 years agoMake modules/context.Context a context.Context (#16031)
zeripath [Mon, 31 May 2021 06:18:11 +0000 (07:18 +0100)]
Make modules/context.Context a context.Context (#16031)

* Make modules/context.Context a context.Context

Signed-off-by: Andrew Thornton <art27@cantab.net>
* Simplify context calls

Signed-off-by: Andrew Thornton <art27@cantab.net>
* Set the base context for requests to the HammerContext

Signed-off-by: Andrew Thornton <art27@cantab.net>
Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
3 years ago[skip ci] Updated translations via Crowdin
GiteaBot [Mon, 31 May 2021 00:11:22 +0000 (00:11 +0000)]
[skip ci] Updated translations via Crowdin

3 years agoReplace clipboard.js with async clipboard api (#15899)
silverwind [Sun, 30 May 2021 19:15:57 +0000 (21:15 +0200)]
Replace clipboard.js with async clipboard api (#15899)

Use async clipboard api [1] over this dependency, saving around 10kB
bundle size before minify while delivering the same functionality.

The issue comment button works but does not have a popup indication. We
could add some toast-style notifications in the future to fix that but I
think it's out of scope of this PR.

[1] https://developer.mozilla.org/en-US/docs/Web/API/Clipboard/writeText

3 years agoClose the dataRC reader sooner (#16023)
zeripath [Sun, 30 May 2021 16:38:44 +0000 (17:38 +0100)]
Close the dataRC reader sooner (#16023)

Fix #15932

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