mirror of
https://github.com/umami-software/umami.git
synced 2026-02-19 03:55:37 +01:00
FIx No such file GeoLite2-Conutry.mmdb on Netlify (v1.37.0)
This commit is contained in:
parent
0f976be5d8
commit
b3ec60be91
2 changed files with 2 additions and 2 deletions
|
|
@ -68,7 +68,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(path.resolve('./public/geo/GeoLite2-Country.mmdb'));
|
||||||
}
|
}
|
||||||
|
|
||||||
const result = lookup.get(ip);
|
const result = lookup.get(ip);
|
||||||
|
|
|
||||||
|
|
@ -14,7 +14,7 @@ if (process.env.MAXMIND_LICENSE_KEY) {
|
||||||
`?edition_id=GeoLite2-Country&license_key=${process.env.MAXMIND_LICENSE_KEY}&suffix=tar.gz`;
|
`?edition_id=GeoLite2-Country&license_key=${process.env.MAXMIND_LICENSE_KEY}&suffix=tar.gz`;
|
||||||
}
|
}
|
||||||
|
|
||||||
const dest = path.resolve(__dirname, '../node_modules/.geo');
|
const dest = path.resolve(__dirname, '../public/geo');
|
||||||
|
|
||||||
if (!fs.existsSync(dest)) {
|
if (!fs.existsSync(dest)) {
|
||||||
fs.mkdirSync(dest);
|
fs.mkdirSync(dest);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue