I've finally set up my own automated repository thanks to aurutils
I've always tried to improve the way I build my own packages on Arch. It basically started with building in a clean chroot some years ago until I transitioned to using aurutils about one year ago.
Today I finally took the time to somewhat automate the process on a VPS — that means regularly checking the AUR for updates, cleanbuilding the packages and serving them over HTTPS. Most of the setup I performed with Ansible (not everything though) using self-written playbooks; though I'm not claiming that those scripts are perfect. But it was a good exercise.
I don't know if there is general interest in the topic or if most people are content with how the AUR process works. I am a bit against the AUR helpers (though e.g. yay takes a lot of work off me on some machines) because I prefer using repositories. That's why I put up with the work.
It is also not perfect, but this is the first time I consider it "good enough" that I want to let the sub know in case anyone here is interested.
If you want to see my results, add the following to your pacman.conf:
[laserepo]
SigLevel = Optional TrustAll
Server = https://repository.pc-hass.de/
Be aware that the packages are unsigned and I don't recommend using it for anything. It is my personal repository and adding repositories to your system is always a possible vector for vulnerabilities! That said, if you want, make use of it, but I'm just posting it here for people to see how the result looks. If you want to be safe, try it in a VM or something.
My setup uses a systemd timer to check for new packages every hour after the last run — regardless if packages have actually been built or not — completed. Or so I hope. Anyhow, there's still a lot of room for improvement, but I hope this is something that interests others as well!
I'd be happy to hear some feedback!
About this post
- Posted
- Archived
- Score
- 70 · 100% up
- Kind
- Text
- ID
- angrel
39 comments
This is also how I currently handle my aur / custom packages. (And one of the best ways imo) I've never looked back to an aur helper.
One thing to keep in mind though: you are essentially restributing packages. This may not be allowed by the license of the package. (e.g. google-chrome, spotify) I don't think I saw a package like this in your current list, but thought I would mention it anyway.
Yes, I had the redistribution issue in mind also. If it came to that, I could just set up simple authentication.
Anyhow, do you have any lessons learned you want to share? :) I see some optimization potential — things like compressed database file (though that should go into aur-utils imho). Also I noticed that aur-build has a -R flag to delete old packages, but aur-sync doesn't, so I created a pull request on Github for that and fixed another tiny bug I spotted (basically, the -r option was mentioned in the man page and --help, but it didn't work).
Ehh let's see.
As Alad already partly mentioned, think about your trust path. Upstream -> AUR package maintainer -> your VPS -> your clients. Some thoughts:
Have you thought about rebuilds? This includes ABI changes of libraries, but also version changes of python.
I also regularly check the integrity of my repository. This includes verifying package and database signatures, missing package files, missing dependencies, orphaned packages, out of date packages.
Good logging/monitoring could also be something to look at. Are you notified of build failures?
Maybe a little less common use case: I sometimes make modifications to PKGBUILDs for various reasons, so I've got a system where I can automatically apply patches to packages.
That's what I can think of of the top of my head. I've probably missed a lot of problems I've hit throughout the years. Hope this helps a bit! :) Rolling my own automation based on aurutils that does exactly what I want it to do has been a blast, and is a journey that will probably never end.
If you're pulling PKGBUILD updates directly from the AUR, you should keep in mind that these can be orphaned at any time, and thus may be adopted by anyone. So if you don't use manual inspection, you should consider some "trust system", e.g. as done in https://github.com/alexheretic/aurto (I haven't tested this, but some other helpers like
bauerbillor Seblu'saurbothave a similar mechanism in place)So is the reasoning for this basically to avoid having to build the AUR packages on your client machines?
Yes. The two primary conveniences gained from doing this are:
pacman -S ...Deleted before we saved it.
yay is not inherently bad, there's nothing "wrong" with it. Let's go through the points why I set up something different:
gitas a missing makedepends. Because if you use the AUR, you have git installed. If you're just runningmakepkg, no problem. It will use your installedgit. But in a clean chroot, it will error out because git is not installed there. The real issue starts with complex programs like ffmpeg. Theconfigurestep might enable functionality that was not explicitly turned off because you have the appropriate library installed, but it's not defined as a dependency. Now you build the package, everything works fine. You install the package on another machine where the library ffmpeg was linked against is not installed — it doesn't work. If you build in a clean chroot, you can be sure that all needed dependencies for the binary or library you are providing are properly declared in the package metainformation.People use yay and don't bother learning how the AUR works, and don't bother reading PKGBUILDs when a package updates.
Hit me in my ugly face, but I say this shouldn't be necessary at all!
Not everyone must understand and check every install/update PKGBUILD. As the AUR is a community project, some might give away some security/responsibility for convenience. Also, not everyone might be into compiling stuff as we are, but also want to use Arch/AUR.
Knowing how the AUR and PKGBUILDs work is a very nice thing, but I don't like that forcing of knowing it to new users.
Still, I highly encourage to only skip reading the PKGBUILD of very popular packages. The less known a package is, the more you should at least look into the PKBUILD if it at least points to the right repository.
Very cool, I would read some blog posting about your experiences/plans :)
Also, repository.pc-hass.de points to the same stuff as only pc-hass.de. Pretty sure this is intentional, but just wanted to tell you in case it isn't to avoid testing problems.
🇩🇪 Außerdem gefällt mir der Domainname. :D Solange du keine Avocados verkaufst, passt der Name immer.
It's not intentional, but I noticed as well. It's just that I don't have any other server specified and nginx then just uses the first entry, even though the hostname doesn't match. But it's not an issue at the moment so I didn't change that.
Haha ja. Heute ist das nicht mehr so schlimm, aber die Domain habe ich auch noch aus der Zeit, in der ich selber zu Hause noch Windows benutzt habe. Und mein Gedankengang damals war, dass es zwar viele Publikationen gibt, die mit "PC-" anfangen, aber für dieses Gefühl, wenn mal wieder irgendwas mit einer kryptischen Meldung nicht funktioniert, da musste genau das her.
Non-German speakers: we're discussing my domain name which roughly translates to pc-rage. It was and still kind of is a tribute to those times when you just want to punch a hole into your screen.
In beiden Fällen sehr zutreffend :D
I should probably try out aurutils again. Last time I set up the repo and all but I just didn't understand how to use aurutils really.
You definitely should. My biggest issue is removing packages from the repository though :D
It basically boils down to this after the initial setup:
aur sync -c $packagename. Not sure the-cis needed or if it's default, but I like it explicit.aur sync -cu.It took me a bit longer because I tried to semi-automate the setup using Ansible.
Aurutils does not build in a chroot by default.
Care to share how u check aur over http? and trigger at change?
The magic is all done by
aur sync. I just had a timer set to run the tool every hour. You can install it from https://aur.archlinux.org/packages/aurutils/This was a triumph. I'm making a note here, huge success.
Who the hell downvoted that magnificent reference?