summaryrefslogtreecommitdiffstats
path: root/routers
Commit message (Collapse)AuthorAgeFilesLines
* Fix rendered wiki page link (#31398) (#31407)wxiaoguang2024-06-193-7/+7
| | | | | Backport #31398 Fix #31395
* Fix missing images in editor preview due to wrong links (#31299) (#31393)wxiaoguang2024-06-172-69/+92
| | | | | | | | | | | | Backport #31299 Parse base path and tree path so that media links can be correctly created with /media/. Resolves #31294 --------- Co-authored-by: Brecht Van Lommel <brecht@blender.org>
* Allow downloading attachments of draft releases (#31369) (#31380)Giteabot2024-06-161-2/+3
| | | | | | | Backport #31369 by Zettat123 Fix #31362 Co-authored-by: Zettat123 <zettat123@gmail.com>
* Fix duplicate sub-path for avatars (#31365) (#31368)wxiaoguang2024-06-151-1/+1
| | | Backport #31365, only backport necessary changes.
* Reduce memory usage for chunked artifact uploads to MinIO (#31325) (#31338)Giteabot2024-06-121-2/+2
| | | | | | | | | | | | | | | Backport #31325 by @bohde When using the MinIO storage driver for Actions Artifacts, we found that the chunked artifact required significantly more memory usage to both upload and merge than the local storage driver. This seems to be related to hardcoding a value of `-1` for the size to the MinIO client [which has a warning about memory usage in the respective docs](https://pkg.go.dev/github.com/minio/minio-go/v7#Client.PutObject). Specifying the size in both the upload and merge case reduces memory usage of the MinIO client. Co-authored-by: Rowan Bohde <rowan.bohde@gmail.com> Co-authored-by: Kyle D <kdumontnu@gmail.com>
* Remove sub-path from container registry realm (#31293) (#31300)Giteabot2024-06-102-4/+10
| | | | | Backport #31293 by wxiaoguang Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
* Fix Activity Page Contributors dropdown (#31264) (#31269)Giteabot2024-06-061-6/+0
| | | | | | | Backport #31264 by wxiaoguang Fix #31261 Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
* Fix NuGet Package API for $filter with Id equality (#31188) (#31242)Thomas Desveaux2024-06-041-19/+29
| | | | | | | | | | | | | | | | | | | | | | Backport #31188 Fixes issue when running `choco info pkgname` where `pkgname` is also a substring of another package Id. Relates to #31168 --- This might fix the issue linked, but I'd like to test it with more choco commands before closing the issue in case I find other problems if that's ok. I'm pretty inexperienced with Go, so feel free to nitpick things. Not sure I handled [this](https://github.com/tdesveaux/gitea/blob/70f87e11b5caf1ee441ae71c7eba1831f45897d4/routers/api/packages/nuget/nuget.go#L135-L137) in the best way, so looking for feedback on if I should fix the underlying issue (`nil` might be a better default for `Value`?). Co-authored-by: KN4CK3R <admin@oldschoolhack.me>
* Fix agit checkout command line hint & fix ShowMergeInstructions checking ↵Giteabot2024-06-031-7/+8
| | | | | | | | | | | | | | | | | (#31219) (#31222) Backport #31219 by @lunny Fix #31135 Before <img width="527" alt="图片" src="https://github.com/go-gitea/gitea/assets/81045/60c07b55-3db2-4a9a-98f1-0eb72d149df2"> After <img width="664" alt="图片" src="https://github.com/go-gitea/gitea/assets/81045/0670ff5d-9e0b-47ac-aba4-9db9131de3b3"> Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
* Ignore FindRecentlyPushedNewBranches err (#31164) (#31171)wxiaoguang2024-05-301-2/+1
| | | Backport #31164
* Fix markup preview (#31158) (#31166)Giteabot2024-05-301-2/+3
| | | | | | | | | | | | Backport #31158 by @wxiaoguang Fix #31157 After: ![image](https://github.com/go-gitea/gitea/assets/2114189/4d918cce-cd0d-4601-9c81-4b32df1b0b38) Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
* Add an immutable tarball link to archive download headers for Nix (#31139) ↵Giteabot2024-05-292-0/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | (#31145) Backport #31139 by @Mic92 This allows `nix flake metadata` and nix in general to lock a *branch* tarball link in a manner that causes it to fetch the correct commit even if the branch is updated with a newer version. For further context, Nix flakes are a feature that, among other things, allows for "inputs" that are "github:someuser/somerepo", "https://some-tarball-service/some-tarball.tar.gz", "sourcehut:~meow/nya" or similar. This feature allows our users to fetch tarballs of git-based inputs to their builds rather than using git to fetch them, saving significant download time. There is presently no gitea or forgejo specific fetcher in Nix, and we don't particularly wish to have one. Ideally (as a developer on a Nix implementation myself) we could just use the generic tarball fetcher and not add specific forgejo support, but to do so, we need additional metadata to know which commit a given *branch* tarball represents, which is the purpose of the Link header added here. The result of this patch is that a Nix user can specify `inputs.something.url = "https://forgejo-host/some/project/archive/main.tar.gz"` in flake.nix and get a link to some concrete tarball for the actual commit in the lock file, then when they run `nix flake update` in the future, they will get the latest commit in that branch. Example of it working locally: » nix flake metadata --refresh 'http://localhost:3000/api/v1/repos/jade/cats/archive/main.tar.gz?dir=configs/nix' Resolved URL: http://localhost:3000/api/v1/repos/jade/cats/archive/main.tar.gz?dir=configs/nix Locked URL: http://localhost:3000/api/v1/repos/jade/cats/archive/804ede182b6b66469b23ea4d21eece52766b7a06.tar.gz?dir=configs /nix&narHash=sha256-yP7KkDVfuixZzs0fsqhSETXFC0y8m6nmPLw2GrAMxKQ%3D Description: Computers with the nixos Path: /nix/store/s856c6yqghyan4v0zy6jj19ksv0q22nx-source Revision: 804ede182b6b66469b23ea4d21eece52766b7a06 Last modified: 2024-05-02 00:48:32 For details on the header value, see: https://github.com/nixos/nix/blob/56763ff918eb308db23080e560ed2ea3e00c80a7/doc/manual/src/protocols/tarball-fetcher.md Co-authored-by: Jörg Thalheim <Mic92@users.noreply.github.com> Co-authored-by: Jade Lovelace <software@lfcode.ca> Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
* Add missed return after `ctx.ServerError` (#31130) (#31133)Giteabot2024-05-285-0/+5
| | | | | Backport #31130 by @lunny Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
* Fix possible ui 500 if workflow's job is nil (#31092) (#31098)Giteabot2024-05-271-0/+8
| | | | | | | Backport #31092 by @lunny Fix #31087 Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
* Fix `View File` button link if branch deleted on pull request files pages ↵Giteabot2024-05-261-1/+1
| | | | (#31063) (#31077)
* Fix wrong display of recently pushed notification (#25812) (#31043)yp053272024-05-231-7/+19
| | | | | | | | | | | Backport #25812 ~~ps: removed some new codes in `tests/integration/pull_merge_test.go`~~ --------- Co-authored-by: silverwind <me@silverwind.io> Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com> Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
* use existing oauth grant for public client (#31015) (#31042)Giteabot2024-05-211-2/+17
| | | | | | | | | | | Backport #31015 by @denyskon Do not try to create a new authorization grant when one exists already, thus preventing a DB-related authorization issue. Fix https://github.com/go-gitea/gitea/pull/30790#issuecomment-2118812426 Co-authored-by: Denys Konovalov <kontakt@denyskon.de> Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
* Refactor sha1 and time-limited code (#31023) (#31030)Giteabot2024-05-211-1/+1
| | | | | Backport #31023 by wxiaoguang Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
* Return `access_denied` error when an OAuth2 request is denied (#30974) (#31029)Giteabot2024-05-201-0/+10
| | | | | | Backport #30974 by Zettat123 Co-authored-by: Zettat123 <zettat123@gmail.com> Co-authored-by: KN4CK3R <admin@oldschoolhack.me>
* Fix bug on avatar (#31008) (#31019)Giteabot2024-05-202-0/+4
| | | | | | | | Backport #31008 by @lunny Extract from #30995 Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com> Co-authored-by: silverwind <me@silverwind.io>
* Fix "force private" logic (#31012) (#31021)Giteabot2024-05-203-4/+4
| | | | | Backport #31012 by wxiaoguang Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
* Improve reverse proxy documents and clarify the AppURL guessing behavior ↵Giteabot2024-05-192-1/+3
| | | | | | | | | | | | | | | (#31003) (#31020) Backport #31003 by wxiaoguang Fix #31002 1. Mention Make sure `Host` and `X-Fowarded-Proto` headers are correctly passed to Gitea 2. Clarify the basic requirements and move the "general configuration" to the top 3. Add a comment for the "container registry" 4. Use 1.21 behavior if the reverse proxy is not correctly configured Co-authored-by: wxiaoguang <wxiaoguang@gmail.com> Co-authored-by: KN4CK3R <admin@oldschoolhack.me>
* Simplify mirror repository API logic (#30963) (#31009)Giteabot2024-05-181-9/+3
| | | | | | | Backport #30963 by wxiaoguang Fix #30921 Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
* Always load or generate oauth2 jwt secret (#30942) (#30978)Giteabot2024-05-141-0/+11
| | | | | | | Backport #30942 by @wxiaoguang Fix #30923 Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
* Protected tag is no internal server error (#30962) (#30970)Giteabot2024-05-143-8/+17
| | | | | | | | | | Backport #30962 by @KN4CK3R Fixes #30959 Adds an API test for protected tags. Fix existing tag in combination with fixtures. Co-authored-by: KN4CK3R <admin@oldschoolhack.me>
* Support using label names when changing issue labels (#30943) (#30958)Giteabot2024-05-131-1/+28
| | | | | | | | | | | | | | | | Backport #30943 by @Zettat123 Resolve #30917 Make the APIs for adding labels and replacing labels support both label IDs and label names so the [`actions/labeler`](https://github.com/actions/labeler) action can work in Gitea. <img width="600px" src="https://github.com/go-gitea/gitea/assets/15528715/7835c771-f637-4c57-9ce5-e4fbf56fa0d3" /> Co-authored-by: Zettat123 <zettat123@gmail.com>
* Move reverproxyauth before session so the header will not be ignored even if ↵Giteabot2024-05-121-6/+6
| | | | | | | | | | user has login (#27821) (#30948) Backport #27821 by @lunny When a user logout and then login another user, the reverseproxy auth should be checked before session otherwise the old user is still login. Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
* Check if reverse proxy is correctly configured (#30890) (#30935)Giteabot2024-05-103-0/+37
| | | | | | | | | Backport #30890 by wxiaoguang Follow #27011 Follow #30885 Co-authored-by: wxiaoguang <wxiaoguang@gmail.com> Co-authored-by: silverwind <me@silverwind.io>
* Remove deprecated stuff for runners (#30930) (#30931)Giteabot2024-05-102-19/+0
| | | | | | | | | | | | Backport #30930 by @wolfogre It's time (maybe somewhat late) to remove some deprecated stuff for the runner. - `x-runner-version`: runners needn't to report version in every request, they will call `Declare`. - `AgentLabels`: runners will report them as `Labels`. Co-authored-by: Jason Song <i@wolfogre.com>
* Fix misspelling of mergable (#30896) (#30905)Giteabot2024-05-082-4/+4
| | | | | | | | Backport #30896 by @yp05327 https://github.com/go-gitea/gitea/pull/25812#issuecomment-2099833692 Follow #30573 Co-authored-by: yp05327 <576951401@qq.com>
* Fix various problems around projects board view (#30696) (#30902)Giteabot2024-05-085-83/+68
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Backport #30696 by @lunny # The problem The previous implementation will start multiple POST requests from the frontend when moving a column and another bug is moving the default column will never be remembered in fact. # What's changed - [x] This PR will allow the default column to move to a non-first position - [x] And it also uses one request instead of multiple requests when moving the columns - [x] Use a star instead of a pin as the icon for setting the default column action - [x] Inserted new column will be append to the end - [x] Fix #30701 the newly added issue will be append to the end of the default column - [x] Fix when deleting a column, all issues in it will be displayed from UI but database records exist. - [x] Add a limitation for columns in a project to 20. So the sorting will not be overflow because it's int8. Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com> Co-authored-by: silverwind <me@silverwind.io> Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
* Fix wrong transfer hint (#30889) (#30900)Giteabot2024-05-081-2/+8
| | | | | | | Backport #30889 by @lunny Fix #30187 Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
* Move database operations of merging a pull request to post receive hook and ↵Giteabot2024-05-082-1/+112
| | | | | | | | | | | | | | | | | | | | | add a transaction (#30805) (#30888) Backport #30805 by @lunny Merging PR may fail because of various problems. The pull request may have a dirty state because there is no transaction when merging a pull request. ref https://github.com/go-gitea/gitea/pull/25741#issuecomment-2074126393 This PR moves all database update operations to post-receive handler for merging a pull request and having a database transaction. That means if database operations fail, then the git merging will fail, the git client will get a fail result. There are already many tests for pull request merging, so we don't need to add a new one. Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com> Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
* Refactor AppURL usage (#30885) (#30891)wxiaoguang2024-05-086-12/+18
| | | | | | | Backport #30885 Fix #30883 Fix #29591 Co-authored-by: KN4CK3R <admin@oldschoolhack.me>
* Repository explore alphabetically order respect owner name (#30882)65432024-05-071-2/+2
| | | | | similar to #30784 but only for the repo explore page is covered by #30876 for the main branch
* Make sure git version&feature are always prepared (#30877) (#30879)wxiaoguang2024-05-078-8/+12
| | | Backport #30877
* Fix no edit history after editing issue's title and content (#30814) (#30845)Giteabot2024-05-032-40/+33
| | | | | | | | | Backport #30814 by @yp05327 Fix #30807 reuse functions in services Co-authored-by: yp05327 <576951401@qq.com>
* Improve grep search (#30843) (#30850)Giteabot2024-05-032-1/+36
| | | | | | | | Backport #30843 by wxiaoguang Reduce the context line number to 1, make "git grep" search respect the include/exclude patter, and fix #30785 Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
* Don't only list code-enabled repositories when using repository API (#30817) ↵Giteabot2024-05-031-3/+1
| | | | | | | | | | | (#30848) Backport #30817 by kemzeb We should be listing all repositories by default. Fixes #28483. Co-authored-by: Kemal Zebari <60799661+kemzeb@users.noreply.github.com>
* Ignore useless error message "broken pipe" (#30801) (#30842)Giteabot2024-05-031-3/+1
| | | | | | | Backport #30801 by wxiaoguang Fix #30792 Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
* Prevent automatic OAuth grants for public clients (#30790) (#30836)Giteabot2024-05-021-2/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Backport #30790 by archer-321 This commit forces the resource owner (user) to always approve OAuth 2.0 authorization requests if the client is public (e.g. native applications). As detailed in [RFC 6749 Section 10.2](https://www.rfc-editor.org/rfc/rfc6749.html#section-10.2), > The authorization server SHOULD NOT process repeated authorization requests automatically (without active resource owner interaction) without authenticating the client or relying on other measures to ensure that the repeated request comes from the original client and not an impersonator. With the implementation prior to this patch, attackers with access to the redirect URI (e.g., the loopback interface for `git-credential-oauth`) can get access to the user account without any user interaction if they can redirect the user to the `/login/oauth/authorize` endpoint somehow (e.g., with `xdg-open` on Linux). Fixes #25061. Co-authored-by: Archer <archer@beezig.eu> Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
* Catch and handle unallowed file type errors in issue attachment API (#30791) ↵Giteabot2024-05-032-2/+17
| | | | | | | | | | | (#30834) Backport #30791 by kemzeb Before, we would just throw 500 if a user passes an attachment that is not an allowed type. This commit catches this error and throws a 422 instead since this should be considered a validation error. Co-authored-by: Kemal Zebari <60799661+kemzeb@users.noreply.github.com>
* Skip gzip for some well-known compressed file types (#30796) (#30813)Giteabot2024-05-021-1/+1
| | | | | | Backport #30796 by wxiaoguang Co-authored-by: wxiaoguang <wxiaoguang@gmail.com> Co-authored-by: silverwind <me@silverwind.io>
* Fix bleve fuzziness (#30799) (#30804)Giteabot2024-05-011-1/+1
| | | | | | | | Backport #30799 by wxiaoguang Fix #30797 Fix #30317 Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
* Fix issue label rendering in the issue popup (#30763) (#30773)Giteabot2024-04-301-1/+4
| | | | | Backport #30763 by wxiaoguang Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
* Rename CodeIndexerEnabled to IsRepoIndexerEnabled (#30762) (#30767)Giteabot2024-04-292-3/+3
| | | | | | | | | | Backport #30762 by @wxiaoguang Fix #30761 Most places use `IsRepoIndexerEnabled` but not `CodeIndexerEnabled`, so it should always use `IsRepoIndexerEnabled` for consistency. Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
* Fix all rounded borders, change affected tab menus to pills (#30707) (#30769)Giteabot2024-04-291-4/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Backport #30707 by @silverwind Fixes https://github.com/go-gitea/gitea/issues/30673, all 23 issues. Notes: - Tab bar menus had to change to pills because of unsolvable issue with the border-radius as tab bar renders a overlapping border onto the box below. And I think pills look better. - Added padding to code editor empty preview message - Hide monaco's built-in blue focus border, we don't need it and it never showed before either. - Label add menu is simplified, removing the nested segment. <img width="1322" alt="Screenshot 2024-04-25 at 22 26 19" src="https://github.com/go-gitea/gitea/assets/115237/7e394e0c-b7ad-417d-8e9f-12f1dea93ed1"> <img width="1326" alt="Screenshot 2024-04-25 at 22 28 00" src="https://github.com/go-gitea/gitea/assets/115237/66c8499f-aa9f-4d95-8cca-ef13dfa82c65"> <img width="997" alt="Screenshot 2024-04-25 at 22 36 53" src="https://github.com/go-gitea/gitea/assets/115237/07896102-c71d-4246-8173-c2bc2e1d3cae"> <img width="832" alt="Screenshot 2024-04-25 at 22 56 09" src="https://github.com/go-gitea/gitea/assets/115237/d83afc96-08ca-4adc-baf4-3d02804be57c"> <img width="361" alt="Screenshot 2024-04-25 at 22 57 12" src="https://github.com/go-gitea/gitea/assets/115237/c7371a68-00b5-47d8-84d0-ddc5268b2b2c"> Co-authored-by: silverwind <me@silverwind.io> Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
* Fix nil dereference on error (#30740) (#30746)wxiaoguang2024-04-292-4/+5
| | | | | Backport #30740 manually Co-authored-by: Chongyi Zheng <git@zcy.dev>
* Prevent allow/reject reviews on merged/closed PRs (#30686)Kemal Zebari2024-04-272-2/+13
| | | Resolves #30675.
* Update misspell to 0.5.1 and add `misspellings.csv` (#30573)silverwind2024-04-279-11/+11
| | | | | | Misspell 0.5.0 supports passing a csv file to extend the list of misspellings, so I added some common ones from the codebase. There is at least one typo in a API response so we need to decided whether to revert that and then likely remove the dict entry.