301 redirection on APT repository

385 views
Skip to first unread message

Pablo Costa

unread,
Jun 6, 2014, 7:48:30 AM6/6/14
to list-cfengine
Hello people,

I have a local proxy to save time and bandwidth for many distribution
and package repositories.
The local proxy is only able to reach certain hostnames, to avoid
unexpected connections.
Recently the CFEngine APT repository stopped being reachable, and the
reason is the HTTP redirection 'pictured' below.

I don't think a '301 Moved Permanently' to a kind-of dynamic dns name
at amazon is semantically sound.

Someone around who has given this a good thought, already, and cares
to share actual policies in this respect (regex on URL?)

Or if someone at CFEngine agrees with my point of view and feels like
solving this in a more elegant way...

I'll appreciate your thoughts.

Cheers!
pablo

$ wget http://cfengine.com/pub/apt/packages
--2014-06-06 13:30:29-- http://cfengine.com/pub/apt/packages
[...]
Proxy request sent, awaiting response... 301 Moved Permanently
Location: http://s3.amazonaws.com/cfengine.package-repos/pub/apt/packages
[following]
[...]

PS -- what a pain in the ass when apt-get just silently hangs for some
minutes xD

Ted Zlatanov

unread,
Jun 6, 2014, 9:58:56 AM6/6/14
to help-c...@googlegroups.com
On Fri, 6 Jun 2014 13:48:09 +0200 Pablo Costa <modul...@gmail.com> wrote:

PC> I don't think a '301 Moved Permanently' to a kind-of dynamic dns name
PC> at amazon is semantically sound.

PC> $ wget http://cfengine.com/pub/apt/packages
PC> --2014-06-06 13:30:29-- http://cfengine.com/pub/apt/packages
PC> [...]
PC> Proxy request sent, awaiting response... 301 Moved Permanently
PC> Location: http://s3.amazonaws.com/cfengine.package-repos/pub/apt/packages

It's S3, not dynamic DNS. S3 buckets are pretty good for hosting large
files with static content. The guides I saw (e.g.
http://xn.pinkhamster.net/blog/tech/host-a-debian-repository-on-s3.html)
use the S3 URL directly but that seems like a nasty infrastructure
dependency.

To avoid the redirects and in order to make the S3 infrastructure less
explicit in the URL, I would set up a domain name that goes to the S3
bucket as in
http://docs.aws.amazon.com/AmazonS3/latest/dev/website-hosting-custom-domain-walkthrough.html,
and make that the official repo site. Everyone switches over and we're
done.

Ted

Reply all
Reply to author
Forward
0 new messages