Two pkg(8) repo configs pointing to same repo

Anthony Jenkins Scoobi_doo at yahoo.com
Tue Mar 27 13:07:14 UTC 2018


I've set up a poudriere package server on my home FreeBSD desktop.  My
laptop has two ways to access this server, depending on whether it's
inside or outside my home LAN (thanks to my stupid ISP router).  When
I'm on my home network, I have to use its local IP address (e.g.
192.168.1.5, or the locally-resolvable name my router gives it).  When
I'm on the Internet, I use my publicly resolvable name (e.g.
myserver.mydomain.com).  I can resolve myserver.mydomain.com on my LAN,
but that's the public IP address of my router and it will not route
packets to my poudriere server using that address (I used to have an ISP
router that /would/ send my internal packets back through the NAT).

Because of these two mutually-exclusive ways of referring to my
poudriere web server, and unless there's a better solution (e.g. fix the
underlying routing or name resolution problem), I have to maintain two
pkg repo configuration files - /usr/local/etc/pkg/repos/poudriere.conf
and .../poudriere-local.conf.  They're identical except for the URL and
I only have one enabled at a time.

Is there a way to configure a pkg(8) repo such that it has multiple ways
to refer to the same physical repository?  I'm picturing the "url:"
parameter being either a string or a list of strings:

my-repo: {
    url: {
        "http://192.168.1.5/poudriere/packages/freebsd_12-1-amd64-HEAD",
       
"http://myserver.mydomain.com/poudriere/packages/freebsd_12-1-amd64-HEAD"
    },
    mirror_type: "http",
    signature_type: "pubkey",
    enabled: yes,
    priority: 1
}

but I don't think that's in the pkg(8) specification.  I can try to
implement this and submit patches if it's worthwhile, or is there a
better way to fix/workaround my inside/outside LAN addressing problem?

Thanks,
Anthony


More information about the freebsd-ports mailing list