[tor-commits] [tor/master] Include instructions on generating geoip files.

nickm at torproject.org nickm at torproject.org
Mon Feb 24 17:39:00 UTC 2014


commit c857276bd79c5a92eba83e85d1cbe189b52b7244
Author: Karsten Loesing <karsten.loesing at gmx.net>
Date:   Fri Feb 21 19:13:33 2014 +0000

    Include instructions on generating geoip files.
    
    Implements #10924.
---
 src/config/mmdb-convert.py |    9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/src/config/mmdb-convert.py b/src/config/mmdb-convert.py
index 80fe6a0..21d170a 100644
--- a/src/config/mmdb-convert.py
+++ b/src/config/mmdb-convert.py
@@ -416,6 +416,13 @@ def dump_tree(entries, node, dump_item, prefix=""):
     else:
         assert node == None
 
+GEOIP_FILE_HEADER = """\
+# Last updated based on %s Maxmind GeoLite2 Country
+# wget http://geolite.maxmind.com/download/geoip/database/GeoLite2-Country.mmdb.gz
+# gunzip GeoLite2-Country.mmdb.gz
+# python mmdb-convert.py GeoLite2-Country.mmdb
+"""
+
 def write_geoip_file(filename, metadata, the_tree, dump_item, fmt_item):
     """Write the entries in the_tree to filename."""
     entries = []
@@ -423,7 +430,7 @@ def write_geoip_file(filename, metadata, the_tree, dump_item, fmt_item):
     fobj = open(filename, 'w')
 
     build_epoch = metadata[0].map['build_epoch'].int_val()
-    fobj.write("# Last updated based on %s Maxmind GeoLite2 Country\n"%
+    fobj.write(GEOIP_FILE_HEADER %
                time.strftime('%B %-d %Y', time.gmtime(build_epoch)))
 
     unwritten = None



More information about the tor-commits mailing list