hi all,
I've got a webrev here for the granular-proxy wad, which gives "pkg
set-publisher" a new option "--proxy" that applies to -g, -G, -m, -M and
-p arguments.
This wad also changes the "pkg publisher <pub>", "pkg publisher -F tsv"
and, for zones, "pkg publisher" command outputs. Examples of each are
at the end of this mail, with a quick summary of the changes.
https://cr.opensolaris.org/action/browse/pkg/timf/granular-proxies/
Comments would be most welcome. Apologies for the weight of this
webrev, I didn't think it'd end up being quite as hefty as this.
cheers,
tim
--proxy option
--------------
We add a --proxy option, where the combination of -g/G/m/M/p and the
--proxy flag now indicate a unique origin or mirror. Wildcards like '-G
* --proxy foo' will only work if every origin to be removed has the same
proxy value 'foo'.
# pkg image-create /tmp/a
# pkg -R /tmp/a set-publisher -g http://ipkg.us.oracle.com/on-extra on-extra
# pkg -R /tmp/a set-publisher -G http://ipkg.us.oracle.com/on-extra
--proxy http://kura:9091 on-extra
pkg set-publisher: Unknown repository origin
'http://ipkg.us.oracle.com/on-extra/' with proxy 'http://kura:9091'
# pkg -R /tmp/a set-publisher -G http://ipkg.us.oracle.com/on-extra on-extra
# pkg -R /tmp/a set-publisher -g http://ipkg.us.oracle.com/on-extra
--proxy http://kura:9091 on-extra
# pkg -R /tmp/a publisher
PUBLISHER TYPE STATUS URI
on-extra origin online
http://ipkg.us.oracle.com/on-extra/
# pkg -R /tmp/a publisher on-extra
Publisher: on-extra
Alias:
Origin URI: http://ipkg.us.oracle.com/on-extra/
Proxy: http://kura:9091
SSL Key: None
SSL Cert: None
Client UUID: a8cd40a8-8227-11e1-8664-d4bed990482b
Catalog Updated: April 9, 2012 09:38:59 AM
Enabled: Yes
Zones pkg publisher changes
---------------------------
We get rid of the "proxy://<uri>" resources for the short-form pkg
publisher output, instead using the more explanatory
"<system-repository>" value, but provide the full URI in both the
long-form pkg publisher output, as well as the --format tsv output.
# pkg -R /zones/kahurangi/root publisher
PUBLISHER TYPE STATUS URI
solaris (syspub) origin online <system-repository>
punchin (syspub) origin online <system-repository>
extra (syspub) origin online <system-repository>
internal-only (syspub) origin online <system-repository>
solarisstudio (syspub) origin online <system-repository>
on-extra (syspub) origin online <system-repository>
userland (syspub) origin online
http://localhost:1008/userland/614bdd284706b4be9743fa5021c76a968192c904/
# pkg -R /zones/kahurangi/root publisher solaris
Publisher: solaris
Alias:
Origin URI: http://ipkg.us.oracle.com/solaris11/dev/
Proxy: http://localhost:1008
SSL Key: None
SSL Cert: None
Client UUID: 787a5634-8227-11e1-a43a-d4bed990482b
Catalog Updated: April 5, 2012 09:00:45 PM
Enabled: Yes
pkg publisher --format tsv change
---------------------------------
This adds the "PROXY" column.
# pkg -R /zones/kahurangi/root publisher -F tsv
PUBLISHER STICKY SYSPUB ENABLED TYPE STATUS URI PROXY
solaris true true true origin online
http://ipkg.us.oracle.com/solaris11/dev/ http://localhost:1008
punchin true true true origin online
http://righthook.us.oracle.com:10000/ http://localhost:1008
extra true true true origin online
http://ipkg.us.oracle.com/opensolaris/extra/ http://localhost:1008
internal-only true true true origin online
http://ipkg.us.oracle.com/internal/solaris11/internal-only/
http://localhost:1008
solarisstudio true true true origin online
http://ipkg.us.oracle.com/solarisstudio/support/ http://localhost:1008
on-extra true true true origin online
http://ipkg.us.oracle.com/internal/solaris11/on/extra/ http://localhost:1008
userland true true true origin online
http://localhost:1008/userland/614bdd284706b4be9743fa5021c76a968192c904/
Authenticating proxies
----------------------
We support authenticating proxies, allowing clients to specify proxy
urls with '$variables' which get expanded from the OS environment at
runtime.
# pkg -R /tmp/a set-publisher --proxy http://localhost:80 -g
http://ipkg.us.oracle.com/on-extra on-extra
pkg set-publisher: The origin URIs for 'on-extra' do not appear to point
to a valid pkg repository.
Please verify the repository's location and the client's network
configuration.
Additional details:
Unable to contact valid package repository
Encountered the following error(s):
Unable to contact any configured publishers.
This is likely a network configuration problem.
http protocol error: code: 407 reason: Proxy Authentication Required
URL: 'http://ipkg.us.oracle.com/on-extra'
# pkg -R /tmp/a set-publisher --no-refresh --proxy
http://\$FOO:\$BAR@localhost:80 -g http://ipkg.us.oracle.com/on-extra
on-extra
# pkg -R /tmp/a publisher on-extra
Publisher: on-extra
Alias:
Origin URI: http://ipkg.us.oracle.com/on-extra/
Proxy: http://$FOO:$BAR@localhost:80
SSL Key: None
SSL Cert: None
Client UUID: c47e7a66-822b-11e1-abcd-d4bed990482b
Catalog Updated: April 9, 2012 10:08:48 AM
Enabled: Yes
# export FOO=imposter
# export BAR=noodles
# pkg -R /tmp/a refresh on-extra
pkg: 0/1 catalogs successfully updated:
Unable to contact valid package repository
Encountered the following error(s):
Unable to contact any configured publishers.
This is likely a network configuration problem.
http protocol error: code: 407 reason: Proxy Authentication Required
URL: 'http://ipkg.us.oracle.com/on-extra'
# export FOO=timf
# export BAR=foobar
# pkg -R /tmp/a refresh on-extra
#
Transport stats
---------------
We add the "Proxy" column, printing the proxy that was actually used at
runtime (ie. respecting any $http_proxy values)
# pkg -R /zones/kahurangi/root refresh on-extra
URL Proxy
Good Err Conn Speed Size Used CSpeed Qual
http://ipkg.us.oracle.com/internal/solari http://localhost:1008
2 0 1 16 kB/s 5.87 kB True 1.135522 3166
http://localhost:1008 -
2 0 1 4 MB/s 4.59 kB True 0.006697 57765
_______________________________________________
pkg-discuss mailing list
[email protected]
http://mail.opensolaris.org/mailman/listinfo/pkg-discuss