Forum archive
TKLDev 17.1 coexistence with squid_deb_proxy_client
My TKLDev instance seems to be downloading OS updates and the like over and over again. Might this have something to do with squid-deb-proxy-client being installed? I typically install it on all my Debian VMs as I have an instance of apt-cacher-ng running for my network. But with this latest TKLDev instance, it seems like neither cache is getting used - not TKLDev's and not my apt-cacher-ng instance.
I didn't realize until searching for answers that squid is now being used in 17.x. The main reason I installed squid-deb-proxy-client on this TKLDev host is because I'm on fairly slow internet and was hoping it might populate its internal cache from the perfectly good one I've already got built up on my dedicated apt caching server.
It sounds like you're on to it, but to ensure that we're on the same page, on TKLDev squid is set up as a caching proxy for http and https. We use squid with a more generic proxy config to allow us to cache all sorts of packages and/or files (not just apt). Apt on TKLDev should be using it's own squid cache - configured in /etc/apt/apt.conf.d/00proxy:
Beyond that, TBH, I'm not completely sure of the best way to achieve your ends.
Possibly the quickest/easiest way to go would be to reconfigure your TKLDev and the TKLDev build process to use your existing apt-cacher for fetching packages. Configuring TKLDev itself is easy (i.e. replace /etc/apt/apt.conf.d/00proxy). To adjust the building appliance's apt cache, adjust the common bootstrap_apt conf script (should locally be found at /turnkey/fab/common/conf/bootstrap_apt). You'll need to adjust the following lines that start with 'Aquire' (lines 38 & 39 currently):
Note that the squid proxy will still be running/available, so you can use it during builds if you want (e.g. caching a downloaded file). Different tools have different ways of setting a proxy, although most Linux utils and programs should honor http_proxy and https_proxy if you set them. Note that the env vars FAB_HTTP_PROXY & FAB_HTTPS_PROXY should contain the default relevant proxy url. Simply export the env vars to enable proxy caching for most commands/services. Do that (in your conf script) like this:
As a longer term plan though, perhaps it's worth considering setting up your own local dedicated web caching server?! You could essentially re-implement the Squid setup we use on TKLDev, on a Core instance? You could then use it to replace your apt-cacher set up, as well as use it as a general caching web proxy to improve your web browsing and other online experience?!
Keep in mind though, that the way we have squid set up on TKLDev, it's essentially a MITM (man in the middle). It decrypts https web traffic, caches it and then re-encrypts it to your browser. So, you'll need to import the CA key into your OS and/or browser. It does also mean that https traffic which you'd generally assume is private, is actually being stored on your network. I didn't bother looking into it, but I'd assume that you could blacklist caching of specific sites (e.g. internet banking) so that connect directly to those sites that it makes the most sense.