Bug 237356 - [feature request] ports-mgmt/pkg: allow 'http_proxy' in repository context
Summary: [feature request] ports-mgmt/pkg: allow 'http_proxy' in repository context
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Many People
Assignee: freebsd-pkg mailing list
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2019-04-18 07:07 UTC by Emanuel Haupt
Modified: 2020-02-17 14:31 UTC (History)
0 users

See Also:
bugzilla: maintainer-feedback? (pkg)


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Emanuel Haupt freebsd_committer 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 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" }
}