Bug 237356

Summary: [feature request] ports-mgmt/pkg: allow 'http_proxy' in repository context
Product: Ports & Packages Reporter: Emanuel Haupt <ehaupt>
Component: Individual Port(s)Assignee: freebsd-pkg (Nobody) <pkg>
Status: Closed FIXED    
Severity: Affects Many People Flags: bugzilla: maintainer-feedback? (pkg)
Priority: ---    
Version: Latest   
Hardware: Any   
OS: Any   

Description Emanuel Haupt freebsd_committer freebsd_triage 2019-04-18 07:07:17 UTC
As the pkg.conf (5) man page states it is currently possible to specify a HTTP proxy within the global pkg environment context like so:

pkg_env: {
  http_proxy: "http://myproxy:3128",
}

It would be very useful if it were possible to specify HTTP proxies within a repository configuration context. For instance:

# /usr/local/etc/pkg/repos/mycorporaterepo.conf
FreeBSD: {
        url: "pkg+http://my.company.tld/${ABI}/latest",
        http_proxy: "http://someuser:secret@myproxy:3128"
}


This logic would be consistent with other repository config systems such as yum (search 'proxy'):

https://linux.die.net/man/5/yum.conf
Comment 1 Emanuel Haupt freebsd_committer freebsd_triage 2020-02-17 14:31:35 UTC
For the record, Bapt notified me via IRC that this is now possible with the following syntax:

# /usr/local/etc/pkg/repos/FreeBSD.conf
FreeBSD:
{       
        url: "pkg+http://pkg.FreeBSD.org/${ABI}/latest",
        env: { "http_proxy": "http://someuser:secret@myproxy:3128" }
}

# /usr/local/etc/pkg/repos/someotherrepo.conf
someotherrepo:
{       
        url: "pkg+http://somewhereelse.internal.tld/",
        env: { "http_proxy": "http://somewhereelse-proxy.internal.tld:3128" }
}