pkg(5) support for HTTP proxy configuration per-mirror
The IPS infrastructure enables us to fetch packages from the Internet (requiring, in our case, requests to an http_proxy for hosts and zones running in a private LAN), as well as to run a mirror of OI repositories and/or our private package repositories in the LAN or even on a local host (requiring direct access).
Currently this seems managed by the http_proxy and https_proxy variables exported or undefined in the shell which executes the "pkg" client command, and influences all requests for this session . These variables are passed down to curl used to fetch the files.
Due to this, mixed accesses (like origin in the internet with mirrors in the LAN or on a localhost) become problematic - one type of requests requires the proxy and others either don't require it putting superfluous load on the proxy, or straight can't use it (i.e. the proxy server's "localhost" does not serve IPS repositories).
The Oracle variant of IPS has several configuration options to cater for this both in the "pkg publisher" configuration as well as in SMF services responsible for package management, as can be seen here:
I believe the pkg(5) project is downstreamed from Oracle open development, but at least as of oi_151a8 this command fails as undefined:
:; pkg set-publisher --proxy http://www-proxy -g http://pkg-server pub
So the RFE is to at least implement such per-publisher setting of optional proxy use (as well as, perhaps, a flag to always go direct and undefine any http(s)_proxy envvar if passed from the shell).
Updated by Jim Klimov about 7 years ago
I had a thread in discussion on this subject with some examples:
My research of the problem boiled down to the description above.
Updated by Alexander Pyhalov almost 7 years ago
pkg in /hipster can do this:
$ pfexec pkg set-publisher --proxy http://proxy.r61.net:3128/ -g http://pkg.openindiana.org/hipster-2014.1/ -G http://pkg.openindiana.org/hipster-2014.1/ openindiana.org $ pfexec pkg refresh $ pfexec pkg info -r entire Name: entire Summary: incorporation to lock all system packages to same build (empty package) Description: incorporation to lock all system packages to same build (empty package) State: Not installed Publisher: openindiana.org Version: 0.5.11 Branch: 2014.1.1.0 Packaging Date: June 30, 2014 07:57:01 PM Size: 0.00 B FMRI: pkg://firstname.lastname@example.org:20140630T195701Z