etix / mirrorbits

Mirrorbits is a geographical download redirector written in Go for distributing files efficiently across a set of mirrors.
MIT License
503 stars 88 forks source link

Add JSON endpoint to list all mirrors #47

Open manno opened 7 years ago

manno commented 7 years ago

For our about page (https://media.ccc.de/about.html) we use JSON to render a table of all mirrors. Previously we would list all active mirrors, their URLs and the number of files on the mirror.

I thought about writing a separate go program later this month to get the information from the redis database, but maybe it would make sense to include this in mirrorbits?

etix commented 7 years ago

For very simple needs there's always the mirmon output (already builtin in mirrorbits): mirrorbits export mirmon

For more advanced outputs, like the mirrors page on videolan.org, I've made a little PHP script that connects to the redis database directly and fetches the list of active mirrors. The result is then parsed and sorted by country. I made a gist illustrating the first part.

But I admit, it would be handy to have something builtin into mirrorbits. Maybe something that can be called using query arguments like mirrorlist or mirrorstats or using a given HTTP header.

manno commented 7 years ago

I created https://github.com/manno/mirrorbits-serverlist-api which fills our needs for now. So I would close this issue?

etix commented 7 years ago

Let's keep this issue opened for now. I'm really interested by some feedback from you and maybe other users on this topic.