Flathub Mirror

Robert McQueen rob at endlessm.com
Wed Feb 12 11:10:27 UTC 2020


On Wed, 2020-02-12 at 11:52 +0100, Bartłomiej Piotrowski wrote:
> On 10/02/2020 21.12, David Florness wrote:
> > Apologies if this question's already been asked, but is there an
> > easy
> > way to setup a mirror for flathub?
> > 
> Not at the moment. Flathub already uses a CDN donated by Fastly.
> There
> are occasional hiccups and slowdowns for uncached objects but overall
> things work pretty well.

If you wanted to optimize access to Flathub for a group of machines on
the same LAN (or other cheap network) so that they only download from
the internet once, you can arrange this with a caching proxy.

You could do this in one of two ways - with a normal HTTP proxy
(something like squid?) - the origin sets the expiry times correctly on
the different types of objects that make up the repo, eg the objects
have a 1 year expiry, refs 1 hr, summary 1 minute or something like
that.

You could also use nginx in a reverse proxy kind of configuration -
that's what Flathub's own frontend servers do. 
https://github.com/flathub/ansible-playbook/blob/master/roles/frontend/templates/conf.d/proxy_cache.conf.j2
is the general cache configuration, and 
https://github.com/flathub/ansible-playbook/blob/master/roles/frontend/templates/default.d/repo.conf.j2
is what proxies the repo.

I've been idly wondering whether, if we made a docker container that
you could just run and it would set up a flathub proxy for you, it
would be possible for us to find some folks in China, Maylasia, etc
with servers on decent connections who would be willing to run that
container and we could add it to some GeoDNS set up. I guess the SSL
certificates get "interesting", but there are these locations in Asia
where Fastly seems to struggle and people experience slow throughput.

Cheers,
Rob

> 
> Bart
> _______________________________________________
> Flatpak mailing list
> Flatpak at lists.freedesktop.org
> 
> https://lists.freedesktop.org/mailman/listinfo/flatpak
> 
> 



More information about the Flatpak mailing list