summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* Delete Labels & IssueLabels on Repo Delete too (#15039) (#15051)65432021-03-194-0/+50
| | | | | * Doctor: find IssueLabels without existing label * Repo Delete: delete labels & issue_labels too
* Fix postgres ID sequences broken by recreate-table (#15015) (#15029)zeripath2021-03-193-1/+140
| | | | | | | | | | Backport #15015 Unfortunately there is a subtle problem with recreatetable on postgres which leads to the sequences not being renamed and not being left at 0. Fix #14725 Signed-off-by: Andrew Thornton <art27@cantab.net>
* another clusterfuzz spotted issue (#15032) (#15034)65432021-03-191-1/+1
| | | | | Signed-off-by: Andrew Thornton <art27@cantab.net> Co-authored-by: zeripath <art27@cantab.net>
* Fix several render issues (#14986) (#15013)zeripath2021-03-176-44/+216
| | | | | | | | | | | Backport #14986 * Fix an issue with panics related to attributes * Wrap goldmark render in a recovery function * Reduce memory use in render emoji * Use a pipe for rendering goldmark - still needs more work and a limiter Signed-off-by: Andrew Thornton <art27@cantab.net> Co-authored-by: Lauris BH <lauris@nix.lv>
* API: fix set milestone on PR creation (#14981) (#15001)Norwin2021-03-155-4/+90
| | | | | | | | | | | | * API: fix set milestone on PR creation pr creation via API failed with 404, because we searched for milestoneID 0, due to uninitialized var usage D: * add tests Co-authored-by: 6543 <6543@obermui.de> Co-authored-by: 6543 <6543@obermui.de>
* Make sure sibling images get a link too (#14979) (#14995)zeripath2021-03-152-1/+43
| | | | | | | | | | | Backport #14979 Due a problem with the ast.Walker in the our transformer in goldmark an image with a sibling image will not be transformed to gain a parent link. This PR fixes this. Fix #12925 Signed-off-by: Andrew Thornton <art27@cantab.net>
* Fix Anchor jumping with escaped query components (#14969) (#14977)zeripath2021-03-131-1/+1
| | | | | | | Backport #14969 Fix #14968 Signed-off-by: Andrew Thornton <art27@cantab.net>
* check if original author is set (#14972)Norwin2021-03-131-1/+1
| | | Co-authored-by: 6543 <6543@obermui.de>
* fix release mail html template (#14976)Norwin2021-03-121-2/+4
| | | was missing an </a>
* Fix excluding more than two labels on issues list (#14962) (#14973)zeripath2021-03-122-19/+13
| | | | | | | | | | | | Backport #14962 Fix #14840 Signed-off-by: Andrew Thornton <art27@cantab.net> Co-authored-by: Norwin Roosen <git@nroo.de> Co-authored-by: jaqra <48099350+jaqra@users.noreply.github.com> Co-authored-by: Norwin Roosen <git@nroo.de> Co-authored-by: jaqra <48099350+jaqra@users.noreply.github.com>
* Prevent panic when editing forked repos by API (#14960) (#14963)65432021-03-121-0/+4
| | | | | | | | | | When editing forked repos using the API the BaseRepository needs to loaded in order to check its visibility otherwise there will be NPE panic. Fix #14956 Signed-off-by: Andrew Thornton <art27@cantab.net> Co-authored-by: zeripath <art27@cantab.net>
* Add "captcha" to list of reserved usernames (#14930)fnetX (aka fralix)2021-03-081-0/+1
| | | Signed-off-by: Otto Richter <git@fralix.ovh>
* Re-enable import local paths after reversion from #13610 (#14925) (#14927)zeripath2021-03-082-0/+19
| | | | | | | | | | Backport #14925 PR #13610 unfortunately disabled importing repositories from local paths. This PR restores this functionality. Fix #14700 Signed-off-by: Andrew Thornton <art27@cantab.net>
* Changelog v1.13.4 (#14917)v1.13.465432021-03-071-0/+13
| | | | | * Changelog v1.13.4 * nit
* Fix race in LFS ContentStore.Put(...) (#14895) (#14913)zeripath2021-03-071-11/+51
| | | | | | | | | | | | | Backport #14895 Continuing on from #14888 The previous implementation has race whereby an incomplete upload or hash mismatch upload can end up in the ContentStore. This PR moves the validation into the reader so that if there is a hash error or size mismatch the reader will return with an error instead of an io.EOF causing the storage to abort the storage. Signed-off-by: Andrew Thornton <art27@cantab.net>
* Fix a couple of issues with a feeds (#14897) (#14903)65432021-03-062-1/+7
| | | | | Backport (#14897) witch fix couple of issues with feeds
* Fix race in local storage (#14888) (#14901)65432021-03-061-10/+38
| | | | | | | | LocalStorage should only put completed files in position Signed-off-by: Andrew Thornton <art27@cantab.net> Co-authored-by: zeripath <art27@cantab.net> Co-authored-by: techknowlogick <techknowlogick@gitea.io>
* When transfering repository and database transaction failed, rollback the ↵65432021-03-061-6/+42
| | | | | | | | | | | renames (#14864) (#14902) Fix #14821 Co-authored-by: Andrew Thornton <art27@cantab.net> Co-authored-by: 6543 <6543@obermui.de> Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com> Co-authored-by: Andrew Thornton <art27@cantab.net>
* Signed-off-by: jolheiser <john.olheiser@gmail.com> (#14898) (#14899)John Olheiser2021-03-051-4/+5
|
* [Docs] Fix how lfs data path is set (#14855) (#14884)65432021-03-042-3/+4
| | | | | | | | * fix docs: lfs data path * DEPRECATED | 已废弃 Co-authored-by: techknowlogick <techknowlogick@gitea.io> Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
* IsUserAllowedToUpdate should igonre if user is nil (#14886)65432021-03-041-0/+3
|
* Add changelog for v1.13.3 (#14877)v1.13.3Lunny Xiao2021-03-041-0/+23
| | | | | | | Add changelog for v1.13.3 Co-authored-by: zeripath <art27@cantab.net> Co-authored-by: 6543 <6543@obermui.de> Co-authored-by: techknowlogick <matti@mdranta.net>
* Fix paging of file commit logs (#14831) (#14879)zeripath2021-03-041-2/+37
| | | | | | | | | | | | | | | | Backport #14831 Unfortunately `git log revision ... --skip=x -- path` skips the number of commits not the number of commits relating to the path. This PR changes the function to have a reader that reads and skips the necessary number of commits by hand instead. Fix #8716 Signed-off-by: Andrew Thornton <art27@cantab.net> Co-authored-by: 6543 <6543@obermui.de> Co-authored-by: 6543 <6543@obermui.de>
* Print usefull error if SQLite is used in settings but not supported (#14476) ↵65432021-03-031-4/+7
| | | | | | | | (#14874) * move log output to points where they are relefant * check explicit of sqlite3 in settings
* Fix display since time round (#14226) (#14873)zeripath2021-03-032-37/+152
| | | | | | | | | | | Backport #14226 * Fix display since time round * Fix since time * Fix tests Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
* When Deleting Repository only explicitly close PRs whose base is not this ↵zeripath2021-03-021-1/+6
| | | | | | | | | | | 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>
* Set HCaptchaSiteKey on Link Account pages (#14834) (#14839)zeripath2021-03-011-0/+3
| | | | | | | | | | 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>
* Fix a couple of CommentAsPatch issues. (#14804) (#14820)zeripath2021-02-286-41/+270
| | | | | | | | | | | | | | | | | | | | | | | | | 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>
* Disable broken OAuth2 providers at startup (#14802) (#14811)zeripath2021-02-261-1/+7
| | | | | | | | | | | 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>
* Re-enable transfer repo back from org to user account (#14807)65432021-02-262-2/+3
| | | | | * re-enable transfer repo back from org to user account * add test case
* Build for only available darwin target (#14771) (#14798)65432021-02-251-1/+1
| | | Co-authored-by: techknowlogick <techknowlogick@gitea.io>
* Backport: Repo Transfer permission checks (#14792) (#14794)65432021-02-254-3/+39
| | | | | * Backport: Repo Transfer permission checks (#14792) * update tests
* Fix double alert in oauth2 application edit view (#14764) (#14768)a10121127962021-02-231-1/+0
| | | Signed-off-by: a1012112796 <1012112796@qq.com>
* Fix broken spans in diffs (#14678) (#14683)zeripath2021-02-152-6/+228
| | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* HasPreviousCommit causes recursive load of commits unnecessarily (#14598) ↵zeripath2021-02-151-13/+25
| | | | | | | | | | | | (#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>
* Prevent race in PersistableChannelUniqueQueue.Has (#14651) (#14676)zeripath2021-02-141-0/+5
| | | | | | | | | | | | | | | 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>
* Turn default hash password algorightm back to pbkdf2 from argon2 until we ↵Lunny Xiao2021-02-133-3/+3
| | | | | | | | | 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>
* Allow org labels to be set with issue templates (#14593) (#14647)zeripath2021-02-131-1/+8
| | | | | | | | | Backport #14593 Fix #13688 Signed-off-by: Andrew Thornton <art27@cantab.net> Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
* Do not assume all 40 char strings are SHA1s (#14624) (#14648)zeripath2021-02-141-11/+15
| | | | | | | | | | | | 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>
* Accept multiple SSH keys in single LDAP SSHPublicKey attribute (#13989) (#14607)zeripath2021-02-083-9/+91
| | | | | | | | | Backport #13989 Fix #13984 Fix #14566 Signed-off-by: Andrew Thornton <art27@cantab.net>
* Fix bug about ListOptions and stars/watchers pagnation (#14556) (#14573)65432021-02-053-7/+11
| | | | | | * Fix bug about ListOptions and stars/watchers pagnation * fix unit test
* Fix GPG key deletion during account deletion (#14561) (#14569)Anton Khimich2021-02-042-1/+15
| | | | | | | | | 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>
* Changelog v1.13.2 (#14535)v1.13.265432021-02-021-0/+32
|
* configure internal ssh server w/ macs and ciphers, backport of #14523 (#14530)Stefan2021-01-301-3/+7
|
* Set the name Mapper in migrations (#14526) (#14529)65432021-01-301-0/+5
| | | | | | | | | | | | | | | | | | | | | | | | 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>
* Fix wiki preview (#14515)Lunny Xiao2021-01-291-1/+1
| | | Co-authored-by: Lauris BH <lauris@nix.lv>
* update code.gitea.io/sdk/gitea v0.13.1 -> v0.13.2 (#14497)65432021-01-2826-77/+151
|
* ChangeUserName: rename user files back on DB issue (#14447)65432021-01-251-3/+12
|
* Fix migration v141 (#14387) (#14388)65432021-01-232-3/+12
| | | | | * Fix mig 141 * temporary fix dump
* ensure timeout error is shown on u2f timeout (#14417) (#14431)zeripath2021-01-232-2/+2
| | | | | | | | 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>