In Valid Logic

Endlessly expanding technology

Managing APT repositories on S3 with ease

S3 is a great place to host an APT repository… cheap storage, easily available, no server to run or anything. The annoying thing is that most ways to set it up involve using something like reprepro on a local box and using s3cmd to then sync the local files up to S3. For me, the annoyance is that I use throw away VMs. I don’t want to store them, or I’ll remove the VM without thinking, and then need to redownload everything to just add one one package.

I wanted just a simple tool that would upload the new package, generate the Package file adding in the new file, and update relevant hashes in the Release file. It seems simple, but could find something for the lazy people like me.

Finally decided to scratch my own itch. Over the weekend I wrote deb-s3. Have to upload a package? No problem.

$ deb-s3 upload my-deb-package-1.0.0_amd64.deb --bucket my-bucket
>> Examining package file my-deb-package-1.0.0_amd64.deb
>> Retrieving existing package manifest
>> Uploading package and new manifests to S3
   -- Transferring pool/m/my/my-deb-package-1.0.0_amd64.deb
   -- Transferring dists/stable/main/binary-amd64/Packages
   -- Transferring dists/stable/main/binary-amd64/Packages.gz
   -- Transferring dists/stable/Release
>> Update complete.

If it is your first package, it creates all the necessary files from scratch. On your server, you can then plug it in your /etc/apt/sources.list as:

deb https://my-bucket.s3.amazonaws.com stable main

It features:

  • Specify different components or codenames as you wish. It’ll maintain other components and architectures in the Release file.
  • Options to specify the visibility of the file. Can set to private or authenticated, and then use apt-s3 to supported authenticated requests against S3.
  • Ability to sign the Release file (GPG will prompt for the passphrase)

Check it out. Use it, love it, fork it, extend it, send a pull request.

If you simply want to use it, its available as a gem as well.

$ gem install deb-s3

And you’re set.

Tuesday, February 26, 2013

 
blog comments powered by Disqus