Proxy should be set up only for ua-related repos
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
ubuntu-advantage-tools (Ubuntu) |
Fix Released
|
Medium
|
Unassigned |
Bug Description
[Impact]
This was intended behavior, but is considered unintuitive and undesirable in some situations.
The issue affects users who want an apt proxy only for ua-related packages, who may find the `apt_http(s)_proxy` variables and expect them to do that. They will be surprised when those variables actually set global apt proxy settings.
This feature was built as such per the request of a different user, so we need to keep the ability to easily set a global apt proxy.
The fix is to add/rename the supported apt proxy settings in a backwards compatible way. We now support two differently scoped apt proxy settings:
global_
ua_apt_
which we think behave more intuitively.
The global_ settings set a global apt proxy. The ua_ settings set a proxy only for ua related packages.
We also still support the plain apt_http(s)_proxy variables and they behave the same way they always have, which is the same as the new global_ settings.
[Test Plan]
To Reproduce:
```
lxc launch ubuntu-daily:focal squid
lxc exec squid -- apt update
lxc exec squid -- apt install squid
lxc exec squid -- sed -i 's/http_access deny all/dns_v4_first on\nacl all src 0.0.0.0\
lxc exec squid -- systemctl restart squid.service
lxc launch ubuntu-daily:focal f-1956764
lxc exec f-1956764 -- ua config set apt_http_proxy=http://
lxc exec f-1956764 -- ua config set apt_https_proxy=http://
lxc exec f-1956764 -- cat /etc/apt/
# See that the proxy was configured globally
```
To see that release 27.9 of ubuntu-
Continuing in the same container from reproducing the bug:
```
lxc exec f-1956764 -- ua config unset apt_http_proxy
lxc exec f-1956764 -- ua config unset apt_https_proxy
lxc exec f-1956764 -- add-apt-repository ppa:ua-
lxc exec f-1956764 -- apt install ubuntu-
# first check that backwards compatibility is maintained
lxc exec f-1956764 -- ua config set apt_http_proxy=http://
# see message about renaming of field, but still success
lxc exec f-1956764 -- ua config set apt_https_proxy=http://
# see message about renaming of field, but still success
lxc exec f-1956764 -- cat /etc/apt/
# see that proxy was configured globally
lxc exec f-1956764 -- ua config unset apt_http_proxy
lxc exec f-1956764 -- ua config unset apt_https_proxy
# second check that new global_ fields work the same as the old fields
lxc exec f-1956764 -- ua config set global_
lxc exec f-1956764 -- ua config set global_
lxc exec f-1956764 -- cat /etc/apt/
# see that proxy was configured globally
lxc exec f-1956764 -- ua config unset global_
lxc exec f-1956764 -- ua config unset global_
# finally check that new ua_ fields work as the bug author desires
lxc exec f-1956764 -- ua config set ua_apt_http_proxy=http://
lxc exec f-1956764 -- ua config set ua_apt_https_proxy=http://
lxc exec f-1956764 -- cat /etc/apt/
# see that proxy was configured only for esm.ubuntu.com
```
[Where problems could occur]
There is some complexity in maintaining backwards compatibility with the new setting names. If we made mistakes here, then backwards compatibility may not work for this feature in all cases.
This feature touches apt configuration, and so if we made a mistake, this could cause broader apt warnings/errors if the generated config is invalid.
[Original Description]
Currently if the proxy is configured for the UA client it is setting up global proxy for the entire apt:
* To change what ubuntu-
* Substitute "apt_https_proxy" for "apt_http_proxy" as necessary.
* sudo ua config set apt_http_
* sudo ua config unset apt_http_proxy
*/
Acquire:
Acquire:
In the clouds though all the packages come from the cloud-based mirrors except UA-related ones.
There is a use case currently when a customer wants to set up a proxy to reach the UA repositories but the proxy is throttling the bandwidth and it is impossible to pull all the packages through it.
Suggesting to set up proxy in apt specifying the repo names such as
Acquire:
Acquire:
Changed in ubuntu-advantage-tools (Ubuntu): | |
status: | Confirmed → Fix Committed |
Changed in ubuntu-advantage-tools (Ubuntu): | |
status: | Fix Committed → In Progress |
description: | updated |
Thanks for the bug report! I think this is a good idea.