summaryrefslogtreecommitdiffstats
path: root/modules
Commit message (Collapse)AuthorAgeFilesLines
* 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-061-0/+5
| | | | | 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>
* 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>
* 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>
* Fix a couple of CommentAsPatch issues. (#14804) (#14820)zeripath2021-02-283-22/+94
| | | | | | | | | | | | | | | | | | | | | | | | | 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>
* 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-131-1/+1
| | | | | | | | | 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>
* 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>
* configure internal ssh server w/ macs and ciphers, backport of #14523 (#14530)Stefan2021-01-301-3/+7
|
* Prevent panic on fuzzer provided string (#14405) (#14409)65432021-01-202-10/+53
| | | | | | | | | | | | | | | | | | | | | * 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>
* Check if label template exist first (#14384) (#14389)65432021-01-192-7/+20
|
* Render links for commit hashes followed by comma (#14224) (#14227)Nuno Silva2021-01-032-1/+7
| | | | | Regex test cases: https://regex101.com/r/mVbPxM/2/ fixes #14223
* Send notifications for mentions in pulls, issues, (code-)comments (#14218) ↵Jimmy Praet2021-01-038-43/+108
| | | | | (#14221) Co-authored-by: techknowlogick <techknowlogick@gitea.io>
* When visit /favicon.ico but the static file is not exist return 404 but not ↵Lunny Xiao2021-01-021-0/+1
| | | | | | | continue to handle the route (#14211) (#14213) Co-authored-by: techknowlogick <techknowlogick@gitea.io> Co-authored-by: techknowlogick <techknowlogick@gitea.io>
* Fix bug of link query order on markdown render (#14156) (#14171)Lunny Xiao2020-12-281-1/+1
| | | | | | | | | * 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>
* Migration: drop too long repo topics (#14152) (#14155)65432020-12-261-0/+9
| | | | | * Migration: drop to long repo topics * Update modules/migrations/gitea_uploader.go
* Fix creation OAuth2 auth source from CLI. (#14146)Daniil Pankratov2020-12-251-0/+5
| | | Fix #8356
* more test case for STORAGE_TYPE overrides (and fixes) (#14096) (#14104)65432020-12-222-8/+57
| | | | | Signed-off-by: 胡玮文 <huww98@outlook.com> Co-authored-by: 胡玮文 <huww98@outlook.com>
* Fix storage config implementation (#14091) (#14095)65432020-12-222-21/+177
| | | | | | | | | | | 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>
* Fix panic in BasicAuthDecode (#14046) (#14048)silverwind2020-12-192-0/+12
| | | | | | | | | | | | | * 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>
* Always wait for the cmd to finish (#14006) (#14039)zeripath2020-12-171-0/+1
| | | | | | | | Backport #14006 After cancelling the context we still need to wait for the command to finish otherwise zombie processes may occur Fix #13987
* Fix feishu webhook caused by API changed (#13937) (#13938)Lunny Xiao2020-12-111-55/+33
| | | fix #13858
* Fix crash in short link processor (#13839) (#13841)mrsdizzie2020-12-041-10/+12
| | | Fixes #13819
* When reinitialising DBConfig reset the database use flags (#13796) (#13811)zeripath2020-12-031-0/+5
| | | | | | | | | | | | | | | | | | 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>
* Migrations: Use Process Manager to create own Context (#13793)65432020-12-025-13/+31
|
* Add Allow-/Block-List for Migrate & Mirrors (#13610) (#13776)65432020-12-014-3/+174
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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>
* Push HEAD instead of master when initialising repositories (#13719) (#13740)zeripath2020-11-281-2/+2
| | | | | | | | | | | | | | | | | | | | | * 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>
* finaly fix gitlab migration with subdir 2.0 (#13646) (#13678)65432020-11-231-2/+6
| | | | | | | | | | | * 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>
* finaly fix gitlab migration with subdir (#13629) (#13633)techknowlogick2020-11-191-2/+9
| | | | | | | * finaly fix #13535 * add logging Co-authored-by: 6543 <6543@obermui.de>
* Migration: Gitlab: Support Subdirectory (#13563) (#13591)65432020-11-171-0/+18
| | | | | Co-authored-by: techknowlogick <techknowlogick@gitea.io> Co-authored-by: techknowlogick <techknowlogick@gitea.io>
* [API] Only Return Json (#13511) (#13565)65432020-11-152-2/+59
| | | | | Backport #13511 Co-authored-by: zeripath <art27@cantab.net>
* missing quotes in default value slice (#13550) (#13557)techknowlogick2020-11-141-1/+1
| | | | | | | 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>
* Add missed sync branch/tag webhook (#13538) (#13556)Lunny Xiao2020-11-131-0/+8
| | | | | | | Co-authored-by: Lauris BH <lauris@nix.lv> Co-authored-by: techknowlogick <techknowlogick@gitea.io> Co-authored-by: Lauris BH <lauris@nix.lv> Co-authored-by: techknowlogick <techknowlogick@gitea.io>
* Use existing analyzer module for language detection for highlighting ↵mrsdizzie2020-11-131-2/+5
| | | | | | | | | | | | | | | | | | | (#13522) (#13551) * Use existing analyzer module for language detction for highlighting Thanks @lafriks for pointing out we can reuse existing code for more reliable language detection here. * Update modules/highlight/highlight.go Co-authored-by: Lauris BH <lauris@nix.lv> Co-authored-by: zeripath <art27@cantab.net> Co-authored-by: Lauris BH <lauris@nix.lv> Co-authored-by: techknowlogick <techknowlogick@gitea.io> Co-authored-by: zeripath <art27@cantab.net> Co-authored-by: Lauris BH <lauris@nix.lv> Co-authored-by: techknowlogick <techknowlogick@gitea.io>
* Disallow urlencoded new lines in git protocol paths if there is a port ↵65432020-11-111-0/+3
| | | | | | | (#13521) (#13524) Signed-off-by: Andrew Thornton <art27@cantab.net> Co-authored-by: zeripath <art27@cantab.net>
* Migration not fail on notmigrated reactions (#13507)65432020-11-111-13/+12
| | | | | * Refactor: dedub code * skip Reactions with Invalid ID
* Prevent panic on git blame by limiting lines to 4096 bytes at most (#13491)65432020-11-101-10/+32
| | | | | | | | Fix #12440 Closes #13192 Signed-off-by: Andrew Thornton <art27@cantab.net> Co-authored-by: Andrew Thornton <art27@cantab.net>
* Fix panic bug in handling multiple references in commit (#13486) (#13487)65432020-11-092-29/+95
| | | | | | | | | | | | | | * Fix panic bug in handling multiple references in commit (#13486) The issue lay in determining the position of matches on a second run round a commit message in FindAllIssueReferences. Fix #13483 Signed-off-by: Andrew Thornton <art27@cantab.net> * CI.restart() Co-authored-by: Andrew Thornton <art27@cantab.net>
* Storage configuration support `[storage]` (#13314) (#13379)Lunny Xiao2020-11-013-7/+30
| | | | | | | | | | | | | * 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>
* Fix typo (#13380) (#13382)Lunny Xiao2020-11-011-1/+1
|
* Migrations should not fail for comment reactions (#13352) (#13355)zeripath2020-10-291-1/+5
| | | | | 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>
* Remove obsolete change of email on profile page (#13341) (#13347)techknowlogick2020-10-291-1/+0
| | | | | | | | | | | | | | | * 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>
* Migration failure during reaction migration from gitea (#13344) (#13345)techknowlogick2020-10-282-3/+12
| | | | | | | | | | | | | | | | * 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>
* Add migrated pulls to pull request task queue (#13331) (#13334)zeripath2020-10-272-8/+10
| | | | | | | | | | | | | | | * 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>
* Fix Storage mapping (#13297) (#13307)zeripath2020-10-254-17/+29
| | | | | | | | | | | | | | | | | | | | | * 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>
* Fix bug isEnd detection on getIssues/getPullRequests (#13299) (#13301)Lunny Xiao2020-10-252-32/+50
|
* Store task errors following migrations and display them (#13246) (#13287)techknowlogick2020-10-241-17/+22
| | | | | | | | | | | | | | | | | | | | * 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>
* Remove PAM from auth dropdown when unavailable (#13276) (#13281)John Olheiser2020-10-232-0/+6
| | | Signed-off-by: jolheiser <john.olheiser@gmail.com>