mirror of
https://gitlab.com/timvisee/send.git
synced 2024-11-08 20:22:45 +01:00
make geoip lookup optional
This commit is contained in:
parent
43c728d5d4
commit
097d3c8377
@ -1,9 +1,12 @@
|
||||
const crypto = require('crypto');
|
||||
const geoip = require('fxa-geodb')();
|
||||
const fetch = require('node-fetch');
|
||||
const config = require('./config');
|
||||
const pkg = require('../package.json');
|
||||
|
||||
const geoip = config.ip_db
|
||||
? require('fxa-geodb')({ dbPath: config.ip_db })
|
||||
: () => ({});
|
||||
|
||||
const HOUR = 1000 * 60 * 60;
|
||||
|
||||
function truncateToHour(timestamp) {
|
||||
|
@ -149,6 +149,11 @@ const conf = convict({
|
||||
format: String,
|
||||
default: '',
|
||||
env: 'SURVEY_URL'
|
||||
},
|
||||
ip_db: {
|
||||
format: String,
|
||||
default: '',
|
||||
env: 'IP_DB'
|
||||
}
|
||||
});
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user