mirror of
https://github.com/umami-software/umami.git
synced 2026-02-15 01:55:36 +01:00
chore: allow custom geolite database path
This commit is contained in:
parent
65f3628ed7
commit
826f29bbc0
1 changed files with 1 additions and 1 deletions
|
|
@ -124,7 +124,7 @@ export async function getLocation(ip: string = '', headers: Headers, hasPayloadI
|
||||||
if (!global[MAXMIND]) {
|
if (!global[MAXMIND]) {
|
||||||
const dir = path.join(process.cwd(), 'geo');
|
const dir = path.join(process.cwd(), 'geo');
|
||||||
|
|
||||||
global[MAXMIND] = await maxmind.open(path.resolve(dir, 'GeoLite2-City.mmdb'));
|
global[MAXMIND] = await maxmind.open(process.env.GEOLITE_DB_PATH || path.resolve(dir, 'GeoLite2-City.mmdb'));
|
||||||
}
|
}
|
||||||
|
|
||||||
const result = global[MAXMIND].get(ip);
|
const result = global[MAXMIND].get(ip);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue