Skip to content

armgit / umami

Public Imported from GitHub
0

Umami is a privacy-first web and product analytics platform. Traffic, campaigns, behavior, conversions, and revenue in one place. No cookies, no surveillance, self-hosted or in the cloud.

Moved geo database location.

Mike Caoc37554214d1c
diff --git a/lib/request.js b/lib/request.js
index ba1c799b0..210921b98 100644
--- a/lib/request.js
+++ b/lib/request.js
@@ -68,7 +68,7 @@ export async function getCountry(req, ip) {
// Database lookup
if (!lookup) {
- lookup = await maxmind.open(path.resolve('./public/geo/GeoLite2-Country.mmdb'));
+ lookup = await maxmind.open(path.resolve('node_modules/.geo/GeoLite2-Country.mmdb'));
}
const result = lookup.get(ip);
diff --git a/scripts/build-geo.js b/scripts/build-geo.js
index cc66f9416..a45547391 100644
--- a/scripts/build-geo.js
+++ b/scripts/build-geo.js
@@ -14,7 +14,7 @@ if (process.env.MAXMIND_LICENSE_KEY) {
`?edition_id=GeoLite2-Country&license_key=${process.env.MAXMIND_LICENSE_KEY}&suffix=tar.gz`;
}
-const dest = path.resolve(__dirname, '../public/geo');
+const dest = path.resolve(__dirname, '../node_modules/.geo');
if (!fs.existsSync(dest)) {
fs.mkdirSync(dest);