]> source.dussan.org Git - gitea.git/log
gitea.git
3 years agoPrevent template renderer from rendering error (#14646)
zeripath [Sat, 13 Feb 2021 19:41:53 +0000 (19:41 +0000)]
Prevent template renderer from rendering error (#14646)

When there is a panic during template rendering unrolled/render
will automatically render the error. This leads to the
panic being displayed in the page and not a 500 page

Fix #14467
Fix #14525

Signed-off-by: Andrew Thornton <art27@cantab.net>
3 years agoPrevent race in PersistableChannelUniqueQueue.Has (#14651)
zeripath [Sat, 13 Feb 2021 19:02:09 +0000 (19:02 +0000)]
Prevent race in PersistableChannelUniqueQueue.Has (#14651)

There is potentially a race with a slow starting internal
queue causing a NPE if Has is checked before the internal
queue has been setup.

This PR adds a lock on the Has() fn.

Fix #14311

Signed-off-by: Andrew Thornton <art27@cantab.net>
3 years agoTurn default hash password algorightm back to pbkdf2 from argon2 until we found a...
Lunny Xiao [Sat, 13 Feb 2021 17:03:29 +0000 (01:03 +0800)]
Turn default hash password algorightm back to pbkdf2 from argon2 until we found a better one (#14673)

* Turn default hash password algorightm back to pbkdf2 from argon2 until we found a better one

* Add a warning on document

3 years ago[skip ci] Updated translations via Crowdin
GiteaBot [Sat, 13 Feb 2021 16:08:31 +0000 (16:08 +0000)]
[skip ci] Updated translations via Crowdin

3 years agorm gogs relict (#14665)
6543 [Sat, 13 Feb 2021 16:07:17 +0000 (17:07 +0100)]
rm gogs relict (#14665)

3 years agoWhitespace in commits (#14650)
vnkmpf [Sat, 13 Feb 2021 04:35:43 +0000 (05:35 +0100)]
Whitespace in commits (#14650)

* Add whitespace to commit view

* Add whitespace to /compare/a...b

* Move repeated whitespaceFlags to gitdiff

* Add whitespace for wiki pages

3 years agoShow Gitea version in swagger (#14654)
techknowlogick [Fri, 12 Feb 2021 20:51:56 +0000 (15:51 -0500)]
Show Gitea version in swagger (#14654)

Show Gitea version in swagger

Co-authored-by: 6543 <6543@obermui.de>
3 years agoAdd v171 (addSortingColToProjectBoard) migration for #14634 (#14652)
6543 [Fri, 12 Feb 2021 11:01:26 +0000 (12:01 +0100)]
Add v171 (addSortingColToProjectBoard) migration for #14634 (#14652)

* add v171 Migration for #14634

* NOT NULL

Co-authored-by: Lauris BH <lauris@nix.lv>
3 years agoFix truncated organization names (#14655)
vnkmpf [Fri, 12 Feb 2021 01:29:07 +0000 (02:29 +0100)]
Fix truncated organization names (#14655)

* Fix truncated organization names

Previous ellipsis implementation hid vertical overflow - image + descent line of letters.
Organization visibility in select on dashboard was not always visible.
This commit extracts classes which don't make collisions with other items on page.

3 years agoFix PATCH /repos/{owner}/{repo} panic (#14637)
Anton Khimich [Thu, 11 Feb 2021 19:53:41 +0000 (14:53 -0500)]
Fix PATCH /repos/{owner}/{repo} panic (#14637)

* Fix a runtime error when modifying a repository through API call

Using the `PATCH /repos/{owner}/{repo}` endpoint and attempting to
modify `default_branch` on an empty repository will cause a
panic. This commit adds a check for a nil pointer before attempting
to dereference it.

* Apply suggestions from code review

* Apply suggestions from code review

* Ensure that the git repository is loaded

If you change the default branch for a repository you must change it in
git too. Therefore you must open the repository before changing the
default branch.

Signed-off-by: Andrew Thornton <art27@cantab.net>
* Allow empty repos to have their default branches changed

Signed-off-by: Andrew Thornton <art27@cantab.net>
Co-authored-by: Anton Khimich <anton.khimicha@mail.utoronto.ca>
Co-authored-by: 6543 <6543@obermui.de>
Co-authored-by: Andrew Thornton <art27@cantab.net>
3 years agoMake fileheader sticky in diffs (#14616)
vnkmpf [Thu, 11 Feb 2021 18:28:51 +0000 (19:28 +0100)]
Make fileheader sticky in diffs (#14616)

* Make fileheader sticky #12552

* Remove sticky filenames when width is 480px or less

On mobile phone sticky filename is hidden due to the combination
of many possible widths and lengths.

* Fix text color for .markdown-info

* Fix visual of sticky diff box on 480px or less

- Hide arrow for select buttons.
- Fix changes, additions and deletions.
With flexbox they look very broken.
This commit hides some words to, so the result is:
"123 changed files  987 additions  456 deletions"
- center text in buttons

Co-authored-by: zeripath <art27@cantab.net>
3 years agoAdded option to disable webhooks (#13176)
Paweł Bogusławski [Thu, 11 Feb 2021 17:34:34 +0000 (18:34 +0100)]
Added option to disable webhooks (#13176)

* Added option to disable web hooks

This mod introduces DISABLE_WEB_HOOKS parameter in [security] section
of app.ini (by default set to false). If set to true it disables web
hooks feature. Any existing undelivered web hook tasks will be cancelled.
Any existing web hook definitions will be left untouched in db but
its delivery tasks will be ignored.

Author-Change-Id: IB#1105130

* Webhook spelling fixed

Webhook spelling fixed.

Fixes: 07df6614dc84cdd2e9f39c57577fa1062bd70012
Related: https://github.com/go-gitea/gitea/pull/13176#pullrequestreview-510868421
Author-Change-Id: IB#1105174

* Parameter description fixed

Parameter description fixed.

Fixes: 07df6614dc84cdd2e9f39c57577fa1062bd70012
Related: https://github.com/go-gitea/gitea/pull/13176#pullrequestreview-514086107
Author-Change-Id: IB#1105174

3 years agoAdd dismiss review feature (#12674)
a1012112796 [Thu, 11 Feb 2021 17:32:25 +0000 (01:32 +0800)]
Add dismiss review feature (#12674)

* Add dismiss review feature

refs:
    https://github.blog/2016-10-12-dismissing-reviews-on-pull-requests/
    https://developer.github.com/v3/pulls/reviews/#dismiss-a-review-for-a-pull-request

* change modal ui and error message

* Add unDismissReview api

Signed-off-by: a1012112796 <1012112796@qq.com>
Co-authored-by: zeripath <art27@cantab.net>
Co-authored-by: 6543 <6543@obermui.de>
3 years agoSort / Move project boards (#14634)
Romain [Thu, 11 Feb 2021 16:32:27 +0000 (17:32 +0100)]
Sort / Move project boards (#14634)

Sort Project board (#14533)

3 years ago[Vendor] Update go-redis to v8.5.0 (#13749)
6543 [Wed, 10 Feb 2021 21:28:32 +0000 (22:28 +0100)]
[Vendor] Update go-redis to v8.5.0 (#13749)

* Update go-redis to v8.4.0

* github.com/go-redis/redis/v8  v8.4.0 -> v8.5.0

* Apply suggestions from code review

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

* Use the Queue termination channel as the default context for pushes

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

Signed-off-by: Andrew Thornton <art27@cantab.net>
Co-authored-by: zeripath <art27@cantab.net>
3 years agoAllow org labels to be set with issue templates (#14593)
zeripath [Wed, 10 Feb 2021 17:18:22 +0000 (17:18 +0000)]
Allow org labels to be set with issue templates (#14593)

Fix #13688

Signed-off-by: Andrew Thornton <art27@cantab.net>
3 years agoDo not assume all 40 char strings are SHA1s (#14624)
zeripath [Wed, 10 Feb 2021 07:37:25 +0000 (07:37 +0000)]
Do not assume all 40 char strings are SHA1s (#14624)

GetCommit() assumes that all 40 char strings are SHA1s. This leads to an
error if you try to do a PR on a branch which is 40 characters long.

This PR attempts the SHA first - and if it fails will switch to using rev-parse.

Fix #14470

Signed-off-by: Andrew Thornton <art27@cantab.net>
3 years agoHasPreviousCommit causes recursive load of commits unnecessarily (#14598)
zeripath [Wed, 10 Feb 2021 07:00:57 +0000 (07:00 +0000)]
HasPreviousCommit causes recursive load of commits unnecessarily (#14598)

This PR improves HasPreviousCommit to prevent the automatic and recursive loading
of previous commits using git merge-base --is-ancestor and git rev-list

Fix #13684

Signed-off-by: Andrew Thornton <art27@cantab.net>
3 years agoImprove the comment on comment type (#14609)
Lunny Xiao [Wed, 10 Feb 2021 03:57:30 +0000 (11:57 +0800)]
Improve the comment on comment type (#14609)

3 years agoPrevent adding nil label to .AddedLabels or .RemovedLabels (#14623)
zeripath [Wed, 10 Feb 2021 02:50:44 +0000 (02:50 +0000)]
Prevent adding nil label to .AddedLabels or .RemovedLabels (#14623)

* Prevent adding nil label to .AddedLabels or .RemovedLabels

There are possibly a few old databases out there with malmigrated data that can
cause panics with empty labels being migrated.

This PR adds a few tests to prevent nil labels being added.

Fix #14466

Signed-off-by: Andrew Thornton <art27@cantab.net>
* Add doctor command to remove the broken label comments

Signed-off-by: Andrew Thornton <art27@cantab.net>
Co-authored-by: 6543 <6543@obermui.de>
3 years agoEnsure memcache TTL cannot be over 30 days (#14592)
zeripath [Tue, 9 Feb 2021 22:29:03 +0000 (22:29 +0000)]
Ensure memcache TTL cannot be over 30 days (#14592)

Memcached TTL cannot be > 30 days and if it is attempted the TTL is interpreted as
a unix timestamp.

This PR ensures that the TTL is switched to a unix timestamp in those cases.

Fix #14571

Signed-off-by: Andrew Thornton <art27@cantab.net>
3 years agoTruncated organisations name #14583 (#14615)
vnkmpf [Tue, 9 Feb 2021 19:51:01 +0000 (20:51 +0100)]
Truncated organisations name #14583 (#14615)

- truncate to max length 40
- add CSS ellipsis

3 years agoAdd support for ref parameter to get raw file API (#14602)
zeripath [Tue, 9 Feb 2021 00:15:47 +0000 (00:15 +0000)]
Add support for ref parameter to get raw file API (#14602)

Fix #14597

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 agoFixed irritating error message related to go version (#14611)
uli-heller [Mon, 8 Feb 2021 15:16:53 +0000 (16:16 +0100)]
Fixed irritating error message related to go version (#14611)

I do have go-1.13.8 installed and get the error message

```
Gitea requires Go 1.13 or greater to build. You can get it at https://golang.org/dl/
```

I do thing that Go 1.14 or greater is actually required

3 years agoUse OldRef instead of CommitSHA for DeleteBranch comments (#14604)
zeripath [Mon, 8 Feb 2021 03:09:14 +0000 (03:09 +0000)]
Use OldRef instead of CommitSHA for DeleteBranch comments (#14604)

Fix #14545

Signed-off-by: Andrew Thornton <art27@cantab.net>
Co-authored-by: 6543 <6543@obermui.de>
Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
3 years agoAdd information on how to build statically (#14594)
zeripath [Mon, 8 Feb 2021 02:06:21 +0000 (02:06 +0000)]
Add information on how to build statically (#14594)

Fix #14576

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, 8 Feb 2021 01:01:27 +0000 (01:01 +0000)]
[skip ci] Updated translations via Crowdin

3 years agoExclude the current dump file from the dump (#14606)
zeripath [Mon, 8 Feb 2021 01:00:12 +0000 (01:00 +0000)]
Exclude the current dump file from the dump (#14606)

* Exclude the current dump file from the dump

Always prevent the current file from being added to the dump.

Fix #13618

Signed-off-by: Andrew Thornton <art27@cantab.net>
* Add skip custom directory option

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

Signed-off-by: Andrew Thornton <art27@cantab.net>
Co-authored-by: 6543 <6543@obermui.de>
3 years agoRemove spurious DataAsync Error logging (#14599)
zeripath [Sun, 7 Feb 2021 21:04:58 +0000 (21:04 +0000)]
Remove spurious DataAsync Error logging (#14599)

Breaking the pipe is a valid way of killing a piped command and any error from
a broken cat-file batch command should be passed back up to the writer any way
therefore specifically logging it is unnecessary.

Signed-off-by: Andrew Thornton <art27@cantab.net>
3 years ago[API] Add delete release by tag & fix unreleased inconsistency (#14563)
6543 [Sun, 7 Feb 2021 18:32:18 +0000 (19:32 +0100)]
[API] Add  delete release by tag & fix unreleased inconsistency (#14563)

* DeleteReleaseByTag delete release not git tags

* Add api to delete tag (without release)

* fix & extend tests

* fix swagger doc

3 years agoFix rate limit bug when downloading assets on migrating from github (#14564)
Lunny Xiao [Sun, 7 Feb 2021 15:56:11 +0000 (23:56 +0800)]
Fix rate limit bug when downloading assets on migrating from github (#14564)

3 years ago[API] Add affected files of commits to commit struct (#14579)
6543 [Sun, 7 Feb 2021 14:43:40 +0000 (15:43 +0100)]
[API] Add affected files of commits to commit struct (#14579)

* Add files affected by a commit to gitea API -- similar to github

* Add files affected by a commit to gitea API

* Fix stupid error

* Fix other stupid typo

* Generate swagger tmpl

* Comply with convert to git commit refacto

* update swagger docs

* extend test

* format code

* Update integrations/api_repo_git_commits_test.go

* Update modules/convert/git_commit.go

Co-authored-by: Laurent Cahour <laurent.cahour@dont-nod.com>
Co-authored-by: zeripath <art27@cantab.net>
3 years ago[skip ci] Updated licenses and gitignores
GiteaBot [Sun, 7 Feb 2021 00:18:59 +0000 (00:18 +0000)]
[skip ci] Updated licenses and gitignores

3 years agoFix locale init (#14582)
John Olheiser [Fri, 5 Feb 2021 21:41:45 +0000 (15:41 -0600)]
Fix locale init (#14582)

just log if lang is already loaded since we can not reload it

Co-authored-by: jolheiser <john.olheiser@gmail.com>
Co-authored-by: 6543 <6543@obermui.de>
Co-authored-by: zeripath <art27@cantab.net>
3 years agoAdd Content-Length header to HEAD requests (#14542)
Farid AYOUJIL [Fri, 5 Feb 2021 20:10:40 +0000 (21:10 +0100)]
Add Content-Length header to HEAD requests (#14542)

* Add Content-Length header to HEAD requests

This change adds the header Content-Length to HEAD HTTP requests.

The previous behaviour was blocking some Windows executables (i.e
bitsadmin.exe) from downloading files hosted in Gitea.

This along with PR #14541, makes the web server compliant with HTTP RFC 2616 which states
"The methods GET and HEAD MUST be supported by all general-purpose servers"
and
"The HEAD method is identical to GET except that the server MUST NOT return a message-body in the response."

This should also respond to issues #8030 and #14532.

* This change adds the header Content-Length to HEAD HTTP requests

Pass the Size of the content as a parameter to ServeData() instead of
calculating it using ioutil.ReadAll(reader) --> this call is dangerous
and can result in a denial of service.

* Add Content-Length header to HEAD requests

Quick fix for imported dependency not used.

* Check if size is positiv int ...

Co-authored-by: zeripath <art27@cantab.net>
3 years agoHonor REGISTER_MANUAL_CONFIRM when doing openid registration (#14548)
Michel Ganguin [Fri, 5 Feb 2021 03:03:20 +0000 (04:03 +0100)]
Honor REGISTER_MANUAL_CONFIRM when doing openid registration (#14548)

REGISTER_MANUAL_CONFIRM is not honored when doing performing an openid registration. The new account is directly accessible.

With this patch, the manual confirm flag gets honored in the same way as a "normal" registration.

3 years agoFix lfs file viewer (#14568)
Lunny Xiao [Fri, 5 Feb 2021 01:29:42 +0000 (09:29 +0800)]
Fix lfs file viewer (#14568)

3 years agoFix typo in generate-emoji.go (#14570)
Ikko Ashimine [Thu, 4 Feb 2021 17:57:42 +0000 (02:57 +0900)]
Fix typo in generate-emoji.go (#14570)

modifer -> modifier

Co-authored-by: techknowlogick <techknowlogick@gitea.io>
3 years agoFix bug about ListOptions and stars/watchers pagnation (#14556)
Lunny Xiao [Thu, 4 Feb 2021 17:23:46 +0000 (01:23 +0800)]
Fix bug about ListOptions and stars/watchers pagnation (#14556)

* Fix bug about ListOptions and stars/watchers pagnation

* fix unit test

Co-authored-by: 6543 <6543@obermui.de>
3 years agoFix gpg key deletion (#14561)
Anton Khimich [Thu, 4 Feb 2021 09:16:21 +0000 (04:16 -0500)]
Fix gpg key deletion (#14561)

* Fix GPG key deletion when user is deleted

Per #14531, deleting a user account will delete the user's GPG keys
from the `gpg_key` table but not from `gpg_key_import`, which causes
an error when creating an account with the same email and attempting
to re-add the same key. This commit deletes all entries from
`gpg_key_import` that match any GPG key IDs belonging to the user.

* Format added code in models/user.go

* Create a new function for listing GPG keys and apply it

Create a new function `listGPGKeys` and replace a previous use
of `ListGPGKeys`. Thanks to @6543 for the patch.

Co-authored-by: Anton Khimich <anton.khimicha@mail.utoronto.ca>
Co-authored-by: 6543 <6543@obermui.de>
3 years ago[API] GetRelease by tag only return release (#14397)
Cameron Braid [Thu, 4 Feb 2021 03:12:25 +0000 (14:12 +1100)]
[API] GetRelease by tag only return release (#14397)

get release by tag should filter out tag releases to be consistent with list releases and get by id

Co-authored-by: 6543 <6543@obermui.de>
3 years agoReduce data races (#14549)
6543 [Wed, 3 Feb 2021 21:36:38 +0000 (22:36 +0100)]
Reduce data races (#14549)

* Add race conditions into test

* Fix Race in GetManager()

* DataAsync() use error chan

* just log no chan

* finish

3 years ago[API] Add pagination to ListBranches (#14524)
6543 [Wed, 3 Feb 2021 19:06:13 +0000 (20:06 +0100)]
[API] Add pagination to ListBranches (#14524)

* make PaginateUserSlice generic -> PaginateSlice

* Add pagination to ListBranches

* add skip, limit to Repository.GetBranches()

* Move routers/api/v1/utils/utils PaginateSlice -> modules/util/paginate.go

* repo_module.GetBranches paginate

* fix & rename & more logging

* better description

Co-authored-by: zeripath <art27@cantab.net>
Co-authored-by: a1012112796 <1012112796@qq.com>
3 years agodocs: update installation with-docker zh-cn (#14554)
Howie Zhao [Wed, 3 Feb 2021 16:12:35 +0000 (00:12 +0800)]
docs: update installation with-docker zh-cn (#14554)

3 years ago[Docs] Clone filters (#14555)
Bagas Sanjaya [Wed, 3 Feb 2021 15:11:20 +0000 (22:11 +0700)]
[Docs] Clone filters (#14555)

In summary: set uploadpack.allowfilter

Signed-off-by: Bagas Sanjaya <bagasdotme@gmail.com>
3 years agoupdate docs to show latest stable version (1.13.2) (#14550)
techknowlogick [Wed, 3 Feb 2021 07:46:42 +0000 (02:46 -0500)]
update docs to show latest stable version (1.13.2) (#14550)

3 years ago Adding Chi's GetHead middleware (#14541)
Farid AYOUJIL [Tue, 2 Feb 2021 08:53:42 +0000 (09:53 +0100)]
 Adding Chi's GetHead middleware (#14541)

Before moving to Chi, HEAD requests were automatically answered by GET
handlers (SetAutoHead(true) from macaron was used).

This Change will restore the previous behaviour.

Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
3 years agoChangelog v1.13.2 (#14535) (#14543)
6543 [Tue, 2 Feb 2021 01:19:10 +0000 (02:19 +0100)]
Changelog v1.13.2 (#14535) (#14543)

3 years ago[skip ci] Updated translations via Crowdin
GiteaBot [Mon, 1 Feb 2021 21:58:33 +0000 (21:58 +0000)]
[skip ci] Updated translations via Crowdin

3 years ago[API] List, Check, Add & delete endpoints for repository teams (#13630)
6543 [Mon, 1 Feb 2021 21:57:12 +0000 (22:57 +0100)]
[API] List, Check, Add & delete endpoints for repository teams (#13630)

* List, Check, Add & delete endpoints for repository teams

* return units on single team responce too

* Add Tests

3 years ago[skip ci] Updated translations via Crowdin
GiteaBot [Mon, 1 Feb 2021 04:50:39 +0000 (04:50 +0000)]
[skip ci] Updated translations via Crowdin

3 years agorm redirect (#14534)
6543 [Mon, 1 Feb 2021 04:49:25 +0000 (05:49 +0100)]
rm redirect (#14534)

3 years agoUpgrade 'css-minimizer-webpack-plugin' to the latest version (#14527)
Atilla Lonny [Sat, 30 Jan 2021 18:07:23 +0000 (10:07 -0800)]
Upgrade 'css-minimizer-webpack-plugin' to the latest version (#14527)

This patch resolves #14520

3 years agoSet the name Mapper in migrations (#14526)
zeripath [Sat, 30 Jan 2021 15:24:25 +0000 (15:24 +0000)]
Set the name Mapper in migrations (#14526)

Migrations currently uses the default Xorm mapper which is
not the same as the mapper Gitea actually uses.

This means that there is a difference between the struct
parsing and mapping to database tables in migrations as
compared to normal Sync2.

This was the cause for the catastrophic problem in v168 -
untagged fields are not mapped in the same way in migrations
as compared to outside of migrations.

This is also likely the cause of some weird subtle failures
in other migrations as any untagged field may not be being
mapped exactly the same way.

This PR suggests that we ensure that the mapper is set at
the start of the migrations code - but also enforces a strict
clean mapper between each migration.

Signed-off-by: Andrew Thornton <art27@cantab.net>
3 years agoInternal ssh server respect Ciphers, MACs and KeyExchanges settings (#14523)
Stefan [Sat, 30 Jan 2021 13:20:32 +0000 (14:20 +0100)]
Internal ssh server respect Ciphers, MACs and KeyExchanges settings (#14523)

3 years agoMove middlewares to web/middleware (#14480)
Lunny Xiao [Sat, 30 Jan 2021 08:55:53 +0000 (16:55 +0800)]
Move middlewares to web/middleware (#14480)

Co-authored-by: 6543 <6543@obermui.de>
3 years agoAdd Doctor FixWrongUserType (#14522)
6543 [Fri, 29 Jan 2021 18:30:43 +0000 (19:30 +0100)]
Add Doctor FixWrongUserType (#14522)

* Add Doctor FixWrongUserType

* use NoAutoTime

3 years ago[skip ci] Updated translations via Crowdin
GiteaBot [Fri, 29 Jan 2021 15:53:59 +0000 (15:53 +0000)]
[skip ci] Updated translations via Crowdin

3 years agonoop (#14521)
John Olheiser [Fri, 29 Jan 2021 15:52:13 +0000 (09:52 -0600)]
noop (#14521)

Signed-off-by: jolheiser <john.olheiser@gmail.com>
Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
3 years agoUpdate docs and comments to remove macaron (#14491)
Lunny Xiao [Fri, 29 Jan 2021 15:35:30 +0000 (23:35 +0800)]
Update docs and comments to remove macaron (#14491)

3 years ago[skip ci] Updated translations via Crowdin
GiteaBot [Fri, 29 Jan 2021 13:44:05 +0000 (13:44 +0000)]
[skip ci] Updated translations via Crowdin

3 years agoFix json charset bug (#14514)
Lunny Xiao [Fri, 29 Jan 2021 13:42:47 +0000 (21:42 +0800)]
Fix json charset bug (#14514)

3 years agoenhancement: add signoff option in commit form (#14516)
a1012112796 [Fri, 29 Jan 2021 08:57:45 +0000 (16:57 +0800)]
enhancement: add signoff option in commit form (#14516)

Signed-off-by: a1012112796 <1012112796@qq.com>
3 years agoFix load time bug (#14508)
Lunny Xiao [Fri, 29 Jan 2021 04:33:47 +0000 (12:33 +0800)]
Fix load time bug (#14508)

3 years agoFix missing locale bug introduced by #14429 (#14513)
delvh [Fri, 29 Jan 2021 03:06:10 +0000 (04:06 +0100)]
Fix missing locale bug introduced by #14429 (#14513)

Fixes #14512

3 years ago[docs] Add zh-tw Translations (#14507)
kevinlin18 [Fri, 29 Jan 2021 00:57:58 +0000 (08:57 +0800)]
[docs] Add zh-tw Translations (#14507)

3 years agoFix migration v141 (#14387)
6543 [Thu, 28 Jan 2021 22:58:33 +0000 (23:58 +0100)]
Fix migration v141 (#14387)

* Fix mig 141

* Add Migration to fix it

* update null values to false first

* Alter Table if posible

* use dropTableColumns instead of recreateTable

* MySQL use Alter

* Postgres use Alter

* Update models/migrations/v167.go

* Apply suggestions from code review

* use 2x add col & 2x update & 2x drop col

* let sqlite be the only issue

* use recreate since it just WORKS

3 years agoExtend TestUserOrgs to cover permission cases (#14495)
6543 [Thu, 28 Jan 2021 21:40:41 +0000 (22:40 +0100)]
Extend TestUserOrgs to cover permission cases (#14495)

* TestMyOrgs: add unauthorized test

* Extend TestUserOrgs, to cover permission cases

3 years agoAdd some Unit-Tests (#14500)
6543 [Thu, 28 Jan 2021 18:08:11 +0000 (19:08 +0100)]
Add some Unit-Tests (#14500)

* fix url

* modules/auth/pa: coverage: 40#.0%

* modules/base coverage: 67.6% -> 89.9%

* modules/cache coverage: 0% -> 12.0%

* modules/convert coverage: 27.1% -> 29.7%

3 years agoVendor Update (#14496)
6543 [Thu, 28 Jan 2021 16:56:38 +0000 (17:56 +0100)]
Vendor Update (#14496)

* update code.gitea.io/sdk/gitea v0.13.1 -> v0.13.2

* update github.com/go-swagger/go-swagger v0.25.0 -> v0.26.0

* update github.com/google/uuid v1.1.2 -> v1.2.0

* update github.com/klauspost/compress v1.11.3 -> v1.11.7

* update github.com/lib/pq 083382b7e6fc -> v1.9.0

* update github.com/markbates/goth v1.65.0 -> v1.66.1

* update github.com/mattn/go-sqlite3 v1.14.4 -> v1.14.6

* update github.com/mgechev/revive 246eac737dc7 -> v1.0.3

* update github.com/minio/minio-go/v7 v7.0.6 -> v7.0.7

* update github.com/niklasfasching/go-org v1.3.2 -> v1.4.0

* update github.com/olivere/elastic/v7 v7.0.21 -> v7.0.22

* update github.com/pquerna/otp v1.2.0 -> v1.3.0

* update github.com/xanzy/go-gitlab v0.39.0 -> v0.42.0

* update github.com/yuin/goldmark v1.2.1 -> v1.3.1

3 years ago[skip ci] Updated translations via Crowdin
GiteaBot [Thu, 28 Jan 2021 12:31:28 +0000 (12:31 +0000)]
[skip ci] Updated translations via Crowdin

3 years agoFix display since time round (#14226)
Lunny Xiao [Thu, 28 Jan 2021 12:29:22 +0000 (20:29 +0800)]
Fix display since time round (#14226)

* Fix display since time round

* Fix since time

* Fix tests

3 years agoFix JSON Header response (#14499)
6543 [Wed, 27 Jan 2021 21:46:22 +0000 (22:46 +0100)]
Fix JSON Header response (#14499)

3 years ago[skip ci] Updated translations via Crowdin
GiteaBot [Wed, 27 Jan 2021 17:47:55 +0000 (17:47 +0000)]
[skip ci] Updated translations via Crowdin

3 years agoFix access log (#14475)
Lunny Xiao [Wed, 27 Jan 2021 17:46:35 +0000 (01:46 +0800)]
Fix access log (#14475)

Fix #14121, #14478.

The `AccessLog` middleware has to be after `Contexter` or `APIContexter` so that we can get `LoginUserName` if possible.
And also there is a **BREAK** change that it removed internal API access log.

3 years agoUse gitea.svg for public/img/gitea-gitea.svg instead of logo.svg (#14479)
Kyle D [Wed, 27 Jan 2021 16:15:39 +0000 (11:15 -0500)]
Use gitea.svg for public/img/gitea-gitea.svg instead of logo.svg (#14479)

3 years agoFix captcha (#14488)
Lunny Xiao [Wed, 27 Jan 2021 14:56:54 +0000 (22:56 +0800)]
Fix captcha (#14488)

Co-authored-by: 6543 <6543@obermui.de>
Co-authored-by: Lauris BH <lauris@nix.lv>
3 years agoFix switch language (#14484)
Lunny Xiao [Wed, 27 Jan 2021 14:20:42 +0000 (22:20 +0800)]
Fix switch language (#14484)

Co-authored-by: 6543 <6543@obermui.de>
Co-authored-by: Lauris BH <lauris@nix.lv>
3 years agoFix: url.Values map was not initialized (#14485)
PhilAtWysdom [Wed, 27 Jan 2021 13:33:32 +0000 (13:33 +0000)]
Fix: url.Values map was not initialized (#14485)

Values map was not initialized, leading to error 500 on submission of initial configuration

Co-authored-by: 6543 <6543@obermui.de>
3 years ago[skip ci] Updated translations via Crowdin
GiteaBot [Wed, 27 Jan 2021 12:48:37 +0000 (12:48 +0000)]
[skip ci] Updated translations via Crowdin

3 years agoFix bug that username missed on issue list assignee filter (#14481)
Lunny Xiao [Wed, 27 Jan 2021 12:47:00 +0000 (20:47 +0800)]
Fix bug that username missed on issue list assignee filter (#14481)

Co-authored-by: 6543 <6543@obermui.de>
3 years ago[skip ci] Updated translations via Crowdin
GiteaBot [Wed, 27 Jan 2021 10:02:09 +0000 (10:02 +0000)]
[skip ci] Updated translations via Crowdin

3 years ago[Feature] add precise search type for Elastic Search (#12869)
Jui-Nan Lin [Wed, 27 Jan 2021 10:00:35 +0000 (18:00 +0800)]
[Feature] add precise search type for Elastic Search (#12869)

* feat: add type query parameters for specifying precise search

* feat: add select dropdown in search box

Co-authored-by: Lauris BH <lauris@nix.lv>
Co-authored-by: techknowlogick <techknowlogick@gitea.io>
3 years agoPrint usefull error if SQLite is used in settings but not supported (#14476)
6543 [Wed, 27 Jan 2021 03:57:18 +0000 (04:57 +0100)]
Print usefull error if SQLite is used in settings but not supported (#14476)

* move log output to points where they are relefant

* check explicit of sqlite3 in settings

3 years ago[skip ci] Updated translations via Crowdin
GiteaBot [Tue, 26 Jan 2021 22:48:54 +0000 (22:48 +0000)]
[skip ci] Updated translations via Crowdin

3 years agoFix bug because of duplicated join (#14454)
Lunny Xiao [Tue, 26 Jan 2021 22:47:42 +0000 (06:47 +0800)]
Fix bug because of duplicated join (#14454)

* Fix bug because of duplicated join

* Move join into setupsession

* Fix bug

* Fix bug

Co-authored-by: 6543 <6543@obermui.de>
Co-authored-by: Lauris BH <lauris@nix.lv>
3 years agoCron job to cleanup hook_task table (#13080)
Brad Albright [Tue, 26 Jan 2021 21:02:42 +0000 (15:02 -0600)]
Cron job to cleanup hook_task table (#13080)

Close **Prune hook_task Table (#10741)**

Added a cron job to delete webhook deliveries in the hook_task table. It can be turned on/off and the schedule controlled globally via app.ini. The data can be deleted by either the age of the delivery which is the default or by deleting the all but the most recent deliveries _per webhook_.

Note: I had previously submitted pr #11416  but I closed it when I realized that I had deleted per repository instead of per webhook. Also, I decided allowing the settings to be overridden via the ui was overkill. Also this version allows the deletion by age which is probably what most people would want.

3 years agoFix panic 500 page rendering (#14474)
Lunny Xiao [Tue, 26 Jan 2021 18:04:20 +0000 (02:04 +0800)]
Fix panic 500 page rendering (#14474)

3 years ago[skip ci] Updated translations via Crowdin
GiteaBot [Tue, 26 Jan 2021 15:38:19 +0000 (15:38 +0000)]
[skip ci] Updated translations via Crowdin

3 years agoMove macaron to chi (#14293)
Lunny Xiao [Tue, 26 Jan 2021 15:36:53 +0000 (23:36 +0800)]
Move macaron to chi (#14293)

Use [chi](https://github.com/go-chi/chi) instead of the forked [macaron](https://gitea.com/macaron/macaron). Since macaron and chi have conflicts with session share, this big PR becomes a have-to thing. According my previous idea, we can replace macaron step by step but I'm wrong. :( Below is a list of big changes on this PR.

- [x] Define `context.ResponseWriter` interface with an implementation `context.Response`.
- [x] Use chi instead of macaron, and also a customize `Route` to wrap chi so that the router usage is similar as before.
- [x] Create different routers for `web`, `api`, `internal` and `install` so that the codes will be more clear and no magic .
- [x] Use https://github.com/unrolled/render instead of macaron's internal render
- [x] Use https://github.com/NYTimes/gziphandler instead of https://gitea.com/macaron/gzip
- [x] Use https://gitea.com/go-chi/session which is a modified version of https://gitea.com/macaron/session and removed `nodb` support since it will not be maintained. **BREAK**
- [x] Use https://gitea.com/go-chi/captcha which is a modified version of https://gitea.com/macaron/captcha
- [x] Use https://gitea.com/go-chi/cache which is a modified version of https://gitea.com/macaron/cache
- [x] Use https://gitea.com/go-chi/binding which is a modified version of https://gitea.com/macaron/binding
- [x] Use https://github.com/go-chi/cors instead of https://gitea.com/macaron/cors
- [x] Dropped https://gitea.com/macaron/i18n and make a new one in `code.gitea.io/gitea/modules/translation`
- [x] Move validation form structs from `code.gitea.io/gitea/modules/auth` to `code.gitea.io/gitea/modules/forms` to avoid dependency cycle.
- [x] Removed macaron log service because it's not need any more. **BREAK**
- [x] All form structs have to be get by `web.GetForm(ctx)` in the route function but not as a function parameter on routes definition.
- [x] Move Git HTTP protocol implementation to use routers directly.
- [x] Fix the problem that chi routes don't support trailing slash but macaron did.
- [x] `/api/v1/swagger` now will be redirect to `/api/swagger` but not render directly so that `APIContext` will not create a html render.

Notices:
- Chi router don't support request with trailing slash
- Integration test `TestUserHeatmap` maybe mysql version related. It's failed on my macOS(mysql 5.7.29 installed via brew) but succeed on CI.

Co-authored-by: 6543 <6543@obermui.de>
3 years ago[skip ci] Updated translations via Crowdin
GiteaBot [Tue, 26 Jan 2021 01:22:19 +0000 (01:22 +0000)]
[skip ci] Updated translations via Crowdin

3 years agoFix incorrect key name so registerManualConfirm setting works as expected. (#14455)
Dofri Jónsson [Tue, 26 Jan 2021 01:20:59 +0000 (02:20 +0100)]
Fix incorrect key name so registerManualConfirm setting works as expected. (#14455)

3 years ago[skip ci] Updated translations via Crowdin
GiteaBot [Sun, 24 Jan 2021 23:38:47 +0000 (23:38 +0000)]
[skip ci] Updated translations via Crowdin

3 years agoUse caddy's certmagic library for extensible/robust ACME handling (#14177)
techknowlogick [Sun, 24 Jan 2021 23:37:35 +0000 (18:37 -0500)]
Use caddy's certmagic library for extensible/robust ACME handling (#14177)

* use certmagic for more extensible/robust ACME cert handling

* accept TOS based on config option

Signed-off-by: Andrew Thornton <art27@cantab.net>
Co-authored-by: zeripath <art27@cantab.net>
Co-authored-by: Lauris BH <lauris@nix.lv>
3 years agoRedirect on changed user and org name (#11649)
Andrew Bezold [Sun, 24 Jan 2021 15:23:05 +0000 (10:23 -0500)]
Redirect on changed user and org name (#11649)

* Add redirect for user

* Add redirect for orgs

* Add user redirect test

* Appease linter

* Add comment to DeleteUserRedirect function

* Fix locale changes

* Fix GetUserByParams

* Fix orgAssignment

* Remove debug logging

* Add redirect prompt

* Dont Export DeleteUserRedirect & only use it within a session

* Unexport newUserRedirect

* cleanup

* Fix & Dedub API code

* Format Template

* Add Migration & rm dublicat

* Refactor: unexport newRepoRedirect() & rm dedub del exec

* if this fails we'll need to re-rename the user directory

Co-authored-by: 6543 <6543@obermui.de>
Co-authored-by: zeripath <art27@cantab.net>
Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
3 years agochore: bump minio to RELEASE.2021-01-16T02-19-44Z (#14445)
wULLSnpAXbWZGYDYyhWTKKspEQoaYxXyhoisqHf [Sun, 24 Jan 2021 14:46:08 +0000 (15:46 +0100)]
chore: bump minio to RELEASE.2021-01-16T02-19-44Z (#14445)

-    image: minio/minio:RELEASE.2020-10-09T22-55-05Z
+    image: minio/minio:RELEASE.2021-01-16T02-19-44Z

3 years ago[skip ci] Updated translations via Crowdin
GiteaBot [Sun, 24 Jan 2021 12:23:25 +0000 (12:23 +0000)]
[skip ci] Updated translations via Crowdin

3 years agoCI: skip build steps for cron update works (#14443)
a1012112796 [Sun, 24 Jan 2021 12:21:33 +0000 (20:21 +0800)]
CI: skip build steps for cron update works (#14443)

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

3 years ago[skip ci] Updated translations via Crowdin
GiteaBot [Sat, 23 Jan 2021 19:34:53 +0000 (19:34 +0000)]
[skip ci] Updated translations via Crowdin