[zypp-devel] Make PK zypp backend work behind a firewall
Hi, I just found PK zypp backend can't work behind a firewall. After reading some source code, there are two ways to do this. 1. PK actually reads proxy info and saves it internally. Zypp backend can get this info by pk_backend_get_proxy_http. But current libzypp doesn't export any function about setting proxy in media/MediaXX.h. So we need add some API in media/MediaXX.h so that pk backend can call this set proxy info 2. Add a new proxy info class like ProxyInfoGconf that reads gconf setting of proxy, that's much more common than /etc/sysconfig/proxy. Any comments? Peter -- To unsubscribe, e-mail: zypp-devel+unsubscribe@opensuse.org For additional commands, e-mail: zypp-devel+help@opensuse.org
On Wednesday 03 March 2010 07:07:58 Zhu, Peter J wrote:
Hi,
I just found PK zypp backend can't work behind a firewall. After reading some source code, there are two ways to do this.
1. PK actually reads proxy info and saves it internally. Zypp backend can get this info by pk_backend_get_proxy_http. But current libzypp doesn't export any function about setting proxy in media/MediaXX.h. So we need add some API in media/MediaXX.h so that pk backend can call this set proxy info
This should be doable.
2. Add a new proxy info class like ProxyInfoGconf that reads gconf setting of proxy, that's much more common than /etc/sysconfig/proxy.
I suppose reading /etc/sysconfig/proxy was implemented to immediately honor any proxy configuration changes applied by YaST. But outside YaST the behavior is problematic. IMO we should leave it to aria2c/curl to evaluate the proxy settings from the environment. An interface as in [1.] can then be used by the application to explicitly set different proxy data. There are also some bugreports addressing this. I think we can do this change this for factory (11.3, libzypp-7.x). -- cu, Michael Andres +------------------------------------------------------------------+ Key fingerprint = 2DFA 5D73 18B1 E7EF A862 27AC 3FB8 9E3A 27C6 B0E4 +------------------------------------------------------------------+ Michael Andres YaST Development ma@novell.com SUSE LINUX Products GmbH, GF: Markus Rex, HRB 16746 (AG Nuernberg) Maxfeldstrasse 5, D-90409 Nuernberg, Germany, ++49 (0)911 - 740 53-0 +------------------------------------------------------------------+ -- To unsubscribe, e-mail: zypp-devel+unsubscribe@opensuse.org For additional commands, e-mail: zypp-devel+help@opensuse.org
From: Michael Andres [mailto:ma@suse.de] Sent: Wednesday, March 03, 2010 4:03 PM To: zypp-devel@opensuse.org Subject: Re: [zypp-devel] Make PK zypp backend work behind a firewall
On Wednesday 03 March 2010 07:07:58 Zhu, Peter J wrote:
Hi,
I just found PK zypp backend can't work behind a firewall. After reading some source code, there are two ways to do this.
1. PK actually reads proxy info and saves it internally. Zypp backend can get this info by pk_backend_get_proxy_http. But current libzypp doesn't export any function about setting proxy in media/MediaXX.h. So we need add some API in media/MediaXX.h so that pk backend can call this set proxy info
This should be doable.
2. Add a new proxy info class like ProxyInfoGconf that reads gconf setting of proxy, that's much more common than /etc/sysconfig/proxy.
I suppose reading /etc/sysconfig/proxy was implemented to immediately honor any proxy configuration changes applied by YaST.
But outside YaST the behavior is problematic. IMO we should leave it to aria2c/curl to evaluate the proxy settings from the environment. An interface as in [1.] can then be used by the application to explicitly set different proxy data.
There are also some bugreports addressing this.
I think we can do this change this for factory (11.3, libzypp-7.x).
What's the git tree I can check? -- To unsubscribe, e-mail: zypp-devel+unsubscribe@opensuse.org For additional commands, e-mail: zypp-devel+help@opensuse.org
On Wednesday 03 March 2010 14:41:48 Zhu, Peter J wrote:
I think we can do this change this for factory (11.3, libzypp-7.x).
What's the git tree I can check?
11.3 development will take place in the 'master' branch. (git://gitorious.org/opensuse/libzypp.git; still at 6.x but will go up soon) Checkins that build and at pass the testsuite will be also be uploaded to obs://zypp:Head. (https://build.opensuse.org/project/show?project=zypp%3AHead) -- cu, Michael Andres +------------------------------------------------------------------+ Key fingerprint = 2DFA 5D73 18B1 E7EF A862 27AC 3FB8 9E3A 27C6 B0E4 +------------------------------------------------------------------+ Michael Andres YaST Development ma@novell.com SUSE LINUX Products GmbH, GF: Markus Rex, HRB 16746 (AG Nuernberg) Maxfeldstrasse 5, D-90409 Nuernberg, Germany, ++49 (0)911 - 740 53-0 +------------------------------------------------------------------+ -- To unsubscribe, e-mail: zypp-devel+unsubscribe@opensuse.org For additional commands, e-mail: zypp-devel+help@opensuse.org
On 3/3/2010 at 7:07, "Zhu, Peter J"
wrote: Hi, I just found PK zypp backend can't work behind a firewall. After reading some source code, there are two ways to do this.
1. PK actually reads proxy info and saves it internally. Zypp backend can get this info by pk_backend_get_proxy_http. But current libzypp doesn't export any function about setting proxy in media/MediaXX.h. So we need add some API in media/MediaXX.h so that pk backend can call this set proxy info
2. Add a new proxy info class like ProxyInfoGconf that reads gconf setting of proxy, that's much more common than /etc/sysconfig/proxy.
Any comments?
(shameles plug): [0] Whenever you think of an application that requires to 'find the right proxy' to use out of the user's environment: think about libproxy. You'll offer more to your application than simply reading *_proxy envvars, like wpad:// and ProxyAutoConfiguration script support, something that's missing in a lot of applications (because they do not want to bring a javascript implementation with them). Libproxy fills this gap: your app only 'asks' libproxy which proxy to use for any specific URL (obvious: every URL has to be given to libproxy for verification: you can't assume that a proxy that was valid for URL1 is also valid for any other address you query). and libproxy gives an array of proxies (to be tried in order - first one that succeeds is the one to use. This is used in companies for failover scenarios, based on PAC files). I'd love to see more applications based on it. No more fiddling with envvars, just because some app does not know how to handle our pac script setup in the office. Dominique [0] http://code.google.com/p/libproxy/ -- To unsubscribe, e-mail: zypp-devel+unsubscribe@opensuse.org For additional commands, e-mail: zypp-devel+help@opensuse.org
(shameles plug): [0] Whenever you think of an application that requires to 'find the right proxy' to use out of the user's environment: think about libproxy. You'll offer more to your application than simply reading *_proxy envvars, like wpad:// and ProxyAutoConfiguration script support, something that's missing in a lot of applications (because they do not want to bring a javascript implementation with them).
Libproxy fills this gap: your app only 'asks' libproxy which proxy to use for any specific URL (obvious: every URL has to be given to libproxy for verification: you can't assume that a proxy that was valid for URL1 is also valid for any other address you query). and libproxy gives an array of proxies (to be tried in order - first one that succeeds is the one to use. This is used in companies for failover scenarios, based on PAC files).
Good idea -- To unsubscribe, e-mail: zypp-devel+unsubscribe@opensuse.org For additional commands, e-mail: zypp-devel+help@opensuse.org
participants (3)
-
Dominique Leuenberger
-
Michael Andres
-
Zhu, Peter J