aboutsummaryrefslogtreecommitdiffstats
path: root/routers/api/packages
Commit message (Collapse)AuthorAgeFilesLines
* Improve NuGet API Parity (#21291) (#34940)Scion3 days1-41/+101
| | | | | | | | | | Fixes #21291, allowing icons and other missing attributes to appear for NuGet packages from inside Visual Studio like they do with GitHub Nuget packages. Adds additional NuGet package information, particularly `IconURL`, to bring the Gitea NuGet API more in-line with GitHub's NuGet API. ref: https://learn.microsoft.com/en-us/nuget/api/search-query-service-resource
* Refactor some trivial problems (#34959)wxiaoguang4 days1-1/+1
| | | | | | | 1. make our "route group pattern match" also update chi's RoutePattern 2. fix incorrect "NotFound" call in conda package 3. make ".flex-item .flex-item-main" has a general gap, then no need to use `tw` tricks 4. improve the "test webhook" UI
* Fix: RPM package download routing & missing package version count (#34909)Exploding Dragon9 days1-0/+2
| | | | | | | | | * Fix RPM package download routing * Fix missing package version count --------- Signed-off-by: Exploding Dragon <explodingfkl@gmail.com> Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
* Refactor container package (#34877)wxiaoguang11 days4-138/+76
| | | Use standard db.WithTx and introduce db.WithTx2
* enforce explanation for necessary nolints and fix bugs (#34883)TheFox0x712 days2-2/+2
| | | | | | | Follows up https://github.com/go-gitea/gitea/pull/34851 --------- Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
* Refactor packages (#34777)wxiaoguang2025-06-225-202/+74
|
* Fix container range bug (#34795)wxiaoguang2025-06-211-1/+3
| | | Fix #34792 and add new tests
* Fix OCI manifest parser (#34797)wxiaoguang2025-06-212-18/+8
| | | Do not parse the media type we don't know.
* Refactor packages (func name & UI) (#34773)wxiaoguang2025-06-1822-28/+28
| | | | | | 1. Use `OpenXxx` instead of `GetXxx` because the returned readers should be correctly closed, and clarify the behaviors of the functions: they increase the download counter 2. Use `packages-content` styles instead of `issue-content`
* Fix some package registry problems (#34759)wxiaoguang2025-06-191-33/+9
| | | | 1. Fix #33787 2. Fix container image display
* Run `gopls modernize` on codebase (#34751)silverwind2025-06-182-8/+2
| | | | Recent modernize fixes: https://github.com/golang/tools/commits/master/gopls/internal/analysis/modernize
* Improve nuget/rubygems package registries (#34741)wxiaoguang2025-06-175-29/+116
| | | | | | | | 1. Add some missing (optional) fields for nuget v2, and sort the fields to make it easier to maintain 2. Add missing "platform" for rubygems: `VERSION-PLATFORM` and `VERSION_PLATFORM` Co-authored-by: Giteabot <teabot@gitea.io>
* Refactor container and UI (#34736)wxiaoguang2025-06-164-72/+110
|
* Fix container range bug (#34725)wxiaoguang2025-06-151-8/+15
| | | Fix #34724
* Fix "oras" OCI client compatibility (#34666)wxiaoguang2025-06-091-7/+8
| | | | | | Fix #25846 1. the ImageConfig can be empty, fall back to default 2. the blob size can be empty, it still needs "Content-Length" header
* Ignore "Close" error when uploading container blob (#34620)wxiaoguang2025-06-091-11/+5
|
* Fix some trivial problems (#34579)wxiaoguang2025-06-021-1/+1
|
* Fix some trivial problems (#34237)wxiaoguang2025-04-181-1/+1
| | | | | | | 1. Using existing "content" variable in `swift.go` 2. Do not report 500 server error in `GetPullDiffStats` middleware, otherwise a PR missing ref won't be able to view. 3. Fix the abused "label button" when listing commits, there was too much padding space, see the screenshot below.
* Swift files can be passed either as file or as form value (#34068)Wolfgang Reithmeier2025-04-181-8/+28
| | | | | | | Fix #33990 --------- Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
* Enable addtional linters (#34085)TheFox0x72025-04-015-10/+11
| | | | | | | | enable mirror, usestdlibbars and perfsprint part of: https://github.com/go-gitea/gitea/issues/34083 --------- Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
* Add a config option to block "expensive" pages for anonymous users (#34024)wxiaoguang2025-03-302-3/+3
| | | | | | | | | | | Fix #33966 ``` ;; User must sign in to view anything. ;; It could be set to "expensive" to block anonymous users accessing some pages which consume a lot of resources, ;; for example: block anonymous AI crawlers from accessing repo code pages. ;; The "expensive" mode is experimental and subject to change. ;REQUIRE_SIGNIN_VIEW = false ```
* enable staticcheck QFxxxx rules (#34064)TheFox0x72025-03-291-6/+8
|
* Fix maven panic when no package exists (#33888)wxiaoguang2025-03-141-0/+5
| | | | | | Fix #33886 Restore the old logic from #16510, which was incorrectly removed by #33678
* Add composor source field (#33502)Lunny Xiao2025-02-281-2/+20
| | | Fix #33066
* Fix for Maven Package Naming Convention Handling (#33678)Diana2025-02-222-15/+11
| | | | | | | | Make legacy package names could be listed and add tests --------- Co-authored-by: diana.strebkova@t-systems.com <diana.strebkova@t-systems.com> Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
* Refactor error system (#33610)wxiaoguang2025-02-161-7/+7
|
* Make git clone URL could use current signed-in user (#33091)wxiaoguang2025-01-071-1/+1
| | | | | | | | | | | | | | close #33086 * Add a special value for "SSH_USER" setting: `(DOER_USERNAME)` * Improve parseRepositoryURL and add tests (now it doesn't have hard dependency on some setting values) Many changes are just adding "ctx" and "doer" argument to functions. By the way, improve app.example.ini, remove all `%(key)s` syntax, it only makes messy and no user really cares about it. Document: https://gitea.com/gitea/docs/pulls/138
* Refactor package (routes and error handling, npm peer dependency) (#33111)wxiaoguang2025-01-0621-214/+98
|
* Use `Project-URL` metadata field to get a PyPI package's homepage URL (#33089)Kemal Zebari2025-01-032-4/+53
| | | Resolves #33085.
* Refactor maven package registry (#33049)wxiaoguang2024-12-312-22/+56
| | | Close #33036
* Refactor arch route handlers (#32993)wxiaoguang2024-12-281-35/+4
|
* Fix maven pom inheritance (#32943)wxiaoguang2024-12-251-0/+2
| | | Fix #30568
* Refactor arch route handlers (#32972)wxiaoguang2024-12-251-16/+12
|
* Add standard-compliant route to serve outdated R packages (#32783)Sebastian T. T.2024-12-111-0/+1
| | | | | | | | | | | | | The R package repository currently does not have support for older versions of packages which should be stored in a separate /Archive router. This PR remedies that by adding a new path router. I am a member of a group that loves using Gitea and this bug has been annoying us for a long time. Hope it can be merged in time for Gitea 1.23.0. Any feedback much appreciated. Fixes #32782
* Add Arch package registry (#32692)KN4CK3R2024-12-042-0/+350
| | | | | | | | | | | | | | | | | | | | | | | Close #25037 Close #31037 This PR adds a Arch package registry usable with pacman. ![grafik](https://github.com/user-attachments/assets/81cdb0c2-02f9-4733-bee2-e48af6b45224) Rewrite of #25396 and #31037. You can follow [this tutorial](https://wiki.archlinux.org/title/Creating_packages) to build a package for testing. Docs PR: https://gitea.com/gitea/docs/pulls/111 Co-authored-by: [d1nch8g@ion.lc](mailto:d1nch8g@ion.lc) Co-authored-by: @ExplodingDragon --------- Co-authored-by: dancheg97 <dancheg97@fmnx.su> Co-authored-by: dragon <ExplodingFKL@gmail.com> Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
* Add Swift login endpoint (#32693)KN4CK3R2024-12-032-43/+59
| | | | | Fix #32683 This PR adds the login endpoint and fixes the documentation links.
* Fix `missing signature key` error when pulling Docker images with ↵Zettat1232024-10-312-2/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | `SERVE_DIRECT` enabled (#32365) Fix #28121 I did some tests and found that the `missing signature key` error is caused by an incorrect `Content-Type` header. Gitea correctly sets the `Content-Type` header when serving files. https://github.com/go-gitea/gitea/blob/348d1d0f322ca57c459acd902f54821d687ca804/routers/api/packages/container/container.go#L712-L717 However, when `SERVE_DIRECT` is enabled, the `Content-Type` header may be set to an incorrect value by the storage service. To fix this issue, we can use query parameters to override response header values. https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetObject.html <img width="600px" src="https://github.com/user-attachments/assets/f2ff90f0-f1df-46f9-9680-b8120222c555" /> In this PR, I introduced a new parameter to the `URL` method to support additional parameters. ``` URL(path, name string, reqParams url.Values) (*url.URL, error) ``` --- Most S3-like services support specifying the content type when storing objects. However, Gitea always use `application/octet-stream`. Therefore, I believe we also need to improve the `Save` method to support storing objects with the correct content type. https://github.com/go-gitea/gitea/blob/b7fb20e73e63b8edc9b90c52073e248bef428fcc/modules/storage/minio.go#L214-L221
* Use per package global lock for container uploads instead of memory lock ↵Lunny Xiao2024-10-111-8/+18
| | | | | | (#31860) This PR uses a per-package lock instead of a global lock for container uploads. So that different packages can be uploaded simultaneously.
* Fix bug when a token is given public only (#32204)Lunny Xiao2024-10-081-0/+14
|
* Fix wrong last modify time (#32102)Lunny Xiao2024-09-211-1/+3
|
* Fix upload maven pacakge parallelly (#31851)Lunny Xiao2024-09-211-0/+13
| | | | | | | Use globallock for maven package uploads. Thanks @tlusser for the test code. Depends on ~#31813~
* Fix nuget/conan/container packages upload bugs (#31967)Lunny Xiao2024-09-055-10/+66
|
* Fix RPM resource leak (#31794)KN4CK3R2024-08-081-4/+5
| | | | | | | Fixes a resource leak introduced by #27069. - add defer - move sign code out of `repository.go`
* Add signature support for the RPM module (#27069)Exploding Dragon2024-08-061-1/+15
| | | | | | | | close #27031 If the rpm package does not contain a matching gpg signature, the installation will fail. See (#27031) , now auto-signing rpm uploads. This option is turned off by default for compatibility.
* Refactor names (#31405)wxiaoguang2024-06-1922-210/+210
| | | | | | | This PR only does "renaming": * `Route` should be `Router` (and chi router is also called "router") * `Params` should be `PathParam` (to distingush it from URL query param, and to match `FormString`) * Use lower case for private functions to avoid exposing or abusing
* Improve rubygems package registry (#31357)wxiaoguang2024-06-172-6/+134
| | | | | | | To make it work with Bundler: https://guides.rubygems.org/rubygems-org-compact-index-api/ It only adds 2 new API endpoints and improves some tests, existing logic is not changed.
* Fix duplicate sub-path for avatars (#31365)wxiaoguang2024-06-151-1/+1
| | | | | | | | | | | Fix #31361, and add tests And this PR introduces an undocumented & debug-purpose-only config option: `USE_SUB_URL_PATH`. It does nothing for end users, it only helps the development of sub-path related problems. And also fix #31366 Co-authored-by: @ExplodingDragon
* Enable `unparam` linter (#31277)silverwind2024-06-112-2/+2
| | | | | | | | | | | | Enable [unparam](https://github.com/mvdan/unparam) linter. Often I could not tell the intention why param is unused, so I put `//nolint` for those cases like webhook request creation functions never using `ctx`. --------- Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com> Co-authored-by: delvh <dev.lh@web.de>
* Remove sub-path from container registry realm (#31293)wxiaoguang2024-06-091-3/+3
| | | | Container registry requires that the "/v2" must be in the root, so the sub-path in AppURL should be removed
* Fix NuGet Package API for $filter with Id equality (#31188)Thomas Desveaux2024-06-041-19/+29
| | | | | | | | | | | | | | | | 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. --------- Co-authored-by: KN4CK3R <admin@oldschoolhack.me>