- Handle gzipped input data in merge tool
  - Add script to generate compressed data
  - Add local additions
  - Add compressed data file, generated from Maxmind data fetched 2013-05-24
  - Include data in installer and updater
  - Update Maxmind license info, now CC-SA 3.0
This commit is contained in:
zzz
2013-05-24 13:46:17 +00:00
parent 9a4cd11748
commit 3daf287de8
7 changed files with 49 additions and 33 deletions

View File

@ -207,7 +207,7 @@ Applications:
FatCow icons: See licenses/LICENSE-FatCowIcons.txt
GeoIP Data:
Copyright (c) 2008 MaxMind, Inc. All Rights Reserved.
This product includes GeoLite data created by MaxMind, available from http://www.maxmind.com/
See licenses/LICENSE-GeoIP.txt
Router Console and I2PSnark themes:

View File

@ -1121,7 +1121,9 @@
<copy file="build/routerconsole.war" todir="pkg-temp/webapps/" />
<copy file="build/addressbook.war" todir="pkg-temp/webapps/" />
<!-- decapitalized the file in 0.7.8 -->
<copy file="installer/resources/countries.txt" todir="pkg-temp/geoip/" />
<copy file="installer/resources/countries.txt" todir="pkg-temp/geoip/" />
<!-- small enough to include for now -->
<copy file="installer/resources/geoipv6.dat.gz" todir="pkg-temp/geoip/" />
</target>
<target name="prepupdateRouter" depends="buildrouter, deletepkg-temp">
@ -1137,6 +1139,7 @@
<!-- GeoIP files and flag icons -->
<target name="prepgeoupdate">
<copy file="installer/resources/geoip.txt" todir="pkg-temp/geoip/" />
<copy file="installer/resources/geoipv6.dat.gz" todir="pkg-temp/geoip/" />
<copy file="installer/resources/countries.txt" todir="pkg-temp/geoip/" />
<copy todir="pkg-temp/docs/icons/flags" >
<fileset dir="installer/resources/icons/flags" />

View File

@ -0,0 +1,9 @@
# Local geoIPv6 additions
# Format: from IP,to IP,,,country code[,"country name"]
####
# common tunnel brokers
2001:5c0:1000:a::,2001:5c0:1000:a::,,,X1,"Freenet6 anonymous"
2001:5c0:1000:b::,2001:5c0:1000:b::,,,X2,"Freenet6 authenticated"
2001:5c0:1100::,2001:5c0:11ff:ffff:ffff:ffff:ffff:ffff,,,X3,"Freenet6 delegated"
# other interesting addresses
2002::,2002:ffff:ffff:ffff:ffff:ffff:ffff:ffff,,,X4,"IPv4 compatibility"
Can't render this file because it contains an unexpected character in line 2 and column 54.

Binary file not shown.

View File

@ -0,0 +1,19 @@
#!/bin/sh
#
# Fetch the latest file from Maxmind, merge with
# our additions, and compress.
#
FILE1=GeoIPv6.csv.gz
FILE2=geoipv6-extras.csv
FILEOUT=geoipv6.dat.gz
rm -f $FILE1 $FILEOUT
wget http://geolite.maxmind.com/download/geoip/database/$FILE1
if [ "$?" -ne "0" ]
then
echo 'Cannot fetch'
exit 1
fi
java -cp ../../build/i2p.jar:../../build/router.jar net.i2p.router.transport.GeoIPv6 $FILE1 $FILE2 $FILEOUT
exit $?

View File

@ -1,32 +1,8 @@
OPEN DATA LICENSE (GeoLite Country and GeoLite City databases)
The GeoLite databases are distributed under the
Creative Commons Attribution-ShareAlike 3.0 Unported License
http://creativecommons.org/licenses/by-sa/3.0/ .
The attribution requirement may be met by including the following in
all advertising and documentation mentioning features of or use of this database:
Copyright (c) 2008 MaxMind, Inc. All Rights Reserved.
All advertising materials and documentation mentioning features or use of
this database must display the following acknowledgment:
"This product includes GeoLite data created by MaxMind, available from
http://maxmind.com/"
Redistribution and use with or without modification, are permitted provided
that the following conditions are met:
1. Redistributions must retain the above copyright notice, this list of
conditions and the following disclaimer in the documentation and/or other
materials provided with the distribution.
2. All advertising materials and documentation mentioning features or use of
this database must display the following acknowledgement:
"This product includes GeoLite data created by MaxMind, available from
http://maxmind.com/"
3. "MaxMind" may not be used to endorse or promote products derived from this
database without specific prior written permission.
THIS DATABASE IS PROVIDED BY MAXMIND, INC ``AS IS'' AND ANY
EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL MAXMIND BE LIABLE FOR ANY
DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
DATABASE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
http://www.maxmind.com/"

View File

@ -151,7 +151,9 @@ class GeoIPv6 {
int count = 0;
InputStream in = null;
try {
in = new FileInputStream(geoFile);
in = new BufferedInputStream(new FileInputStream(geoFile));
if (geoFile.getName().endsWith(".gz"))
in = new GZIPInputStream(in);
String buf = null;
BufferedReader br = new BufferedReader(new InputStreamReader(in, "ISO-8859-1"));
while ((buf = br.readLine()) != null) {
@ -314,6 +316,13 @@ class GeoIPv6 {
return rv;
}
/**
* Merge and compress CSV files to I2P compressed format
*
* GeoIP infile1.csv[.gz] [infile2.csv[.gz]...] outfile.dat.gz
*
* Used to create the file for distribution, do not comment out
*/
public static void main(String args[]) {
if (args.length < 2) {
System.err.println("Usage: GeoIP infile1.csv [infile2.csv...] outfile.dat.gz");