-
Notifications
You must be signed in to change notification settings - Fork 43
Expand file tree
/
Copy pathdefault.js
More file actions
51 lines (45 loc) · 1.4 KB
/
default.js
File metadata and controls
51 lines (45 loc) · 1.4 KB
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
'use strict';
/**
* This is the default config for the API package
*/
const defer = require('config/defer').deferConfig;
const defaults = {
base_domain: 'localhost',
protocol: 'https',
port: 8000,
api_url: '', // if not set, generated from api_protocol and api_base_domain
sentry: {
// Check all config options here: https://docs.sentry.io/platforms/node/configuration/
dsn: '', // required to enable Sentry
environment: 'localhost', // adjust to your environments
tracesSampleRate: 1.0, // adjust in production
},
slack_url: '',
mattermost_url: '',
management_role: 'admin',
routes: {
boxes: '/boxes',
users: '/users',
statistics: '/statistics',
management: '/management',
},
jwt: {
secret: 'OH GOD THIS IS SO INSECURE PLS CHANGE ME', // should be at least 32 characters
algorithm: 'HS256',
validity_ms: 3600000, // 1 hour
issuer: '', // usually the base url of the api. generated if not set from api_protocol and api_base_domain. for example https://api.opensensemap.org
},
refresh_token: {
secret: 'I ALSO WANT TO BE CHANGED',
algorithm: 'sha256',
validity_ms: 604800000, // 1 week
},
};
// computed keys
defaults['api_url'] = defer(function () {
return `${this.protocol}://${this.base_domain}`;
});
defaults['jwt']['issuer'] = defer(function () {
return `${this.protocol}://${this.base_domain}`;
});
module.exports = defaults;