Closed lueschem closed 6 years ago
Possible solution:
Apply the following algorithm:
printenv http_proxy
(make sure there is no sudo
involved)gsettings
is available and try to retrieve the proxy (see also https://developer.gnome.org/ProxyConfiguration/)Hint: With sudo -E edi ...
the (proxy) environment variables can be preserved.
Notes about gsettings: Schema: https://github.com/GNOME/gsettings-desktop-schemas/blob/master/schemas/org.gnome.system.proxy.gschema.xml.in
Sample output:
lueschem@lueschem-xps:~$ gsettings list-recursively org.gnome.system.proxy
--> unused --> org.gnome.system.proxy use-same-proxy false
org.gnome.system.proxy mode 'manual'
org.gnome.system.proxy autoconfig-url 'http://foo.bar'
org.gnome.system.proxy ignore-hosts ['localhost', '127.0.0.0/8', '::1']
org.gnome.system.proxy.ftp host 'foo:bar@127.0.0.3'
org.gnome.system.proxy.ftp port 8080
org.gnome.system.proxy.socks host ''
org.gnome.system.proxy.socks port 8080
org.gnome.system.proxy.http host 'foo:bar@127.0.0.3'
org.gnome.system.proxy.http port 8080
org.gnome.system.proxy.http use-authentication false
org.gnome.system.proxy.http authentication-password ''
org.gnome.system.proxy.http authentication-user ''
--> unused --> org.gnome.system.proxy.http enabled false
org.gnome.system.proxy.https host ''
org.gnome.system.proxy.https port 8080
If org.gnome.system.proxy mode
is set to 'auto'
log a warning and do not set a proxy.
Python bindings: https://pygobject.readthedocs.io/en/latest/
Issue Type
Environment detail
Desired Behaviour
sudo edi ...
andedi ...
shall use the same proxy settings.Actual Behaviour
sudo edi ...
does not take the proxy settings of the current user into account. The difference between Ubuntu 18.04 and Ubuntu 16.04 is that Ubuntu 16.04 had the possibility to apply the proxy settings system wide while for 18.04 it is only applied per user.