aboutsummaryrefslogtreecommitdiffstats
path: root/modules
Commit message (Collapse)AuthorAgeFilesLines
* Use complete SHA to create and query commit status (#22244) (#22258)Jason Song2022-12-288-11/+14
| | | | | | | | | | | | | Backport #22244. Fix #13485. Co-authored-by: delvh <dev.lh@web.de> Co-authored-by: Lauris BH <lauris@nix.lv> Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com> Co-authored-by: delvh <dev.lh@web.de> Co-authored-by: Lauris BH <lauris@nix.lv> Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
* Normalize NuGet package version on upload (#22186) (#22201)KN4CK3R2022-12-212-1/+32
| | | | | Backport of #22186 Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
* Check for zero time instant in TimeStamp.IsZero() (#22171) (#22173)Gusted2022-12-201-3/+8
| | | | | | | | | | | - Backport of #22171 - Currently, the 'IsZero' function for 'TimeStamp' just checks if the unix time is zero, which is not the behavior of 'Time.IsZero()', but Gitea is using this method in accordance with the behavior of 'Time.IsZero()'. - Adds a new condition to check for the zero time instant. - Fixes a bug where non-expiring GPG keys where shown as they expired on Jan 01, 0001. - Related https://codeberg.org/Codeberg/Community/issues/791
* Workaround for container registry push/pull errors (#21862) (#22069)KN4CK3R2022-12-101-0/+7
| | | Backport of #21862
* Handle empty author names (#21902) (#22028)zeripath2022-12-062-2/+8
| | | | | | | | | | | Backport #21902 Although git does expect that author names should be of the form: `NAME <EMAIL>` some users have been able to create commits with: `<EMAIL>` Fix #21900 Signed-off-by: Andrew Thornton <art27@cantab.net> Co-authored-by: Lauris BH <lauris@nix.lv>
* On Tag/Branch Exist Check, dont panic if repo is nil (#21787) (#21789)65432022-12-052-2/+2
| | | | | | Backport #21787 Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com> Co-authored-by: Lauris BH <lauris@nix.lv>
* Fix vertical align of committer avatar rendered by email address (#21884) ↵Xinyu Zhou2022-11-231-3/+3
| | | | | | | | | | | | | (#21919) Backport #21884 Committer avatar rendered by `func AvatarByEmail` are not vertical align as `func Avatar` does. - Replace literals `ui avatar` and `ui avatar vm` with the constant `DefaultAvatarClass` Signed-off-by: Xinyu Zhou <i@sourcehut.net>
* Fix setting HTTP headers after write (#21833) (#21874)KN4CK3R2022-11-201-13/+49
| | | | Backport #21833
* Prevent dangling user redirects (#21856) (#21859)Gusted2022-11-181-0/+3
| | | | | | | - Backport #21856 - It's possible that the `user_redirect` table contains a user id that no longer exists. - Delete a user redirect upon deleting the user. - Add a check for these dangling user redirects to check-db-consistency.
* Fix enabling partial clones on 1.17 (#21809)zeripath2022-11-141-5/+0
| | | | | | | | | When backporting #20902 in #21058 there was a slight misbackport. It was missed that we needed to remove the global command option before setting the settings. Fix #21805 Signed-off-by: Andrew Thornton <art27@cantab.net>
* Prevent panic in doctor command when running default checks (#21791) (#21808)zeripath2022-11-132-12/+24
| | | | | | | | | | | | | | | | | | Backport #21791 There was a bug introduced in #21352 due to a change of behaviour caused by #19280. This causes a panic on running the default doctor checks because the panic introduced by #19280 assumes that the only way opts.StdOut and opts.Stderr can be set in RunOpts is deliberately. Unfortunately, when running a git.Command the provided RunOpts can be set, therefore if you share a common set of RunOpts these two values can be set by the previous commands. This PR stops using common RunOpts for the commands in that doctor check but secondly stops RunCommand variants from changing the provided RunOpts. Signed-off-by: Andrew Thornton <art27@cantab.net>
* Add HEAD fix to gitea doctor (#21352) (#21751)Xinyu Zhou2022-11-111-0/+91
| | | | | | | | | | | | | | | | | | | | Backport #21352 Due to a bug in presumably an older version of Gitea, multiple of my repositories still have their HEADs pointing to a `master` branch while the default branch on the UI is listed as `main`. This adds a `gitea doctor` command that will fix all of the HEAD references for repos when they're not synchronized with the default branch in the DB. This will help with cloning to ensure that git automatically checks out the right branch, instead of a nonexistent one. Note: I'm not sure if I actually need to do more other than add a file here. Will try testing this out on my server soon. Co-authored-by: Clar Fon <15850505+clarfonthey@users.noreply.github.com> Co-authored-by: zeripath <art27@cantab.net> Co-authored-by: wxiaoguang <wxiaoguang@gmail.com> Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
* Sync git hooks when config file path changed (#21619) (#21625)Jason Song2022-10-301-1/+2
| | | | | | | | | | | | Backport #21619 . A patch to #17335. Just like AppPath, Gitea writes its own CustomConf into git hook scripts too. If Gitea's CustomConf changes, then the git push may fail. Co-authored-by: techknowlogick <techknowlogick@gitea.io> Co-authored-by: techknowlogick <techknowlogick@gitea.io>
* Fix package access for admins and inactive users (#21580) (#21592)KN4CK3R2022-10-281-3/+6
| | | | | | Backport of #21580 Co-authored-by: Lauris BH <lauris@nix.lv> Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
* Fix `Timestamp.IsZero` (#21593) (#21604)KN4CK3R2022-10-271-1/+1
| | | | | Backport of #21593 Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
* support binary deploy in npm packages (#21589)eleith2022-10-253-1/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | backport of #21372 for v1.17.4 ------------------- npm package.json supports binary packaging: https://docs.npmjs.com/cli/v8/configuring-npm/package-json#bin the npm registry documents that the binary references will be attached to the abbreviated version object: https://github.com/npm/registry/blob/master/docs/responses/package-metadata.md#abbreviated-version-object unfortunately their api documentation leaves this out: https://github.com/npm/registry/blob/master/docs/responses/package-metadata.md#abbreviated-version-objectdoc which is likely to be the reason this was left out in gitea's initial implementation this response is critical for npm to install the binary in the .bin folder so as to be included on the users default bin path, resulting in immediate access to any binaries provided by the package i have tested upload and installing through npm and can confirm the npm registry now responds with bin in the version metadata and results in the binary being available after install. this fixes https://github.com/go-gitea/gitea/issues/21303 Co-authored-by: eleith <online-github@eleith.com> Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
* Fix generating compare link (#21519) (#21530)Lunny Xiao2022-10-211-0/+13
| | | | | | | Fix #6318, backport #21519 Co-authored-by: zeripath <art27@cantab.net> Co-authored-by: zeripath <art27@cantab.net>
* Display total commit count in hook message (#21400) (#21481)KN4CK3R2022-10-172-27/+30
| | | | | | Backport of #21400 Co-authored-by: wxiaoguang <wxiaoguang@gmail.com> Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
* improve code quality (#21464) (#21463)65432022-10-156-27/+64
| | | | | Backport #21464 and #21465 Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
* Stop logging CheckPath returns error: context canceled (#21064) (#21405)zeripath2022-10-111-2/+2
| | | | | | | | | | | | | Backport #21064 We should only log CheckPath errors if they are not simply due to context cancellation - and we should add a little more context to the error message. Fix #20709 Signed-off-by: Andrew Thornton <art27@cantab.net> Signed-off-by: Andrew Thornton <art27@cantab.net>
* Tag list should include draft releases with existing tags (#21263) (#21365)Jason Song2022-10-071-1/+3
| | | | | | | Backport #21263. Before, a tag for a draft release disappeared in the tag list, fix #21262. Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
* Fix missing m.Run() in TestMain (#21341)wxiaoguang2022-10-052-1/+5
| | | Backport #21340, add the missing m.Run()
* Fix empty container layer history and UI (#21251) (#21278)KN4CK3R2022-09-271-1/+3
| | | Backport of #21251
* Use en-US as fallback when using other default language (#21200) (#21256)wxiaoguang2022-09-253-8/+34
| | | | | | Only en-US has complete translations. When use other language as default, the en-US should still be used as fallback. Backport #21200, Close #21199
* Respect `REQUIRE_SIGNIN_VIEW` for packages (#20873) (#21232)KN4CK3R2022-09-231-33/+49
| | | | | | | | | Backport of #20873 When REQUIRE_SIGNIN_VIEW = true, even with public repositories, you can only see them after you login. The packages should not be accessed without login. Co-authored-by: Lauris BH <lauris@nix.lv> Co-authored-by: wxiaoguang <wxiaoguang@gmail.com> Co-authored-by: techknowlogick <techknowlogick@gitea.io>
* Use Go 1.19 fmt for Gitea 1.17, sync emoji data (#21239)wxiaoguang2022-09-2213-509/+553
| | | | | | | The images used by Gitea's drone pipeline were upgraded to Go 1.19.x It causes the lint fails because Go 1.19 uses new code format. This PR partially backport #20758 (including the emoji-data sync), partially fix the format manually.
* Treat git object mode 40755 as directory (#21195) (#21218)wxiaoguang2022-09-201-2/+2
| | | | | | | | Backport #21195 Git uses 040000 for tree object, but some users may get 040755 for unknown reasons, fix #21190 Co-authored-by: techknowlogick <techknowlogick@gitea.io>
* Add MD5 back to template helper functions to avoid breaking (#21102)wxiaoguang2022-09-071-0/+1
| | | | | | In #20932 the MD5 helper function was removed from template context, it breaks user's customized templates. This PR adds the MD5 helper function back.
* Fix hard-coded timeout and error panic in API archive download endpoint ↵zeripath2022-09-061-0/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | (#20925) (#21051) Backport #20925 This commit updates the `GET /api/v1/repos/{owner}/{repo}/archive/{archive}` endpoint which prior to this PR had a couple of issues. 1. The endpoint had a hard-coded 20s timeout for the archiver to complete after which a 500 (Internal Server Error) was returned to client. For a scripted API client there was no clear way of telling that the operation timed out and that it should retry. 2. Whenever the timeout _did occur_, the code used to panic. This was caused by the API endpoint "delegating" to the same call path as the web, which uses a slightly different way of reporting errors (HTML rather than JSON for example). More specifically, `api/v1/repo/file.go#GetArchive` just called through to `web/repo/repo.go#Download`, which expects the `Context` to have a `Render` field set, but which is `nil` for API calls. Hence, a `nil` pointer error. The code addresses (1) by dropping the hard-coded timeout. Instead, any timeout/cancelation on the incoming `Context` is used. The code addresses (2) by updating the API endpoint to use a separate call path for the API-triggered archive download. This avoids producing HTML-errors on errors (it now produces JSON errors). Signed-off-by: Peter Gardfjäll <peter.gardfjall.work@gmail.com> Signed-off-by: Peter Gardfjäll <peter.gardfjall.work@gmail.com> Signed-off-by: Andrew Thornton <art27@cantab.net> Co-authored-by: Peter Gardfjäll <peter.gardfjall.work@gmail.com> Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
* Set uploadpack.allowFilter etc on gitea serv to enable partial clones with ↵zeripath2022-09-041-1/+14
| | | | | | | | | | | | | | | ssh (#20902) (#21058) Backport #20902 When setting.Git.DisablePartialClone is set to false then the web server will add filter support to web http. It does this by using`-c` command arguments but this will not work on gitea serv as the upload-pack and receive-pack commands do not support this. Instead we move these options into the .gitconfig instead. Fix #20400 Signed-off-by: Andrew Thornton <art27@cantab.net> Signed-off-by: Andrew Thornton <art27@cantab.net>
* Fix 500 on time in timeline API (#21052) (#21057)qwerty2872022-09-041-0/+6
| | | | | | | | Backport #21052 Before converting a TrackedTime for the API we need to load its attributes - otherwise we get an NPE. Fix #21041
* fix broken insecureskipverify handling in rediss connection uris (#20967) ↵zeripath2022-09-042-2/+20
| | | | | | | | | | | (#21053) Backport #20967 Currently, it's impossible to connect to self-signed TLS encrypted redis instances. The problem lies in inproper error handling, when building redis tls options - only invalid booleans are allowed to be used in `tlsConfig` builder. The problem is, when `strconv.ParseBool(...)` returns error, it always defaults to false - meaning it's impossible to set `tlsOptions.InsecureSkipVerify` to true. Fixes #19213 Co-authored-by: Igor Rzegocki <ajgon@users.noreply.github.com>
* Add more checks in migration code (#21011) (#21050)zeripath2022-09-047-43/+48
| | | | | | | | | | | Backport #21011 When migrating add several more important sanity checks: * SHAs must be SHAs * Refs must be valid Refs * URLs must be reasonable Signed-off-by: Andrew Thornton <art27@cantab.net>
* Fix download archiver of a commit (#20962) (#20971)Lunny Xiao2022-08-281-0/+1
|
* Enable contenthash in filename for dynamic assets (#20813) (#20932)silverwind2022-08-252-1/+6
| | | | | | | This should solve the main problem of dynamic assets getting stale after a version upgrade. Everything not affected will use query-string based cache busting, which includes files loaded via HTML or worker scripts.
* Disable doctor logging on panic (#20847) (#20898)zeripath2022-08-241-3/+3
| | | | | | | | | | | | Backport #20847 If permissions are incorrect for writing to the doctor log simply disable the log file instead of panicing. Related #20570 Signed-off-by: Andrew Thornton <art27@cantab.net> Co-authored-by: delvh <dev.lh@web.de>
* Set no-tags in git fetch on compare (#20893) (#20936)zeripath2022-08-231-1/+1
| | | | | | | | | | | | | | | Backport #20893 In the compare endpoint the git fetch is restricted to a certain branch however, this does not completely prevent tag acquisition/pollution as git fetch will collect any tags on that branch. This causes pollution of the tag namespace and could cause confusion by users. This PR adds `--no-tags` to the `git fetch` call. Signed-off-by: Andrew Thornton <art27@cantab.net> Signed-off-by: Andrew Thornton <art27@cantab.net>
* Don't open new page for ext wiki on same repository (#20725) (#20910)Gusted2022-08-221-0/+1
| | | | | | | | | | | | | * Don't open new page for ext wiki on same repository (#20725) - Backport of #20725 - When the external wiki has been set to a file on the repository, don't open the page on a tab. - Resolves #20657 * Gofmt * Fix line Co-authored-by: zeripath <art27@cantab.net>
* Fix push mirror address backend get error Address cause setting page display ↵zeripath2022-08-221-2/+2
| | | | error (#20593) (#20901)
* Ensure that graceful start-up is informed of unused SSH listener (#20877)JonRB2022-08-212-2/+3
| | | | | | | | | | | | | The graceful manager waits for 4 listeners to be created or to be told that they are not needed. If it is not told about them it will indefinitely and timeout. This leads to SVC hosts not being told of being in the readyState but on Unix would lead to the termination of the process. There was an unfortunate regression in #20299 which missed this subtly and in the case whereby SSH is disabled the `builtinUnused()` is not called. This PR adds a call to `builtinUnused()` when not using the builtin ssh to allow `createServerWaitGroup.Done()` to be called. In addition it was noted that the if/else clauses for timeout informing of the SVC host were in the wrong order. These have been swapped. Fix #20609
* Add migrate repo archiver and packages storage support on command line ↵Lunny Xiao2022-08-181-5/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | (#20757) (#20806) * Add migrate repo archiver and packages storage support on command line (#20757) * Add migrate repo archiver and packages storage support on command line * Fix typo * Use stdCtx * Use packageblob and fix command description * Add migrate packages unit tests * Fix comment year * Fix the migrate storage command line description * Update cmd/migrate_storage.go Co-authored-by: zeripath <art27@cantab.net> * Update cmd/migrate_storage.go Co-authored-by: zeripath <art27@cantab.net> * Update cmd/migrate_storage.go Co-authored-by: zeripath <art27@cantab.net> * Fix test Co-authored-by: 6543 <6543@obermui.de> Co-authored-by: zeripath <art27@cantab.net> * bug fix Co-authored-by: 6543 <6543@obermui.de> Co-authored-by: zeripath <art27@cantab.net>
* Executable check always returns true for windows (#20637) (#20835)zeripath2022-08-171-0/+5
| | | | | | | | | | Backport #20637 Windows doesn't have the concept of "executable" POSIX bits so for now always return true to minimise doctor and logging noise. Addresses #20636 Co-authored-by: silverwind <me@silverwind.io> Co-authored-by: JonRB <4564448+eeyrjmr@users.noreply.github.com> Co-authored-by: silverwind <me@silverwind.io>
* fix merge (#20819)Lunny Xiao2022-08-171-0/+5
|
* Fix git.Init for doctor sub-command (#20782) (#20783)wxiaoguang2022-08-141-1/+6
|
* Add disable download source configuration (#20548) (#20579)Lunny Xiao2022-08-123-5/+7
| | | | | | | | | | | | | | * Add disable download source configuration (#20548) Add configuration to enable/disable download source from UI. Co-authored-by: zeripath <art27@cantab.net> * Fix BaseVars not used in renderering * Fix disabled open in vscode menu when disabling download source from UI Co-authored-by: zeripath <art27@cantab.net> Co-authored-by: Lauris BH <lauris@nix.lv>
* Fix SecToTime edge-cases (#20610) (#20611)Gusted2022-08-082-10/+37
|
* Use request timeout for git service rpc (#20689) (#20693)parnic2022-08-071-8/+17
| | | | | | | This enables git.Command's Run to optionally use the given context directly so its deadline will be respected. Otherwise, it falls back to the previous behavior of using the supplied timeout or a default timeout value of 360 seconds. repo's serviceRPC() calls now use the context's deadline (which is unset/unlimited) instead of the default 6-minute timeout. This means that large repo clones will no longer arbitrarily time out on the upload-pack step, and pushes can take longer than 6 minutes on the receive-pack step. Fixes #20680
* Add username check to doctor (#20140) (#20671)John Olheiser2022-08-041-0/+30
| | | | | | | | | | | | | | | * Add username check to doctor - Add a new breaking change detector to Gitea's doctor, which checks if all users still have a valid username according to Gitea. Given from time-to-time we need to make changes, either due to new routes or due to security, it's for a instance's admin to check if all users still have a valid username. * Fix extra argument * Apply suggestions from code review * Apply suggestions from code review
* Fix package upload for files >32mb (#20622) (#20635)KN4CK3R2022-08-033-5/+98
| | | | | | | | * Rewind file before first read. * Added tests. Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com> Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
* Adjust line detection in highlight.go (#20612)wxiaoguang2022-08-032-49/+68
| | | | | | | | | | | | The code for detection of lines in highlight.go is somewhat too complex and doesn't take account of how Chroma is actually splitting things into lines for us. Remove both the .line and .cl classes from Chroma's HTML which made the old conditional work again. This fixed Copy of YAML files while also reducing the amount of rendered HTML nodes. Co-authored-by: zeripath <art27@cantab.net> Co-authored-by: Lauris BH <lauris@nix.lv>