mirror of
https://github.com/kremalicious/umami.git
synced 2025-02-14 21:10:34 +01:00
Fix geo lookup for Netlify.
This commit is contained in:
parent
131a0968dd
commit
d3f5f42d02
@ -1,4 +1,3 @@
|
|||||||
import path from 'path';
|
|
||||||
import requestIp from 'request-ip';
|
import requestIp from 'request-ip';
|
||||||
import { browserName, detectOS } from 'detect-browser';
|
import { browserName, detectOS } from 'detect-browser';
|
||||||
import isLocalhost from 'is-localhost-ip';
|
import isLocalhost from 'is-localhost-ip';
|
||||||
@ -68,7 +67,7 @@ export async function getCountry(req, ip) {
|
|||||||
|
|
||||||
// Database lookup
|
// Database lookup
|
||||||
if (!lookup) {
|
if (!lookup) {
|
||||||
lookup = await maxmind.open(path.resolve('node_modules/.geo/GeoLite2-Country.mmdb'));
|
lookup = await maxmind.open('./node_modules/.geo/GeoLite2-Country.mmdb');
|
||||||
}
|
}
|
||||||
|
|
||||||
const result = lookup.get(ip);
|
const result = lookup.get(ip);
|
||||||
|
@ -1,2 +1,2 @@
|
|||||||
[functions]
|
[functions]
|
||||||
included_files = ["node_modules/.geo/*.mmdb"]
|
included_files = ["node_modules/.geo/**"]
|
||||||
|
Loading…
x
Reference in New Issue
Block a user