[zypp-devel] Make PackageKit zypp backend work using proxy
Hi dear developers, I found PackageKit zypp backend can't work with proxy. In fact, libzypp can't read GConf system proxy settings, so I have wrote a patch to read GConf proxy setting using GConf API, but I found GConf API can't got the correct proxy setting in libzypp, with some investigation, I found the DBUS_SESSION_BUS_ADDRESS is not set while entering libzypp from PackageKit or zypper, so GConf API(gconf_client_get_default, gconf_client_get,etc.) can't works. I don't know why GConf API can't works when libzypp is called by PackageKit or zypper, and why DBUS_SESSION_BUS_ADDRESS is not set. I also have tried to use libproxy API to got proxy info in libzypp, but still failed, because libproxy also use GConf API and GConf API can't works in libzypp. Attached is my patch for reading GConf proxy info. What should I do here to let GConf API works in libzypp? -Thanks in advanced -Qiang
On Tue, Apr 6, 2010 at 2:50 AM, Zhang, Qiang Z
Hi dear developers,
I found PackageKit zypp backend can't work with proxy. In fact, libzypp can’t read GConf system proxy settings, so I have wrote a patch to read
Sounds complicated. Why not just read proxy settings from the environment? Does PackageKit do the downloading itself or does it call out to some other program? -- Jon -- To unsubscribe, e-mail: zypp-devel+unsubscribe@opensuse.org For additional commands, e-mail: zypp-devel+help@opensuse.org
On Tuesday 06 April 2010 09:50:42 Zhang, Qiang Z wrote:
Hi dear developers,
I found PackageKit zypp backend can't work with proxy. In fact, libzypp can't read GConf system proxy settings,
Yes, libzypp currently refers to /etc/sysconfig/proxy. But there are requests to change this and prefer the settings from the environment, maybe even use libproxy to retrieve the values.
so I have wrote a patch to read GConf proxy setting using GConf API, but I found GConf API can't got the correct proxy setting in libzypp, with some investigation, I found the DBUS_SESSION_BUS_ADDRESS is not set while entering libzypp from PackageKit or zypper, so GConf API(gconf_client_get_default, gconf_client_get,etc.) can't works.
I don't know why GConf API can't works when libzypp is called by PackageKit or zypper, and why DBUS_SESSION_BUS_ADDRESS is not set.
I also have tried to use libproxy API to got proxy info in libzypp, but still failed, because libproxy also use GConf API and GConf API can't works in libzypp.
Attached is my patch for reading GConf proxy info.
What should I do here to let GConf API works in libzypp?
I'm not familiar with GConf. But before taking a GConf reader into libzypp, I'd vote for using libproxy. This reminds me that we want to offer an API to pass proxy settings down to libzypp, overwriting any internal detection. This is what PackageKit could use until libzypps defaults fir it's needs. -- 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 4/6/2010 at 15:45, Michael Andres
wrote: I'm not familiar with GConf. But before taking a GConf reader into libzypp, I'd vote for using libproxy.
Very wise... gconf would be only looking at the gnome desktop... and once I read that we also support KDE :) A 'difficulty' in most cases, when it comes to PK is it's 'bare' way of detecting proxy settings: It's much too inflexible and can't handle 'multiple proxies' as used in various situations. If you want to use libproxy (or any other reliable way of proxy handling.. does not really matter; libproxy can only help you out) you need to pass every single URL to the proxy helper to detect what the right proxy for exactly this URL would be (think about pac files here). think about a 'typical' setup: - Repo 1: repo.mycomp.com/repository (internal, not reachable through our proxy) - Repo 2: download.o.o/repositories/[...] (external, requires proxy). Obvious the proxy settings vary from 'case to case'. Is PK reading 'proxy ignore' variables? Which ones are supported? (Of course you can s/PK/libzypp/ throughout the entire mail... it depends on who is doing the downloading at the end... ) Dominique -- To unsubscribe, e-mail: zypp-devel+unsubscribe@opensuse.org For additional commands, e-mail: zypp-devel+help@opensuse.org
Thanks. In fact, I have tried libproxy, but libproxy also call GConf API, so libproxy also can't get the correct proxy info. Seems the runtime environment is changed in libzypp. Any comment? -Thanks -Qiang -----Original Message----- From: Dominique Leuenberger [mailto:Dominique.Leuenberger@TMF-Group.com] Sent: 2010年4月7日 18:11 To: zypp-devel@opensuse.org Subject: Re: [zypp-devel] Make PackageKit zypp backend work using proxy
On 4/6/2010 at 15:45, Michael Andres
wrote: I'm not familiar with GConf. But before taking a GConf reader into libzypp, I'd vote for using libproxy.
Very wise... gconf would be only looking at the gnome desktop... and once I read that we also support KDE :) A 'difficulty' in most cases, when it comes to PK is it's 'bare' way of detecting proxy settings: It's much too inflexible and can't handle 'multiple proxies' as used in various situations. If you want to use libproxy (or any other reliable way of proxy handling.. does not really matter; libproxy can only help you out) you need to pass every single URL to the proxy helper to detect what the right proxy for exactly this URL would be (think about pac files here). think about a 'typical' setup: - Repo 1: repo.mycomp.com/repository (internal, not reachable through our proxy) - Repo 2: download.o.o/repositories/[...] (external, requires proxy). Obvious the proxy settings vary from 'case to case'. Is PK reading 'proxy ignore' variables? Which ones are supported? (Of course you can s/PK/libzypp/ throughout the entire mail... it depends on who is doing the downloading at the end... ) Dominique -- To unsubscribe, e-mail: zypp-devel+unsubscribe@opensuse.org For additional commands, e-mail: zypp-devel+help@opensuse.org
On Wednesday 07 April 2010 14:25:33 Zhang, Qiang Z wrote:
Thanks. In fact, I have tried libproxy, but libproxy also call GConf API, so libproxy also can't get the correct proxy info. Seems the runtime environment is changed in libzypp. Any comment?
I don't know what libzypp should change to prevent GConf from working. AFAIK it does not delete or undefine any environment variable. -- 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 04/07/2010 at 3:45 PM, Michael Andres
wrote: On Wednesday 07 April 2010 14:25:33 Zhang, Qiang Z wrote: Thanks. In fact, I have tried libproxy, but libproxy also call GConf API, so libproxy also can't get the correct proxy info. Seems the runtime environment is changed in libzypp. Any comment? I don't know what libzypp should change to prevent GConf from working. AFAIK it does not delete or undefine any environment variable.
Most likely the issue is the 'user' libzypp is running as. It's probably in root's context and root does not have any gconf keys set (unless 'it' ever logged in and configured the gnome proxies). libzypp using gconf api and also libproxy will always query the 'current users' gnome settings. For PK this would probably result in a 'helper' app in the user workspace that can forward the settings using a dbus call or the like... Dominique -- To unsubscribe, e-mail: zypp-devel+unsubscribe@opensuse.org For additional commands, e-mail: zypp-devel+help@opensuse.org
Hi, On Wed, 7 Apr 2010, Dominique Leuenberger wrote:
I don't know what libzypp should change to prevent GConf from working. AFAIK it does not delete or undefine any environment variable.
Most likely the issue is the 'user' libzypp is running as. It's probably in root's context and root does not have any gconf keys set (unless 'it' ever logged in and configured the gnome proxies).
libzypp using gconf api and also libproxy will always query the 'current users' gnome settings. For PK this would probably result in a 'helper' app in the user workspace that can forward the settings using a dbus call or the like...
Helper app? WTF? sorry ;-) I think it's reasonable to expect that either the user configures proxy settings also for root, if he needs to use proxies for whatever reason. Or alternatively that libproxy (or libzypp itself) setuid's to $LOGNAME for querying the proxy info. Ciao, Michael. -- To unsubscribe, e-mail: zypp-devel+unsubscribe@opensuse.org For additional commands, e-mail: zypp-devel+help@opensuse.org
On Wednesday 07 April 2010 12:11:18 Dominique Leuenberger wrote:
Obvious the proxy settings vary from 'case to case'. Is PK reading 'proxy ignore' variables? Which ones are supported?
(Of course you can s/PK/libzypp/ throughout the entire mail... it depends on who is doing the downloading at the end... )
Downloading is done by libzypp, either via libcurl or aria2c. Internally zypp works similar to libproxy, there's a method taking an URL and returning the proxy to use. Just the magic behind libzypps method is far less sophisticated. I'll have a closer look at libproxy. -- 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 04/07/2010 at 3:30 PM, Michael Andres
wrote: On Wednesday 07 April 2010 12:11:18 Dominique Leuenberger wrote: Obvious the proxy settings vary from 'case to case'. Is PK reading 'proxy ignore' variables? Which ones are supported?
(Of course you can s/PK/libzypp/ throughout the entire mail... it depends on who is doing the downloading at the end... )
Downloading is done by libzypp, either via libcurl or aria2c. Internally zypp works similar to libproxy, there's a method taking an URL and returning the proxy to use.
Just the magic behind libzypps method is far less sophisticated. I'll have a closer look at libproxy.
If there's anything I can help you with libzypp, just let me know. I'll gladly join in here as an upstream dev. Dominique -- To unsubscribe, e-mail: zypp-devel+unsubscribe@opensuse.org For additional commands, e-mail: zypp-devel+help@opensuse.org
participants (5)
-
Dominique Leuenberger
-
Jon Nelson
-
Michael Andres
-
Michael Matz
-
Zhang, Qiang Z