Lunny Xiao
375ea8cef1
Move some errors to their own sub packages ( #32880 )
2024-12-20 18:05:29 +00:00
KN4CK3R
53d1d899f2
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: [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 >
2024-12-04 23:09:07 +00:00
wxiaoguang
f355b0a3a8
Fix db engine ( #32351 )
...
Fix #32349
2024-10-27 18:48:07 -04:00
KN4CK3R
a5ae7453ab
Fix package list performance ( #30520 )
...
Fixes #28255
The new query uses the id field to sort by "newer". This most not be
correct (usually it is) but it's faster (see #28255 ).
If someone has a better idea, please propose changes.
Co-authored-by: Giteabot <teabot@gitea.io >
2024-04-20 13:07:00 +02:00
wxiaoguang
f52cd2b335
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
4abd1e1ede
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
KN4CK3R
cb3ba6de2d
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
7c4b71f4b0
Revert "packages: Calculate package size quota using package creator ID instead of owner ID ( #28007 )" ( #28049 )
...
This reverts commit #28007 56188ee597 .
2023-11-14 16:03:56 +01:00
Danila Fominykh
56188ee597
packages: Calculate package size quota using package creator ID instead of owner ID ( #28007 )
...
Changed behavior to calculate package quota limit using package `creator
ID` instead of `owner ID`.
Currently, users are allowed to create an unlimited number of
organizations, each of which has its own package limit quota, resulting
in the ability for users to have unlimited package space in different
organization scopes. This fix will calculate package quota based on
`package version creator ID` instead of `package version owner ID`
(which might be organization), so that users are not allowed to take
more space than configured package settings.
Also, there is a side case in which users can publish packages to a
specific package version, initially published by different user, taking
that user package size quota. Version in fix should be better because
the total amount of space is limited to the quota for users sharing the
same organization scope.
2023-11-14 00:38:50 +01:00
KN4CK3R
d9de6a27eb
List all Debian package versions in Packages ( #27786 )
...
Closes #27783
This PR lists all and not only the latest package versions in the
`Packages` index.
2023-10-29 14:14:47 +00:00
Lunny Xiao
f491fe30b2
make writing main test easier ( #27270 )
...
This PR removed `unittest.MainTest` the second parameter
`TestOptions.GiteaRoot`. Now it detects the root directory by current
working directory.
---------
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com >
2023-09-28 01:38:53 +00:00
Lunny Xiao
f2c51e40f5
move repository deletion to service layer ( #26948 )
...
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com >
2023-09-08 04:51:15 +00:00
KN4CK3R
dee9545407
Fix NuGet search endpoints ( #25613 )
...
Fixes #25564
Fixes #23191
- Api v2 search endpoint should return only the latest version matching
the query
- Api v3 search endpoint should return `take` packages not package
versions
2023-08-14 02:50:55 +00:00
KN4CK3R
93334846f7
Test if container blob is accessible before mounting ( #22759 )
...
related #16865
This PR adds an accessibility check before mounting container blobs.
---------
Co-authored-by: techknowlogick <techknowlogick@gitea.io >
Co-authored-by: silverwind <me@silverwind.io >
2023-07-09 11:24:43 +00:00
silverwind
01d3d331e1
Replace interface{} with any ( #25686 )
...
Result of running `perl -p -i -e 's#interface\{\}#any#g' **/*` and `make fmt`.
Basically the same [as golang did](2580d0e08d ).
2023-07-04 18:36:08 +00:00
KN4CK3R
4745509014
Hide limited users if viewed by anonymous ghost ( #25214 )
...
The ghost user leads to inclusion of limited users/orgs in
`BuildCanSeeUserCondition`.
2023-06-13 11:21:11 +08:00
KN4CK3R
61008870a9
Add CRAN package registry ( #22331 )
...
This PR adds a [CRAN](https://cran.r-project.org/ ) package registry.

2023-05-22 10:57:49 +08:00
KN4CK3R
3935ff393a
Add Go package registry ( #24687 )
...
Fixes #7608
This PR adds a Go package registry usable with the Go proxy protocol.

2023-05-14 23:38:40 +08:00
KN4CK3R
aaa9fed845
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 <techknowlogick@gitea.io >
Co-authored-by: silverwind <me@silverwind.io >
Co-authored-by: Giteabot <teabot@gitea.io >
2023-05-12 17:27:50 +00:00
KN4CK3R
272efb6f84
Add RPM registry ( #23380 )
...
Fixes #20751
This PR adds a RPM package registry. You can follow [this
tutorial](https://opensource.com/article/18/9/how-build-rpm-packages ) to
build a *.rpm 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 .

2023-05-05 20:33:37 +00:00
KN4CK3R
ae5b28834b
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 <brian@hongs.me >
Co-authored-by: techknowlogick <techknowlogick@gitea.io >
Co-authored-by: Giteabot <teabot@gitea.io >
2023-05-02 12:31:35 -04:00
Yarden Shoham
f38e98a1fa
Revert "Add Debian package registry" ( #24412 )
...
Reverts go-gitea/gitea#22854
2023-04-28 18:06:41 -04:00
KN4CK3R
d840fa60ab
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 <brian@hongs.me >
Co-authored-by: techknowlogick <techknowlogick@gitea.io >
2023-04-28 17:51:36 -04:00
KN4CK3R
3b0e4c134b
Use ghost user if package creator does not exist ( #23822 )
...
Fixes #23818
2023-04-04 16:14:46 +08:00
KN4CK3R
f0ec5b94c6
Add Swift package registry ( #22404 )
...
This PR adds a [Swift](https://www.swift.org/ ) package registry.

2023-03-13 15:28:39 -05:00
Lunny Xiao
8e5a2c2a41
Use link in UI which returned a relative url but not html_url which contains an absolute url ( #21986 )
...
partially fix #19345
This PR add some `Link` methods for different objects. The `Link`
methods are not different from `HTMLURL`, they are lack of the absolute
URL. And most of UI `HTMLURL` have been replaced to `Link` so that users
can visit them from a different domain or IP.
This PR also introduces a new javascript configuration
`window.config.reqAppUrl` which is different from `appUrl` which is
still an absolute url but the domain has been replaced to the current
requested domain.
2023-02-06 12:09:18 -06:00
KN4CK3R
423acc5d4c
Add Chef package registry ( #22554 )
...
This PR implements a [Chef registry](https://chef.io/ ) to manage
cookbooks. This package type was a bit complicated because Chef uses RSA
signed requests as authentication with the registry.


Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com >
2023-02-06 09:49:21 +08:00
KN4CK3R
2f3b65ac09
Add Cargo package registry ( #21888 )
...
This PR implements a [Cargo registry](https://doc.rust-lang.org/cargo/ )
to manage Rust packages. This package type was a little bit more
complicated because Cargo needs an additional Git repository to store
its package index.
Screenshots:



---------
Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com >
2023-02-05 18:12:31 +08:00
KN4CK3R
cdacd3519b
Add Conda package registry ( #22262 )
...
This PR adds a [Conda](https://conda.io/ ) package registry.
2023-02-01 12:30:39 -06:00
Lunny Xiao
1b9aea9974
Display unreferenced packages total size in package admin panel ( #22498 )
2023-01-18 09:52:04 -06:00
KN4CK3R
6cda084a5a
Fix container blob mount ( #22226 )
2023-01-16 17:35:48 -05:00
KN4CK3R
cef704bee3
Use ErrInvalidArgument in packages ( #22268 )
...
Related to
https://github.com/go-gitea/gitea/pull/22262#discussion_r1059010774
Signed-off-by: Andrew Thornton <art27@cantab.net >
Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com >
Co-authored-by: zeripath <art27@cantab.net >
Co-authored-by: Lauris BH <lauris@nix.lv >
2022-12-31 12:49:37 +01:00
KN4CK3R
2c8893fd7e
Fix condition for is_internal ( #22095 )
...
depends on #22094
Fixes https://codeberg.org/forgejo/forgejo/issues/77
The old logic did not consider `is_internal`.
Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com >
Co-authored-by: techknowlogick <techknowlogick@gitea.io >
2022-12-14 17:16:01 +08:00
Lunny Xiao
53fc37c1f0
refactor some functions to support ctx as first parameter ( #21878 )
...
Co-authored-by: KN4CK3R <admin@oldschoolhack.me >
Co-authored-by: Lauris BH <lauris@nix.lv >
2022-12-03 10:48:26 +08:00
Jason Song
eb974fbef7
Update gitea-vet to check FSFE REUSE ( #22004 )
...
Related to:
- #21840
- https://gitea.com/gitea/gitea-vet/pulls/21
What it looks like when it's working:
https://drone.gitea.io/go-gitea/gitea/64040/1/5
All available SPDX license identifiers: [SPDX License
List](https://spdx.org/licenses/ ).
Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com >
2022-12-02 22:14:57 +08:00
flynnnnnnnnnn
487cb6a411
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 <john.olheiser@gmail.com >
2022-11-27 18:20:29 +00:00
KN4CK3R
98e30f0d3b
Add package registry cleanup rules ( #21658 )
...
Fixes #20514
Fixes #20766
Fixes #20631
This PR adds Cleanup Rules for the package registry. This allows to
delete unneeded packages automatically. Cleanup rules can be set up from
the user or org settings.
Please have a look at the documentation because I'm not a native english
speaker.
Rule Form

Rule List

Rule Preview

Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com >
2022-11-20 16:08:38 +02:00
zeripath
9461ebdd8e
Adjust gitea doctor --run storages to check all storage types ( #21785 )
...
The doctor check `storages` currently only checks the attachment
storage. This PR adds some basic garbage collection functionality for
the other types of storage.
Signed-off-by: Andrew Thornton <art27@cantab.net >
Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com >
2022-11-15 16:08:59 +08:00
KN4CK3R
b96af37608
Add package registry quota limits ( #21584 )
...
Related #20471
This PR adds global quota limits for the package registry. Settings for
individual users/orgs can be added in a seperate PR using the settings
table.
Co-authored-by: Lauris BH <lauris@nix.lv >
Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com >
2022-11-09 14:34:27 +08:00
KN4CK3R
9ad8b699ce
Alter package_version.metadata_json to LONGTEXT ( #21667 )
2022-11-03 15:28:46 +08:00
KN4CK3R
b9b9051a91
Allow package version sorting ( #21453 )
2022-10-23 09:18:15 +08:00
KN4CK3R
9a21acf64b
Add generic set type ( #21408 )
...
This PR adds a generic set type to get rid of maps used as sets.
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com >
2022-10-12 13:18:26 +08:00
luzpaz
74e399fd2f
Fix various typos ( #21103 )
...
Found via `codespell -q 3 -S
./options/locale,./options/license,./public/vendor,./web_src/fomantic -L
actived,allways,attachements,ba,befores,commiter,pullrequest,pullrequests,readby,splitted,te,unknwon`
Co-authored-by: techknowlogick <techknowlogick@gitea.io >
2022-09-07 14:40:36 -04:00
KN4CK3R
a6d0c2bd7a
Delete unreferenced packages when deleting a package version ( #20977 )
...
Delete a package if its last version got deleted. Otherwise removing the owner works only after the clean up job ran.
Fix #20969
2022-09-03 17:01:00 +01:00
KN4CK3R
6021c5d6b6
Add support for Vagrant packages ( #20930 )
...
* Add support for Vagrant boxes.
* Add authentication.
* Add tests.
* Add integration tests.
* Add docs.
* Add icons.
* Update routers/api/packages/api.go
Co-authored-by: Lauris BH <lauris@nix.lv >
Co-authored-by: 6543 <6543@obermui.de >
2022-08-29 15:04:45 +08:00
KN4CK3R
bacb6509c0
Add support for Pub packages ( #20560 )
...
* Added support for Pub packages.
* Update docs/content/doc/packages/overview.en-us.md
Co-authored-by: Gergely Nagy <algernon@users.noreply.github.com >
Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com >
Co-authored-by: Gergely Nagy <algernon@users.noreply.github.com >
Co-authored-by: Lauris BH <lauris@nix.lv >
2022-08-07 18:09:54 +08:00
KN4CK3R
8e45a82c3f
Add Docker /v2/_catalog endpoint ( #20469 )
...
* Added properties for packages.
* Fixed authenticate header format.
* Added _catalog endpoint.
* Check owner visibility.
* Extracted condition.
* Added test for _catalog.
Co-authored-by: 6543 <6543@obermui.de >
Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com >
Co-authored-by: Lauris BH <lauris@nix.lv >
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com >
2022-07-28 11:59:39 +08:00
KN4CK3R
f89febe144
Hide internal package versions ( #20492 )
...
* Hide internal versions from most searches.
* Added test.
2022-07-27 09:59:10 +08:00
zeripath
4b5829433e
Add option to purge users ( #18064 )
...
Add the ability to purge users when deleting them.
Close #15588
Signed-off-by: Andrew Thornton <art27@cantab.net >
2022-07-14 08:22:09 +01:00
Wim
f481b601d6
Add more linters to improve code readability ( #19989 )
...
Add nakedret, unconvert, wastedassign, stylecheck and nolintlint linters to improve code readability
- nakedret - https://github.com/alexkohler/nakedret - nakedret is a Go static analysis tool to find naked returns in functions greater than a specified function length.
- unconvert - https://github.com/mdempsky/unconvert - Remove unnecessary type conversions
- wastedassign - https://github.com/sanposhiho/wastedassign - wastedassign finds wasted assignment statements.
- notlintlint - Reports ill-formed or insufficient nolint directives
- stylecheck - https://staticcheck.io/docs/checks/#ST - keep style consistent
- excluded: [ST1003 - Poorly chosen identifier](https://staticcheck.io/docs/checks/#ST1003 ) and [ST1005 - Incorrectly formatted error string](https://staticcheck.io/docs/checks/#ST1005 )
2022-06-20 12:02:49 +02:00