** Description changed:

+ [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_apt_http(s)_proxy
+ ua_apt_http(s)_proxy
+ 
+ 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\/0\nhttp_access allow all\nhttp_access deny all/' /etc/squid/squid.conf
+ 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://squid:3128
+ lxc exec f-1956764 -- ua config set apt_https_proxy=http://squid:3128
+ lxc exec f-1956764 -- cat /etc/apt/apt.conf.d/90ubuntu-advantage-aptproxy
+ # See that the proxy was configured globally
+ ```
+ 
+ 
+ To see that release 27.9 of ubuntu-advantage-tools fixes the problem, you can 
use the build in `ppa:ua-client/staging` for now (or once it is in -proposed, 
just enable proposed).
+ 
+ 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-client/staging
+ lxc exec f-1956764 -- apt install ubuntu-advantage-tools
+ 
+ # first check that backwards compatibility is maintained
+ lxc exec f-1956764 -- ua config set apt_http_proxy=http://squid:3128
+ # see message about renaming of field, but still success
+ lxc exec f-1956764 -- ua config set apt_https_proxy=http://squid:3128
+ # see message about renaming of field, but still success
+ lxc exec f-1956764 -- cat /etc/apt/apt.conf.d/90ubuntu-advantage-aptproxy
+ # 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_apt_http_proxy=http://squid:3128
+ lxc exec f-1956764 -- ua config set global_apt_https_proxy=http://squid:3128
+ lxc exec f-1956764 -- cat /etc/apt/apt.conf.d/90ubuntu-advantage-aptproxy
+ # see that proxy was configured globally
+ 
+ lxc exec f-1956764 -- ua config unset global_apt_http_proxy
+ lxc exec f-1956764 -- ua config unset global_apt_https_proxy
+ 
+ # finally check that new ua_ fields work as the bug author desires
+ lxc exec f-1956764 -- ua config set ua_apt_http_proxy=http://squid:3128
+ lxc exec f-1956764 -- ua config set ua_apt_https_proxy=http://squid:3128
+ lxc exec f-1956764 -- cat /etc/apt/apt.conf.d/90ubuntu-advantage-aptproxy
+ # 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-advantage-tools sets, run one of the following:
  * Substitute "apt_https_proxy" for "apt_http_proxy" as necessary.
  *   sudo ua config set apt_http_proxy=<value>
  *   sudo ua config unset apt_http_proxy
  */
  Acquire::http::Proxy http://<proxy_ip>:3128;
  Acquire::https::Proxy http://<proxy_ip>:3128;
  
  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::http::Proxy::<esm repo> "http://your.proxy.host/";;
  Acquire::http::Proxy::<fips repo> "http://your.proxy.host/";;

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/1956764

Title:
  Proxy should be set up only for ua-related repos

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/ubuntu-advantage-tools/+bug/1956764/+subscriptions


-- 
ubuntu-bugs mailing list
[email protected]
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to