FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > Debian > Debian Java

 
 
LinkBack Thread Tools
 
Old 08-04-2011, 08:27 AM
Vratislav Podzimek
 
Default GeoIP and mirrors in anaconda

Hi everybody,
I was looking at the Anaconda/UX Redesign/Discussion pages [1] and came
accross the 'Mirrors' and 'IP-based geolocation' sections. I've spent
some time searching for our possibilities to make it work in the
suggested way and these are the summed-up results:

1) As for the Mirrors:
Yum uses Fedora mirrors list server [2] which runs the Mirror Manager.
The Mirror Manager is able to choose the best mirror using many methods
including GeoIP [3]. So we already have this functionality in Anaconda
and it can be changed on the wiki page [1].

2) As for the GeoIP:
There is a free database with GPL API in many languages (including C and
Python) [4]. This is the solution used by the Mirror Manager. But the
problem is that we would need the "outer IP address" of the machine to
query the database for which we would have to use some server.
So I think the best solution for Anaconda would be using Mirror Manager
running on Fedora mirrors list server (the same as yum does). We could
use a simple HTTP request to get the mirrors list which contains
information about prefered countries on the first (commented) line. Here
is the example (from Masaryk university in Brno):

# repo = fedora-15 arch = i386 Using preferred netblock Using ASN 2852
Using ASN 2852 Using ASN 2852 Using Internet2 country = CZ country = BE
country = BG country = BY country = RO country = GR country = GB country
= HR country = HU country = PT country = PL country = EE country = IT
country = ES country = MD country = IL country = FR country = FI country
= NL country = NO country = CH country = SK country = SE country = DK
country = DE country = LV country = IS country = AT country = IE country
= UA
http://ftp.linux.cz/pub/linux/fedora/linux/releases/15/Everything/i386/os/
http://ultra.linux.cz/MIRRORS/fedora.redhat.com/linux/releases/15/Everything/i386/os/
http://ftp.sh.cvut.cz/MIRRORS/fedora/linux/releases/15/Everything/i386/os/
...

And even it's easy to parse the first line to get the country we of
course don't need the whole mirrors list. So I'm communicating with the
author of the Mirror Manager and searching for some better suiting
solution for us.

Do you think it's the right way? And should I try to add it to Anaconda
in current state? It could be used to set default values for locale and
language settings and possibly also the default time zone.

Thanks in advance for any suggestions and comments.
Vrata Podzimek



[1] https://fedoraproject.org/wiki/Anaconda/UX_Redesign/Discussion
[2] via repos' mirrorlists' URLs in
https://mirrors.fedoraproject.org/metalink?repo=fedora-$releasever&arch=
$basearch format
[3] https://fedorahosted.org/mirrormanager/wiki
[4] http://www.maxmind.com/app/c

_______________________________________________
Anaconda-devel-list mailing list
Anaconda-devel-list@redhat.com
https://www.redhat.com/mailman/listinfo/anaconda-devel-list
 
Old 08-05-2011, 01:08 PM
Vratislav Podzimek
 
Default GeoIP and mirrors in anaconda

I'm sending a quotation of my conversation with Matt Domsch (developer
of the Mirror Manager). Any opinions, suggestions and rejections will be
appreciated.

Vrata Podzimek

> On Thu, 2011-08-04 at 09:36 -0500, Matt Domsch wrote:
> > On Thu, Aug 04, 2011 at 02:04:06AM -0500, Vratislav Podzimek wrote:
> > > Let me explain it in a more detailed way. We want to add some IP-based
> > > geolocation features to Anaconda installer [1]. We could include GeoIP
> > > (C API) and python-GeoIP libraries into the Anaconda but then we would
> > > have to have also the database included and we would have to somehow get
> > > the "outer IP address" (on some server the client's IP address) of the
> > > machine. This solution would need some server.
> > >
> > > So my idea was to use already running Fedora Mirrors list server with
> > > MirrorManager running in a way Yum does [2]. But we of course doesn't
> > > need the whole mirror list so my question was if there is any way to get
> > > info only about location. Via XML-RPC but HTTP request shouldn't be a
> > > problem as well.
> > >
> > > I hope it's more clear from these two paragraphs. If you have any
> > > suggestion other than using HTTP request and parsing the first
> > > (commented) line from the mirror list the get the country it would be
> > > really appreciated.
> > >
> >
> > Yes, there are several ways we could handle this.
> >
> > 1) purchase a service from maxmind.com, and hava anaconda query their
> > servers directly. http://www.maxmind.com/app/web_services#city
> >
> > 2) create a stand-alone small and trivial web server application to
> > query a local copy of the maxmind database. This would be hosted
> > by Fedora Infrastructure.
> >
> > 3) add a new query type to MirrorManager, and use the existing Fedora
> > Infrastructure to serve this. Right now, MM doesn't use the
> > City-level database. Is country-level "good enough" for your
> > purposes?
> >
> > 4) hack MM to return something in the mirrorlist response header. I'm
> > not inclined to do this.
> >
>
> I think 3) is the best one. 1) would cost money which is not necessary
> having the other solutions. 2) would be more complicated compared to 3)
> and it would be time-wasting to write new application from scratch when
> we already have the working code. As for 4) -- it works right now. There
> already are preferred countries on the first (commented) line of the
> mirrorlist returned by MM so it can be parsed to get the most preferred
> country. Which is, I think, the best estimation we can do according to
> algorithm and data used in MM. But we of course don't need the whole
> mirror list.
>
> We want to use IP-geolocation data to set the default locales and
> language settings (for which country-level info is enough) and if it's
> possible also to set the default timezone settings (which would need
> city-level info).
>
> Summed up, I think the best solution would be to add a new query type to
> MM and use the existing Fedora Infrastructure to serve this. It would
> cause only a negligible number of queries so no significant load for the
> server. And if we could add the city-level information, it would be
> great.
>
> Before any changes to MM please let me discuss this solution with the
> rest of Anaconda team. If you don't mind I will CC you in that
> conversation.
>
> Vratislav Podzimek

_______________________________________________
Anaconda-devel-list mailing list
Anaconda-devel-list@redhat.com
https://www.redhat.com/mailman/listinfo/anaconda-devel-list
 

Thread Tools




All times are GMT. The time now is 02:20 AM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright 2007 - 2008, www.linux-archive.org