Draft: Create torrent files for generated images if --torrent is provided
This uses the mktorrent tool to create a .torrent file for each generated image. Torrents are nice because they have built-in checksumming, trivially resumable downloads and theoretically can reduce bandwith on the image download server.
Each torrent contains a few open trackers but its expected that most peers would be found through DHT. A web seed pointing to the ftp.freedombox.org server is also added; other mirrors could be added in the future. These URLs are all hardcoded for now but could be made configurable if desired.
This came out of a discussion between myself and @njoseph at DebConf. I had already written a similar script for Wikimedia dumps using mktorrent so it was pretty straightforward for me to add in here. Torrent creation needs a --torrent
flag for now so it can be phased in whenever the infra stuff is ready, if necessary. Happy to make changes if desired!
-
Move to infrastructure project