]> source.dussan.org Git - gitea.git/log
gitea.git
3 years agoReplies to outdated code comments should also be outdated (#13217) (#13433)
6543 [Thu, 5 Nov 2020 20:14:55 +0000 (21:14 +0100)]
Replies to outdated code comments should also be outdated (#13217) (#13433)

* When replying to an outdated comment it should not appear on the files page

This happened because the comment took the latest commitID as its base instead of the
reviewID that it was replying to.

There was also no way of creating an already outdated comment - and a
reply to a review on an outdated line should be outdated.

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

Signed-off-by: Andrew Thornton <art27@cantab.net>
Co-authored-by: techknowlogick <techknowlogick@gitea.io>
Co-authored-by: zeripath <art27@cantab.net>
Co-authored-by: techknowlogick <techknowlogick@gitea.io>
3 years agoAlternative fix for HTML diff entity split (#13425) (#13427)
mrsdizzie [Thu, 5 Nov 2020 16:54:03 +0000 (11:54 -0500)]
Alternative fix for HTML diff entity split (#13425) (#13427)

* Alternative fix for HTML diff entity split

This commit both reverts PR #13357 and uses the exiting implementation alredy used for spans to fix the same issue. That PR duplicates most of logic that is already present elsewhere and still was failing for some cases. This should be simpler as it uses the existing logic that already works for <span>s being split apart.

Added both test cases as well.

* Update gitdiff_test.go

* fmt

* entity can have uppercase letter, also add detailed comment per @zeripath

3 years agoAdd missing full names when DEFAULT_SHOW_FULL_NAME is enabled (#13424)
Wim [Wed, 4 Nov 2020 14:51:07 +0000 (15:51 +0100)]
Add missing full names when DEFAULT_SHOW_FULL_NAME is enabled (#13424)

3 years agoVendor: mvdan.cc/xurls v2.1.0 -> v2.2.0 (#13407)
6543 [Tue, 3 Nov 2020 01:56:51 +0000 (02:56 +0100)]
Vendor: mvdan.cc/xurls v2.1.0 -> v2.2.0 (#13407)

3 years agoFix 'add code comment' button being invisible all the time (#13389) (#13402)
Cirno the Strongest [Mon, 2 Nov 2020 23:09:29 +0000 (00:09 +0100)]
Fix 'add code comment' button being invisible all the time (#13389) (#13402)

* Fix 'add code comment' button being invisible all the time

* Fix off-center icon

* Remove old JS hover hack

* Show on full-line hover

Co-authored-by: techknowlogick <techknowlogick@gitea.io>
(cherry picked from commit 7f7e7f3ca432fa80f9f5a8a71c9c10a89ac43c4f)

3 years agoFix reactions on code comments (#13390) (#13401)
Cirno the Strongest [Mon, 2 Nov 2020 14:05:41 +0000 (15:05 +0100)]
Fix reactions on code comments (#13390) (#13401)

Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
(cherry picked from commit 06268dcf53657ffe012abe878e1127ab4f954264)

3 years agoStorage configuration support `[storage]` (#13314) (#13379)
Lunny Xiao [Sun, 1 Nov 2020 15:12:50 +0000 (23:12 +0800)]
Storage configuration support `[storage]` (#13314) (#13379)

* Fix minio bug

* Add tests for storage configuration

* Change the Seek flag to keep compitable minio?

* Fix test when first-byte-pos of all ranges is greater than the resource length

Co-authored-by: techknowlogick <techknowlogick@gitea.io>
Co-authored-by: techknowlogick <techknowlogick@gitea.io>
3 years agoFix typo (#13380) (#13382)
Lunny Xiao [Sun, 1 Nov 2020 07:14:39 +0000 (15:14 +0800)]
Fix typo (#13380) (#13382)

3 years agoWhen creating line diffs do not split within an html entity (#13357) (#13375)
zeripath [Sat, 31 Oct 2020 19:30:23 +0000 (19:30 +0000)]
When creating line diffs do not split within an html entity (#13357) (#13375)

Backport #13357

* When creating line diffs do not split within an html entity

Fix #13342

Signed-off-by: Andrew Thornton <art27@cantab.net>
* Add test case

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

Signed-off-by: Andrew Thornton <art27@cantab.net>
Co-authored-by: techknowlogick <techknowlogick@gitea.io>
Co-authored-by: techknowlogick <techknowlogick@gitea.io>
3 years agoComment Header fixes (#13356) (#13374)
silverwind [Sat, 31 Oct 2020 17:25:10 +0000 (18:25 +0100)]
Comment Header fixes (#13356) (#13374)

Apply more flexboxes on comment header and remove float hacks. Needs
1.13 backport.

Fixes: https://github.com/go-gitea/gitea/issues/13316
Co-authored-by: Lauris BH <lauris@nix.lv>
Co-authored-by: Lauris BH <lauris@nix.lv>
3 years agoFix scrolling to resolved comment anchors (#13343) (#13371)
zeripath [Sat, 31 Oct 2020 11:51:51 +0000 (11:51 +0000)]
Fix scrolling to resolved comment anchors (#13343) (#13371)

* Fix scrolling to resolved comment anchors

As described on discord, when the window.location.hash refers to a
resolved comment then the scroll to functionality does not work.

This PR fixes this.

Signed-off-by: Andrew Thornton <art27@cantab.net>
* Apply suggestions from code review

Co-authored-by: silverwind <me@silverwind.io>
Co-authored-by: techknowlogick <techknowlogick@gitea.io>
3 years agoFix links to repositories in /user/setting/repos (#13360) (#13362)
zeripath [Fri, 30 Oct 2020 17:51:52 +0000 (17:51 +0000)]
Fix links to repositories in /user/setting/repos (#13360) (#13362)

* Fix links to repositories in /user/setting/repos

somehow the links gained a spurious $ in the links.

Signed-off-by: Andrew Thornton <art27@cantab.net>
* And fix #13359

Signed-off-by: Andrew Thornton <art27@cantab.net>
3 years agoMigrations should not fail for comment reactions (#13352) (#13355)
zeripath [Fri, 30 Oct 2020 00:05:15 +0000 (00:05 +0000)]
Migrations should not fail for comment reactions (#13352) (#13355)

An extension to #13444 - where we now ensure that comment reaction failures do not cause migrations failure

Signed-off-by: Andrew Thornton <art27@cantab.net>
3 years agoAnd there is another one ... (#13350)
zeripath [Thu, 29 Oct 2020 12:48:58 +0000 (12:48 +0000)]
And there is another one ... (#13350)

Signed-off-by: Andrew Thornton <art27@cantab.net>
3 years agoRemove obsolete change of email on profile page (#13341) (#13347)
techknowlogick [Thu, 29 Oct 2020 06:44:45 +0000 (02:44 -0400)]
Remove obsolete change of email on profile page (#13341) (#13347)

* Remove obsolete change of email on profile page

The change email on the account profile page is out-of-date
and unnecessary.

Changing email should be done using the account page.

Fix #13336

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 agoMigration failure during reaction migration from gitea (#13344) (#13345)
techknowlogick [Thu, 29 Oct 2020 03:57:15 +0000 (23:57 -0400)]
Migration failure during reaction migration from gitea (#13344) (#13345)

* Migrating reactions is just not that important

A failure during migrating reactions should not cause failure of
migration.

Signed-off-by: Andrew Thornton <art27@cantab.net>
* When checking issue reactions check the correct permission

Signed-off-by: Andrew Thornton <art27@cantab.net>
Co-authored-by: techknowlogick <techknowlogick@gitea.io>
Co-authored-by: zeripath <art27@cantab.net>
3 years agoAdd deprecation notice for webhook payload's secret field (#13329)
JustAnotherArchivist [Thu, 29 Oct 2020 03:14:26 +0000 (03:14 +0000)]
Add deprecation notice for webhook payload's secret field (#13329)

3 years agoAdd migrated pulls to pull request task queue (#13331) (#13334)
zeripath [Tue, 27 Oct 2020 23:44:21 +0000 (23:44 +0000)]
Add migrated pulls to pull request task queue (#13331) (#13334)

* Add migrated pulls to pull request task queue

Fix #13321

Signed-off-by: Andrew Thornton <art27@cantab.net>
* Improve error reports

Signed-off-by: Andrew Thornton <art27@cantab.net>
Co-authored-by: techknowlogick <techknowlogick@gitea.io>
Co-authored-by: techknowlogick <techknowlogick@gitea.io>
3 years agoDeny wrong pull (#13308) (#13326)
M4RKUS-11111 [Tue, 27 Oct 2020 20:26:07 +0000 (21:26 +0100)]
Deny wrong pull (#13308) (#13326)

* Deny wrong pull (#13308)

* Deny wrong pull

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

Co-authored-by: zeripath <art27@cantab.net>
Co-authored-by: Markus <git+markus@obermui.de>
Co-authored-by: zeripath <art27@cantab.net>
* CI.restart()

Co-authored-by: Markus <git+markus@obermui.de>
Co-authored-by: zeripath <art27@cantab.net>
Co-authored-by: 6543 <6543@obermui.de>
3 years agoAvatar autogeneration fixed (#13282)
Paweł Bogusławski [Mon, 26 Oct 2020 13:56:14 +0000 (14:56 +0100)]
Avatar autogeneration fixed (#13282)

This mod fixes problem with initial avatar autogeneration and
avatar autogneration after deleting previous avatar.

Related: https://github.com/go-gitea/gitea/issues/13159
Fixes: 80a6b0f5bce15a641fc75f5f1ef6e42ef54424bc
Author-Change-Id: IB#1105243

3 years agoEnsure topics added using the API are added to the repository (#13285) (#13302)
zeripath [Mon, 26 Oct 2020 12:14:40 +0000 (12:14 +0000)]
Ensure topics added using the API are added to the repository (#13285) (#13302)

Partial Backport #13285

Fix #12426

Signed-off-by: Andrew Thornton <art27@cantab.net>
Co-authored-by: Lauris BH <lauris@nix.lv>
3 years agoAttempt to handle unready PR in tests (#13305) (#13310)
zeripath [Mon, 26 Oct 2020 11:13:39 +0000 (11:13 +0000)]
Attempt to handle unready PR in tests (#13305) (#13310)

Backport #13305

Signed-off-by: Andrew Thornton <art27@cantab.net>
Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
Co-authored-by: Lauris BH <lauris@nix.lv>
3 years ago Fix Storage mapping (#13297) (#13307)
zeripath [Mon, 26 Oct 2020 01:40:46 +0000 (01:40 +0000)]
 Fix Storage mapping (#13297) (#13307)

* Fix Storage mapping (#13297)

Backport #13297

This PR fixes several bugs in setting storage

* The default STORAGE_TYPE should be the provided type.
* The Storage config should be passed in to NewStorage as a pointer - otherwise the Mappable interface function MapTo will not be found
* There was a bug in the MapTo function.

Fix #13286

Signed-off-by: Andrew Thornton <art27@cantab.net>
* add missing changes from backport #13164

Signed-off-by: Andrew Thornton <art27@cantab.net>
Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
3 years agoWhen the git ref is unable to be found return broken pr (#13218) (#13303)
zeripath [Sun, 25 Oct 2020 23:10:09 +0000 (23:10 +0000)]
When the git ref is unable to be found return broken pr (#13218) (#13303)

Backport #13218

Fix #13216

Signed-off-by: Andrew Thornton <art27@cantab.net>
3 years agoFix bug isEnd detection on getIssues/getPullRequests (#13299) (#13301)
Lunny Xiao [Sun, 25 Oct 2020 08:13:26 +0000 (16:13 +0800)]
Fix bug isEnd detection on getIssues/getPullRequests (#13299) (#13301)

3 years agoStore task errors following migrations and display them (#13246) (#13287)
techknowlogick [Sat, 24 Oct 2020 05:02:36 +0000 (01:02 -0400)]
Store task errors following migrations and display them (#13246) (#13287)

* Store task errors following migrations and display them

When migrate tasks fail store the error in the task table
and ensure that they show on the status page.

Fix #13242

Signed-off-by: Andrew Thornton <art27@cantab.net>
* Update web_src/js/index.js

* Hide the failed first

Signed-off-by: Andrew Thornton <art27@cantab.net>
Co-authored-by: techknowlogick <techknowlogick@gitea.io>
Co-authored-by: zeripath <art27@cantab.net>
3 years agoRemove PAM from auth dropdown when unavailable (#13276) (#13281)
John Olheiser [Fri, 23 Oct 2020 16:00:20 +0000 (11:00 -0500)]
Remove PAM from auth dropdown when unavailable (#13276) (#13281)

Signed-off-by: jolheiser <john.olheiser@gmail.com>
3 years agoMigrations: Gitea should not fail just because of no apiConfig return (#13229) (...
6543 [Fri, 23 Oct 2020 11:11:40 +0000 (13:11 +0200)]
Migrations: Gitea should not fail just because of no apiConfig return (#13229) (#13273)

* close #13227

* log it

:+1:

Co-authored-by: zeripath <art27@cantab.net>
Co-authored-by: zeripath <art27@cantab.net>
Co-authored-by: techknowlogick <techknowlogick@gitea.io>
Co-authored-by: zeripath <art27@cantab.net>
Co-authored-by: techknowlogick <techknowlogick@gitea.io>
3 years agoMore arc-green fixes (#13247) (#13253)
silverwind [Thu, 22 Oct 2020 22:55:44 +0000 (00:55 +0200)]
More arc-green fixes (#13247) (#13253)

- Fix various white borders
- Tweak basic button style to have more contrast
- Add more contrast to hover styles
- Invert Matrix webhook icon

May backport to 1.13.

Co-authored-by: zeripath <art27@cantab.net>
Co-authored-by: zeripath <art27@cantab.net>
3 years agoFix initial commit page & binary munching problem (#13249) (#13258)
zeripath [Thu, 22 Oct 2020 12:59:01 +0000 (13:59 +0100)]
Fix initial commit page & binary munching problem (#13249) (#13258)

Backport #13249

* Fix initial commit page

Unfortunately as a result of properly fixing ParsePatch the hack that
used git show <initial_commit_id> to get the diff for this failed.

This PR fixes this using the "super-secret" empty tree ref to make the
diff against.

Signed-off-by: Andrew Thornton <art27@cantab.net>
* Also fix #13248

Signed-off-by: Andrew Thornton <art27@cantab.net>
* Update services/gitdiff/gitdiff.go

Co-authored-by: 6543 <6543@obermui.de>
Co-authored-by: 6543 <6543@obermui.de>
3 years agoAdd better error checking for inline html diff code (#13251)
mrsdizzie [Thu, 22 Oct 2020 02:37:50 +0000 (22:37 -0400)]
Add better error checking for inline html diff code (#13251)

* Fix error in diff html rendering (#13191)

* Fix error in diff html rendering

Was missing an optional whitespace check in regex. Also noticed a rare case where diff.Type == Equal would be empty and thus get a newline attached. Fixed that too.

Fixes #13177

* Update services/gitdiff/gitdiff.go

Co-authored-by: zeripath <art27@cantab.net>
* Update gitdiff_test.go

* fmt

Co-authored-by: zeripath <art27@cantab.net>
* Add better error checking for inline html diff code (#13239)

* Add better error checking for inline html diff code

A better fix for #13191 which cleans up this code a bit and adds basic checking which should avoid writing broken HTML in future situations.

* Update gitdiff_test.go

* better regex

Co-authored-by: zeripath <art27@cantab.net>
3 years agoReturn the full rejection message and errors in flash errors (#13221) (#13237)
zeripath [Wed, 21 Oct 2020 18:54:19 +0000 (19:54 +0100)]
Return the full rejection message and errors in flash errors (#13221) (#13237)

* Return the full rejection message and errors in flash errors (#13221)

Signed-off-by: Andrew Thornton <art27@cantab.net>
* Update routers/repo/pull.go

Co-authored-by: John Olheiser <john.olheiser@gmail.com>
Co-authored-by: John Olheiser <john.olheiser@gmail.com>
3 years agoUpdate heatmap fixtures to restore tests (#13224) (#13225)
6543 [Tue, 20 Oct 2020 22:39:37 +0000 (00:39 +0200)]
Update heatmap fixtures to restore tests (#13224) (#13225)

`the hotfix day`

3 years agoVarious arc-green fixes (#13214) (#13215)
techknowlogick [Tue, 20 Oct 2020 06:10:05 +0000 (02:10 -0400)]
Various arc-green fixes (#13214) (#13215)

- Style search dropdown
- Fix radio buttons and tweak checkboxes
- Add styling for error form elements
- Make borders brighter and focus more apparent
- Adjust comment box border color to match

Fixes: https://github.com/go-gitea/gitea/pull/12491
Co-authored-by: silverwind <me@silverwind.io>
3 years agoFix size and clickable area on file table back link (#13205) (#13207)
techknowlogick [Mon, 19 Oct 2020 06:56:17 +0000 (02:56 -0400)]
Fix size and clickable area on file table back link (#13205) (#13207)

Fixes: https://github.com/go-gitea/gitea/issues/13038
Should backport to 1.13.

Co-authored-by: silverwind <me@silverwind.io>
3 years agoUpdate CHANGELOG.md (#13200) (#13202)
a1012112796 [Sun, 18 Oct 2020 17:13:57 +0000 (01:13 +0800)]
Update CHANGELOG.md (#13200) (#13202)

Co-authored-by: zeripath <art27@cantab.net>
Co-authored-by: zeripath <art27@cantab.net>
3 years agoWhen handling errors in storageHandler check underlying error (#13178) (#13193)
techknowlogick [Sun, 18 Oct 2020 14:52:03 +0000 (10:52 -0400)]
When handling errors in storageHandler check underlying error (#13178) (#13193)

Unfortunately there was a mistake in #13164 which fails to handle
os.PathError wrapping an os.ErrNotExist

Signed-off-by: Andrew Thornton <art27@cantab.net>
Co-authored-by: techknowlogick <techknowlogick@gitea.io>
Co-authored-by: zeripath <art27@cantab.net>
4 years agofix a small nit (#13187)
赵智超 [Sat, 17 Oct 2020 15:38:34 +0000 (23:38 +0800)]
fix a small nit (#13187)

Signed-off-by: a1012112796 <1012112796@qq.com>
4 years agoFix diff skipping lines (#13155)
zeripath [Sat, 17 Oct 2020 01:39:35 +0000 (02:39 +0100)]
Fix diff skipping lines (#13155)

* Fix diff skipping lines

Backport #13154

ParsePatch previously just skipped all lines that start with "+++ " or "--- "
and makes no attempt to see these lines in context.

This PR rewrites ParsePatch to pay attention to context and position
within a patch, ensuring that --- and +++ are only skipped if
appropriate.

This PR also fixes several issues with incomplete files.

Fix https://codeberg.org/Codeberg/Community/issues/308
Fix #13153

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

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

* simplify error handling

Signed-off-by: Andrew Thornton <art27@cantab.net>
* never return io.EOF

Signed-off-by: Andrew Thornton <art27@cantab.net>
Co-authored-by: techknowlogick <techknowlogick@gitea.io>
4 years agoUpdate go-version v1.2.3 -> v1.2.4 (#13169) (#13172)
6543 [Fri, 16 Oct 2020 16:23:52 +0000 (18:23 +0200)]
Update go-version v1.2.3 -> v1.2.4 (#13169) (#13172)

Co-authored-by: zeripath <art27@cantab.net>
Co-authored-by: zeripath <art27@cantab.net>
4 years agoShow outdated comments in pull request (#13148) (#13162)
6543 [Fri, 16 Oct 2020 01:46:56 +0000 (03:46 +0200)]
Show outdated comments in pull request (#13148) (#13162)

Co-authored-by: zeripath <art27@cantab.net>
Co-authored-by: Iván Valdés <iv@a.ki>
Co-authored-by: zeripath <art27@cantab.net>
4 years agoFix Italian language file parsing error (#13156)
Lauris BH [Thu, 15 Oct 2020 11:57:17 +0000 (14:57 +0300)]
Fix Italian language file parsing error (#13156)

4 years agoalign mysql service settings in drone
Matti R [Wed, 14 Oct 2020 20:57:12 +0000 (16:57 -0400)]
align mysql service settings in drone

4 years agoAdd back only missing translation for Latvian language (#13144) v1.13.0-rc1
Lauris BH [Wed, 14 Oct 2020 20:54:56 +0000 (23:54 +0300)]
Add back only missing translation for Latvian language (#13144)

* Add back only missing translation for Latvian language

* Backport German translations

4 years agorun mysql container with same conditions as other services
Matti R [Wed, 14 Oct 2020 20:45:38 +0000 (16:45 -0400)]
run mysql container with same conditions as other services

4 years agoChangelog v1.13.0-RC1 (#13142)
6543 [Wed, 14 Oct 2020 18:48:03 +0000 (20:48 +0200)]
Changelog v1.13.0-RC1 (#13142)

* Changelog v1.13.0

* reorder topics

* impruve

* Apply suggestions from code review

* Apply suggestions from code review

* Apply suggestions from code review

* Apply suggestions from code review

* Goldmark ...

* Add 12516

* Apply suggestions from code review

* Update CHANGELOG.md

* Apply suggestions from code review

Co-authored-by: techknowlogick <matti@mdranta.net>
* Apply suggestions from code review

Co-authored-by: zeripath <art27@cantab.net>
* Update CHANGELOG.md

* Apply suggestions from code review

Co-authored-by: 6543 <6543@obermui.de>
* Securety is more importand than Breaking ...

Co-authored-by: techknowlogick <matti@mdranta.net>
Co-authored-by: zeripath <art27@cantab.net>
4 years ago[skip ci] Updated translations via Crowdin
GiteaBot [Wed, 14 Oct 2020 17:02:15 +0000 (17:02 +0000)]
[skip ci] Updated translations via Crowdin

4 years agoUpdate sshd_config (#13143)
Anders Eurenius Runvald [Wed, 14 Oct 2020 17:01:11 +0000 (19:01 +0200)]
Update sshd_config (#13143)

Afaik, adding these lines does nothing unless the file(s) are present. Having them in let's admins supply certs instead of relying on TOFU.

Co-authored-by: zeripath <art27@cantab.net>
4 years ago[skip ci] Updated translations via Crowdin
GiteaBot [Wed, 14 Oct 2020 13:09:05 +0000 (13:09 +0000)]
[skip ci] Updated translations via Crowdin

4 years agoAvatars and Repo avatars support storing in minio (#12516)
Lunny Xiao [Wed, 14 Oct 2020 13:07:51 +0000 (21:07 +0800)]
Avatars and Repo avatars support storing in minio (#12516)

* Avatar support minio

* Support repo avatar minio storage

* Add missing migration

* Fix bug

* Fix test

* Add test for minio store type on avatars and repo avatars; Add documents

* Fix bug

* Fix bug

* Add back missed avatar link method

* refactor codes

* Simplify the codes

* Code improvements

* Fix lint

* Fix test mysql

* Fix test mysql

* Fix test mysql

* Fix settings

* Fix test

* fix test

* Fix bug

4 years ago[skip ci] Updated translations via Crowdin
GiteaBot [Wed, 14 Oct 2020 12:12:40 +0000 (12:12 +0000)]
[skip ci] Updated translations via Crowdin

4 years agoShow original author's reviews on pull summary box (#13127)
赵智超 [Wed, 14 Oct 2020 12:11:11 +0000 (20:11 +0800)]
Show original author's reviews on pull summary box (#13127)

follow #12039, show original author's reviews by other way.
fix #11705.

Signed-off-by: a1012112796 <1012112796@qq.com>
4 years ago[skip ci] Updated translations via Crowdin
GiteaBot [Wed, 14 Oct 2020 11:18:41 +0000 (11:18 +0000)]
[skip ci] Updated translations via Crowdin

4 years agoFix punctuation in trust model description (#13140)
Lauris BH [Wed, 14 Oct 2020 11:17:40 +0000 (14:17 +0300)]
Fix punctuation in trust model description (#13140)

4 years agoFinally fix diff names (#13136)
zeripath [Wed, 14 Oct 2020 04:49:33 +0000 (05:49 +0100)]
Finally fix diff names (#13136)

* Finally fix diff names

#12771 attempted to fix diff by avoiding the git diff line as
it is possible to have an ambiguous line here.

#12254 attempted to fix diff by assuming that names would quoted
if they needed to be and if one was quoted then both would be.

Both of these were wrong.

I have now discovered `--src-prefix` and `--dst-prefix` which
means that we can set this in such a way to force the git diff
to always be unambiguous.

Therefore this PR rollsback most of the changes in #12771 and
uses these options to fix this.

Signed-off-by: Andrew Thornton <art27@cantab.net>
* Update services/gitdiff/gitdiff.go

* Update services/gitdiff/gitdiff.go

* Update modules/repofiles/temp_repo.go

* fix test

Signed-off-by: Andrew Thornton <art27@cantab.net>
Co-authored-by: Lauris BH <lauris@nix.lv>
4 years ago[skip ci] Updated translations via Crowdin
GiteaBot [Wed, 14 Oct 2020 04:07:05 +0000 (04:07 +0000)]
[skip ci] Updated translations via Crowdin

4 years agoGitea 2 Gitea migration (#12657)
6543 [Wed, 14 Oct 2020 04:06:00 +0000 (06:06 +0200)]
Gitea 2 Gitea migration (#12657)

* first draft

* update gitea sdk to 9e280adb4da

* adapt feat of updated sdk

* releases now works

* break the Reactions loop

* use convertGiteaLabel

* fix endless loop because paggination is not supported there !!!

* rename gitea local uploader files

* pagination can bite you in the ass

* Version Checks

* lint

* docs

* rename gitea sdk import to miss future conficts

* go-swagger: dont scan the sdk structs

* make sure gitea can shutdown gracefully

* make GetPullRequests and GetIssues similar

* rm useles

* Add Test: started ...

* ... add tests ...

* Add tests and Fixing things

* Workaround missing SHA

* Adapt: Ensure that all migration requests are cancellable
(714ab71ddc4260937b1480519d453d2dc4e77dd6)

* LINT: fix misspells in test set

* adapt ListMergeRequestAwardEmoji

* update sdk

* Return error when creating giteadownloader failed

* update sdk

* adapt new sdk

* adopt new features

* check version before err

* adapt: 'migrate service type switch page'

* optimize

* Fix DefaultBranch

* impruve

* handle subPath

* fix test

* Fix ReviewCommentPosition

* test GetReviews

* add DefaultBranch int test set

* rm unused

* Update SDK to v0.13.0

* addopt sdk changes

* found better link

* format template

* Update Docs

* Update Gitea SDK (v0.13.1)

4 years ago[Enhancement] Allow admin to merge pr with protected file changes (#12078)
赵智超 [Tue, 13 Oct 2020 18:50:57 +0000 (02:50 +0800)]
[Enhancement] Allow admin to merge pr with protected file changes (#12078)

* [Enhancement] Allow admin to merge pr with protected file changes

As tilte, show protected message in diff page and merge box.

Signed-off-by: a1012112796 <1012112796@qq.com>
* remove unused ver

* Update options/locale/locale_en-US.ini

Co-authored-by: Cirno the Strongest <1447794+CirnoT@users.noreply.github.com>
* Add TrN

* Apply suggestions from code review

* fix lint

* Update options/locale/locale_en-US.ini

Co-authored-by: zeripath <art27@cantab.net>
* Apply suggestions from code review

* move pr proteced files check to TestPatch
* Call TestPatch when protected branches settings changed

* Apply review suggestion @CirnoT

* move to service @lunny

* slightly restructure routers/private/hook.go

Adds a lot of comments and simplifies the logic

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

Signed-off-by: Andrew Thornton <art27@cantab.net>
* skip duplicate protected files check

* fix check logic

* slight refactor of TestPatch

Signed-off-by: Andrew Thornton <art27@cantab.net>
* When checking for protected files changes in TestPatch use the temporary repository

Signed-off-by: Andrew Thornton <art27@cantab.net>
* fix introduced issue with hook

Signed-off-by: Andrew Thornton <art27@cantab.net>
* Remove the check on PR index being greater than 0 as it unnecessary

Signed-off-by: Andrew Thornton <art27@cantab.net>
Co-authored-by: techknowlogick <matti@mdranta.net>
Co-authored-by: Cirno the Strongest <1447794+CirnoT@users.noreply.github.com>
Co-authored-by: zeripath <art27@cantab.net>
Co-authored-by: techknowlogick <techknowlogick@gitea.io>
4 years ago[skip ci] Updated translations via Crowdin
GiteaBot [Tue, 13 Oct 2020 16:25:13 +0000 (16:25 +0000)]
[skip ci] Updated translations via Crowdin

4 years agoMove update-server-info to hooks (#12826)
zeripath [Tue, 13 Oct 2020 16:24:06 +0000 (17:24 +0100)]
Move update-server-info to hooks (#12826)

Signed-off-by: Andrew Thornton <art27@cantab.net>
Co-authored-by: techknowlogick <techknowlogick@gitea.io>
4 years agoAdd API Section to Changelog (#13125)
6543 [Tue, 13 Oct 2020 05:39:17 +0000 (07:39 +0200)]
Add API Section to Changelog (#13125)

Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
Co-authored-by: techknowlogick <techknowlogick@gitea.io>
4 years agoProvide self-registering storage system (#12978)
zeripath [Tue, 13 Oct 2020 03:58:34 +0000 (04:58 +0100)]
Provide self-registering storage system (#12978)

* Provide self-registering storage system

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

Signed-off-by: Andrew Thornton <art27@cantab.net>
* Remove old strings from setting

Signed-off-by: Andrew Thornton <art27@cantab.net>
* oops attachments not attachment

Signed-off-by: Andrew Thornton <art27@cantab.net>
Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
4 years ago[API] If User is Admin, show 500 error message on PROD mode too (#13115)
6543 [Tue, 13 Oct 2020 00:41:49 +0000 (02:41 +0200)]
[API] If User is Admin, show 500 error message on PROD mode too (#13115)

* API: show admin 500 error message on PROD mode too

* a nit

* dont miss InternalServerError

Co-authored-by: techknowlogick <techknowlogick@gitea.io>
4 years agoSave TimeStamps for Star, Label, Follow, Watch and Collaboration to Database (#13124)
6543 [Tue, 13 Oct 2020 00:01:57 +0000 (02:01 +0200)]
Save TimeStamps for Star, Label, Follow, Watch and Collaboration to Database (#13124)

* Add timestamps to Star, Label, LanguageStat, Follow, Watch and Collaboration

* Star do not need updated

* LanguageStat do not need update (they wont change)

* fix unit-test

4 years agoReturn 404 not 500 from API if team does not exist (#13118)
zeripath [Mon, 12 Oct 2020 21:09:21 +0000 (22:09 +0100)]
Return 404 not 500 from API if team does not exist (#13118)

If team does not exist expect ErrTeamNotExist not ErrUserNotEXist

Fix #11336

Signed-off-by: Andrew Thornton <art27@cantab.net>
Co-authored-by: Lauris BH <lauris@nix.lv>
4 years agoAdd team support for review request (#12039)
赵智超 [Mon, 12 Oct 2020 19:55:13 +0000 (03:55 +0800)]
Add team support for review request (#12039)

Add team support for review request

Block #11355

Signed-off-by: a1012112796 <1012112796@qq.com>
Signed-off-by: Andrew Thornton <art27@cantab.net>
Co-authored-by: Lauris BH <lauris@nix.lv>
Co-authored-by: Andrew Thornton <art27@cantab.net>
4 years ago[skip ci] Updated translations via Crowdin
GiteaBot [Mon, 12 Oct 2020 18:45:03 +0000 (18:45 +0000)]
[skip ci] Updated translations via Crowdin

4 years agoFix args in tasks.json (#13116)
Elena Neuschild [Mon, 12 Oct 2020 18:44:01 +0000 (20:44 +0200)]
Fix args in tasks.json (#13116)

4 years agoProhibit automatic downgrades (#13108)
6543 [Mon, 12 Oct 2020 14:35:56 +0000 (16:35 +0200)]
Prohibit automatic downgrades (#13108)

Prohibit automatic downgrades by checking the version of the db and warning if the version number should be lower.

Close #13107

Co-authored-by: Cirno the Strongest <1447794+CirnoT@users.noreply.github.com>
4 years agoImprove error feedback for duplicate deploy keys (#13112)
Chris Shyi [Mon, 12 Oct 2020 13:44:56 +0000 (21:44 +0800)]
Improve error feedback for duplicate deploy keys (#13112)

Instead of a generic HTTP 500 error page, a flash message is rendered with the deploy key page template to inform the user that a key with the intended title already exists.

Fixes #13110

4 years agochore: update minio image version (#13109)
wULLSnpAXbWZGYDYyhWTKKspEQoaYxXyhoisqHf [Mon, 12 Oct 2020 08:45:20 +0000 (10:45 +0200)]
chore: update minio image version (#13109)

* 2020-05-16 --> 2020-10-09

4 years ago4 line diff (#13103)
6543 [Mon, 12 Oct 2020 01:15:15 +0000 (03:15 +0200)]
4 line diff (#13103)

4 years agoUpdate golangci-lint to version 1.31.0 (#13102)
kolaente [Sun, 11 Oct 2020 20:27:20 +0000 (22:27 +0200)]
Update golangci-lint to version 1.31.0 (#13102)

This PR updates golangci-lint to the latest version 1.31.0.

The upgrade introduced a new check for which I've fixed or disabled most cases.

Signed-off-by: kolaente <k@knt.li>
4 years ago[skip ci] Updated translations via Crowdin
GiteaBot [Sun, 11 Oct 2020 18:52:13 +0000 (18:52 +0000)]
[skip ci] Updated translations via Crowdin

4 years agoLog the underlying panic in runMigrateTask (#13096)
zeripath [Sun, 11 Oct 2020 18:51:13 +0000 (19:51 +0100)]
Log the underlying panic in runMigrateTask (#13096)

If there is a panic during runMigrateTask we should capture and log the underlying
panic error.

This PR ensures that the panic is logged and captured as part of the task message.

Fix #13095

Signed-off-by: Andrew Thornton <art27@cantab.net>
4 years agoAdd ssh certificate support (#12281)
Wim [Sun, 11 Oct 2020 00:38:09 +0000 (02:38 +0200)]
Add ssh certificate support (#12281)

* Add ssh certificate support

* Add ssh certificate support to builtin ssh

* Write trusted-user-ca-keys.pem based on configuration

* Update app.example.ini

* Update templates/user/settings/keys_principal.tmpl

Co-authored-by: silverwind <me@silverwind.io>
* Remove unused locale string

* Update options/locale/locale_en-US.ini

Co-authored-by: silverwind <me@silverwind.io>
* Update options/locale/locale_en-US.ini

Co-authored-by: silverwind <me@silverwind.io>
* Update models/ssh_key.go

Co-authored-by: silverwind <me@silverwind.io>
* Add missing creation of SSH.Rootpath

* Update cheatsheet, example and locale strings

* Update models/ssh_key.go

Co-authored-by: zeripath <art27@cantab.net>
* Update models/ssh_key.go

Co-authored-by: zeripath <art27@cantab.net>
* Update models/ssh_key.go

Co-authored-by: zeripath <art27@cantab.net>
* Update models/ssh_key.go

Co-authored-by: zeripath <art27@cantab.net>
* Update models/ssh_key.go

* Optimizations based on feedback

* Validate CA keys for external sshd

* Add filename option and change default filename

Add a SSH_TRUSTED_USER_CA_KEYS_FILENAME option which default is
RUN_USER/.ssh/gitea-trusted-user-ca-keys.pem

Do not write a file when SSH_TRUSTED_USER_CA_KEYS is empty.

Add some more documentation.

* Remove unneeded principalkey functions

* Add blank line

* Apply suggestions from code review

Co-authored-by: zeripath <art27@cantab.net>
* Add SSH_AUTHORIZED_PRINCIPALS_ALLOW option

This adds a SSH_AUTHORIZED_PRINCIPALS_ALLOW which is default
email,username this means that users only can add the principals
that match their email or username.

To allow anything the admin need to set the option anything.

This allows for a safe default in gitea which protects against malicious
users using other user's prinicipals. (before that user could set it).

This commit also has some small other fixes from the last code review.

* Rewrite principal keys file on user deletion

* Use correct rewrite method

* Set correct AuthorizedPrincipalsBackup default setting

* Rewrite principalsfile when adding principals

* Add update authorized_principals option to admin dashboard

* Handle non-primary emails

Signed-off-by: Andrew Thornton <art27@cantab.net>
* Add the command actually to the dashboard template

* Update models/ssh_key.go

Co-authored-by: silverwind <me@silverwind.io>
* By default do not show principal options unless there are CA keys set or they are explicitly set

Signed-off-by: Andrew Thornton <art27@cantab.net>
* allow settings when enabled

* Fix typos in TrustedUserCAKeys path

* Allow every CASignatureAlgorithms algorithm

As this depends on the content of TrustedUserCAKeys we should allow all
signature algorithms as admins can choose the specific algorithm on their
signing CA

* Update models/ssh_key.go

Co-authored-by: Lauris BH <lauris@nix.lv>
* Fix linting issue

Co-authored-by: silverwind <me@silverwind.io>
Co-authored-by: zeripath <art27@cantab.net>
Co-authored-by: Lauris BH <lauris@nix.lv>
Co-authored-by: techknowlogick <matti@mdranta.net>
Co-authored-by: techknowlogick <techknowlogick@gitea.io>
4 years agoFix attachments list in edit comment (#13036)
zeripath [Sat, 10 Oct 2020 23:49:59 +0000 (00:49 +0100)]
Fix attachments list in edit comment (#13036)

#11141 broke the appearance of dropzone attachments when editting
comments causing poorly updating lists.

This PR fixes this.

Fix #12583

Signed-off-by: Andrew Thornton art27@cantab.net
4 years agoFix deadlock when deleting team user (#13092)
zeripath [Sat, 10 Oct 2020 19:48:58 +0000 (20:48 +0100)]
Fix deadlock when deleting team user (#13092)

`models.getUserRepoPermission(...)` calls `HasOrgVisible` which
uses `models.x` potentially outside of the transaction `e` provided
as an argument to `getUserRepoPermission`.

This PR switches to use `hasOrgVisible(e, ...)`.

Fix #12983

Signed-off-by: Andrew Thornton <art27@cantab.net>
4 years agoChange default log configuration (#13088)
zeripath [Sat, 10 Oct 2020 15:19:50 +0000 (16:19 +0100)]
Change default log configuration (#13088)

* Change default log configuration

This PR changes the install page and the docker default
logging configuration to match the suggested configuration
that I repeatedly end up suggesting on issues.

It further improves the logging configuration docs to
recommend specific instructions for how to configure logs
for posting to issues.

Signed-off-by: Andrew Thornton <art27@cantab.net>
* Update docs/content/doc/advanced/logging-documentation.en-us.md

4 years agoSet appropriate `autocomplete` attributes on password fields (#13078)
silverwind [Fri, 9 Oct 2020 07:32:30 +0000 (09:32 +0200)]
Set appropriate `autocomplete` attributes on password fields (#13078)

`new-password` prevents annoying autocompletion in some cases, thought
it's not semantically correct to use that for example on all three
fields on the user account page, so some annoyances remain.

Co-authored-by: Lauris BH <lauris@nix.lv>
4 years agoDisable DSA ssh keys by default (#13056)
zeripath [Fri, 9 Oct 2020 06:52:57 +0000 (07:52 +0100)]
Disable DSA ssh keys by default (#13056)

* Disable DSA ssh keys by default

OpenSSH has disabled DSA keys since version 7.0

As the docker runs openssh > v7.0 we should just disable
DSA keys by default.

Refers to #11417

Signed-off-by: Andrew Thornton <art27@cantab.net>
* Just disable DSA keys by default

Signed-off-by: Andrew Thornton <art27@cantab.net>
* Appears we need to set the minimum key sizes too

Signed-off-by: Andrew Thornton <art27@cantab.net>
* Appears we need to set the minimum key sizes too

Signed-off-by: Andrew Thornton <art27@cantab.net>
* Remove DSA type

* Fix Tests

Co-authored-by: techknowlogick <techknowlogick@gitea.io>
Co-authored-by: Lauris BH <lauris@nix.lv>
4 years agoFix line break for MS teams webhook (#13081)
Iván Valdés [Fri, 9 Oct 2020 05:30:55 +0000 (22:30 -0700)]
Fix line break for MS teams webhook (#13081)

Signed-off-by: Ivan Valdes <ivan@vald.es>
Co-authored-by: Lauris BH <lauris@nix.lv>
4 years agoImprove Docker container name (#13077)
Melroy van den Berg [Fri, 9 Oct 2020 02:31:07 +0000 (04:31 +0200)]
Improve Docker container name (#13077)

* Improve Docker container name

Use a better Docker container name than the default 'server'

* Changing to gitea and use recommended v3 Docker-compose

Use `gitea` as container name. And use version 3 of the docker-compose, which should now be used: https://docs.docker.com/compose/compose-file/compose-versioning/

Co-authored-by: techknowlogick <techknowlogick@gitea.io>
4 years agoCache last commit when pushing for big repository (#10109)
Lunny Xiao [Thu, 8 Oct 2020 22:17:23 +0000 (06:17 +0800)]
Cache last commit when pushing for big repository (#10109)

* Cache last commit when pushing for big repository

* Fix bug

* detect force push

* Refactor cache push

* Finish cache last commit info when push

* Some improvements

* Fix lint

* Remove unused changes

* Move pull request test before cache

* Fix test mysql

Co-authored-by: techknowlogick <techknowlogick@gitea.io>
Co-authored-by: Lauris BH <lauris@nix.lv>
4 years agoHide sync ssh keys button on admin dashboard if ssh disabled or builtin-ssh enabled...
Lunny Xiao [Thu, 8 Oct 2020 16:43:15 +0000 (00:43 +0800)]
Hide sync ssh keys button on admin dashboard if ssh disabled or builtin-ssh enabled (#13072)

Co-authored-by: zeripath <art27@cantab.net>
4 years ago[skip ci] Updated translations via Crowdin
GiteaBot [Thu, 8 Oct 2020 15:51:23 +0000 (15:51 +0000)]
[skip ci] Updated translations via Crowdin

4 years agofix a small nit (#13074)
赵智超 [Thu, 8 Oct 2020 15:50:17 +0000 (23:50 +0800)]
fix a small nit (#13074)

Signed-off-by: a1012112796 <1012112796@qq.com>
4 years agoAvoid setting the CONN_STR in issue indexer queue unless it is meant to be set (...
zeripath [Wed, 7 Oct 2020 22:24:41 +0000 (23:24 +0100)]
Avoid setting the CONN_STR in issue indexer queue unless it is meant to be set (#13069)

Since the move to common leveldb and common redis the disk queue code (#12385)
will check the connection string before defaulting to the DATADIR.

Therefore we should ensure that the connection string is kept empty
unless it is actually set.

Unforunately the issue indexer was missed in #13025 this PR fixes this omission

Fix #13062

Signed-off-by: Andrew Thornton <art27@cantab.net>
4 years agoGitea serv, hooks, manager and the like should always display Fatals (#13032)
zeripath [Wed, 7 Oct 2020 20:44:16 +0000 (21:44 +0100)]
Gitea serv, hooks, manager and the like should always display Fatals (#13032)

The gitea cmd/serv.go setup function deletes the console logger to
prevent stdout interference with commands. However, the problem is that
it then calls setting.NewContext which may cause an exit with log.Fatal
- which will then not be shown.

Now, log.Fatal is so disastrous that the interference that logging
causes is wanted. However, we can avoid stdout interference by emitting
on stderr.

This PR forces the creation of a console logger on stderr listening on
Fatal for these commands. Most commands have a `--debug` option now that
will print more reasons too - however, defaulting to give the log for
Fatal seems reasonable.

Signed-off-by: Andrew Thornton <art27@cantab.net>
4 years ago[skip ci] Updated translations via Crowdin
GiteaBot [Wed, 7 Oct 2020 18:25:19 +0000 (18:25 +0000)]
[skip ci] Updated translations via Crowdin

4 years agoDisable Git Hooks by default (#13064)
techknowlogick [Wed, 7 Oct 2020 18:24:14 +0000 (14:24 -0400)]
Disable Git Hooks by default (#13064)

* Disable Git Hooks by default

Related #13058

* pass tests

4 years ago[skip ci] Updated translations via Crowdin
GiteaBot [Wed, 7 Oct 2020 09:56:17 +0000 (09:56 +0000)]
[skip ci] Updated translations via Crowdin

4 years agoMitigate Security vulnerability in the git hook feature (#13058)
Niklas Goerke [Wed, 7 Oct 2020 09:55:13 +0000 (11:55 +0200)]
Mitigate Security vulnerability in the git hook feature (#13058)

* Extend git hook warning in the UI.

Git hooks are a dangerous feature, administrators should be warned before giving
the git hook privilege to users.

* Disable Git hooks by default and add warning.

Git hooks are a dangerous features (see warning text) that should only
be enabled if the administrator was informed about the risk involved.

Co-authored-by: Niklas Goerke <goerke@fzi.de>
4 years agoUpdate third-party-tools.en-us.md (#13046)
Rongjian Zhang [Tue, 6 Oct 2020 16:55:51 +0000 (00:55 +0800)]
Update third-party-tools.en-us.md (#13046)

4 years ago[skip ci] Updated translations via Crowdin
GiteaBot [Tue, 6 Oct 2020 16:17:17 +0000 (16:17 +0000)]
[skip ci] Updated translations via Crowdin

4 years agofix: case typo (#13049)
Rongjian Zhang [Tue, 6 Oct 2020 16:16:16 +0000 (00:16 +0800)]
fix: case typo (#13049)

* Update settings.go

* Run swagger generate

4 years ago[skip ci] Updated translations via Crowdin
GiteaBot [Tue, 6 Oct 2020 07:24:15 +0000 (07:24 +0000)]
[skip ci] Updated translations via Crowdin

4 years ago[Docs] Update GitNex Link (#13050)
6543 [Tue, 6 Oct 2020 07:23:10 +0000 (09:23 +0200)]
[Docs] Update GitNex Link (#13050)

4 years agoAdding visual cue for "Limited" & "Private" organizations. (#13040)
Spencer Taylor [Tue, 6 Oct 2020 06:25:43 +0000 (01:25 -0500)]
Adding visual cue for "Limited" & "Private" organizations. (#13040)

* Adding visual cue for "Limited" & "Private" organizations.

* Moving org visibility CSS styles to .less files.

Co-authored-by: Gitea <gitea@fake.local>
Co-authored-by: techknowlogick <techknowlogick@gitea.io>
4 years agoFix error create comment on outdated file (#13041)
6543 [Tue, 6 Oct 2020 00:18:55 +0000 (02:18 +0200)]
Fix error create comment on outdated file (#13041)

* FIX

* more specific

Co-authored-by: techknowlogick <techknowlogick@gitea.io>