89d7929711
Fix package link setting can only list limited repositories ( #35394 )
...
Fix #24801
<img width="1123" height="503" alt="image"
src="https://github.com/user-attachments/assets/823f4214-e08a-4506-9018-057c50e7fc52 "
/>
---------
Co-authored-by: wxiaoguang <[email protected] >
Co-authored-by: Giteabot <[email protected] >
2025-09-11 01:50:17 +02:00
e1e4815a1c
Redirect to a presigned URL of HEAD for HEAD requests ( #35088 )
...
Resolves https://github.com/go-gitea/gitea/issues/35086 .
---------
Co-authored-by: wxiaoguang <[email protected] >
2025-07-16 11:22:45 +00:00
09bb19ad01
Fix: RPM package download routing & missing package version count ( #34909 )
...
* Fix RPM package download routing
* Fix missing package version count
---------
Signed-off-by: Exploding Dragon <[email protected] >
Co-authored-by: wxiaoguang <[email protected] >
2025-06-30 23:02:30 +08:00
wxiaoguang and GitHub
8efc4ca334
Refactor packages (func name & UI) ( #34773 )
...
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`
2025-06-18 19:04:24 +00:00
wxiaoguang and GitHub
a2ae7c69da
Fix some package registry problems ( #34759 )
...
1. Fix #33787
2. Fix container image display
2025-06-19 00:32:43 +08:00
silverwind and GitHub
1f35435b81
Run gopls modernize on codebase ( #34751 )
...
Recent modernize fixes:
https://github.com/golang/tools/commits/master/gopls/internal/analysis/modernize
2025-06-18 01:48:09 +00:00
c5e78fc7ad
Do not mutate incoming options to SearchRepositoryByName ( #34553 )
...
Similar to #34544 , this PR changes the `opts` argument in
`SearchRepositoryByName()` to be passed by value instead of by pointer,
as its mutations do not escape the function scope and are not used
elsewhere. This simplifies reasoning about the function and avoids
unnecessary pointer usage.
This insight emerged during an initial attempt to refactor
`RenderUserSearch()`, which currently intermixes multiple concerns.
---------
Co-authored-by: Philip Peterson <[email protected] >
2025-06-02 17:33:25 +00:00
4ddf94dee5
refactor organization menu ( #33928 )
...
Fix missing items in organization menu.
**Menu**
<details>
<summary>Show</summary>
Before:

After:

</details>
**Packages**
<details>
keep it consistent with the other pages.
<summary>Show</summary>
Before:

After:

</details>
---------
Co-authored-by: wxiaoguang <[email protected] >
2025-04-10 12:12:55 -07:00
wxiaoguang and GitHub
f35850f48e
Refactor error system ( #33610 )
2025-02-16 22:13:17 -08:00
wxiaoguang and GitHub
cd1b5488a3
Refactor pagination ( #33037 )
...
I am sure the simple approach should work, let's try it in 1.24
Follow #29834 and #29841
2024-12-30 01:57:38 +00:00
wxiaoguang and GitHub
2a828e2798
Clarify path param naming ( #32969 )
...
In history (from some legacy frameworks), both `:name` and `name` are
supported as path path name, `:name` is an alias to `name`.
To make code consistent, now we should only use `name` but not `:name`.
Also added panic check in related functions to make sure the name won't
be abused in case some downstreams still use them.
2024-12-24 13:47:45 +00:00
wxiaoguang and GitHub
a163c53a60
Refactor template & test related code ( #32938 )
...
Move some legacy code from "base" package to proper packages.
2024-12-22 15:33:19 +00:00
0c3c041c88
Add Arch package registry ( #32692 )
...
Close #25037
Close #31037
This PR adds a Arch package registry usable with pacman.

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: [[email protected] ](mailto:[email protected] )
Co-authored-by: @ExplodingDragon
---------
Co-authored-by: dancheg97 <[email protected] >
Co-authored-by: dragon <[email protected] >
Co-authored-by: wxiaoguang <[email protected] >
2024-12-04 23:09:07 +00:00
wxiaoguang and GitHub
43c7a2e7b1
Refactor names ( #31405 )
...
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
2024-06-19 06:32:45 +08:00
wxiaoguang and GitHub
6106a61eff
Remove sub-path from container registry realm ( #31293 )
...
Container registry requires that the "/v2" must be in the root, so the
sub-path in AppURL should be removed
2024-06-09 16:29:29 +08:00
48d4580dd5
Clarify permission "HasAccess" behavior ( #30585 )
...
Follow #30495
"HasAccess" behavior wasn't clear, to make it clear:
* Use a new name `HasAnyUnitAccess`, it will be easier to review related
code and permission problems.
* Separate everyone access mode to a separate field, then all calls to
HasAccess are reverted to old behavior before #30495 .
* Add new tests.
---------
Co-authored-by: Giteabot <[email protected] >
2024-04-20 03:15:04 +00:00
wxiaoguang and GitHub
a889381664
Remove AddParamIfExist(AddParam) ( #29841 )
...
Follow #29834
Remove AddParamIfExist, use "AddParamString" instead, it should clearly
know what is being added into the parameters.
2024-03-16 12:07:56 +00:00
wxiaoguang and GitHub
e0ea3811c4
Refactor AddParam to AddParamIfExist ( #29834 )
...
When read the code: `pager.AddParam(ctx, "search", "search")`, the
question always comes: What is it doing? Where is the value from? Why
"search" / "search" ?
Now it is clear: `pager.AddParamIfExist("search", ctx.Data["search"])`
2024-03-16 10:20:13 +01:00
wxiaoguang and GitHub
bf6502a8f7
Fix incorrect relative/absolute URL usages ( #29531 )
...
Add two "HTMLURL" methods for PackageDescriptor.
And rename "FullWebLink" to "VersionWebLink"
2024-03-02 17:38:38 +00:00
6543 and GitHub
a3f05d0d98
remove util.OptionalBool and related functions ( #29513 )
...
and migrate affected code
_last refactoring bits to replace **util.OptionalBool** with
**optional.Option[bool]**_
2024-03-02 16:42:31 +01:00
Lunny Xiao and GitHub
29f149bd9f
Move context from modules to services ( #29440 )
...
Since `modules/context` has to depend on `models` and many other
packages, it should be moved from `modules/context` to
`services/context` according to design principles. There is no logic
code change on this PR, only move packages.
- Move `code.gitea.io/gitea/modules/context` to
`code.gitea.io/gitea/services/context`
- Move `code.gitea.io/gitea/modules/contexttest` to
`code.gitea.io/gitea/services/contexttest` because of depending on
context
- Move `code.gitea.io/gitea/modules/upload` to
`code.gitea.io/gitea/services/context/upload` because of depending on
context
2024-02-27 08:12:22 +01:00
KN4CK3R and GitHub
461d8b53c2
Fix some RPM registry flaws ( #28782 )
...
Related #26984
(https://github.com/go-gitea/gitea/pull/26984#issuecomment-1889588912 )
Fix admin cleanup message.
Fix models `Get` not respecting default values.
Rebuild RPM repository files after cleanup.
Do not add RPM group to package version name.
Force stable sorting of Alpine/Debian/RPM repository data.
Fix missing deferred `Close`.
Add tests for multiple RPM groups.
Removed non-cached `ReplaceAllStringRegex`.
If there are multiple groups available, it's stated in the package
installation screen:

2024-01-19 11:37:10 +00:00
Lunny Xiao and GitHub
cddf245c12
Replace more db.DefaultContext ( #27628 )
...
Target #27065
2023-10-15 17:46:06 +02:00
Nanguan Lin and GitHub
7480aacdad
Fix 404 when there is an internal version of package ( #27615 )
...
close #27601
The Docker registry has an internal version, which leads to 404
2023-10-15 09:22:10 +00:00
7047df36d4
Another round of db.DefaultContext refactor ( #27103 )
...
Part of #27065
---------
Co-authored-by: KN4CK3R <[email protected] >
2023-09-25 13:17:37 +00:00
JakobDev and GitHub
958d148043
Show always repo count in header ( #26842 )
...
A few pages don't load the repo count of an user/org, so it is not shown
in the header. This happens mostly on org pages, but the package
settings applies to the user page as well.
Before:

After:

Seen on #26826
Regression of #25928
2023-09-06 08:49:36 +00:00
JakobDev and GitHub
f3fbb7c67d
Count only visible repos on profile ( #25928 )
...
Fixes #25914
2023-08-11 13:08:05 -04:00
2af30f715e
Fix inconsistent user profile layout across tabs ( #25625 )
...
Fix ::User Profile Page Project Tab Have Inconsistent Layout and Style
Added the big_avator for consistency in the all header_items tabs.
Fixes : #24871
> ### Description
> in the user profile page the `Packages` and `Projects` tab have small
icons for user but other tabs have bigger profile picture with user
info:
>
> ### Screenshots
> ### **For Packages And Projects:**
>

>
> ### **For Other Tabs:**
>

>
## Before

## After changes
Project View
<img width="1394" alt="image"
src="https://github.com/go-gitea/gitea/assets/80308335/95d181d7-8e61-496d-9899-7b825c91ad56 ">
Packages View
<img width="1378" alt="image"
src="https://github.com/go-gitea/gitea/assets/80308335/7f5fd60f-6b18-4fa8-8c56-7b0d45d1a610 ">
## Org view for projects page
<img width="1385" alt="image"
src="https://github.com/go-gitea/gitea/assets/80308335/6400dc89-a5ae-4f0a-831b-5b6efa020d89 ">
## Org view for packages page
<img width="1387" alt="image"
src="https://github.com/go-gitea/gitea/assets/80308335/4e1e9ffe-1e4b-4334-8657-de11b5fd31d0 ">
---------
Co-authored-by: wxiaoguang <[email protected] >
Co-authored-by: Giteabot <[email protected] >
Co-authored-by: silverwind <[email protected] >
2023-07-06 18:59:24 +00:00
KN4CK3R and GitHub
c890454769
Add direct serving of package content ( #25543 )
...
Fixes #24723
Direct serving of content aka HTTP redirect is not mentioned in any of
the package registry specs but lots of official registries do that so it
should be supported by the usual clients.
2023-07-03 15:33:28 +02:00
KN4CK3R and GitHub
cf2356062f
Redirect to package after version deletion ( #25594 )
...
Related #25559
Current behaviour:
1. Deletion of a package version
2. Redirect to the owners package list
New behaviour:
1. Deletion of a package version
2.1. If there are more versions available, redirect to the package again
2.2. If there are no versions available, redirect to the owners package
list
2023-06-29 17:01:14 +00:00
9173e079ae
Add Alpine package registry ( #23714 )
...
This PR adds an Alpine package registry. You can follow [this
tutorial](https://wiki.alpinelinux.org/wiki/Creating_an_Alpine_package )
to build a *.apk package for testing.
This functionality is similar to the Debian registry (#22854 ) and
therefore shares some methods. I marked this PR as blocked because it
should be merged after #22854 .

---------
Co-authored-by: techknowlogick <[email protected] >
Co-authored-by: silverwind <[email protected] >
Co-authored-by: Giteabot <[email protected] >
2023-05-12 17:27:50 +00:00
bf999e4069
Add Debian package registry ( #24426 )
...
Co-authored-by: @awkwardbunny
This PR adds a Debian package registry.
You can follow [this
tutorial](https://www.baeldung.com/linux/create-debian-package ) to build
a *.deb package for testing.
Source packages are not supported at the moment and I did not find
documentation of the architecture "all" and how these packages should be
treated.

Part of #20751 .
Revised copy of #22854 .
---------
Co-authored-by: Brian Hong <[email protected] >
Co-authored-by: techknowlogick <[email protected] >
Co-authored-by: Giteabot <[email protected] >
2023-05-02 12:31:35 -04:00
Yarden Shoham and GitHub
c0ddec8a2a
Revert "Add Debian package registry" ( #24412 )
...
Reverts go-gitea/gitea#22854
2023-04-28 18:06:41 -04:00
bf77e2163b
Add Debian package registry ( #22854 )
...
Co-authored-by: @awkwardbunny
This PR adds a Debian package registry. You can follow [this
tutorial](https://www.baeldung.com/linux/create-debian-package ) to build
a *.deb package for testing. Source packages are not supported at the
moment and I did not find documentation of the architecture "all" and
how these packages should be treated.
---------
Co-authored-by: Brian Hong <[email protected] >
Co-authored-by: techknowlogick <[email protected] >
2023-04-28 17:51:36 -04:00
e9288c2477
Fix improper HTMLURL usages in Go code ( #22839 )
...
In Go code, HTMLURL should be only used for external systems, like
API/webhook/mail/notification, etc.
If a URL is used by `Redirect` or rendered in a template, it should be a
relative URL (aka `Link()` in Gitea)
Co-authored-by: Lunny Xiao <[email protected] >
2023-02-11 14:34:11 +08:00
6fe3c8b398
Support org/user level projects ( #22235 )
...
Fix #13405
<img width="1151" alt="image"
src="https://user-images.githubusercontent.com/81045/209442911-7baa3924-c389-47b6-b63b-a740803e640e.png ">
Co-authored-by: 6543 <[email protected] >
2023-01-20 19:42:33 +08:00
KN4CK3R and GitHub
309e86a9bf
Use dynamic package type list ( #22263 )
...
Replace the hardcoded list with the dynamic list.
2022-12-29 00:31:54 +01:00
0a7d3ff786
refactor some functions to support ctx as first parameter ( #21878 )
...
Co-authored-by: KN4CK3R <[email protected] >
Co-authored-by: Lauris BH <[email protected] >
2022-12-03 10:48:26 +08:00
e81ccc406b
Implement FSFE REUSE for golang files ( #21840 )
...
Change all license headers to comply with REUSE specification.
Fix #16132
Co-authored-by: flynnnnnnnnnn <flynnnnnnnnnn@github>
Co-authored-by: John Olheiser <[email protected] >
2022-11-27 18:20:29 +00:00
fc7a2d5a95
Add support for HEAD requests in Maven registry ( #21834 )
...
Related #18543
Co-authored-by: Lunny Xiao <[email protected] >
2022-11-24 16:25:13 +02:00
KN4CK3R and GitHub
876ee8c3cd
Allow package version sorting ( #21453 )
2022-10-23 09:18:15 +08:00
Lauris BH and GitHub
b59b0cad0a
Add user/organization code search ( #19977 )
...
Fixes #19925
Screenshots:

2022-10-11 00:12:03 +01:00
dc0253b063
Replace ServeStream with ServeContent ( #20903 )
...
* Replace ServeStream with ServeContent.
* Update modules/timeutil/timestamp.go
Co-authored-by: delvh <[email protected] >
Co-authored-by: delvh <[email protected] >
Co-authored-by: Lunny Xiao <[email protected] >
Co-authored-by: techknowlogick <[email protected] >
2022-08-25 12:05:21 -04:00
6543 and GitHub
0b12abcfb5
Add missing Tabs on organisation/package view (Frontport #20539 ) ( #20540 )
...
hotfix #20106
2022-07-31 14:32:51 +02:00
KN4CK3R and GitHub
a3d55ac523
Hide internal package versions ( #20492 )
...
* Hide internal versions from most searches.
* Added test.
2022-07-27 09:59:10 +08:00
26095115f4
Move some repository related code into sub package ( #19711 )
...
* Move some repository related code into sub package
* Move more repository functions out of models
* Fix lint
* Some performance optimization for webhooks and others
* some refactors
* Fix lint
* Fix
* Update modules/repository/delete.go
Co-authored-by: delvh <[email protected] >
* Fix test
* Merge
* Fix test
* Fix test
* Fix test
* Fix test
Co-authored-by: delvh <[email protected] >
2022-06-06 16:01:49 +08:00
Lunny Xiao and GitHub
cbd45471b1
Move access and repo permission to models/perm/access ( #19350 )
...
* Move access and repo permission to models/perm/access
* Remove unnecessary code
2022-05-11 12:09:36 +02:00
KN4CK3R and GitHub
8adba93498
Hide private repositories in packages ( #19584 )
2022-05-07 18:21:15 +02:00
c003491cfb
Allow package linking to private repository ( #19348 )
...
* Display private repos too.
* lint
Co-authored-by: Lunny Xiao <[email protected] >
2022-04-09 23:57:37 +08:00
KN4CK3R and GitHub
5e242e021b
Package registry changes ( #19305 )
...
* removed debug logs
* fixed SELECT
* removed unneeded error type
* use common SearchVersions method
* remove empty container upload versions
* return err
2022-04-06 03:32:09 +02:00