Needs review
Project:
GeoIP API
Version:
7.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Feature request
Assigned:
Reporter:
Created:
14 Oct 2010 at 15:03 UTC
Updated:
29 Mar 2016 at 09:38 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
anrikun commentedBy the way, I'm OK to work on that if you're open to patches.
Let me know :-)
Comment #2
aruna.kulatunga commentedHow very interesting. I was looking at that functionality just five minutes ago and then while searching found this post...
BTW, the current download URL, that appears in the Status page, is broken. The correct download URL should be
http://geolite.maxmind.com/download/geoip/database/GeoLiteCountry/GeoIP....
Comment #3
drewish commentedaruna.kulatunga, would you mind opening a separate issue for the URL?
Comment #4
anrikun commentedHere is a patch based on 6.x-1.2 that adds this feature.
It assumes that a GeoIP.dat is already present at sites/all/libraries/geoip/GeoIP.dat (or wherever you have changed the GeoIP data file location to).
It will not carry any automatic update if not.
Comment #5
drewish commentedHumm... I feel like auto updating it in the files directory would be one but updating it in other places is going to cause problems (the webserver should not have permissions to overwrite Drupal core or contrib files). I wonder if it would make sense to implement this as a drush command. It would make installation and upgrading a lot easier. You could always schedule a cron job to run the drush task. Thoughts?
Comment #6
anrikun commentedI don't know much about Drush :-(
I will have a look at it!
Comment #7
roball commentedPer default I would point to the City (not Country) DB file's location at
http://geolite.maxmind.com/download/geoip/database/GeoLiteCity.dat.gz
Comment #8
drewish commentedTake a look at #863930: Add drush command to fetch the getid3 library I did a drush command for getid3 to download its library. Should be able to do something similar.
Comment #10
alarcombe commentedI added a patch for the 7.x-1.x which adds a drush command to update the city or country database.
Comment #11
alarcombe commentedA better patch - increased informational logging, and creates the geoip library directory if not already present.
Comment #12
drewish commentedShould we be calling drush_log('Decompressing database', 'ok'); with 'ok' if it hasn't finished yet? Seems like it might be beter to flag that as 'info' rather than okay.
Comment #13
dnotes commentedHow interesting to see this being discussed now. I created an automated cron update of the geoip city database for a 6.x project some time ago, and am just now upgrading to 7.x. The code was part of the glue module for the project, but if you would like, I can do it as a patch to geoip and incorporate alarcombe's code above, which seems to move in the direction that I was going with the choice of database type. I ran into a few issues with truly automated updates:
1. Administrators should really be notified when a geo database update is attempted, so that they can check the site.
2. When files are created by php with cron, file ownership and permissions can get tricky depending on the webhost. My only solution was to set the downloaded file to 777; otherwise I ran into problems of the cron download creating a file that I could not move or delete through my limited shell access. =Bad.
Comment #14
markosaurus commentedHi there,
Just wondered if this ever made it into the module? I just got prompted to update as my local version is out of date by over a month.
Would be lovely to see this functionality automated! :)
Thanks,
Mark