aboutsummaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
...
* Fix 64-bit atomic operations on 32-bit machines (#19531) (#19532)Gusted2022-04-271-1/+4
| | | | | | - Backport #19531 - Doing 64-bit atomic operations on 32-bit machines is a bit tricky by golang, as they can only be done under certain set of conditions(https://pkg.go.dev/sync/atomic#pkg-note-BUG). - This PR fixes such case whereby the conditions weren't met, it moves the int64 to the first field of the struct, which will 64-bit operations happening on this property on 32-bit machines. - Resolves #19518
* Fix migrate release from github (#19510) (#19523)Lunny Xiao2022-04-271-9/+12
| | | | | * Fix migrate release from github * Fix bug
* When view _Siderbar or _Footer, just display once (#19501) (#19522)Lunny Xiao2022-04-271-30/+51
| | | Co-authored-by: zeripath <art27@cantab.net>
* Prevent dangling archiver goroutine (#19516) (#19526)zeripath2022-04-273-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | Backport #19516 Within doArchive there is a service goroutine that performs the archiving function. This goroutine reports its error using a `chan error` called `done`. Prior to this PR this channel had 0 capacity meaning that the goroutine would block until the `done` channel was cleared - however there are a couple of ways in which this channel might not be read. The simplest solution is to add a single space of capacity to the goroutine which will mean that the goroutine will always complete and even if the `done` channel is not read it will be simply garbage collected away. (The PR also contains two other places when setting up the indexers which do not leak but where the blocking of the sending goroutine is also unnecessary and so we should just add a small amount of capacity and let the sending goroutine complete as soon as it can.) Signed-off-by: Andrew Thornton <art27@cantab.net> Co-authored-by: 6543 <6543@obermui.de> Co-authored-by: 6543 <6543@obermui.de>
* Unset git author/committer variables when running integration tests (#19512) ↵techknowlogick2022-04-261-0/+7
| | | | | | | | | | | | | | (#19519) TestAPIGitTag (and likely others) will fail if the running environment contains GIT_AUTHOR_NAME and other env variables like it. This PR simply unsets these when running the integration tests. Fix #14247 Signed-off-by: Andrew Thornton <art27@cantab.net> Co-authored-by: zeripath <art27@cantab.net>
* Fix blame page select range error and some typos (#19503)Lunny Xiao2022-04-263-6/+5
| | | Partially back port from #19500 and fix two typos.
* Add notags to fetch (#19487) (#19490)65432022-04-251-23/+21
| | | | | * Add notags to fetch (#19487) * gofumpt
* User specific repoID or xorm builder conditions for issue search (#19475) ↵65432022-04-258-32/+22
| | | | (#19476)
* [doctor] authorized-keys: fix displayed check name (backport #19464) (#19484)Pilou2022-04-251-2/+2
| | | The registered check name is authorized-keys, not authorized_keys.
* Mark TemplateLoading error as "UnprocessableEntity" (#19445) (#19446)Gusted2022-04-223-7/+8
| | | | | | | | | * Mark TemplateLoading error as "UnprocessableEntity" (#19445) - Backport #19445 - Don't return Internal Server error if the user provide incorrect label template, instead return UnprocessableEntity. - Resolves #19399 - dep: upgrade: github.com/gogs/chardet
* Prevent dangling cat-file calls (goroutine alternative) (#19454) (#19466)65432022-04-221-0/+12
| | | | | | | | | | | | | | | | | | | | | If an `os/exec.Command` is passed non `*os.File` as an input/output, go will create `os.Pipe`s and wait for their closure in `cmd.Wait()`. If the code following this is responsible for closing `io.Pipe`s or other handlers then on process death from context cancellation the `Wait` can hang. There are two possible solutions: 1. use `os.Pipe` as the input/output as `cmd.Wait` does not wait for these. 2. create a goroutine waiting on the context cancellation that will close the inputs. This PR provides the second option - which is a simpler change that can be more easily backported. Closes #19448 Signed-off-by: Andrew Thornton <art27@cantab.net> Co-authored-by: zeripath <art27@cantab.net>
* Set correct PR status on 3way on conflict checking (#19457) (#19458)Gusted2022-04-224-10/+93
| | | | | | | | | - Backport #19457 - When 3-way merge is enabled for conflict checking, it has a new interesting behavior that it doesn't return any error when it found a conflict, so we change the condition to not check for the error, but instead check if conflictedfiles is populated, this fixes a issue whereby PR status wasn't correctly on conflicted PR's. - Refactor the mergeable property(which was incorrectly set and lead me this bug) to be more maintainable. - Add a dedicated test for conflicting checking, so it should prevent future issues with this. - Ref: Fix the latest error for https://gitea.com/gitea/go-sdk/pulls/579 Co-authored-by: zeripath <art27@cantab.net>
* RepoAssignment ensure to close before overwrite (#19449) (#19460)65432022-04-211-0/+9
| | | | | * check if GitRepo already open and close if * Only run RepoAssignment once
* Add Changelog v1.16.6 (#19339)v1.16.665432022-04-211-1/+36
| | | | | | Co-authored-by: delvh <dev.lh@web.de> Co-authored-by: techknowlogick <matti@mdranta.net> Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com> Co-authored-by: zeripath <art27@cantab.net>
* When dumping trim the standard suffices instead of a random suffix (#19440) ↵65432022-04-201-2/+7
| | | | | | | | | | | | | | | | | | (#19447) * When dumping trim the standard suffices instead of a random suffix Instead of using the `path.Ext()` to trim the last "extension" suffix, just iterate through the supported suffices and trim those. Fix #19424 Signed-off-by: Andrew Thornton <art27@cantab.net> * fix enum with to have correct supported types only Co-authored-by: 6543 <6543@obermui.de> Co-authored-by: zeripath <art27@cantab.net>
* Fix DELETE request for non-existent public key (#19443) (#19444)Gusted2022-04-201-4/+9
| | | | | | | | - Backport #19443 - Add a return for the first "block" of errors, which fixes the double error messages. - Add a return for `externallyManaged`. - Resolves #19398 Co-authored-by: 6543 <6543@obermui.de>
* Don't panic on `ErrEmailInvalid` (#19441) (#19442)Gusted2022-04-202-3/+16
| | | | | | | - Backport #19441 - Don't panic on `ErrEmailInvalid`, this was caused due that we were trying to force `ErrEmailCharIsNotSupported` interface, which panics. - Resolves #19397 Co-authored-by: 6543 <6543@obermui.de>
* Add uploadpack.allowAnySHA1InWant to allow --filter=blob:none with older git ↵65432022-04-201-3/+3
| | | | | | | | | | | clients (#19430) (#19438) Older git clients need uploadpack.allowAnySHA1InWant if partial cloning is allowed. Fix #19118 Signed-off-by: Andrew Thornton <art27@cantab.net> Co-authored-by: zeripath <art27@cantab.net>
* Warn on SSH connection for incorrect configuration (#19317) (#19437)65432022-04-201-0/+9
| | | | | | | | | | | | Backport #19317 - Warn on SSH connection for incorrect configuration - When `setting.RepoRootPath` cannot be found(most likely due to incorrect configuration) show "Gitea: Incorrect configuration" on the client-side to help easier with debugging the problem. Co-authored-by: delvh <dev.lh@web.de> Co-authored-by: wxiaoguang <wxiaoguang@gmail.com> Co-authored-by: techknowlogick <techknowlogick@gitea.io>
* API: Search Issues, dont show 500 if filter result in empty list (#19244) ↵65432022-04-201-15/+16
| | | | | | | | | | | (#19436) Backport #19244 * remove error who is none * use setupSessionNoLimit instead of setupSessionWithLimit when no pagination Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
* When updating mirror repo intervals by API reschedule next update too ↵zeripath2022-04-204-28/+60
| | | | | | | | | | | | (#19429) (#19433) Backport #19429 When a mirror repo interval is updated by the UI it is rescheduled with that interval however the API does not do this. The API also lacks the enable_prune option. This PR adds this functionality in to the API Edit Repo endpoint. Signed-off-by: Andrew Thornton <art27@cantab.net>
* Fix nil error when some pages are rendered outside request context (#19428)wxiaoguang2022-04-191-1/+1
|
* Only request write when necessary (#18657) (#19422)Lunny Xiao2022-04-191-11/+4
| | | | | | | | | | | | | | | | | | | | | * Only request write when necessary - Only request write for `INTERNAL_TOKEN_URI` when no token was found. - Resolves #18655 * Fix perm * Update setting.go * Update setting.go * Update setting.go Co-authored-by: wxiaoguang <wxiaoguang@gmail.com> Co-authored-by: zeripath <art27@cantab.net> Co-authored-by: Gusted <williamzijl7@hotmail.com> Co-authored-by: wxiaoguang <wxiaoguang@gmail.com> Co-authored-by: zeripath <art27@cantab.net>
* Fix double blob-hunk on diff page (#19404) (#19405)Gusted2022-04-151-1/+0
| | | | - Don't show the blob-hunk twice on diff page - Backport #19404
* go get -u crypto (#19388)techknowlogick2022-04-122-130/+3
|
* Update locale_ru-RU.ini (#19383) (#19387)Vasiliy Bukharev2022-04-131-1/+1
| | | Signed-off-by: bvp <bvp-yar@ya.ru>
* Don't allow merging PR's which are being conflict checked (#19357) (#19358)Gusted2022-04-131-0/+5
| | | | | | | | | * Don't allow merging PR's which are being conflict checked (#19357) - Backport of #19357 - When a PR is still being conflict checked, don't allow the PR to be merged(the merge button could already be visible before e.g. a new commit was pushed to the PR). - Resolves #19352 * Update error message
* Fix middleware function's placements for `/user/...` (#19377) (#19378)Gusted2022-04-121-3/+3
| | | | | - Backport #19377 - Add reqSignIn to `/user/task/{task}` as it specific to a logged in user currently not-logged in user could cause a NPE. - Remove `/user/active` reqSignIn middleware, because when you want to active a account you're not "signed in" so it doesn't make sense to add that middleware.
* Disable service worker by default (#18914) (#19342)silverwind2022-04-074-5/+3
| | | | | | | | The service worker causes a lot of issues with JS errors after instance upgrades while not bringing any real performance gain over regular HTTP caching. Disable it by default for this reason. Maybe later we can remove it completely, as I simply see no benefit in having it.
* Fix invalid CSRF token bug, make sure CSRF tokens can be up-to-date (#19338)wxiaoguang2022-04-061-0/+1
| | | There was a bug that the CSRF token wouldn't in 24h. This fix just does what the CSRF function comment says: If this request is a GET request, it will generate a new token. Then the CSRF token can be kept up-to-date.
* Revert the minimal golang version requirement from 1.17 to 1.16 and add a ↵Lunny Xiao2022-04-056-7/+31
| | | | | | | | | | | | | | | | | | | | | | | | | warning in Makefile (#19319) * Revert the minimal golang version requirement from 1.17 to 1.16 and add a warning in Makefile * Apply suggestions from code review Co-authored-by: John Olheiser <john.olheiser@gmail.com> * 1.16 * Update modules/util/net.go Co-authored-by: Gusted <williamzijl7@hotmail.com> * correct bool conditional yay tests for catching this :) * Update hostmatcher.go Co-authored-by: John Olheiser <john.olheiser@gmail.com> Co-authored-by: techknowlogick <techknowlogick@gitea.io> Co-authored-by: Gusted <williamzijl7@hotmail.com>
* Restore user autoregistration with email addresses (#19261) (#19312)zeripath2022-04-021-29/+39
| | | | | | | | | | | | | Backport #19261 Unfortunately #18789 disabled autoregistration using email addresses as they would be shortcut to email address does not exist. This PR attempts to restore autoregistration by allowing an unknown email address to percolate through to the autoregistration path of UserSignin. Fix #19256 Signed-off-by: Andrew Thornton <art27@cantab.net>
* Performance improvement for add team user when org has more than 1000 ↵Lunny Xiao2022-04-011-12/+41
| | | | repositories (#19227) (#19289)
* Move checks for pulls before merge into own function (#19271) (#19277)65432022-03-317-214/+216
| | | | | | | | Backport #19271 Fix: * The API does ignore issue dependencies where Web does not * The API checks if "IsSignedIfRequired" where Web does not - UI probably do but nothing will some to craft custom requests * Default merge message is crafted a bit different between API and Web if not set on specific cases ...
* Use full output of git show-ref --tags to get tags for PushUpdateAddTag ↵zeripath2022-03-299-103/+324
| | | | | | | | | | | | | | | | | | | | | | | | | (#19235) (#19236) * Use full output of git show-ref --tags to get tags for PushUpdateAddTag (#19235) Strangely #19038 appears to relate to an issue whereby a tag appears to be listed in `git show-ref --tags` but then does not appear when `git show-ref --tags -- short_name` is called. As a solution though I propose to stop the second call as it is unnecessary and only likely to cause problems. I've also noticed that the tags calls are wildly inefficient and aren't using the common cat-files - so these have been added. I've also noticed that the git commit-graph is not being written on mirroring - so I've also added writing this to the migration which should improve mirror rendering somewhat. Fix #19038 Signed-off-by: Andrew Thornton <art27@cantab.net> Co-authored-by: 6543 <6543@obermui.de> * fix rebase relict Co-authored-by: 6543 <6543@obermui.de>
* Granular webhook events in editHook (#19251) (#19257)John Olheiser2022-03-291-5/+16
| | | Signed-off-by: jolheiser <john.olheiser@gmail.com>
* Only send webhook events to active system webhooks and only deliver to ↵zeripath2022-03-294-6/+18
| | | | | | | | | | | | | | | | | active hooks (#19234) (#19248) Backport #19234 There is a bug in the system webhooks whereby the active state is not checked when webhooks are prepared and there is a bug that deactivating webhooks do not prevent queued deliveries. * Only add SystemWebhooks to the prepareWebhooks list if they are active * At the time of delivery if the underlying webhook is not active mark it as "delivered" but with a failed delivery so it does not get delivered. Fix #19220 Signed-off-by: Andrew Thornton <art27@cantab.net>
* Check go and nodejs version by go.mod and package.json (#19197) (#19254)wxiaoguang2022-03-291-5/+6
| | | | | | | * Check go and nodejs version by go.mod and package.json * Update Go official site URL Co-authored-by: wxiaoguang <wxiaoguang@gmail.com> Co-authored-by: gesangtome <gesangtome@foxmail.com>
* Fix clone url JS error for the empty repo page (#19209)wxiaoguang2022-03-291-7/+10
| | | | Co-authored-by: 6543 <6543@obermui.de> Co-authored-by: zeripath <art27@cantab.net>
* Use goproxy.io instead of goproxy.cn (#19242) (#19246)65432022-03-291-32/+32
| | | Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
* Prevent intermittent failures in RepoIndexerTest (#19225 #19229) (#19228)zeripath2022-03-281-2/+13
| | | | | | | | | | | | | | | | Backport #19225 Backport #19229 The RepoIndexerTest is failing with considerable frequency due to a race inherrent in its design. This PR adjust this test to avoid the reliance on waiting for the populate repo indexer to run and forcibly adds the repo to the queue. It then flushes the queue. It may be worth separating out the tests somewhat by testing the Index function directly away from the queue however, this forceful method should solve the current problem. Fix #19162 Signed-off-by: Andrew Thornton <art27@cantab.net>
* Touch mirrors on even on fail to update (#19217) (#19233)zeripath2022-03-272-0/+11
| | | | | | | | | | Backport #19217 If a mirror fails to be synchronised it should be pushed to the bottom of the queue of the awaiting mirrors to be synchronised. At present if there LIMIT number of broken mirrors they can effectively prevent all other mirrors from being synchronized as their last_updated time will remain earlier than other mirrors. Signed-off-by: Andrew Thornton <art27@cantab.net>
* Hide sensitive content on admin panel progress monitor (#19218 & #19226) ↵Lunny Xiao2022-03-274-13/+61
| | | | | | | | | | | | | | | | | | | | | | | (#19231) * Hide sensitive content on admin panel progress monitor (#19218) Sanitize urls within git process descriptions. Co-authored-by: wxiaoguang <wxiaoguang@gmail.com> Co-authored-by: Andrew Thornton <art27@cantab.net> * Do not include global arguments in process manager (#19226) Backport #19226 The git command by default adds a number of global arguments. These are not helpful to be displayed in the process manager and so should be skipped for default process descriptions. Signed-off-by: Andrew Thornton <art27@cantab.net> Co-authored-by: wxiaoguang <wxiaoguang@gmail.com> Co-authored-by: Andrew Thornton <art27@cantab.net>
* Bump goldmark to v1.4.11 (#19201) (#19203)Robert Kaussow2022-03-243-3/+16
| | | | | | | | | | | | | * Bump goldmark to v1.4.11 * fix go.sum Signed-off-by: Andrew Thornton <art27@cantab.net> * add testcase Signed-off-by: Andrew Thornton <art27@cantab.net> Co-authored-by: Andrew Thornton <art27@cantab.net>
* Changelog for 1.16.5 (#19189)v1.16.5zeripath2022-03-241-0/+31
| | | | | | | | * Changelog for 1.16.5 ## [1.16.5](https://github.com/go-gitea/gitea/releases/tag/1.16.5) - 2022-03-23 Signed-off-by: Andrew Thornton <art27@cantab.net> Co-authored-by: 6543 <6543@obermui.de>
* Fix showing issues in your repositories (#18916) (#19191)65432022-03-242-15/+61
| | | | | | | - Make a restriction on which issues can be shown based on if you the user or team has write permission to the repository. - Fixes a issue whereby you wouldn't see any associated issues with a specific team on a organization if you wasn't a member(fixed by zeroing the User{ID} in the options). - Resolves #18913 Co-authored-by: Gusted <williamzijl7@hotmail.com>
* Prevent redirect to Host (2) (#19175) (#19186)zeripath2022-03-231-0/+6
| | | | | | | | | | | | | | | | Backport #19175 Unhelpfully Locations starting with `/\` will be converted by the browser to `//` because ... well I do not fully understand. Certainly the RFCs and MDN do not indicate that this would be expected. Providing "compatibility" with the (mis)behaviour of a certain proprietary OS is my suspicion. However, we clearly have to protect against this. Therefore we should reject redirection locations that match the regular expression: `^/[\\\\/]+` Reference #9678 Signed-off-by: Andrew Thornton <art27@cantab.net>
* Fix compare link in active feeds for new branch (#19149) (#19185)zeripath2022-03-232-1/+35
| | | | | | | | | | | | | | | | | | | | | | | Backport #19149 When a new branch is pushed the old SHA is always listed as the empty sha and thus the compare link that is created does not work correctly. Therefore when creating the compare link for new branches: 1. Attempt to get the parent of the first commit and use that as the basis for the compare link. 2. If this is not possible make a comparison to the default branch 3. Finally if that is not possible simply do not show a compare link. However, there are multiple broken compare links remaining therefore, in order for these to not break we will simply make the compare link redirect to the default branch. Fix #19144 Signed-off-by: a1012112796 <1012112796@qq.com> Signed-off-by: Andrew Thornton <art27@cantab.net> Co-authored-by: Andrew Thornton <art27@cantab.net> Co-authored-by: a1012112796 <1012112796@qq.com>
* Redirect .wiki/* ui link to /wiki (#18831) (#19184)zeripath2022-03-231-0/+20
| | | | | | | | | | | | | Backport #18831 Redirect .wiki/* ui link to /wiki fix #18590 Signed-off-by: a1012112796 <1012112796@qq.com> Signed-off-by: Andrew Thornton <art27@cantab.net> Co-authored-by: Andrew Thornton <art27@cantab.net> Co-authored-by: a1012112796 <1012112796@qq.com>
* Prevent start panic due to missing DotEscape functionAndrew Thornton2022-03-231-0/+1
| | | | | | | | | | Unfortunately #19169 causing a panic at startup in prod mode. This was hidden by dev mode because the templates are compiled dynamically there. The issue is that DotEscape is not in the original FuncMap at the time of compilation which causes a panic. Ref #19169 Signed-off-by: Andrew Thornton <art27@cantab.net>