mirror of
https://github.com/umami-software/umami.git
synced 2025-12-06 01:18:00 +01:00
Use new geo folder.
This commit is contained in:
parent
23d02e5aac
commit
05933ff1d2
3 changed files with 12 additions and 9 deletions
|
|
@ -7,16 +7,17 @@ const https = require('https');
|
|||
const zlib = require('zlib');
|
||||
const tar = require('tar');
|
||||
|
||||
let url =
|
||||
'https://raw.githubusercontent.com/GitSquared/node-geolite2-redist/master/redist/GeoLite2-Country.tar.gz';
|
||||
const db = 'GeoLite2-City';
|
||||
|
||||
let url = `https://raw.githubusercontent.com/GitSquared/node-geolite2-redist/master/redist/${db}.tar.gz`;
|
||||
|
||||
if (process.env.MAXMIND_LICENSE_KEY) {
|
||||
url =
|
||||
`https://download.maxmind.com/app/geoip_download` +
|
||||
`?edition_id=GeoLite2-City&license_key=${process.env.MAXMIND_LICENSE_KEY}&suffix=tar.gz`;
|
||||
`?edition_id=${db}&license_key=${process.env.MAXMIND_LICENSE_KEY}&suffix=tar.gz`;
|
||||
}
|
||||
|
||||
const dest = path.resolve(__dirname, '../node_modules/.geo');
|
||||
const dest = path.resolve(__dirname, '../geo');
|
||||
|
||||
if (!fs.existsSync(dest)) {
|
||||
fs.mkdirSync(dest);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue