hi all,
I'm looking to allow users to selectively use web proxies with pkg(1),
letting them set different web proxies for different URIs, and perhaps
none for others. Here's the approach I was going to take, comments
would be most welcome.
On the server-side, we'll add a new "proxied-urls" list property to each
existing "publishers" entry returned by the publisher/0/ response.
The list contains a series of [uri, proxy] lists so that clients using
-p can discover a suggested proxy to use automatically[1] Older
clients ignore the "proxied-urls" list, so I don't think this needs a
bump of the publisher/ response version.
That property name is intentionally the same as the existing
"proxied-urls" list served by the syspub/0/ response, and I intend to
modify that to use special [uri, "syspub"] values, rather than just the
[uri, uri, ... ] values used today, indicating that the system publisher
proxy should be used.
On the client-side, when we discover that a URI is associated with a
proxy, we pass that proxy information to the transport (support for
passing a proxy already exists with the work that was done for the
system publisher)
To support granular proxies from command line, we'll add a --proxy
option to "pkg set-publisher", which, when used with any "-g" or "-m"
URIs, associates that proxy with those URIs and overrides any proxy
configuration supplied from the server.
When used with the "-p" option, it associates that proxy with all URIs
that were discovered at the address supplied.
Finally, the "pkg/system-repository" and "pkg/mirror" SMF services will
be modified to automatically proxy requests through the correct proxy
URI, as configured in the image from which they derive their
configuration. Right now, the services have a single
"config/http[s]_proxy" property set on the SMF instance that applies to
all URIs - I'd propose to have that override the --proxy settings in the
image from which each SMF service gains its configuration.
Let me know if any of the above sounds wrong, or if you've any
questions: I'm still exploring the code here, so there's time to change
tack if I've got anything askew.
cheers,
tim
[1] this ties into the pkg mirror work I'm investigating at the moment,
to allow a user to do
# pkg publisher
PUBLISHER TYPE STATUS URI
# pkg set-publisher -p http://mymirror:9091
pkg set-publisher:
Added publisher(s): extra, internal-only, on-extra, solaris,
solarisstudio, userland
where the client automatically gets configured with all publishers
served by from that mirror, with the --proxy property set to that mirror
for each URI.
_______________________________________________
pkg-discuss mailing list
[email protected]
http://mail.opensolaris.org/mailman/listinfo/pkg-discuss