Restrict access to custom repository
Hello guys.
Right now at home I'm hosting a custom package repository for Archlinux in which I build packages from AUR and some custom packages that I use regularly.
My setup
I'm using a Swag container to serve the packages, Cloudflare as my DNS provider and a container with aurutils to build my packages.
The situation
Right now my custom repository is accessible from the internet (which is something I want) and people with the URL of the repository can use it.
Scope
What I would like to achieve is to restrict the access to my custom repository pretty much like SSH key autentication when remoting inside a machine. I don't want random people to begin using my repository, but only a few, even if they have the URL.
Possible solutions
VPN and Virtual interface
Right now the only idea I have in mind is making the repository accessible only through a VPN, and setup a virtual interface on my machine to the VPN so that I don't get those annoying messages saying that the download of the database has failed.
XferCommand
https://bbs.archlinux.org/viewtopic.php?id=237687
SSHFS
Not my favourite
Any suggestion about how you would achieve this?
Solution
As one of the commenters suggested, I think I will go for HTTP basic authentication which seems to be what I was looking for.
Edited 8 Jun 2022. We only hold this version.
About this post
- Posted
- Archived
- Edited
- Score
- 44 · 96% up
- Kind
- Text
- ID
- v7lytk
7 comments
https://bbs.archlinux.org/viewtopic.php?id=275915
Thanks! Didn't see that thread
Does pacman use .netrc?
If so OP should put his secrets there so it's specifically identifiable as sensitive.
https://bbs.archlinux.org/viewtopic.php?id=237687
Yes it appears it does. I suggest keeping secrets and config seperate.
Put the repo behind Tailscale and remove it from the public Internet
thanks for letting me discover this service, seems pretty interesting.
I've looked into it and it seems pretty much like using a VPN to allow the use of the repository, is that right?
It's the same concept just far easier / less annoying to set up. Effectively you can imagine that every computer you own has a 2nd network adapter that are all connected to the same network switch, no matter where in the world they are. This means you can run services that don't have any publicly open ports to the Internet, which vastly reduces your attack surface