cybozu-go / aptutil

Go utilities for Debian APT repositories
MIT License
124 stars 29 forks source link

transparently proxy repositories #46

Open johncollaros opened 4 years ago

johncollaros commented 4 years ago

Hi,

One of the advantages of apt-cacher-ng was that sources.list files didn't need updating. Just the Acquire::http::Proxy statement, or http(s)_proxy enviroment line were required.

When you start adding other repos for software projects, either manually or using PPAs, this looks like it will be messy. How does the proxy know which repo you wish to use?

stappersg commented 4 years ago

I wonder how this relates to #34 Is it same thing these (#46 and #34) issues are about?

johncollaros commented 4 years ago

Hi @stappersg

No, this is to do with configuring repos in sources.list. https://github.com/cybozu-go/aptutil/blob/master/cmd/go-apt-cacher/USAGE.md

With apt-cacher-ng, I only have to tell apt to use the proxy, either by setting the environment variable :

http_proxy=http://<apt-cacher-hostname>:<apt-cacher-port>
https_proxy=http://<apt-cacher-hostname>:<apt-cacher-port>

or by configuring apt.conf:

Acquire::http::proxy "http://<apt-cacher-hostname>:<apt-cacher-port>";
Acquire::https::proxy "http://<apt-cacher-hostname>:<apt-cacher-port>";

go-apt requires you to change the hostname for every entry in all sources.list files. Eg:

deb http://security.ubuntu.com/ubuntu trusty main restricted

becomes

deb http://<go-apt-cacher hostname>/ubuntu trusty main restricted

Unless I have misunderstood the configuration. Could someone knowledgeable chime in? thanks :-)