bundle-bot
This is an attempt to automate the creation of git-bundles, i.e. single-file representations of complete git repositories. It imitates what is included in the build scripts of the i2p.i2p project, here to allow to bundle other projects as well. Background is myself hitting the wall when trying to clone i2p.www (but also noticing the several years old bundle for i2p.i2p) ;) Uh, publicing means license. Not too knowledgable about that, but will go with gpl2 to have something said and make my intentions clear.
Requirements
Software and User
I basically did
apt install git
apt install mktorrent
adduser bundle-bot
Git-Setup
You need to setup git to work with the transport and URL you wish to use for keeping the repository up-to-date and obviously need to get the repository before you bundle it also. Possible variations for transports:
- ssh/git on any of
- git@git.idk.i2p:i2p-hackers/i2p.i2p.git or
- WHATSTHECLEARNET or
- GITHUB-READONLY-MIRROR
- http on any of
- http://git.idk.i2p/i2p-hackers/i2p.i2p.git or
- WHATSTHECLEARNET or
- GITHUB-READONLY-MIRROR
Maybe see the I2P project page on git for details if in doubt.
I2PSnark
The script wants to copy the created files to the (specified) i2psnark directory to make them available. Accordingly you will need a router with i2psnark running on the same machine as a service (or you need to adjust accordingly).
CurrentState / ToDo
This is utmost alpha ;) So check the code and see if you can find something useful, but don't blame me if you implode some universe by running it. I actually just changed code and can't even test it now, as I don't want to overwrite files. You have been warned :P
- i2psnark doesn't autostart the torrents so far - either need to restart router, do it manually, or find another way
- Does the .torrent needs to be published at postman to be "accessible"? Maybe grep the magnet link somehow and just publish that on a website?
- mktorrent is called as root, this doesn't seem sensible. Just need to figure out how to run the lengthy line with su ...
- Some error handling - checking exit codes at the very least - before trusting this to cron/service
- service file/timer file then btw.
- And for cron/service lockfile handling always seems like a good idea
- logging/notification-mails/-messages
- automated tests? Do I wanna be that fancy?
- Automatic distribution to mirrors? Download won't be very fast if only one serves them.
- Cleaning up - I decided to change my "root makes rm --force bla*" into something less frighening, but if supposed to run automatically, old versions would need to be removed at some point (it's currently around 780 MB for a version with repos)