forked from qualitance/ldir-web
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathindex.js
123 lines (102 loc) · 2.94 KB
/
index.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
115
116
117
118
119
120
121
122
123
'use strict';
var path = require('path');
var _ = require('lodash');
var hostname = process.env.VIRTUAL_HOST;
function requiredProcessEnv(name) {
if (!process.env[name]) {
throw new Error('You must set the ' + name + ' environment variable');
}
return process.env[name];
}
// All configurations will extend these options
// ============================================
var all = {
env: process.env.NODE_ENV,
staticSite: process.env.STATIC_SITE,
contact: {
name: 'Lets Do It Romania',
email: 'registruldeseurilor@letsdoitromania.ro'
},
// Authorities contact config
authorities: {
mail_from: 'primarii@letsdoitromania.ro',
default_to: 'primaria@mailinator.com',
reply_to: 'primaria@mailinator.com'
},
// Server IP
ip: process.env.OPENSHIFT_NODEJS_IP ||
process.env.IP ||
undefined,
//INSERT MANDRILL CREDENTIALS
mandrill: {
key: '' // prevent email sending by using a test key
},
// Root path of server
root: path.normalize(__dirname + '/../../..'),
// Server port
port: process.env.PORT || 80,
// Secret for session, you will want to change this and make it an environment variable
secrets: {
session: 'ldr-web-secret'
},
//INSERT PUSH NOTIFICATIONS SERVER URL
pushNotifications: {
server: '',
userPrefix: 'LDIR_SANDBOX_',
strictSSL: true,
preventSend: true
},
// List of user roles
userRoles: ['volunteer', 'supervisor', 'admin'],
// MongoDB connection options
mongo: {
uri: 'mongodb://mongo1,mongo2,mongo3/ldirweb-dev?replicaSet=rs&readPreference=primaryPreferred'
},
//INSERT AMAZON CREDENTIALS
amazonBucket: '',
amazonPrefix: '',
amazonKey: '',
amazonSecret: '',
amazonRegion: '',
images: {
thumbnail_size: {
width: 100,
height: 100
},
image_size: {
width: 800,
height: 600
},
target_ratio: 1.33, // 4:3
max_size: 10 * 1024 * 1024 // 10 Mb
},
defaultPaginationLimit: 10,
phantomPath: './node_modules/phantomjs/lib/phantom/bin/phantomjs',
//INSERT SENTRY URL
sentryUrl: '',
formDataParser: {
fileSaveLocation: 'uploads/',
fileUploadLimit: 3
},
//INSERT FACEBOOK CREDENTIALS
facebook: { // use dev credentials for facebook
clientID: '',
clientSecret: '',
callbackURL: hostname + '/auth/facebook/callback',
apiURL: process.env.FACEBOOK_API_URL
},
temporary_storage: './server/storage/temp/',
kue: {
port: 6379,
host: 'redis'
},
elasticHost: 'http://elasticsearch:9200',
pile: {
min_reported_days: 30
}
};
// Export the config object based on the NODE_ENV
// ==============================================
module.exports = _.merge(
all,
require('./' + process.env.NODE_ENV + '.js') || {});