update to GeoLite2-City

This commit is contained in:
Francis Cao 2023-02-14 12:06:41 -08:00
parent eea01b21cf
commit 4351ef37f8
3 changed files with 4 additions and 3 deletions

View File

@ -48,7 +48,8 @@
"import/no-anonymous-default-export": "off",
"@next/next/no-img-element": "off",
"@typescript-eslint/no-empty-function": "off",
"@typescript-eslint/no-explicit-any": "off"
"@typescript-eslint/no-explicit-any": "off",
"@typescript-eslint/no-var-requires": "off"
},
"globals": {
"React": "writable"

View File

@ -68,7 +68,7 @@ export async function getCountry(req, ip) {
// Database lookup
if (!lookup) {
lookup = await maxmind.open(path.resolve('node_modules/.geo/GeoLite2-Country.mmdb'));
lookup = await maxmind.open(path.resolve('node_modules/.geo/GeoLite2-City.mmdb'));
}
const result = lookup.get(ip);

View File

@ -7,7 +7,7 @@ const zlib = require('zlib');
const tar = require('tar');
let url =
'https://raw.githubusercontent.com/GitSquared/node-geolite2-redist/master/redist/GeoLite2-Country.tar.gz';
'https://raw.githubusercontent.com/GitSquared/node-geolite2-redist/master/redist/GeoLite2-City.tar.gz';
if (process.env.MAXMIND_LICENSE_KEY) {
url =