]> source.dussan.org Git - gitea.git/log
gitea.git
3 years agoFix display since time round (#14226) (#14873)
zeripath [Wed, 3 Mar 2021 21:17:34 +0000 (21:17 +0000)]
Fix display since time round (#14226) (#14873)

Backport #14226

* Fix display since time round

* Fix since time

* Fix tests

Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
3 years agoWhen Deleting Repository only explicitly close PRs whose base is not this repository...
zeripath [Tue, 2 Mar 2021 13:44:14 +0000 (13:44 +0000)]
When Deleting Repository only explicitly close PRs whose base is not this repository (#14823) (#14842)

Backport #14823

When Deleting Repository only explicitly close PRs whose base is not this repository

Fix #14775

Signed-off-by: Andrew Thornton <art27@cantab.net>
3 years agoSet HCaptchaSiteKey on Link Account pages (#14834) (#14839)
zeripath [Mon, 1 Mar 2021 15:12:48 +0000 (15:12 +0000)]
Set HCaptchaSiteKey on Link Account pages (#14834) (#14839)

Backport #14834

When using HCaptcha on link account pages the site key needs to be passed
in. This PR ensures that HCaptchaSiteKey is set in the data.

Fix #14766

Signed-off-by: Andrew Thornton <art27@cantab.net>
3 years agoFix a couple of CommentAsPatch issues. (#14804) (#14820)
zeripath [Sun, 28 Feb 2021 13:19:51 +0000 (13:19 +0000)]
Fix a couple of CommentAsPatch issues.  (#14804) (#14820)

Backport #14804

* CutDiffAroundLine makes the incorrect assumption that `---` and `+++` always represent part of the header of a diff.

This PR adds a flag to its parsing to prevent this problem and adds a streaming parsing technique to CutDiffAroundLine using an io.pipe instead of just sending data to an unbounded buffer.

Fix #14711

* Handle unquoted comment patch files

When making comment patches unfortunately the patch does not always quote the filename
This makes the diff --git header ambiguous again.

This PR finally adds handling for ambiguity in to parse patch

Fix #14812

* Add in testing for no error

There is no way currently for CutDiffAroundLine in this test to cause an
error however, it should still be tested.

Signed-off-by: Andrew Thornton <art27@cantab.net>
3 years agoDisable broken OAuth2 providers at startup (#14802) (#14811)
zeripath [Fri, 26 Feb 2021 10:44:45 +0000 (10:44 +0000)]
Disable broken OAuth2 providers at startup (#14802) (#14811)

Backport #14802

Instead of causing a log.Fatal, we should handle broken OAuth2
providers by disabling them.

Fix #8930

Signed-off-by: Andrew Thornton <art27@cantab.net>
Co-authored-by: techknowlogick <techknowlogick@gitea.io>
3 years agoRe-enable transfer repo back from org to user account (#14807)
6543 [Fri, 26 Feb 2021 09:08:09 +0000 (10:08 +0100)]
Re-enable transfer repo back from org to user account (#14807)

* re-enable transfer repo back from org to user account

* add test case

3 years agoBuild for only available darwin target (#14771) (#14798)
6543 [Thu, 25 Feb 2021 14:29:03 +0000 (15:29 +0100)]
Build for only available darwin target (#14771) (#14798)

Co-authored-by: techknowlogick <techknowlogick@gitea.io>
3 years agoBackport: Repo Transfer permission checks (#14792) (#14794)
6543 [Thu, 25 Feb 2021 07:49:27 +0000 (08:49 +0100)]
Backport: Repo Transfer permission checks (#14792) (#14794)

* Backport: Repo Transfer permission checks (#14792)

* update tests

3 years agoFix double alert in oauth2 application edit view (#14764) (#14768)
a1012112796 [Mon, 22 Feb 2021 23:22:49 +0000 (07:22 +0800)]
Fix double alert in oauth2 application edit view (#14764) (#14768)

Signed-off-by: a1012112796 <1012112796@qq.com>
3 years agoFix broken spans in diffs (#14678) (#14683)
zeripath [Sun, 14 Feb 2021 23:30:07 +0000 (23:30 +0000)]
Fix broken spans in diffs (#14678) (#14683)

Backport #14678

Gitea runs diff on highlighted code fragment for each line in order to
provide code highlight diffs. Unfortunately this diff algorithm is not
aware that span tags and entities are atomic and cannot be split.

The current fixup code makes some attempt to fix these broken tags
however, it cannot handle situations where a tag is split over multiple
blocks.

This PR provides a more algorithmic fixup mechanism whereby spans and
entities are completely coalesced into their respective blocks.

This may result in a incompletely reduced diff but - it will definitely
prevent the broken entities and spans that are currently possible.

As a result of this fixup several inconsistencies were discovered in our
testcases and these were also fixed.

Fix #14231

Signed-off-by: Andrew Thornton <art27@cantab.net>
Co-authored-by: 6543 <6543@obermui.de>
3 years agoHasPreviousCommit causes recursive load of commits unnecessarily (#14598) (#14649)
zeripath [Sun, 14 Feb 2021 22:44:26 +0000 (22:44 +0000)]
HasPreviousCommit causes recursive load of commits unnecessarily (#14598) (#14649)

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>
Co-authored-by: 6543 <6543@obermui.de>
3 years agoPrevent race in PersistableChannelUniqueQueue.Has (#14651) (#14676)
zeripath [Sun, 14 Feb 2021 00:50:50 +0000 (00:50 +0000)]
Prevent race in PersistableChannelUniqueQueue.Has (#14651) (#14676)

Backport #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>
Co-authored-by: 6543 <6543@obermui.de>
3 years agoTurn default hash password algorightm back to pbkdf2 from argon2 until we found a...
Lunny Xiao [Sat, 13 Feb 2021 20:19:33 +0000 (04:19 +0800)]
Turn default hash password algorightm back to pbkdf2 from argon2 until we found a better one (#14673) (#14675)

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

* Add a warning on document

Co-authored-by: zeripath <art27@cantab.net>
3 years agoAllow org labels to be set with issue templates (#14593) (#14647)
zeripath [Sat, 13 Feb 2021 18:34:47 +0000 (18:34 +0000)]
Allow org labels to be set with issue templates (#14593) (#14647)

Backport #14593

Fix #13688

Signed-off-by: Andrew Thornton <art27@cantab.net>
Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
3 years agoDo not assume all 40 char strings are SHA1s (#14624) (#14648)
zeripath [Sat, 13 Feb 2021 17:25:47 +0000 (17:25 +0000)]
Do not assume all 40 char strings are SHA1s (#14624) (#14648)

Backport #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 agoAccept multiple SSH keys in single LDAP SSHPublicKey attribute (#13989) (#14607)
zeripath [Mon, 8 Feb 2021 01:25:30 +0000 (01:25 +0000)]
Accept multiple SSH keys in single LDAP SSHPublicKey attribute (#13989) (#14607)

Backport #13989

Fix #13984

Fix #14566

Signed-off-by: Andrew Thornton <art27@cantab.net>
3 years agoFix bug about ListOptions and stars/watchers pagnation (#14556) (#14573)
6543 [Fri, 5 Feb 2021 21:11:15 +0000 (22:11 +0100)]
Fix bug about ListOptions and stars/watchers pagnation (#14556) (#14573)

* Fix bug about ListOptions and stars/watchers pagnation

* fix unit test

3 years agoFix GPG key deletion during account deletion (#14561) (#14569)
Anton Khimich [Thu, 4 Feb 2021 20:28:48 +0000 (15:28 -0500)]
Fix GPG key deletion during account deletion (#14561) (#14569)

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.

Co-authored-by: Anton Khimich <anton.khimicha@mail.utoronto.ca>
3 years agoChangelog v1.13.2 (#14535) v1.13.2
6543 [Mon, 1 Feb 2021 23:11:05 +0000 (00:11 +0100)]
Changelog v1.13.2 (#14535)

3 years agoconfigure internal ssh server w/ macs and ciphers, backport of #14523 (#14530)
Stefan [Sat, 30 Jan 2021 19:57:31 +0000 (20:57 +0100)]
configure internal ssh server w/ macs and ciphers, backport of #14523 (#14530)

3 years agoSet the name Mapper in migrations (#14526) (#14529)
6543 [Sat, 30 Jan 2021 19:47:11 +0000 (20:47 +0100)]
Set the name Mapper in migrations (#14526) (#14529)

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>
Co-authored-by: zeripath <art27@cantab.net>
3 years agoFix wiki preview (#14515)
Lunny Xiao [Fri, 29 Jan 2021 14:37:20 +0000 (22:37 +0800)]
Fix wiki preview (#14515)

Co-authored-by: Lauris BH <lauris@nix.lv>
3 years agoupdate code.gitea.io/sdk/gitea v0.13.1 -> v0.13.2 (#14497)
6543 [Thu, 28 Jan 2021 15:14:57 +0000 (16:14 +0100)]
update code.gitea.io/sdk/gitea v0.13.1 -> v0.13.2 (#14497)

3 years agoChangeUserName: rename user files back on DB issue (#14447)
6543 [Sun, 24 Jan 2021 23:36:16 +0000 (00:36 +0100)]
ChangeUserName: rename user files back on DB issue (#14447)

3 years agoFix migration v141 (#14387) (#14388)
6543 [Sat, 23 Jan 2021 11:33:03 +0000 (12:33 +0100)]
Fix migration v141 (#14387) (#14388)

* Fix mig 141

* temporary fix dump

3 years agoensure timeout error is shown on u2f timeout (#14417) (#14431)
zeripath [Sat, 23 Jan 2021 04:11:57 +0000 (04:11 +0000)]
ensure timeout error is shown on u2f timeout (#14417) (#14431)

Backport #14417

Signed-off-by: Andrew Thornton <art27@cantab.net>
Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
Co-authored-by: 6543 <6543@obermui.de>
3 years agoFix lfs preview bug (#14428) (#14433)
6543 [Sat, 23 Jan 2021 02:55:52 +0000 (03:55 +0100)]
Fix lfs preview bug (#14428) (#14433)

Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
3 years ago[Backport] Fix Deadlock & Delete affected reactions on comment deletion (#14392)...
6543 [Sat, 23 Jan 2021 02:03:29 +0000 (03:03 +0100)]
[Backport] Fix Deadlock & Delete affected reactions on comment deletion (#14392) (#14425)

* Enhance Ghost comment mitigation Settings (#14392)

* refactor models.DeleteComment and delete related reactions too

* use deleteComment for UserDeleteWithCommentsMaxDays in DeleteUser

* Resolve Fixme & fix potential deadlock

* rm refactor

* make diff eaven less

3 years agoPrevent panic on fuzzer provided string (#14405) (#14409) 14430/head
6543 [Wed, 20 Jan 2021 18:47:30 +0000 (19:47 +0100)]
Prevent panic on fuzzer provided string (#14405) (#14409)

* Prevent panic on fuzzer provided string

The fuzzer has found that providing a <body> tag with an attribute to
PostProcess causes a panic. This PR removes any rendered html or body
tags from the output.

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

* placate lint again

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

Signed-off-by: Andrew Thornton <art27@cantab.net>
Co-authored-by: zeripath <art27@cantab.net>
3 years agoUse path not filepath in routers/editor (#14390) (#14396)
6543 [Tue, 19 Jan 2021 09:00:13 +0000 (10:00 +0100)]
Use path not filepath in routers/editor (#14390) (#14396)

The incorrect use of filepath instead of path means that
it is possible to cause a stackoverflow on Windows

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 agoRemoved invalid form tag (#14391) (#14395)
6543 [Tue, 19 Jan 2021 05:12:04 +0000 (06:12 +0100)]
Removed invalid form tag (#14391) (#14395)

introduced by #5073

Co-authored-by: KN4CK3R <KN4CK3R@users.noreply.github.com>
3 years agoCheck if label template exist first (#14384) (#14389)
6543 [Mon, 18 Jan 2021 22:27:33 +0000 (23:27 +0100)]
Check if label template exist first (#14384) (#14389)

3 years agocheck release publisher exists (#14375)
Norwin [Mon, 18 Jan 2021 13:14:27 +0000 (13:14 +0000)]
check release publisher exists (#14375)

fixes #14365
was silently fixed in the feature PR #12096 for v1.14

3 years agoUse Request.URL.RequestURI() for fcgi (#14312) (#14347)
Kyungmin Bae [Fri, 15 Jan 2021 12:26:45 +0000 (21:26 +0900)]
Use Request.URL.RequestURI() for fcgi (#14312) (#14347)

Co-authored-by: Lauris BH <lauris@nix.lv>
3 years agoUse ServerError provided by Context (#14333) (#14345)
Lunny Xiao [Fri, 15 Jan 2021 09:36:30 +0000 (17:36 +0800)]
Use ServerError provided by Context (#14333) (#14345)

... instead of InternalServerError by macaron

3 years agoFix edit-label form init (#14337)
Norwin [Thu, 14 Jan 2021 13:03:16 +0000 (13:03 +0000)]
Fix edit-label form init (#14337)

3 years agofix mailIssueCommentBatch for pull request (#14252) (#14296)
a1012112796 [Mon, 11 Jan 2021 00:46:19 +0000 (08:46 +0800)]
fix mailIssueCommentBatch for pull request (#14252) (#14296)

fix #14250

Signed-off-by: a1012112796 <1012112796@qq.com>
3 years agoAdd secure/httpOnly attributes to the lang cookie (#14279) (#14280)
6543 [Thu, 7 Jan 2021 14:35:02 +0000 (15:35 +0100)]
Add secure/httpOnly attributes to the lang cookie (#14279) (#14280)

* Add secure/httpOnly attributes to the lang cookie (#9690) (#14279)

* apply to InitLocales() too

Co-authored-by: Timo Gurr <timo.gurr@gmail.com>
3 years agoRender links for commit hashes followed by comma (#14224) (#14227)
Nuno Silva [Sun, 3 Jan 2021 16:58:39 +0000 (16:58 +0000)]
Render links for commit hashes followed by comma (#14224) (#14227)

Regex test cases: https://regex101.com/r/mVbPxM/2/

fixes #14223

3 years agoSend notifications for mentions in pulls, issues, (code-)comments (#14218) (#14221)
Jimmy Praet [Sun, 3 Jan 2021 13:44:40 +0000 (14:44 +0100)]
Send notifications for mentions in pulls, issues, (code-)comments (#14218) (#14221)

Co-authored-by: techknowlogick <techknowlogick@gitea.io>
3 years agoFix avatar bugs (#14217) (#14220)
6543 [Sun, 3 Jan 2021 01:21:39 +0000 (01:21 +0000)]
Fix avatar bugs (#14217) (#14220)

Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
3 years agoEnsure that schema search path is set with every connection on postgres (#14131)...
zeripath [Sat, 2 Jan 2021 17:58:53 +0000 (17:58 +0000)]
Ensure that schema search path is set with every connection on postgres (#14131) (#14216)

Backport #14131

Unfortunately every connection to postgres requires that the search path is
set appropriately.

This PR shadows the postgres driver to ensure that as soon as a connection
is open, the search_path is set appropriately.

Fix #14088

Signed-off-by: Andrew Thornton <art27@cantab.net>
3 years agoFix dashboard issues labels filter bug (#14210) (#14214)
Lunny Xiao [Sat, 2 Jan 2021 17:08:04 +0000 (01:08 +0800)]
Fix dashboard issues labels filter bug (#14210) (#14214)

3 years agoWhen visit /favicon.ico but the static file is not exist return 404 but not continue...
Lunny Xiao [Sat, 2 Jan 2021 10:52:36 +0000 (18:52 +0800)]
When visit /favicon.ico but the static file is not exist return 404 but not continue to handle the route (#14211) (#14213)

Co-authored-by: techknowlogick <techknowlogick@gitea.io>
Co-authored-by: techknowlogick <techknowlogick@gitea.io>
3 years agofix branch selector on new issue page (#14194) (#14207)
a1012112796 [Fri, 1 Jan 2021 14:14:49 +0000 (22:14 +0800)]
fix branch selector on new issue page (#14194) (#14207)

fix #14185

Signed-off-by: a1012112796 <1012112796@qq.com>
Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
3 years agoCheck for notExist on profile repository page (#14197) (#14203)
zeripath [Thu, 31 Dec 2020 13:03:56 +0000 (13:03 +0000)]
Check for notExist on profile repository page (#14197) (#14203)

Backport #14197

Fix #14189

3 years agoAdd changelog for v1.13.1 (#14172) v1.13.1
Lunny Xiao [Mon, 28 Dec 2020 17:36:22 +0000 (01:36 +0800)]
Add changelog for v1.13.1 (#14172)

* Add changelog for v1.13.1

* Update CHANGELOG.md

Co-authored-by: John Olheiser <john.olheiser@gmail.com>
* Update CHANGELOG.md

* Update CHANGELOG.md

Co-authored-by: John Olheiser <john.olheiser@gmail.com>
* Update CHANGELOG.md

Co-authored-by: John Olheiser <john.olheiser@gmail.com>
* Update CHANGELOG.md

Co-authored-by: John Olheiser <john.olheiser@gmail.com>
Co-authored-by: zeripath <art27@cantab.net>
Co-authored-by: techknowlogick <techknowlogick@gitea.io>
3 years agoFix bug of link query order on markdown render (#14156) (#14171)
Lunny Xiao [Mon, 28 Dec 2020 17:08:55 +0000 (01:08 +0800)]
Fix bug of link query order on markdown render (#14156) (#14171)

* Fix bug of link query order on markdown render

* Fix bluemonday bug and fix one wrong test

Co-authored-by: 6543 <6543@obermui.de>
Co-authored-by: 6543 <6543@obermui.de>
3 years agoMigration: drop too long repo topics (#14152) (#14155)
6543 [Sun, 27 Dec 2020 02:57:06 +0000 (02:57 +0000)]
Migration: drop too long repo topics (#14152) (#14155)

* Migration: drop to long repo topics

* Update modules/migrations/gitea_uploader.go

3 years agoFix escaping issue in diff (#14154)
zeripath [Sat, 26 Dec 2020 22:15:42 +0000 (22:15 +0000)]
Fix escaping issue in diff (#14154)

Ensure that linecontent is escaped before passing to template.HTML

Signed-off-by: Andrew Thornton <art27@cantab.net>
3 years agoFix creation OAuth2 auth source from CLI. (#14146)
Daniil Pankratov [Fri, 25 Dec 2020 12:02:52 +0000 (15:02 +0300)]
Fix creation OAuth2 auth source from CLI. (#14146)

Fix #8356

3 years agoEnsure that search term and page are not lost on adoption page-turn (#14133) (#14143)
zeripath [Thu, 24 Dec 2020 21:54:15 +0000 (21:54 +0000)]
Ensure that search term and page are not lost on adoption page-turn (#14133) (#14143)

Backport #14133

Fix #14111

Signed-off-by: Andrew Thornton <art27@cantab.net>
3 years agomore test case for STORAGE_TYPE overrides (and fixes) (#14096) (#14104)
6543 [Tue, 22 Dec 2020 07:13:57 +0000 (07:13 +0000)]
more test case for STORAGE_TYPE overrides (and fixes) (#14096) (#14104)

Signed-off-by: 胡玮文 <huww98@outlook.com>
Co-authored-by: 胡玮文 <huww98@outlook.com>
3 years agoFix storage config implementation (#14091) (#14095)
6543 [Mon, 21 Dec 2020 22:56:18 +0000 (22:56 +0000)]
Fix storage config implementation (#14091) (#14095)

The design is very flexible, but not implemented correctly.
This commit fixes several issues:
* Costom storage type stated in https://docs.gitea.io/en-us/config-cheat-sheet/#storage-storage
  not working
* [storage.attachments], [storage.minio] section not respected

Signed-off-by: 胡玮文 <huww98@outlook.com>
Co-authored-by: 胡玮文 <huww98@outlook.com>
3 years agodep: update crypto. info: https://golangtutorial.dev/news/fix-in-crypto-package/...
techknowlogick [Mon, 21 Dec 2020 06:02:40 +0000 (01:02 -0500)]
dep: update crypto. info: https://golangtutorial.dev/news/fix-in-crypto-package/ (#14078)

3 years agoFix panic in BasicAuthDecode (#14046) (#14048)
silverwind [Fri, 18 Dec 2020 16:19:43 +0000 (17:19 +0100)]
Fix panic in BasicAuthDecode (#14046) (#14048)

* Fix panic in BasicAuthDecode

If the string does not contain ":" that function would run into an
`index out of range [1] with length 1` error. prevent that.

* Update BasicAuthDecode()

Co-authored-by: 6543 <6543@obermui.de>
Co-authored-by: 6543 <6543@obermui.de>
Co-authored-by: zeripath <art27@cantab.net>
3 years ago[API] GetCombinedCommitStatusByRef always return json & swagger doc fixes (#14047)
6543 [Fri, 18 Dec 2020 13:38:47 +0000 (13:38 +0000)]
[API] GetCombinedCommitStatusByRef always return json & swagger doc fixes (#14047)

* Fix swagger docs

* always return json

3 years agoHotFix: Hide private partisipation in Orgs (#13994) (#14031)
6543 [Thu, 17 Dec 2020 21:32:24 +0000 (21:32 +0000)]
HotFix: Hide private partisipation in Orgs (#13994) (#14031)

* HotFix: Hide private partisipation in Orgs

Co-authored-by: zeripath <art27@cantab.net>
3 years agoAlways wait for the cmd to finish (#14006) (#14039)
zeripath [Thu, 17 Dec 2020 20:06:51 +0000 (20:06 +0000)]
Always wait for the cmd to finish (#14006) (#14039)

Backport #14006

After cancelling the context we still need to wait for the
command to finish otherwise zombie processes may occur

Fix #13987

3 years agoDon't use simpleMDE editor on mobile devices for 1.13 (#14029)
mrsdizzie [Thu, 17 Dec 2020 16:39:12 +0000 (11:39 -0500)]
Don't use simpleMDE editor on mobile devices for 1.13 (#14029)

* Don't use simpleMDE editor on mobile devices

simpleMDE doesn't work properly on mobile devices -- We've replaced it with the slightly more working easyMDE in 1.14 but since that change can't be backported to 1.13 we will just disable the editor on mobile here.

* make isMobile function per code review -- disable simpleMDE for code review and replies

* Fix issue with plain text and wiki

Co-authored-by: silverwind <me@silverwind.io>
3 years agoAdd emoji in label to project boards (#13978) (#14021)
6543 [Wed, 16 Dec 2020 20:15:58 +0000 (20:15 +0000)]
Add emoji in label to project boards (#13978) (#14021)

* Update view.tmpl

Added rendering of emoji to project label

* Add RenderEmojiPlain to the title and remove has-emoji

Co-authored-by: zeripath <art27@cantab.net>
Co-authored-by: Rakshith Ravi <rakshith.ravi@gmx.com>
Co-authored-by: zeripath <art27@cantab.net>
3 years agoSend webhook when tag is removed via Web UI (#14015) (#14019)
Cirno the Strongest [Wed, 16 Dec 2020 17:24:02 +0000 (18:24 +0100)]
Send webhook when tag is removed via Web UI (#14015) (#14019)

* Send webhook when tag is removed via Web UI

* Stray code (cherry picked from commit 53308de0bf6880798666a98cbc2df6c7be527f50)

* Fix for 1.13

3 years agoalways use headCommitID for review comment diff (#14011)
Jimmy Praet [Wed, 16 Dec 2020 10:50:30 +0000 (11:50 +0100)]
always use headCommitID for review comment diff (#14011)

3 years agoTrim the branch prefix from action.GetBranch (#13981) (#13986)
zeripath [Mon, 14 Dec 2020 20:35:40 +0000 (20:35 +0000)]
Trim the branch prefix from action.GetBranch (#13981) (#13986)

Backport #13981

 #13882 has revealed that the refname of an action is actually only a
refname pattern and necessarily a branch. For examplem pushing to
refs/heads/master will result in action with refname refs/heads/master
but pushing to master will result in a refname master.

The simplest solution to providing a fix here is to trim the prefix
therefore this PR proposes this.

Signed-off-by: Andrew Thornton <art27@cantab.net>
Co-authored-by: a1012112796 <1012112796@qq.com>
Co-authored-by: a1012112796 <1012112796@qq.com>
3 years agoEnsure template renderer is available before storage handler (#13982)
zeripath [Mon, 14 Dec 2020 12:45:33 +0000 (12:45 +0000)]
Ensure template renderer is available before storage handler (#13982)

`ctx.Error` requires that templates are available for this to
render the error page otherwise there will be a panic at this
time.

This was fixed in #13164 but was not completely backported.

Fix #13971

Signed-off-by: Andrew Thornton <art27@cantab.net>
3 years agoWhenever the password is updated ensure that the hash algorithm is too (#13966) ...
zeripath [Sun, 13 Dec 2020 00:01:44 +0000 (00:01 +0000)]
Whenever the password is updated ensure that the hash algorithm is too (#13966) (#13967)

Backport #13966

`user.HashPassword` may potentially - and in fact now likely does - change
the `passwd_hash_algo` therefore whenever the `passwd` is updated, this
also needs to be updated.

Fix #13832

Thanks @fblaese for the hint

Signed-off-by: Andrew Thornton <art27@cantab.net>
3 years agoEnforce setting HEAD in wiki to master (#13950) (#13961)
6543 [Sat, 12 Dec 2020 17:21:26 +0000 (17:21 +0000)]
Enforce setting HEAD in wiki to master (#13950) (#13961)

The default branch in wikis must be master - therefore forcibly set the HEAD
to master.

Fix #13846

Signed-off-by: Andrew Thornton <art27@cantab.net>
Co-authored-by: 6543 <6543@obermui.de>
Co-authored-by: zeripath <art27@cantab.net>
3 years agoFix feishu webhook caused by API changed (#13937) (#13938)
Lunny Xiao [Fri, 11 Dec 2020 15:11:32 +0000 (23:11 +0800)]
Fix feishu webhook caused by API changed (#13937) (#13938)

fix #13858

3 years agolog error when login failed (#13903) (#13913)
Lunny Xiao [Wed, 9 Dec 2020 15:37:15 +0000 (23:37 +0800)]
log error when login failed (#13903) (#13913)

Co-authored-by: techknowlogick <techknowlogick@gitea.io>
Co-authored-by: techknowlogick <techknowlogick@gitea.io>
Co-authored-by: 6543 <6543@obermui.de>
3 years agoFix Quote Reply button on review diff (#13830) (#13898)
Jimmy Praet [Tue, 8 Dec 2020 22:12:35 +0000 (23:12 +0100)]
Fix Quote Reply button on review diff (#13830) (#13898)

Backport of #13830

Co-authored-by: 6543 <6543@obermui.de>
3 years agoFix Pull Merge when tag with same name as base branch exist (#13882) (#13896)
a1012112796 [Tue, 8 Dec 2020 11:58:44 +0000 (19:58 +0800)]
Fix Pull Merge when tag with same name as base branch exist (#13882) (#13896)

fix dst refspec error in 'Push back to upstream' when base branch have
same name with a tag.

fix #13851
Signed-off-by: a1012112796 <1012112796@qq.com>
Co-authored-by: 6543 <6543@obermui.de>
Co-authored-by: zeripath <art27@cantab.net>
3 years ago[API] return original URL of Repositories (#13885) (#13886)
6543 [Tue, 8 Dec 2020 04:59:19 +0000 (04:59 +0000)]
[API] return original URL of Repositories (#13885) (#13886)

3 years agoFix branch/tag notifications in mirror sync (#13855) (#13862)
manuelluis [Sun, 6 Dec 2020 04:30:28 +0000 (05:30 +0100)]
Fix branch/tag notifications in mirror sync (#13855) (#13862)

Co-authored-by: Gitea <gitea@fake.local>
Co-authored-by: 6543 <6543@obermui.de>
3 years agoFix mermaid chart size (#13865)
silverwind [Sun, 6 Dec 2020 03:13:31 +0000 (04:13 +0100)]
Fix mermaid chart size (#13865)

3 years agoFix crash in short link processor (#13839) (#13841)
mrsdizzie [Fri, 4 Dec 2020 03:08:48 +0000 (22:08 -0500)]
Fix crash in short link processor (#13839) (#13841)

Fixes #13819

3 years agoUpdate font stack to bootstrap's latest (#13834) (#13837)
silverwind [Fri, 4 Dec 2020 01:21:34 +0000 (02:21 +0100)]
Update font stack to bootstrap's latest (#13834) (#13837)

Backport #13834

3 years agoMake sure email recipients can see issue (#13820) (#13827)
John Olheiser [Thu, 3 Dec 2020 21:37:33 +0000 (15:37 -0600)]
Make sure email recipients can see issue (#13820) (#13827)

* Initial pass

* Remove over-op

Signed-off-by: jolheiser <john.olheiser@gmail.com>
3 years agoReply button is not removed when deleting a code review comment (#13824)
Jimmy Praet [Thu, 3 Dec 2020 20:26:47 +0000 (21:26 +0100)]
Reply button is not removed when deleting a code review comment (#13824)

Backport #13774

3 years agoWhen reinitialising DBConfig reset the database use flags (#13796) (#13811)
zeripath [Thu, 3 Dec 2020 10:13:19 +0000 (10:13 +0000)]
When reinitialising DBConfig reset the database use flags (#13796) (#13811)

Backport #13796

One perennial issue is users running the install page,
changing the database dialect and then suffering with issues

This PR simply resets all of the database.Use flags on
initDBConfig. This should prevent this issue from occuring.

Fix #13788
Fix #5480

Signed-off-by: Andrew Thornton <art27@cantab.net>
Co-authored-by: techknowlogick <techknowlogick@gitea.io>
Co-authored-by: techknowlogick <techknowlogick@gitea.io>
3 years agoMigrations: Use Process Manager to create own Context (#13793)
6543 [Wed, 2 Dec 2020 21:11:11 +0000 (22:11 +0100)]
Migrations: Use Process Manager to create own Context (#13793)

3 years ago1.13.0 Changelog (#13782) v1.13.0
techknowlogick [Wed, 2 Dec 2020 04:54:26 +0000 (23:54 -0500)]
1.13.0 Changelog (#13782)

Co-authored-by: 6543 <6543@obermui.de>
3 years agoset git-core paths in snap (#13711) (#13781)
techknowlogick [Wed, 2 Dec 2020 00:36:11 +0000 (19:36 -0500)]
set git-core paths in snap (#13711) (#13781)

Signed-off-by: artivis <deray.jeremie@gmail.com>
Co-authored-by: techknowlogick <techknowlogick@gitea.io>
Co-authored-by: Jeremie Deray <deray.jeremie@gmail.com>
3 years agoAdd Allow-/Block-List for Migrate & Mirrors (#13610) (#13776)
6543 [Wed, 2 Dec 2020 00:28:34 +0000 (01:28 +0100)]
Add Allow-/Block-List for Migrate & Mirrors (#13610) (#13776)

* add black list and white list support for migrating repositories

* specify log message

* use blocklist/allowlist

* allways use lowercase to match url

* Apply allow/block

* Settings: use existing "migrations" section

* convert domains lower case

* dont store unused value

* Block private addresses for migration by default

* use proposed-upstream func to detect private IP addr

* add own error for blocked migration, add tests, imprufe api

* fix test

* fix-if-localhost-is-ipv4

* rename error & error message

* rename setting options

* Apply suggestions from code review

Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
Co-authored-by: zeripath <art27@cantab.net>
Co-authored-by: techknowlogick <techknowlogick@gitea.io>
Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
Co-authored-by: zeripath <art27@cantab.net>
Co-authored-by: techknowlogick <techknowlogick@gitea.io>
3 years agoSet RUN_MODE prod by default (#13765) (#13767)
silverwind [Tue, 1 Dec 2020 01:55:38 +0000 (02:55 +0100)]
Set RUN_MODE prod by default (#13765) (#13767)

* Set RUN_MODE prod by default (#13765)

I think it's a bad default to have "dev" as the default run mode which
enables debugging and now also disables HTTP caching. It's better to
just default to a value suitable for general deployments.

Co-authored-by: techknowlogick <techknowlogick@gitea.io>
* flip default in checkRunMode

Co-authored-by: techknowlogick <techknowlogick@gitea.io>
3 years agoFix bogus http requests on diffs (#13760) (#13761)
silverwind [Mon, 30 Nov 2020 19:51:48 +0000 (20:51 +0100)]
Fix bogus http requests on diffs (#13760) (#13761)

The .blob-excerpt elements don't have these data attributes in some
cases resulting in bogus http request when expanding a diff and clicking
into the expanded area. This prevents those.

Should backport to 1.13.

Fixes: https://github.com/go-gitea/gitea/issues/13759
3 years agoui: show 'owner' tag for real owner (#13689) (#13743)
a1012112796 [Sun, 29 Nov 2020 12:50:58 +0000 (20:50 +0800)]
ui: show 'owner' tag for real owner (#13689) (#13743)

* ui: show 'owner' tag for real owner

Signed-off-by: a1012112796 <1012112796@qq.com>
* Update custom/conf/app.example.ini

* simplify logic

fix logic
fix a small bug about original author

* remove system manager tag

Co-authored-by: techknowlogick <techknowlogick@gitea.io>
Co-authored-by: Lauris BH <lauris@nix.lv>
3 years agoPush HEAD instead of master when initialising repositories (#13719) (#13740)
zeripath [Sat, 28 Nov 2020 21:59:32 +0000 (21:59 +0000)]
Push HEAD instead of master when initialising repositories (#13719) (#13740)

* Push HEAD instead of master when initialising repositories

It is possible on modern gits to change the initial branch to something other than
master. This breaks initialising repositories because we assume that the initial
branch is going to be master unless specifically changed.

This PR simply bypasses this issue by pushing the HEAD rather than the master branch.

Signed-off-by: Andrew Thornton <art27@cantab.net>
* Update modules/repository/init.go

Co-authored-by: mrsdizzie <info@mrsdizzie.com>
Co-authored-by: mrsdizzie <info@mrsdizzie.com>
Co-authored-by: techknowlogick <techknowlogick@gitea.io>
Co-authored-by: mrsdizzie <info@mrsdizzie.com>
Co-authored-by: techknowlogick <techknowlogick@gitea.io>
3 years agoIncrement skip to avoid infini-loop (#13703) (#13727)
John Olheiser [Sat, 28 Nov 2020 04:55:53 +0000 (22:55 -0600)]
Increment skip to avoid infini-loop (#13703) (#13727)

Signed-off-by: jolheiser <john.olheiser@gmail.com>
Co-authored-by: Lauris BH <lauris@nix.lv>
Co-authored-by: Lauris BH <lauris@nix.lv>
4 years agoCSS table fixes (#13693)
silverwind [Tue, 24 Nov 2020 17:45:24 +0000 (18:45 +0100)]
CSS table fixes (#13693)

Backport https://github.com/go-gitea/gitea/pull/13692 to 1.13.

4 years agofinaly fix gitlab migration with subdir 2.0 (#13646) (#13678)
6543 [Mon, 23 Nov 2020 16:40:58 +0000 (17:40 +0100)]
finaly fix gitlab migration with subdir 2.0 (#13646) (#13678)

* final fix 2.0?

* ignore Approvals for pulls if not found

* CI.restart()

Co-authored-by: Lauris BH <lauris@nix.lv>
Co-authored-by: Lauris BH <lauris@nix.lv>
4 years agoValidate email before inserting/updating (#13475) (#13666)
6543 [Sun, 22 Nov 2020 17:31:35 +0000 (18:31 +0100)]
Validate email before inserting/updating (#13475) (#13666)

* Add email validity check (#13475)

* Improve error feedback for duplicate deploy keys

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

* API returns 422 error when key with name exists

* Add email validity checking

Add email validity checking for the following routes:
[Web interface]
1. User registration
2. User creation by admin
3. Adding an email through user settings
[API]
1. POST /admin/users
2. PATCH /admin/users/:username
3. POST /user/emails

* Add further tests

* Add signup email tests

* Add email validity check for linking existing account

* Address PR comments

* Remove unneeded DB session

* Move email check to updateUser

Co-authored-by: zeripath <art27@cantab.net>
Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
Co-authored-by: techknowlogick <techknowlogick@gitea.io>
* skip email validation on empty string (#13627)

- move validation into its own function
- use a session for UpdateUserSetting

* rm TODO for backport

Co-authored-by: Chris Shyi <chrisshyi13@gmail.com>
Co-authored-by: zeripath <art27@cantab.net>
Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
Co-authored-by: techknowlogick <techknowlogick@gitea.io>
4 years ago* Handle incomplete diff files properly (#13668)
6543 [Sun, 22 Nov 2020 16:51:39 +0000 (17:51 +0100)]
* Handle incomplete diff files properly (#13668)

The code for parsing diff hunks has a bug whereby a very long line in a very long diff would not be completely read leading to an unexpected character.

  This PR ensures that the line is completely cleared

* Also allow git max line length <4096

* Add test case

Fix #13602

Signed-off-by: Andrew Thornton <art27@cantab.net>
Co-authored-by: Andrew Thornton <art27@cantab.net>
4 years agoFix issue/pull request list assignee filter (#13647) (#13651)
Karl Heinz Marbaise [Thu, 19 Nov 2020 22:58:35 +0000 (23:58 +0100)]
Fix issue/pull request list assignee filter (#13647) (#13651)

* Fixes #13641 - Filtering in Pull Request kept all the time.
 - The URL contains all the time the assignee in cases
   where once a type has been selected.

Signed-off-by: Karl Heinz Marbaise <kama@soebes.de>
* Followup Fixes #13641 - Filtering in Pull Request kept all the time.
 - The URL contains all the time the assignee in cases
   where once a type has been selected.
 - The same behaviour was observed issues viewed via milestones.

Signed-off-by: Karl Heinz Marbaise <kama@soebes.de>
4 years agofinaly fix gitlab migration with subdir (#13629) (#13633)
techknowlogick [Thu, 19 Nov 2020 16:20:12 +0000 (11:20 -0500)]
finaly fix gitlab migration with subdir (#13629) (#13633)

* finaly fix #13535

* add logging

Co-authored-by: 6543 <6543@obermui.de>
4 years agoAPI: Fix GetQueryBeforeSince (#13561)
6543 [Thu, 19 Nov 2020 02:21:21 +0000 (03:21 +0100)]
API: Fix GetQueryBeforeSince (#13561)

4 years agoFix a bug when check if owner is active (#13613)
Lunny Xiao [Wed, 18 Nov 2020 09:59:24 +0000 (17:59 +0800)]
Fix a bug when check if owner is active (#13613)

4 years agoMigration: Gitlab: Support Subdirectory (#13563) (#13591)
6543 [Tue, 17 Nov 2020 07:01:33 +0000 (08:01 +0100)]
Migration: Gitlab: Support Subdirectory (#13563) (#13591)

Co-authored-by: techknowlogick <techknowlogick@gitea.io>
Co-authored-by: techknowlogick <techknowlogick@gitea.io>
4 years agoFix Fomatic Build (#13596)
silverwind [Mon, 16 Nov 2020 23:01:05 +0000 (00:01 +0100)]
Fix Fomatic Build (#13596)

Port of #13593 to 1.13

4 years ago[API] Only Return Json (#13511) (#13565)
6543 [Sun, 15 Nov 2020 16:29:16 +0000 (17:29 +0100)]
[API] Only Return Json (#13511) (#13565)

Backport #13511

Co-authored-by: zeripath <art27@cantab.net>
4 years agomissing quotes in default value slice (#13550) (#13557)
techknowlogick [Sat, 14 Nov 2020 12:12:01 +0000 (07:12 -0500)]
missing quotes in default value slice (#13550) (#13557)

Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
Co-authored-by: techknowlogick <techknowlogick@gitea.io>
Co-authored-by: Patrick Aljord <patcito@gmail.com>
Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>