[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#981166: support origin pins based on path (Was: apt-cacher-ng HTTPS URLs cannot be pinned)



Control: retitle -1 support origin pins based on path

On Wed, Jan 27, 2021 at 04:06:18PM +0900, Marc Dequènes wrote:
> Package: apt
> Version: 2.1.18
> Severity: wishlist
> Control: affects -1 apt-cacher-ng
> 
> Quack,
> 
> I am using apt-cacher-ng and in order to use https I'm using the method
> recommended by its author by prepending HTTPS/// to the host, which gives
> URLs of the like:
>   http://HTTPS///myrepo.example.com/debian
> 
> Previously I was using o= to match but now prefers matching with the origin.
> I realized that when using a proxy with this trick, and even if I encode the
> slashes as %2f it is not matching. In fact after looking into the code I
> found out it simply split at the first slash, and matches with "HTTPS" which
> means it de facto matches all my configured sources, not very practical.

This is correct, the hostname ends with the first /. Encoded characters
are not allowed inside hostnames I believe. Here the hostname is HTTPS
and the path is ///myrepo.example.com/debian.

So effectively, what you are asking for is to allow origin to pin based
on the path, not just the hostname, like we allow for apt_auth.conf.

It's possible to do this in 2.x since we have an extensible cache API
with private pointers where we could store an extended origin, without
breaking existing uses of origin.

Arguably we could also hack up a solution for acng's hack, but that
feels like the wrong approach.
-- 
debian developer - deb.li/jak | jak-linux.org - free software dev
ubuntu core developer                              i speak de, en


Reply to: