mirror of
https://github.com/umami-software/umami.git
synced 2026-02-04 04:37:11 +01:00
Merge branch 'dev' of https://github.com/umami-software/umami into feat/um-171-cloud-mode-env-variable
This commit is contained in:
commit
a777b2916f
88 changed files with 1014 additions and 945 deletions
|
|
@ -1,4 +1,4 @@
|
|||
/* eslint-disable no-console */
|
||||
/* eslint-disable no-console, @typescript-eslint/no-var-requires */
|
||||
const fs = require('fs-extra');
|
||||
const path = require('path');
|
||||
const https = require('https');
|
||||
|
|
|
|||
|
|
@ -1,20 +0,0 @@
|
|||
/* eslint-disable no-console */
|
||||
require('dotenv').config();
|
||||
const path = require('path');
|
||||
|
||||
const maxmind = require('maxmind');
|
||||
|
||||
async function getLocation() {
|
||||
const lookup = await maxmind.open(path.resolve('../node_modules/.geo/GeoLite2-City.mmdb'));
|
||||
const result = lookup.get('46.135.3.1');
|
||||
|
||||
const country = result?.country?.iso_code ?? result?.registered_country?.iso_code;
|
||||
const subdivision = result?.subdivisions[0]?.iso_code;
|
||||
const subdivision2 = result?.subdivisions[0]?.names?.en;
|
||||
const subdivision3 = result?.subdivisions[1]?.names?.en;
|
||||
const city = result?.city?.names?.en;
|
||||
console.log(result);
|
||||
console.log(country, subdivision, city, subdivision2, subdivision3);
|
||||
}
|
||||
|
||||
getLocation();
|
||||
Loading…
Add table
Add a link
Reference in a new issue