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.
TypeScript analyticsaudience-segmentationchartscohort-analysisgoogle-analyticsproduct-analyticsstatisticsuser-journeyweb-analytics
Updated request-ip package.
Mike Cao39c0ea11c3d8
diff --git a/lib/request.js b/lib/request.jsindex 6ca684e22..210921b98 100644--- a/lib/request.js+++ b/lib/request.js@@ -1,3 +1,4 @@+import path from 'path';import requestIp from 'request-ip';import { browserName, detectOS } from 'detect-browser';import isLocalhost from 'is-localhost-ip';@@ -67,7 +68,7 @@ export async function getCountry(req, ip) {// Database lookupif (!lookup) {- lookup = await maxmind.open('node_modules/.geo/GeoLite2-Country.mmdb');+ lookup = await maxmind.open(path.resolve('node_modules/.geo/GeoLite2-Country.mmdb'));}const result = lookup.get(ip);diff --git a/package.json b/package.jsonindex cd0783915..b0ee7429c 100644--- a/package.json+++ b/package.json@@ -97,7 +97,7 @@"react-tooltip": "^4.2.21","react-use-measure": "^2.0.4","react-window": "^1.8.6",- "request-ip": "^2.1.3",+ "request-ip": "^3.3.0","semver": "^7.3.6","thenby": "^1.3.4","timezone-support": "^2.0.2",diff --git a/yarn.lock b/yarn.lockindex e448c0126..98144f5ed 100644--- a/yarn.lock+++ b/yarn.lock@@ -4081,11 +4081,6 @@ is-weakref@^1.0.2:dependencies:call-bind "^1.0.2"-is_js@^0.9.0:- version "0.9.0"- resolved "https://registry.npmjs.org/is_js/-/is_js-0.9.0.tgz"- integrity sha512-8Y5EHSH+TonfUHX2g3pMJljdbGavg55q4jmHzghJCdqYDbdNROC8uw/YFQwIRCRqRJT1EY3pJefz+kglw+o7sg==-isbot@^3.4.5:version "3.5.0"resolved "https://registry.npmjs.org/isbot/-/isbot-3.5.0.tgz"@@ -5669,12 +5664,10 @@ regjsparser@^0.8.2:dependencies:jsesc "~0.5.0"-request-ip@^2.1.3:- version "2.2.0"- resolved "https://registry.npmjs.org/request-ip/-/request-ip-2.2.0.tgz"- integrity sha512-Hn4zUAr+XHbUs2RrfHur62t7+UhvtevqK32ordFewguEfNHUkhSdYgbG7PDGmXZEzqEXll9bei0+VMe6gkmuUQ==- dependencies:- is_js "^0.9.0"+request-ip@^3.3.0:+ version "3.3.0"+ resolved "https://registry.yarnpkg.com/request-ip/-/request-ip-3.3.0.tgz#863451e8fec03847d44f223e30a5d63e369fa611"+ integrity sha512-cA6Xh6e0fDBBBwH77SLJaJPBmD3nWVAcF9/XAcsrIHdjhFzFiB5aNQFytdjCGPezU3ROwrR11IddKAM08vohxA==version "2.88.0"