make geoip lookup optional
This commit is contained in:
parent
43c728d5d4
commit
097d3c8377
2 changed files with 9 additions and 1 deletions
|
@ -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 a new issue