-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Arch linux packages #25037
Comments
cc @KN4CK3R (for once you're back) |
Your plan does not fit into the existing structure because you want to manage the packages outside of Gitea. There is no reason to do that because the Arch linux packages are just (from what I have seen) a mix between how the Debian and RPM registries work. If you want to implement it, have a look at the code of these two package types. Otherwise I could implement it, just let me know. |
I have created some dirty implementation on my public gitea instance:
There is and endpoint Example of
Also there is an endpoint for pushing packages Plus, we can add functionality to create mirrors for arch linux packages (or other FS mirrors) in personal gitea instances (also have some dirty implementation in my instance). This will simplify process of package update/share/delivery for end users by a lot. I have made it by adding env variable with string list: I have used my own utility (pack) to push pakcages to specific endpoint. It is working similarly to docker containers. but with arch linux packages, it can be used like that: pack push fmnx.su/linux If you agree, that it's a good idea to simplify the process of fs mirroring and package delivery, keeping compatability with existing package manager formats, we can implement that in gitea in separate pull request, first - for FS mirrors for existing packages, second - for specific packages endpoints/their representation in gitea. I can make FS mirrors configurable in such a way, that user can bind them on any endpoint and any folder, say, under Let me know what do u think about it, i would try to help as much as i can :D |
Thank you for your work. This would still manage the packages outside of Gitea, so there is no UI, blob deduplication, package cleanup, ... |
hm... I think it is possible to make some combined solution, providing emulated file-server (just by binding endpoints for files, but making lookups to database) and still storing all package blobs in database. I will try to rework it in such a way, let me know if that might not be the case. |
I started implementing arch package registry with support for gitea's built-in file storage (fork link). Already implemented:
I had to create a bit custom API (which is not standardized, but fits well in arch paradigm), so that it would be possible to connect gitea instances directly in Would like to know, wether that implementation could be merged after i finish with package repo/owner linking. |
Thanks, but I think we can't use a system dependecy like pacman in the background. |
Sure, will remove this dependency, that would be much better 😅 |
Removed import (
"github.com/DataDog/zstd"
"github.com/mholt/archiver/v3"
) I have a couple question to continue implementation.
|
Just wanted to chime in that Arch isn't the only thing that uses pacman for package management. I'm actually interested in this for hosting MSYS2/MinGW packages so it'd be nice for whatever solution to be able to support multiple distributions. |
@nephatrine You can start it locally with docker/go, or test it on my public gitea instance (currently there is no UI, since i haven't connected package properties to package files in gitea's database). This API accepts only signed packages, but should work fine if you use GnuPG to sign your packages. Docker compose exmaple: services:
registry:
image: fmnx.su/core/registry:latest
container_name: registry
ports:
- 80:80
volumes:
- ./pkgs:/pkgs
- ./keys:/keys
environment:
ARCH_REGISTRY_PORT: 80
ARCH_REGISTRY_KEYDIR: /keys
ARCH_REGISTRY_PKGDIR: /pkgs Package push command example: registry push -w [email protected] localhost /var/cache/pacman/pkg/pkg-1-1-x86_64.pkg.tar.zst Tell me if this is not the case for you, i will try to adjust it in best possible way. |
@Dancheg97 Set up that standalone registry and tried testing it out with my non-Arch pacman packages. I was able to push successfully and see the packages I pushed in the /pkgs directory in the container so they got there ok. I'm not really sure how to get them back out though. Tried adding
I see localhost.db in /pkgs on the container so I'm not sure if there is some other path/subdirectory I need to tack onto the end of the URL for it to work. I tried a couple of different things and tried investigating via web browser, but just get 404s. My main concern though is that if anything like this gets into Gitea we don't want to end up in the same situation we have with the RPM repository (see #25304) where right now there isn't a way to separate packages for one distro from another and so a RHEL8 system pointing at a Gitea RPM repository might end up pulling in Fedora 38 or RHEL9 packages which generally won't work at all. There needs to be a way to specify the distro (Arch, KaOS, MSYS2, etc) when pushing and these need to be presented under separate paths to the end-users in their pacman configs so that they only see packages for the OS they are running. That might be outside the scope of your standalone registry if you're solely focused on Arch, but for Gitea I think any pacman repository needs to work for more than just a single distribution. |
@nephatrine That won't be hard to implement it in that way, but will take a little more time. |
@Dancheg97 yeah, basically just separate buckets for different distros so that if I'm building for KaOS Linux and Arch Linux users can get the right packages via pacman. |
It's great to see some work on this feature, this will be really useful!
Was this a temporary restriction, or will it also be in the release of this feature? |
Yes, that was a temporary restriction. In the release version, the package signature would be saved only if it was provided with the package during upload. |
Feature Description
I would like to add new package registry with arch linux packages to gitea. I've seen the implementation of other package registries, with arch linux pacman it's quite different.
To get complete working pacman registry with arch linux packages you have to mount file server with directory containing package archives, signatures and database.
Contribution plan:
pacman
utility withapk
for system calls and further actions.Let me know if i could work on that feature.
Thank you!
Screenshots
No response
The text was updated successfully, but these errors were encountered: