Switch to geolite2-redist

master
Manuel Kasper 2022-08-02 17:23:05 +02:00
rodzic 1b2ac37d18
commit baa6ed46b8
4 zmienionych plików z 843 dodań i 5 usunięć

Wyświetl plik

@ -35,10 +35,6 @@ config.rbn = {
maxSpotHistory: 1000
};
config.geoip = {
path: 'GeoLite2-City.mmdb'
};
config.summitListUrl = 'https://www.sotadata.org.uk/summitslist.csv';
config.sotatrailsUrl = 'https://sotatrails.ch/api.php';

832
package-lock.json wygenerowano

Plik diff jest za duży Load Diff

Wyświetl plik

@ -22,6 +22,7 @@
"express-jwt": "^5.3.1",
"express-validator": "^6.10.0",
"express-ws": "^4.0.0",
"geolite2-redist": "^3.0.2",
"hasha": "^5.1.0",
"htmlparser2": "^3.10.1",
"jwks-rsa": "^1.6.0",

Wyświetl plik

@ -17,7 +17,7 @@ const utils = require('./utils');
const photos_router = require('./photos_router')
const tracks_router = require('./tracks_router')
const solardata = require('./solardata')
const maxmind = require('maxmind');
const maxmind = require('maxmind')
let dbChecker = (req, res, next) => {
if (db.getDb() == null) {
@ -278,6 +278,15 @@ app.get('/activators/:callsign', (req, res) => {
});
let geoLookup;
import('geolite2-redist').then((geolite2) => {
return geolite2.open(
'GeoLite2-City',
(dbPath) => maxmind.open(dbPath)
)
}).then((reader) => {
geoLookup = reader
})
maxmind.open(config.geoip.path).then((lookup) => {
geoLookup = lookup;
});