Closed davidmhewitt closed 4 years ago
Why isn't this using PacRunner
or the NetworkManager interfaces? Also, why is this necessary? NetworkManager already handles system proxy stuff to take care of that...
@Conan-Kudo This plug currently uses the GNOME dconf keys to set a proxy. This works quite well for desktop applications and browsers but does not take effect for commands like curl
which use environment variables like http_proxy
and also doesn't work with apt which expects proxy configuration to be in a config file. So you end up with proxy settings that work for some things but not others.
I may be missing something, but my understanding is that until every piece of software uses libproxy
or PacRunner
or something similar to resolve proxies, then this will continue to be a problem. I don't think NetworkManager can set environment variables for things like curl
and I'm also struggling to find in their documentation how you set a manually configured proxy with it.
I believe this is why ubuntu-system-service
continues to be used and shipped by Ubuntu to get around some of these minor proxy annoyances. However, if there's a missing link that would make this more distro independent, please point me in that direction and I'll rework this to use that.
@davidmhewitt The correct thing to do would be to adjust ubuntu-system-service
to fetch the configuration from NetworkManager if it exists and dynamically set it to the environment for all the things. Or make a separate specific service for this if you don't want to adjust ubuntu-system-service
.
Per-connection proxy information is available through the connection settings enumeration.
@Conan-Kudo While I agree that would be better, I think that's a separate issue that's beyond the scope of this. Doing something like that would require reworking this switchboard plug to better configure per-connection proxies via NetworkManager. Plus the work involved in making a suitable system service to handle the environment variables etc...
The aim of this relatively low overhead PR is to bring our proxy settings back to feature parity with the GNOME control center settings page which elementary used to ship and then we lost the systemwide proxy functionality when writing this switchboard plug.
@donadigo @Conan-Kudo Thank you both for the feedback, I've made the changes as suggested.
@donadigo
ubuntu-system-service
code seems reasonably fail safe. So I think I'd like to avoid a dialog, but I'm open to @elementary/ux opinions. Thanks again for the review.
Superseded by #255
Superseded by #255
Fixes #37
Uses the
ubuntu-system-service
DBus interface and a bit of Polkit to set the apt proxy and proxy environment variables for terminal use when configuring a proxy in the plug.Since this depends on an ubuntu specific package, I've added a CMake option to enable the systemwide proxy setting functionality.
Compiling with
cmake -DCMAKE_INSTALL_PREFIX=/usr -DUSE_UBUNTU_SERVICES=ON
will enable the functionality.