Running a Mirror¶
Thank you for your interest in running a mirror for the IzzyOnDroid repository! Mirrors help us balance the load and increase our resilience – and they help the people out there as well. Not just during maintenance windows, but, by using a nearby mirror, also for faster downloads as well as reducing resource usage (as not all data has to be sent all around the globe multiple times).
What kind of mirrors does IzzyOnDroid use?¶
We currently have two „primary“ mirrors established, where we push to ourselves whenever a new index was deployed (see: Schedules). To reduce the load of our primary site, one of those mirrors is available as source for „secondary“ mirrors to pull from.
Requirements¶
To run a mirror, you will need:
- a server with some disk space (currently, 50 GB are fully sufficient1), ideally available 24/7 (i.e. as few „down times” as possible)
- a good internet connection (people will be downloading from it)
rsync(to sync the repo), and obviously a web server (to serve the mirror viahttps)
To be established as official mirror (i.e. to be included with our config, so clients have your mirror available automatically), also
- have a privacy policy (see e.g. the very simple one we have, the rather extensive one of FAU (in German), or the ones by Lysator (pretty short; Swedish and English) or Purdue PLUG)
- have our little iod-stats-builder set up, and the „pickup points“ coordinated with us, so our Download Statistics can cover it
- have some monitoring in place (disk usage, up-to-dateness, availability)
- reach out to us e.g. by mail (see: contact) to let us know the server location (country code), URL (where the clients can find it), whom to contact if needed (a name + email address), and tell us a little about who you are. Should your mirror be accessible via the TOR network, please include the relevant details as well!
Your mirror should sync automatically (e.g. via Cron) in intervals, at least once a day (but no more than 4 times a day) – for orientation, please see our Schedules for when the primaries are usually synced up and add 1..2 hours to that. Make sure your mirror does not fall behind more than one or two days at worst (apart from unforseeable, technical outages, of course).
Setup¶
First, have a dedicated directory to hold the data. We currently have no archive, so you'll only need a single place:
mkdir -p /var/www/izzyondroid/fdroid/repo
chown -R www-data.www-data /var/www/izzyondroid
(assuming your web server will be running as user www-data and group www-data). Now run the initial sync – ideally from a terminal multiplexer like Zellij, tmux, or Screen, as the initial sync can take some time:
sudo -u www-data -E rsync -P --archive --delay-updates --delete-after --safe-links izzy.zw.is::repo /var/www/izzydroid/fdroid
Instead of -P, you can alternatively use --info=progress2 to have a progress shown that's not as verbose. For the later, automated runs, of course replace -P/--info=progress2 by --quiet, and include something like --timeout=3600 (1 hour), to ensure there are no „overlapping runs“. Example cron job:
27 9,21 * * * www-data /usr/bin/rsync --archive --delay-updates --quiet --delete-after --safe-links --timeout=3600 izzy.zw.is::repo /var/www/izzydroid/fdroid
Please vary the time: if all mirrors start syncing at 9:27 simultaneously, that would be … not optimal. Currently, our Schedules state „App repo … syncs around 8 pm CE[S]T“, so a good time frame would be between 8:20 and 10 pm CE[S]T. Have your cron job forward mails, so you'll be informed should the sync fail.
-
we try to keep our repository trim. At the time of this writing, the overall size is below 20 GB, so the specified 50 GB already take some growth into account. Please check here every once in a while if this might have changed. ↩