aboutsummaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* Increment skip to avoid infini-loop (#13703) (#13728)release/v1.12John Olheiser2020-11-281-1/+1
| | | | | | | Signed-off-by: jolheiser <john.olheiser@gmail.com> Co-authored-by: Lauris BH <lauris@nix.lv> Co-authored-by: Lauris BH <lauris@nix.lv>
* * Handle incomplete diff files properly (#13669)65432020-11-222-6/+96
| | | | | | | | | | | | | | | 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>
* Fix a bug when check if owner is active (#13614)Lunny Xiao2020-11-182-2/+2
|
* Fix Fomatic Build (#13593)65432020-11-161-3/+3
|
* Changelog for v1.12.6 (#13152)v1.12.6Lauris BH2020-11-161-3/+72
| | | | | | | | | | | | | | | | | | | | | | | | | | | * Changelog for v1.12.6 * Update changelog * Update CHANGELOG.md * Update changelog * Sorry for unrelated changes :] Co-authored-by: 6543 <6543@obermui.de> * Update CHANGELOG.md Co-authored-by: 6543 <6543@obermui.de> * Update CHANGELOG.md Co-authored-by: 6543 <6543@obermui.de> * Update changelog * add future PRs Co-authored-by: 6543 <6543@obermui.de>
* API: Fix GetQueryBeforeSince (#13559) (#13560)65432020-11-155-23/+43
| | | | | | | * API: Fix GetQueryBeforeSince * CI.restart() Co-authored-by: zeripath <art27@cantab.net>
* [API] Only Return Json (#13511) (#13564)65432020-11-155-48/+103
| | | | | Backport #13511 Co-authored-by: zeripath <art27@cantab.net>
* Prevent git operations for inactive users (#13527) (#13537)Lunny Xiao2020-11-132-1/+44
| | | | | | | | | | | | | * prevent git operations for inactive users * Some fixes * Deny push to the repositories which's owner is inactive * deny operations also when user is ProhibitLogin Co-authored-by: zeripath <art27@cantab.net> Co-authored-by: zeripath <art27@cantab.net>
* Disallow urlencoded new lines in git protocol paths if there is a port ↵65432020-11-111-0/+3
| | | | | | | (#13521) (#13525) Signed-off-by: Andrew Thornton <art27@cantab.net> Co-authored-by: zeripath <art27@cantab.net>
* Prevent panic on git blame by limiting lines to 4096 bytes at most (#13492)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>
* use registry mirror for docker-in-docker (#13438) (#13446)techknowlogick2020-11-061-2/+6
| | | | | Co-authored-by: Lauris BH <lauris@nix.lv> Co-authored-by: Lauris BH <lauris@nix.lv>
* [Vendor] update mvdan.cc/xurls v2.1.0 -> v2.2.0 (#13407) (#13408)65432020-11-029-27/+41
| | | | | * Vendor: mvdan.cc/xurls v2.1.0 -> v2.2.0 * CI.restart()
* Migration failure during reaction migration from gitea (#13344) (#13346)techknowlogick2020-10-292-3/+7
| | | | | | | | | | | | | | | | | | | | | | | | * Migration failure during reaction migration from gitea (#13344) * 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> * Delete gitea_downloader.go * Backport #13349 Unfortunately my final push to #13344 didn't register - or I failed to push it properly. GetIssueCommentReactions in routers/api/v1/repo/issue_reaction.go also makes the same mistake. Co-authored-by: zeripath <art27@cantab.net>
* Remove obsolete change of email on profile page (#13341) (#13348)techknowlogick2020-10-295-12/+18
| | | | | | | | | | | | | | * 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>
* Add migrated pulls to pull request task queue (#13331) (#13335)zeripath2020-10-271-0/+2
| | | | | | | Backport #13331 Fix #13321 Signed-off-by: Andrew Thornton <art27@cantab.net>
* Deny wrong pull (#13308) (#13327)M4RKUS-111112020-10-271-0/+6
| | | | | | | | | * Deny wrong pull * Update routers/api/v1/repo/pull.go Co-authored-by: Markus <git+markus@obermui.de> Co-authored-by: zeripath <art27@cantab.net>
* Attempt to handle unready PR in tests (#13305) (#13311)zeripath2020-10-261-4/+21
| | | | | Backport #13305 Signed-off-by: Andrew Thornton <art27@cantab.net>
* Fix initial commit page & binary munching problem (#13249) (#13259)zeripath2020-10-221-2/+11
| | | | | | | | | | | | | | | | | | | | | | | 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>
* Update heatmap fixtures to restore tests (#13224) (#13226)65432020-10-203-3/+3
| | | `the hotfix day`
* Fix diff skipping lines (#13157)zeripath2020-10-162-179/+346
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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>
* Finally fix diff names (#13136) (#13139)zeripath2020-10-143-124/+81
| | | | | | | | | | | | | | | | | | Backport #13136 it is possible to have an ambiguous line here. 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>
* Return 404 not 500 from API if team does not exist (#13118) (#13119)zeripath2020-10-131-1/+1
| | | | | | | | | Backport #13118 If team does not exist expect ErrTeamNotExist not ErrUserNotEXist Fix #11336 Signed-off-by: Andrew Thornton <art27@cantab.net>
* [Backport] Prohibit automatic downgrades (#13108) (#13111)65432020-10-121-4/+9
| | | | | | | | | | | | | | | | * Prohibit automatic downgrades * do not only log, print to stderr too * Update models/migrations/migrations.go * Update models/migrations/migrations.go Co-authored-by: Cirno the Strongest <1447794+CirnoT@users.noreply.github.com> * a nit Co-authored-by: zeripath <art27@cantab.net> Co-authored-by: Cirno the Strongest <1447794+CirnoT@users.noreply.github.com>
* Backport Migration Option AuthToken (#13101)65432020-10-128-33/+37
| | | | | | fix #13085 Backport #12862 Backport Parts of #12672
* Fix attachments list in edit comment (#13036) (#13097)zeripath2020-10-124-19/+31
| | | | | | | | | | | | | | Backport #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 Co-authored-by: techknowlogick <techknowlogick@gitea.io>
* Migration Tool: Backport GitLab Label Color Normalizer (#12793) (#13100)65432020-10-111-1/+14
| | | | | fix bug mentioned in #13085 backport of #12793
* Log the underlying panic in runMigrateTask (#13096) (#13098)zeripath2020-10-111-7/+4
| | | | | | | | | | | | Backport #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>
* Fix deadlock when deleting team user (#13093)zeripath2020-10-101-1/+1
| | | | | | | | | | | | | Backport #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>
* Fix error create comment on outdated file (#13041) (#13042)65432020-10-061-1/+4
| | | | | | | | | * FIX * more specific Co-authored-by: techknowlogick <techknowlogick@gitea.io> Co-authored-by: techknowlogick <techknowlogick@gitea.io>
* Fix repository create/delete event webhooks (#13008) (#13027)James Lakin2020-10-042-23/+17
|
* Fix 500 on README in submodule (#13006) (#13016)techknowlogick2020-10-021-0/+11
| | | | | | | | | | | | | | | | If a README file is a symlink to a submodule Gitea the view branch page will return a 500. The underlying problem is a missed conversion of an plumbing.ErrObjectNotFound in git/tree_blob.go. Fix #12599 Signed-off-by: Andrew Thornton <art27@cantab.net> Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com> Co-authored-by: zeripath <art27@cantab.net> Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
* Changelog 1.12.5 (#13002)v1.12.5John Olheiser2020-10-011-0/+27
| | | | | | | | | | | | | | | | | * Changelog 1.12.5 Signed-off-by: jolheiser <john.olheiser@gmail.com> * Update CHANGELOG.md * Update CHANGELOG.md Co-authored-by: techknowlogick <matti@mdranta.net> * Apply suggestions from code review Co-authored-by: techknowlogick <matti@mdranta.net> Co-authored-by: techknowlogick <matti@mdranta.net>
* allow U2F with default settings for gitea in subpath (#12990) (#13001)techknowlogick2020-10-011-2/+2
| | | | | | | | | * allow U2F with default settings for gitea in subpath * use trim suffix Co-authored-by: zeripath <art27@cantab.net> Co-authored-by: zeripath <art27@cantab.net>
* Prevent empty div when editing comment (#12404) (#12991)techknowlogick2020-10-012-5/+5
| | | | | | | | | * Prevent empty div when editing comment The template for attachments needs to remove whitespace and return empty when there are no attachments. Fix #10220 Co-authored-by: zeripath <art27@cantab.net>
* Mirror: Update DB on Address-Update too (#12964) (#12967)65432020-09-282-6/+10
| | | | | | | | | * Mirror: Update DB on Address-Update too (#12964) * Mirror: Update DB on Address-Update too * new name for function to better describe * fix lint
* Allow extended config on cron settings (#12939) (#12943)zeripath2020-09-252-2/+67
| | | | | | | Backport #12939 Fix #12934 Signed-off-by: Andrew Thornton <art27@cantab.net>
* Open transaction when adding Avatar email-hash pairs to the DB (#12577) (#12940)zeripath2020-09-241-1/+12
| | | | | | | | | | | | | | | | | | | | | | | | | Backport #12577 When adding Avatar email-hash pairs we simply want the DB table to represent a Set. We don't care if the hash-pair is already present, so we just simply Insert and ignore the error. Unfortunately this seems to cause some DBs to log the duplicate insert to their logs - looking like a bug a in Gitea. Now, there is no standard way in SQL to say Insert but if there's an error ignore it. MySQL has INSERT IGNORE, PostgreSQL >= 9.5 has INSERT ... ON CONFLICT DO NOTHING, but I do not believe that SQLite or MSSQL have variants. This PR places the insert in a transaction which we are happy to fail if there is an error - hopefully this will stop the unnecessary logging. Signed-off-by: Andrew Thornton <art27@cantab.net> Co-authored-by: techknowlogick <techknowlogick@gitea.io> Co-authored-by: techknowlogick <techknowlogick@gitea.io>
* Fix ListUserOrgs (#12910) (#12915)赵智超2020-09-211-1/+1
| | | | | | | | | fix #12891 Signed-off-by: a1012112796 <1012112796@qq.com> Co-authored-by: Lauris BH <lauris@nix.lv> Co-authored-by: Lauris BH <lauris@nix.lv>
* Update only the repository columns that need updating (#12900) (#12912)zeripath2020-09-211-2/+7
| | | | | | | | | | | | Backport #12900 We should only update is_empty, default_branch and updated time columns during commitRepoAction and not update other columns as we risk overwriting incorrect information. Fix #11823 Fix #10536 Signed-off-by: Andrew Thornton <art27@cantab.net>
* Fix panic when adding long comment (#12892) (#12894)mrsdizzie2020-09-181-1/+1
| | | Previous PR #12881 causes out of bounds panic by working on wrong string.
* Convert User expose ID each time (#12855) (#12883)65432020-09-183-4/+15
| | | | | | | | | | | | | | | | | | | | | * Convert User expose ID each time (#12855) * git blame tells me a lot of gitea things happen here around 2018, add header * move user code int its own file * expose user id * adopt things from APIFormat * fix test * CI.restart() * No Refactor * CI.restart() Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
* Add size limit for content of comment on action ui (#12881) (#12890)赵智超2020-09-181-1/+10
| | | | | | | | | Signed-off-by: a1012112796 <1012112796@qq.com> Co-authored-by: mrsdizzie <info@mrsdizzie.com> Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com> Co-authored-by: mrsdizzie <info@mrsdizzie.com> Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com> Co-authored-by: techknowlogick <techknowlogick@gitea.io>
* Fix pgsql migration test (#12844) (#12884)Lunny Xiao2020-09-181-0/+3
| | | | | Co-authored-by: Lauris BH <lauris@nix.lv> Co-authored-by: Lauris BH <lauris@nix.lv>
* Fix [API] CreateRepo missing information (#12848) (#12867)65432020-09-181-0/+6
| | | | | | | | | | | | | | | | * Fix [API] [Bug] CreateRepo missing information (#12848) * Fix [API] [Bug] CreateRepo missing information * add code comment Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com> * CI.restart() * CI.restart() Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com> Co-authored-by: zeripath <art27@cantab.net>
* Support slashes in release tags (#12864) (#12882)zeripath2020-09-172-3/+3
| | | | | | | Backport #12864 Fix #12861 Signed-off-by: Andrew Thornton <art27@cantab.net>
* Fix migration v111 (#12868)Lunny Xiao2020-09-162-17/+43
|
* Escape more things that are passed through str2html (#12622) (#12850)zeripath2020-09-157-17/+18
| | | | | | | | | | | | | Backport #12622 * Escape more things that are passed through str2html Signed-off-by: Andrew Thornton <art27@cantab.net> * Bloody editors! Co-authored-by: mrsdizzie <info@mrsdizzie.com> * Update routers/user/oauth.go
* Fix notifications page links (#12838) (#12853)zeripath2020-09-151-0/+1
| | | | Signed-off-by: Andrew Thornton <art27@cantab.net>
* On Migration respect old DefaultBranch (#12843) (#12858)65432020-09-157-41/+56
| | | | | | | | | * On Migration respect old DefaultBranch * add DefaultBranch int test set Co-authored-by: zeripath <art27@cantab.net> Co-authored-by: zeripath <art27@cantab.net>
* Stop cloning unnecessarily on PR update (#12839) (#12852)zeripath2020-09-151-60/+19
| | | | | | | Backport #12839 Fix #12740 Signed-off-by: Andrew Thornton <art27@cantab.net>