mirror of
https://github.com/kremalicious/umami.git
synced 2024-12-22 17:23:54 +01:00
Updated next config.
This commit is contained in:
parent
ad95da63b7
commit
d1765f746b
@ -3,6 +3,9 @@ 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';
|
||||||
import maxmind from 'maxmind';
|
import maxmind from 'maxmind';
|
||||||
|
import getConfig from 'next/config';
|
||||||
|
const { serverRuntimeConfig } = getConfig();
|
||||||
|
|
||||||
import {
|
import {
|
||||||
DESKTOP_OS,
|
DESKTOP_OS,
|
||||||
MOBILE_OS,
|
MOBILE_OS,
|
||||||
@ -60,7 +63,9 @@ export async function getCountry(req, ip) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Database lookup
|
// Database lookup
|
||||||
const lookup = await maxmind.open(path.resolve(__dirname, '../geo/GeoLite2-Country.mmdb'));
|
const lookup = await maxmind.open(
|
||||||
|
path.resolve(serverRuntimeConfig.PROJECT_ROOT, '../geo/GeoLite2-Country.mmdb'),
|
||||||
|
);
|
||||||
|
|
||||||
const result = lookup.get(ip);
|
const result = lookup.get(ip);
|
||||||
|
|
||||||
|
@ -5,6 +5,9 @@ module.exports = {
|
|||||||
env: {
|
env: {
|
||||||
VERSION: pkg.version,
|
VERSION: pkg.version,
|
||||||
},
|
},
|
||||||
|
serverRuntimeConfig: {
|
||||||
|
PROJECT_ROOT: __dirname,
|
||||||
|
},
|
||||||
webpack(config) {
|
webpack(config) {
|
||||||
config.module.rules.push({
|
config.module.rules.push({
|
||||||
test: /\.svg$/,
|
test: /\.svg$/,
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "umami",
|
"name": "umami",
|
||||||
"version": "0.57.0",
|
"version": "0.58.0",
|
||||||
"description": "A simple, fast, website analytics alternative to Google Analytics. ",
|
"description": "A simple, fast, website analytics alternative to Google Analytics. ",
|
||||||
"author": "Mike Cao <mike@mikecao.com>",
|
"author": "Mike Cao <mike@mikecao.com>",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
|
Loading…
Reference in New Issue
Block a user