-
Notifications
You must be signed in to change notification settings - Fork 3
/
exampleCredentials.js
114 lines (94 loc) · 3.33 KB
/
exampleCredentials.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
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
// Environment is set with the CCENV process environment variable
// This can be set in the command line before commands
// (e.g. CCENV=development npm start)
const CCENV = process.env.CCENV || 'development';
const RECEIVEBACKUPMODE = process.env.RECEIVEBACKUPMODE == 'on';
const baseProductionReadyCredentials = {
// Allow access to CCENV be consistent from credentials.js
// TODO: Update all references to CCENV to be from here
CCENV,
RECEIVEBACKUPMODE,
// Twilio-related
// (must start with 'AC')
accountSid: 'ACTWILIOACCOUNTSIDTWILIOAC',
authToken: 'TWILIOAUTHTOKENTWILIOAUTHT',
// URL base of the current deploy
// e.g. 'https://multnomah.clientcomm.org'
// or 'http://localhost:4000' for local development
baseUrl: 'http://localhost:4000',
// A unique name identifying this deploy of clientcomm
clientcommInstanceName: 'instancenameunique',
// TODO: Move all twilio components into a single key
twilio: {
outboundCallbackUrl: 'http://ecx-x-x-xx.us-xxx.compute.amazonaws.com',
outboundCallbackUrlBackup: 'http://ecx-x-x-xx.us-xxx.compute.amazonaws.com',
},
// Session
sessionSecret: 'abcdefg',
// For testing purposes
// TODO: Make this something that is set when running the tests
localDbUser: 'postgres',
// Connection details for the production database
db: {
user: 'usernameunqiue',
password: '**************************',
host: 'unique.lksjdfbj3.us-west-1.rds.amazonaws.com',
},
// Currently we use Gmail Node library for email comms
// TODO: Perhaps use Mailgun and stop relying on Google for outbound notifications
em: {
password: '**************************',
},
// New Relic monitoring information
newrelic: {
key: '**************************',
appName: 'unique_name',
},
mailgun: {
apiKey: '**************************',
},
// AWS interface/access secrets
aws: {
accessKey: '**************************',
secretAccessKey: '**************************',
},
s3: {
bucketName: 'clientcomm-attachments',
},
mixpanel: {
token: '**************************',
secret: '**************************',
},
keenProjectId: '*****************************',
keenWriteKey: '*****************************',
keenReadKey: '*****************************',
};
if (CCENV == 'production') {
baseProductionReadyCredentials.db = {
user: 'foobar',
password: '**************************',
host: 'unique-production.slkdfj9d8sf.us-west-1.rds.amazonaws.com',
};
}
// Update the phone number for all non-production environments
if (CCENV !== 'production') {
// Update the outbound URL to whatever you are using in tests/development
// (e.g. could be a Ngrok set up, another EC2 instance, etc.)
baseProductionReadyCredentials.twilio.outboundCallbackUrl =
'https://123abc.ngrok.io';
}
// Changes made when we are developing
// (e.g. staging server, different rootURL, etc.)
if (CCENV == 'development') {
console.log(
'Development environment: Credentials have been modified.'.yellow
);
baseProductionReadyCredentials.db = {
user: 'foobar',
password: '**************************',
host: 'unique-staging.slkdfj9d8sf.us-west-1.rds.amazonaws.com',
};
}
const hostName = baseProductionReadyCredentials.db.host.split('.')[0];
console.log(`Database being used: ${hostName}`);
module.exports = baseProductionReadyCredentials;