This repository has been archived by the owner on Jun 7, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathconfig.js
69 lines (65 loc) · 2.54 KB
/
config.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
var xtend = require('xtend');
// Default configuration options used by the app. Most of these can be
// overriden by environment variables (see below).
var defaults = {
host: '0.0.0.0', // cosmetic
port: 4000, // port to listen on
dbUri: process.env.NODE_ENV === 'test' ? 'mongodb://localhost/oam-uploader-test' : 'mongodb://localhost/oam-uploader', // the mongodb database uri (mongodb://user:pass@host:port/db)
adminPassword: null, // the administrator username
adminUsername: null, // the administrator password
oinBucket: 'oam-uploader', // name of the OpenImageryNetwork bucket to which imagery should be uploaded
uploadBucket: 'oam-uploader-temp', // name of the bucket for temporary storage for direct uploads
thumbnailSize: 300, // (very) approximate thumbnail size, in kilobytes
maxWorkers: 1, // the maximum number of workers
sendgridApiKey: null, // sendgrid API key, for sending notification emails
sendgridFrom: '[email protected]', // the email address from which to send notification emails
gdriveKey: null,
emailNotification: {
subject: '[ OAM Uploader ] Imagery upload submitted',
text: 'Your upload has been successfully submitted and is now being ' +
'processed. You can check on the status of the upload at ' +
'http://upload.openaerialmap.org/#/status/{UPLOAD_ID}.'
},
cookiePassword: '3b296ce42ec560abeabaef',
logOptions: {
opsInterval: 3000,
reporters: [{
reporter: require('good-console'),
events: {
request: '*',
error: '*',
response: '*',
info: '*',
log: '*'
}
}]
},
tilerBaseUrl: 'http://tiles.openaerialmap.org'
};
// Environment variable overrides
var environment = {
port: process.env.PORT,
host: process.env.HOST,
oinBucket: process.env.OIN_BUCKET,
uploadBucket: process.env.UPLOAD_BUCKET,
dbUri: process.env.NODE_ENV === 'test' ? process.env.DBURI_TEST : process.env.DBURI,
maxWorkers: process.env.MAX_WORKERS,
adminPassword: process.env.ADMIN_PASSWORD,
adminUsername: process.env.ADMIN_USERNAME,
sendgridApiKey: process.env.SENDGRID_API_KEY,
sendgridFrom: process.env.SENDGRID_FROM,
gdriveKey: process.env.GDRIVE_KEY,
tilerBaseUrl: process.env.TILER_BASE_URL,
cookiePassword: process.env.COOKIE_PASSWORD
};
var config = xtend(defaults);
for (var k in environment) {
if (typeof environment[k] !== 'undefined') {
config[k] = environment[k];
}
}
// override json.stringify behavior so we don't accidentally log secret keys
config.toJSON = function () {
return '[ hidden ]';
};
module.exports = config;