On Wed, Oct 20, 2004 at 02:11:44AM +0200, martin f krafft wrote:
> Here's an idea I just had about apt-proxy/apt-cacher NG. Maybe this
> could be interesting, maybe it's just crap. Your call.

> Based on a normal mirror layout, the idea is to use apache's 404
> hook for packages. When an existing package is requested, it is
> served regularly. If the file is not found, a 404 is triggered,
> which can be served by a CGI-like thingie that goes to retrieve the
> package, returns 200 instead of 404 and streams the package as the
> 404 error document contents while writing it to the filesystem
> (tee(1) style).

This all sounds great. I've been thinking about it since this posting,
and one thing I'd like to see would be this hooked up to mod_proxy, so
I only have to change one setting in apt.conf, rather than a couple of
lines in sources.list, when I move from site to site.

I'm not sure yet myself how this would work, but I guess it would
catch anything that was looking for a Packages.gz, and rewrite it
internally as a connection to a local mirror or mirrors. If that
didn't work, trying the client-supplied mirror server as a fallback
would allow it to neatly cache those files which were coming from
Debian-external package pools, while still ensuring only files that
are listed in a Packages.gz somewhere get through.

That last fallback would have to be optional, or anyone could put a
Packages.gz on a webserver, and suddenly any file would be gettable
through the proxy, which would defeat one of the purposes to which
_I_ currently put apt-proxy (which is providing unmetered Debian
archive access for otherwise metered ISP customers. ^_^)

But for my home install, it'd be nice to know that experimental,
the IPv6 archive and the WMI, CenterICQ and irssi daily build
archives are all being cached and cleaned automatically when I'm
there, and otherwise I comment out the proxy option and they work
when I'm off-site for a week.

Is there anything such a system would want to fetch from a Debian
mirror that doesn't show up in Packages.gz or Sources.gz?

> For Release, Package, Sources, and Contents files, we need
> a RewriteRule. When one of these is is accessed, a call to a mirror
> should be made to check for updates. If there is one, download it
> and stream it.

> How do you send the newly retrieved file instead of the static file
> present on the filesystem? Essentially, this is the only need for
> a proxy, which could be implemented with a RewriteRule and a CGI. Or
> maybe apache can do this somehow?

> I think this would be an extremely simple implementation, using the
> proven apache for most of the work (and not the buggy twisted module
> that apt-proxy uses). Thus, the entire thing is reduced to a couple
> of httpd.conf entries and two extremely simple (?) CGIs.

> In addition, a cronjob runs daily to purge all files in the
> filesystem space, which are not referenced from any of the
> Packages/Sources files.

> This is a braindump. Please comment. Am I missing something? Would
> someone like to try this? I really don't have the time right now...

-- 
-----------------------------------------------------------
Paul "TBBle" Hampson, MCSE
7th year CompSci/Asian Studies student, ANU
The Boss, Bubblesworth Pty Ltd (ABN: 51 095 284 361)
[EMAIL PROTECTED]

"No survivors? Then where do the stories come from I wonder?"
-- Capt. Jack Sparrow, "Pirates of the Caribbean"

This email is licensed to the recipient for non-commercial
use, duplication and distribution.
-----------------------------------------------------------

Attachment: signature.asc
Description: Digital signature

Reply via email to