GeoIP 2020-08

Meet db-ip.com license requirements
BuildTime update
This commit is contained in:
zzz
2020-08-20 15:39:12 +00:00
parent 046d1e01b0
commit c067f38123
6 changed files with 17 additions and 19 deletions

View File

@ -172,8 +172,8 @@ Installer:
GeoIP Data:
(not included in most distribution packages)
This product includes GeoLite2 data created by MaxMind, available from http://www.maxmind.com/
See licenses/LICENSE-GeoIP.txt
IP Geolocation by DB-IP https://db-ip.com/
See https://creativecommons.org/licenses/by/4.0/
Launchers:
(not included in distribution packages)

View File

@ -8,6 +8,7 @@ package net.i2p.router.web.helpers;
*
*/
import java.io.File;
import java.io.IOException;
import java.io.Serializable;
import java.io.Writer;
@ -42,6 +43,7 @@ import net.i2p.router.TunnelPoolSettings;
import net.i2p.router.util.HashDistance; // debug
import net.i2p.router.networkdb.kademlia.FloodfillNetworkDatabaseFacade;
import static net.i2p.router.sybil.Util.biLog2;
import net.i2p.router.transport.GeoIP;
import net.i2p.router.web.HelperBase;
import net.i2p.router.web.Messages;
import net.i2p.router.web.WebAppStarter;
@ -807,6 +809,16 @@ class NetDbRenderer {
buf.append(getTranslatedCountry(country));
buf.append("</a></td><td align=\"center\">").append(num).append("</td></tr>\n");
}
// https://db-ip.com/db/download/ip-to-country-lite
String geoDir = _context.getProperty(GeoIP.PROP_GEOIP_DIR, GeoIP.GEOIP_DIR_DEFAULT);
File geoFile = new File(geoDir);
if (!geoFile.isAbsolute())
geoFile = new File(_context.getBaseDir(), geoDir);
geoFile = new File(geoFile, GeoIP.GEOIP2_FILE_DEFAULT);
if (geoFile.exists()) {
// we'll assume we are using it, ignore case where Debian file is newer
buf.append("<tr><td colspan=\"2\"><font size=\"-2\"><a href=\"https://db-ip.com/\">IP Geolocation by DB-IP</a></font></td></tr>");
}
buf.append("</table>\n");
}

View File

@ -34,10 +34,10 @@ public class BuildTime {
private static final long _latestTime;
private static final long YEARS_25 = 25L*365*24*60*60*1000;
/** update this periodically */
private static final String EARLIEST = "2020-05-15 12:00:00 UTC";
private static final String EARLIEST = "2020-08-19 12:00:00 UTC";
// fallback if parse fails ticket #1976
// date -d 202x-xx-xx +%s
private static final long EARLIEST_LONG = 1589515200 * 1000L;
private static final long EARLIEST_LONG = 1597809600 * 1000L;
static {
// this is the standard format of build.timestamp as set in the top-level build.xml

View File

@ -1,14 +0,0 @@
Database and Contents Copyright (c) 2018 MaxMind, Inc.
This work is licensed under the Creative Commons Attribution-ShareAlike 4.0 International License.
To view a copy of this license, visit http://creativecommons.org/licenses/by-sa/4.0/.
No changes were made.
This database incorporates GeoNames [http://www.geonames.org] geographical data,
which is made available under the Creative Commons Attribution 3.0 License.
To view a copy of this license, visit http://www.creativecommons.org/licenses/by/3.0/us/.
The attribution requirement may be met by including the following in
all advertising and documentation mentioning features of or use of this database:
"This product includes GeoLite2 data created by MaxMind, available from
http://www.maxmind.com/"

View File

@ -73,7 +73,7 @@ public class GeoIP {
public static final String PROP_GEOIP_DIR = "geoip.dir";
public static final String GEOIP_DIR_DEFAULT = "geoip";
static final String GEOIP_FILE_DEFAULT = "geoip.txt";
static final String GEOIP2_FILE_DEFAULT = "GeoLite2-Country.mmdb";
public static final String GEOIP2_FILE_DEFAULT = "GeoLite2-Country.mmdb";
static final String COUNTRY_FILE_DEFAULT = "countries.txt";
public static final String PROP_IP_COUNTRY = "i2np.lastCountry";
public static final String PROP_DEBIAN_GEOIP = "geoip.dat";