-
Notifications
You must be signed in to change notification settings - Fork 0
/
config.js
57 lines (53 loc) · 1.79 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
/* eslint no-process-env: 0 */
/* eslint no-inline-comments: 0 */
/* eslint camelcase: 0 */
'use strict';
const env = process.env.NODE_ENV || 'production';
const localhost = () => `${process.env.LISTEN_HOST || '0.0.0.0'}:${process.env.PORT || 8080}`;
const useMocks = process.env.USE_MOCKS ? process.env.USE_MOCKS === 'true' : env !== 'production';
module.exports = {
env: env,
csp: {
imgSrc: ['data:']
},
useMocks: useMocks,
dateTimeFormat: 'DD-MM-YYYY, hh:mma',
port: process.env.PORT || 8080,
session: {
secret: process.env.SESSION_SECRET || 'howdoesyourgardengrow',
ttl: process.env.SESSION_TTL || 1800, /* 30 mins timeout */
name: process.env.SESSION_KEY || 'rotm.sid'
},
redis: {
port: process.env.REDIS_PORT || '6379',
host: process.env.REDIS_HOST || '127.0.0.1',
password: process.env.REDIS_PASSWORD
},
email: {
from: process.env.FROM_ADDRESS || '',
replyTo: process.env.REPLY_TO || '',
region: process.env.EMAIL_REGION || '',
transport: process.env.EMAIL_TRANSPORT || 'ses',
caseworker: process.env.CASEWORKER_EMAIL || '',
transportOptions: {
accessKeyId: process.env.HOF_SES_USER || process.env.AWS_USER || '',
secretAccessKey: process.env.HOF_SES_PASSWORD || process.env.AWS_PASSWORD || '',
port: process.env.TRANSPORT_PORT || '',
host: process.env.TRANSPORT_HOST || '',
secure: false
}
},
upload: {
maxFileSize: '100mb',
hostname: !useMocks && process.env.FILE_VAULT_URL ?
process.env.FILE_VAULT_URL :
`http://${localhost()}/api/image-upload`
},
keycloak: {
token: process.env.KEYCLOAK_TOKEN_URL,
username: process.env.KEYCLOAK_USERNAME,
password: process.env.KEYCLOAK_PASSWORD,
clientId: process.env.KEYCLOAK_CLIENT_ID,
secret: process.env.KEYCLOAK_SECRET
},
};