Bug 132398 - Default proxy configuration
Summary: Default proxy configuration
Status: VERIFIED FIXED
Alias: None
Product: SUSE Linux 10.1
Classification: openSUSE
Component: Firefox (show other bugs)
Version: Beta 9
Hardware: Other Other
: P5 - None : Enhancement (vote)
Target Milestone: RC 2
Assignee: Wolfgang Rosenauer
QA Contact: E-mail List
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-11-04 20:30 UTC by Michael Stather
Modified: 2006-05-17 07:31 UTC (History)
3 users (show)

See Also:
Found By: Other
Services Priority:
Business Priority:
Blocker: ---
Marketing QA Status: ---
IT Deployment: ---


Attachments
fix (37.04 KB, patch)
2006-03-20 02:37 UTC, Robert O'Callahan
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Michael Stather 2005-11-04 20:30:29 UTC
The default proxy configuration for the installed firefox should be set to "auto-detect the proxy settings" so that firefox keeps to the proxy settings donw within YaST
Comment 1 Robert O'Callahan 2005-11-06 23:06:44 UTC
Does YaST set the proxy settings in gconf? If not, how should I get them?
Comment 2 Wolfgang Rosenauer 2005-11-07 05:13:58 UTC
YaST basically sets the environment variables $http_proxy and $https_proxy.
This discussion is very old and at any time there was the plan to extend the gconf database to fall back to these variables if nothing else is set.
The upstream feature request is 
https://bugzilla.mozilla.org/show_bug.cgi?id=66057
Comment 3 JP Rosevear 2005-11-07 14:07:53 UTC
The gnome-settings-daemon should keep the GNOME proxy setting in sync with the gconf one as of NLD9 SP2.  Federico did this work.
Comment 4 Federico Mena Quintero 2005-11-08 21:32:50 UTC
Our Bangalore team wrote the patches for Firefox to read the proxy settings from GConf.  Don't we include those in our Firefox package for Suse 10?

Hummm, it even looks like we don't include the proxy patch in control-center2 in Suse 10.  We included it in Suse 9.3.
Comment 5 Robert O'Callahan 2005-11-09 21:09:52 UTC
We will use the gconf settings for all kinds of things if use_system_prefs is enabled. But we don't want to enable that by default.
Comment 6 Robert O'Callahan 2005-11-09 21:13:26 UTC
I think we might fix upstream bug 66057 by having the existing "auto-detect proxy configuration" option (which currently uses WPAD, i.e., looks for wpad.mydomain) check HTTP_PROXY/FTP_PROXY first. Then we could make auto-detect proxy configuration the default setting. As far as I can tell it doesn't hurt if there is no WPAD server present.
Comment 7 JP Rosevear 2005-11-11 13:51:05 UTC
Lets give this a try then.
Comment 8 Wolfgang Rosenauer 2005-12-22 07:48:26 UTC
JP, do we want this for CODE10? Robert, I don't know if I have enough time until feature freeze. Basically it's just getenv and check if they contain values and use them?
Comment 9 Michael Stather 2005-12-22 14:43:03 UTC
I don´t understand why you wnat to change something inside firefox. It´s just the default setting which needs to be changed IMHO, and firefox will read the settings from the environment vars (at leas on my systems it does).
Comment 10 Federico Mena Quintero 2005-12-22 16:40:16 UTC
It's pretty important for a running Firefox process to pick up changes in the proxy settings through GConf.  Otherwise you would have to restart it.

In a GNOME session, the GConf settings are the most important ones.
Comment 11 Michael Stather 2005-12-22 17:39:30 UTC
Yes this would be the best solution, but if SuSE should be that perfect I could submit another 30 bug reports (this is nothing against SuSE, it´s still the best distro around).
Comment 12 Federico Mena Quintero 2005-12-22 18:15:50 UTC
Hey, we aim for perfection.  Do submit those reports :)
Comment 13 Wolfgang Rosenauer 2005-12-22 18:22:09 UTC
to comment #9: Firefox doesn't use the $*_proxy variables. What you mean are the gconf settings.

to comment #10: yes, in GNOME sessions it would be OK to use the system prefs (gconf settings). AFAIK Robert's patch can sync the Firefox proxy settings with gconf's. Maybe we should detect a GNOME session and activate system prefs? Robert, do you think it's safe to switch it on?

This bugreport is mainly about the whole system and the only setting which should be honored by every application are the env variables $http_proxy and $ftp_proxy ( if not superseded by another more special setting). This is what this bug is about IMHO.
Comment 14 Robert O'Callahan 2005-12-22 20:12:36 UTC
I'm going to fix this as soon as I figure out what should be implemented.

If picking up dynamic changes is important (and I agree that it probably is) then the environment variables are useless, and gconf is the way to go. However, turning on the full gconf system-prefs facility is not the right way to go. It's too invasive and risky where it's not absolutely necessary.

How about this. My new system-prefs code contains a list of the preferences that should be mapped. I can generalize it to support multiple lists, with the actual list selected at startup time. At startup we'll do the following:
-- If gconf is not installed then the gconf system prefs module won't load and no gconf prefs will be mapped.
-- If gconf is installed the gconf system prefs module will load. Then we check the config.use_system_prefs pref. If it's true, then we map all supported gconf prefs.
-- Otherwise we check DESKTOP_SESSION. If it's 'gnome', then we map the gconf proxy settings only.
-- Otherwise we map nothing.

How does that sound? There is one more question to decide: should the user be able to change the proxy via the Firefox preferences UI? If so, should those changes be written back to gconf?
Comment 15 Wolfgang Rosenauer 2005-12-22 20:44:53 UTC
This sounds good but then we have no support for the env vars again.
And I don't think that dynamic updates have to occur in a running application (for environment variables). No other application is doing this AFAIK. The variables are still the only common denominator for all applications and desktops. We can set it with YaST and online-update is using it as well.

Your suggestion is still very interesting but you know that feature freeze is near?
To your question about the Firefox UI: The default is greying it out if taken from gconf but then we have the problem that the user doesn't know why it's locked.
I would also not force the user to use the gconf proxies. He might want to use different proxy settings for different applications.
The biggest problem here is user experience and not the implementation :-(
Comment 16 Robert O'Callahan 2005-12-22 21:04:36 UTC
What I just suggested is a very small amount of work on top of the existing lockdown patches. Probably less work than using HTTP_PROXY.

But okay, how about this combination of my previous suggestions:
-- Make "auto-detect proxy configuration", which currently uses WPAD, use gconf instead if DESKTOP_SESSION is "gnome". We will assume that if the user/administrator wants WPAD then they will point gconf's /system/proxy/autoconfig_url at http://wpad/wpad.dat (which is all WPAD does).
-- When DESKTOP_SESSION is not "gnome", make "auto-detect proxy configuration" check *_PROXY env. vars first before checking WPAD.
Comment 17 JP Rosevear 2006-01-11 14:44:05 UTC
This work is now right?
Comment 18 Wolfgang Rosenauer 2006-01-11 14:50:13 UTC
yes, it will be in beta1.
Comment 19 Michael Stather 2006-03-11 13:00:39 UTC
I tested it in beta6 and while it works in KDE it doesn´t work in GNOME.
Comment 20 Wolfgang Rosenauer 2006-03-11 14:28:49 UTC
Could you please explain what doesn't work in GNOME?
Comment 21 Michael Stather 2006-03-11 14:33:07 UTC
Firefox is set to "auto-detect proxy settings".
This does work in KDE but doesn´t work in GNOME.
In GNOME I can´t access any websites using firefox.
Comment 22 Wolfgang Rosenauer 2006-03-11 15:56:53 UTC
Then it's a GNOME problem if it is one at all.
What are your GNOME proxy settings in gnome-control-center?
Comment 23 Michael Stather 2006-03-12 14:44:47 UTC
I didn´t change any settings, it´s set to "use system proxy settings".
Another thing which I really don´t understand (after reading the whole discussion above) is why you use gconf. Why don´t you just use the environment variables no matter which desktop is used. This is what is done by wget&co and this works always.
You use gconf under gnome, so why don´t you use kdenetwork under kde. It also has an option to set the proxy in the kde control center for all kde apps. So either it´s "complete" support for both kde and gnome or the env vars which are always set and desktop-independant IMHO.
Comment 24 Wolfgang Rosenauer 2006-03-12 18:39:35 UTC
Since gconf integration is already available in Firefox and the system variables are
1. basically a system-default set by the administrator
2. to unix-like to know for the beginner
it makes sense to use the gconf settings when running in Gnome environment.
But we fallback to environment variables which is a good thing.
The reason why there is no support for KDE is simply because noone provided a patch to use it.

I think the current implementation is the best trade-off for now.
Comment 25 Wolfgang Rosenauer 2006-03-16 09:50:06 UTC
I just have tested again with beta8 and I can confirm that we have a problem.
Firefox in KDE gets the environment variables and is using them without problems.
Firefox in Gnome doesn't work. As epiphany works correctly under Gnome there might be an issue with our Firefox patch and it doesn't get the gconf settings correctly.
That's a bug we have to fix as soon as possible. Robert, would you please have a look at it (in addition to myself)?
Comment 26 Wolfgang Rosenauer 2006-03-16 09:53:43 UTC
If I look in gconf settings if system_values are used I see the proxy settings almost correctly. The "secure_host" setting is empty but https_proxy is set correctly in the environment. So this might also be a gconf bug.
Comment 27 Wolfgang Rosenauer 2006-03-16 11:52:44 UTC
(opened another bug for the secure_host thing)

It turned out that this is a Firefox specific problem.
If I set gconf settings they are also not used or wrongly used and Firefox doesn't load anything.
Comment 28 Federico Mena Quintero 2006-03-16 16:20:31 UTC
Does the patch that we had in Suse 9.3 work for our most recent Firefox package?  It certainly worked back then.

The description of how proxies work in Suse+GNOME is here: https://wiki.innerweb.novell.com/index.php/NLD_GNOME_Proxy_Configuration
Comment 29 Wolfgang Rosenauer 2006-03-16 17:28:08 UTC
The current patch to get the gconf proxies is completely different to what we used in Firefox 1.0.x when use_system_settings was used there.
I think I understand how proxy settings work.
If Firefox is not running under Gnome it uses the environment variables directly which definitely works. But getting the proxy settings through gconf doesn't work currently.
Comment 30 Robert O'Callahan 2006-03-20 02:37:48 UTC
Created attachment 73857 [details]
fix

Here's an updated system-proxies.patch. I installed squid and verified that with this patch I can access my proxy on localhost when I set that from gconf.
Comment 31 Robert O'Callahan 2006-03-20 02:45:50 UTC
regarding comment #28, we still have that code ... well, an updated version of it. But it's only active when config.use_system_prefs is enabled. Its effect is to force synchronization of Mozilla proxy settings with gconf (so any changes through Firefox UI will propagate back to gconf, mandatory gconf settings disable the Firefox UI, etc).

This bug is about making it possible, as an option, for Firefox to read the gconf or other system settings, whether or not use_system_prefs is enabled (use_system_prefs is disabled for most users).
Comment 32 Wolfgang Rosenauer 2006-03-20 08:28:08 UTC
Thanks Robert. The patch works for me.
Comment 33 Johannes Weberhofer 2006-03-22 17:38:54 UTC
Firefox configuration is working much better now, but I can not force Firefox to read the WPAD information provided by DHCP. 

I suggest to add another option to Firefox, something like "Use System settings"; then the functionallity of WPAD would work having "auto-detect the proxy settings" set, and "Use system settings" would read the current GNOME/KDE settings. This feature would even be usefull to have in Windows...
Comment 34 JP Rosevear 2006-03-22 18:34:11 UTC
We explicitly decided not to add another option, but it was discussed.  WPAD settings should be preferred however, that was part of this patch.
Comment 35 Robert O'Callahan 2006-03-22 22:16:17 UTC
(In reply to comment #33)
> Firefox configuration is working much better now, but I can not force Firefox
> to read the WPAD information provided by DHCP.

You can choose "use system settings" and then configure WPAD via gconf. You set /system/proxy/mode to "auto" and /system/proxy/autoconfig_url to http://wpad/wpad.dat. You need to do this anyway to make sure that GNOME applications work.

> I suggest to add another option to Firefox, something like "Use System
> settings"; then the functionallity of WPAD would work having "auto-detect the
> proxy settings" set, and "Use system settings" would read the current
> GNOME/KDE settings. This feature would even be usefull to have in Windows...

Actually, in the upstream version of this patch I am adding a new preference for this, due to feedback (and there's a guy working on a Mac implementation, but no Windows yet). We could apply the upstream version here too, if we want to.

(In reply to comment #34)
> We explicitly decided not to add another option, but it was discussed.  WPAD
> settings should be preferred however, that was part of this patch.

Actually this patch was designed to fall back to WPAD when environment variables and gconf are not available. In GNOME setups gconf is always available so WPAD will not be used unless it is configured in gconf.
Comment 36 Johannes Weberhofer 2006-03-23 06:47:13 UTC
In my opinion, it makes configuration confusing, because firefox behaves different in different environments.

In a network at one of my customers we are using WPAD to use different proxies for different target addresses. The only way to do that is to use complex scripts (proxy.pac);
up to now the configuration was very simple, because the users could simply use Firefox's standard setting "auto-detect the proxy settings". Now it seems necessary to set the proxy setting individually for each users in the private gnome setup.
Comment 37 Robert O'Callahan 2006-03-23 22:59:19 UTC
That is true. I had assumed people like that would have the correct gconf settings too, so that their GNOME apps can fetch with HTTP, but I guess not. Anyway we've decided to take the upstream version of this patch, which uses a new preference, which I will attach here for Wolfgang soon.
Comment 38 Wolfgang Rosenauer 2006-03-24 05:59:48 UTC
I've checked the proposed patch.
The problem with this is, that we would have to add an option in the UI which is not available in upstream Firefox. Therefore no translations are available for this option and the way how the localization works in mozilla stuff will break the UI almost completely.
So if we really want to change it that way, someone would have to maintain 31 language packs internally.

Comment 39 Johannes Weberhofer 2006-03-24 10:38:53 UTC
I think those changes should be suggested to the Firefox project, to have this feature for every Firefox releases (as mentioned before, it would also be nice to have this facility in the MS Windows environment and on Apple computers).

When you (from Novell/SuSE) can propose this patch and donate it to the Mozilla project, I could imagine, that they will include it to the sources...

Thank you for the great work and sorry for the work my posting caused ;-)
Johannes
Comment 40 Wolfgang Rosenauer 2006-03-24 10:52:47 UTC
The patch we are talking about is already half-way in the Firefox original code.
But it can be added at the earliest with Firefox 2. But we have to ship 1.5.x soon ;-)
Comment 41 Andreas Jaeger 2006-03-29 12:48:36 UTC
This not critical for 10.1.
Comment 42 Robert O'Callahan 2006-04-06 04:45:56 UTC
Wolfgang, JP and I decided to try reusing an existing string.

From here:
http://lxr.mozilla.org/mozilla/source/browser/components/preferences/fonts.xul#45,
copy
<!DOCTYPE prefwindow SYSTEM "chrome://browser/locale/preferences/fonts.dtd" >
into browser/components/preferences/connection.xul.

Then you can set the preference string to &resolution.system.label;
In English that string is "System setting", which works OK in this context. I don't know if it still makes sense in other locales though.

Hey, if that doesn't work we can write some JS code to ask Babelfish to translate "Use system settings" into the desired language :-).
Comment 43 Wolfgang Rosenauer 2006-04-11 10:21:15 UTC
package submitted with proposed change
Comment 44 Johannes Weberhofer 2006-05-17 07:29:36 UTC
Hello!

The released version works great. Well done! I think, the bug can be closed.