This repository was archived by the owner on Aug 10, 2018. It is now read-only.
forked from oaeproject/Hilary
-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathconfig.js
More file actions
359 lines (337 loc) · 16.6 KB
/
config.js
File metadata and controls
359 lines (337 loc) · 16.6 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
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
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
/*
* Copyright 2013 Apereo Foundation (AF) Licensed under the
* Educational Community License, Version 2.0 (the "License"); you may
* not use this file except in compliance with the License. You may
* obtain a copy of the License at
*
* http://www.osedu.org/licenses/ECL-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an "AS IS"
* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
* or implied. See the License for the specific language governing
* permissions and limitations under the License.
*/
var bunyan = require('bunyan');
var config = module.exports.config = {};
// UI related config information. By default, we assume that the UI repostory
// can be found on the same level as the Hilary folder.
/**
* `config.ui`
*
* Configuration namespace for the UI module.
*
* @param {String} path The path to the UI static assets
*/
config.ui = {
'path': '/opt/3akai-ux'
};
// Cassandra related config information.
config.cassandra = {
'hosts': [ '127.0.0.1' ],
'keyspace': 'oae',
'user': '',
'pass': '',
'timeout': 5000,
'replication': 1,
'strategyClass': 'SimpleStrategy'
};
// The redis related configuration information.
// The `dbIndex` key allows for seperation of actual and unit test data.
// By default redis starts up with 16 DB indexes so there should
// be no need to create one.
// We'll assume that:
// 0 = production
// 1 = unit tests
config.redis = {
'host': '127.0.0.1',
'port': 6379,
'pass': '',
'dbIndex': 0
};
/**
* `config.servers`
*
* Configuration namespace for servers.
*
* @param {String} globalAdminAlias The tenant alias that will be used for the global admins.
* @param {String} globalAdminHost The hostname on which the global admin server can be reached by users.
* @param {Number} globalAdminPort The network port on which the global admin express server can run.
* @param {Number} tenantPort The network port on which the tenant express server can run.
* @param {Boolean} useHttps Whether or not the server is accessible via HTTPS. Hilary will *not* expose an HTTPS server, it's up to a frontend server such as Apache or Nginx to deal with the actual delivery of HTTPS traffic. This flag is mainly used to generate correct backlinks to the web application.
*/
config.servers = {
'globalAdminAlias': 'admin',
'globalAdminHost': 'admin.vagrant.oae',
'globalAdminPort': 2000,
'serverInternalAddress': '127.0.0.1',
'tenantPort': 2001,
'useHttps': false,
'strictHttps': true
};
/**
* `config.files`
*
* Configuration namespace for files.
*
* @param {String} tmpDir The directory where temporary files can be created. (profile pictures when cropping, ...)
* @param {String} uploadDir The directory where upload files can be buffered before moving them over to the configured storage backend.
* @param {Object} cleaner Holds configuration properties for the cleaning job that removes lingering files in the upload directory.
* @param {Boolean} cleaner.enabled Whether or not the cleaning job should run.
* @param {Number} cleaner.interval Files that haven't been accessed in this amount (of seconds) should be removed.
* @param {String} localStorageDirectory The directory where the local storage backend can store its files. By default, the files get stored on the same level as the Hilary directory. Note: the absolute path to this directory should also be configured in the Nginx config file. This directory will not be used when Amazon S3 file storage is used.
* @param {String} limit The maximum file upload size, accepted formats look like "5mb", "200kb", "1gb". You should also adjust your front-end proxy (e.g., Nginx, Apache) to also handle files of this size
*/
config.files = {
'localStorageDirectory': '/opt/files',
'tmpDir': '/tmp',
'uploadDir': '/tmp/uploads',
'cleaner': {
'enabled': true,
'interval': 2*60*60
},
'limit': '4096mb'
};
// The configuration that can be used to generate secure HTTP cookies.
// It's strongly recommended that you change this value.
// Make sure that this value is the same accross each app server.
config.cookie = {
'secret': 'SODIFJ984FJA984JAFP98WF4PAW984F984FJ9'
};
config.log = {
'streams': [
{
'level': 'info',
'path': '/opt/oae/server.log'
}
],
'serializers': {
'err': bunyan.stdSerializers.err,
'req': bunyan.stdSerializers.req,
'res': bunyan.stdSerializers.res
}
};
// This object holds the configuration for the telemetry monitoring.
// By default telemetry is disabled.
// We currently support two types of publishers:
// * displaying data on the console
// * pushing data to circonus (via httptrap and redis)
config.telemetry = {
'enabled': false,
'publisher': 'console',
'circonus': {
'url': 'https://trap.noit.circonus.net/module/httptrap/check-uuid/secret-here',
'circonusInterval': 30000,
'redisInterval': 20000
},
'console': {
'interval': 5000
}
};
/**
* `config.search`
*
* Configuration namespace for search.
*
* @param {Object[]} hosts The elastic search hosts/ports with which to communicate. Each element of this array is a hash that has 2 keys: 'host' and 'port'.
* @param {Object} index Holds configuration properties for the OAE search index.
* @param {String} index.name The unique name of the index.
* @param {Object} index.settings Holds the elastic search index configuration settings, as per http://www.elasticsearch.org/guide/reference/api/admin-indices-create-index.html
* @param {Boolean} [index.destroyOnStartup] Whether or not the index should be destroyed when the server starts up. Do not enable this on a production server. Defaults to `false`.
* @param {Boolean} [processIndexJobs] Whether or not this node should act as an indexer. Only disable this if you have another dedicated set of machines performing index processing. Defaults to `true`.
*/
config.search = {
'hosts': [
{ 'host': '127.0.0.1', 'port': 9200 },
],
'index': {
'name': 'oae',
'settings': {
'number_of_shards': 5,
'number_of_replicas': 1,
'analysis': {
'analyzer': {
'q': {
'type': 'custom',
'char_filter': ['html_strip'],
'tokenizer': 'letter',
'filter': ['lowercase', 'q_edgengram']
}
},
'filter': {
'q_edgengram': {
'type': 'edgeNGram',
'min_gram': 1,
'max_gram': 15
}
}
}
}
},
'processIndexJobs': true
};
/**
* `config.mq`
*
* Configuration namespace for the message queue (RabbitMQ).
*
* @param {Object} connection The connection description
* @param {String} connection.host The host for the connection
* @param {Number} connection.port The port for the connection
* @param {Boolean} [purgeQueuesOnStartup] If `true`, the application will **delete** all messages in a queue when a worker is first bound. This setting only takes effect if the NODE_ENV environment variable is not set to `production` to indicate a production environment. Default: `false`
*/
config.mq = {
'connection': {
'host': [ '127.0.0.1' ],
'port': 5672
},
'purgeQueuesOnStartup': false
};
/**
* `config.previews`
*
* Configuration namespace for the preview processor.
*
* @param {Boolean} enabled Whether or not the preview processor should be running
* @param {String} dir A directory that can be used to store temporary files in
* @param {Object} office Holds the configuration for anything Office related
* @param {String} office.binary The path to the 'soffice.bin' binary that starts up Libre Office. ex: On OS X it is `/Applications/LibreOffice.app/Contents/MacOS/soffice.bin` with a default install
* @param {Number} office.timeout Defines the timeout (in ms) when the Office process should be killed
* @param {Object} pdf Holds the configuration for anything related to PDF splitting
* @param {String} pdf.binary The path to the `pdftk` binary that can be used to split a PDF file into a PDF-per-page
* @param {Number} pdf.timeout Defines the timeout (in ms) when the pdftk process should be killed
* @param {Object} link Holds the configuration for anything related to link processing
* @param {String} link.renderDelay Defines the timeout (in ms) that should be waited between loading the page and taking a screenshot
* @param {Number} link.renderTimeout Defines the timeout (in ms) when the screencapturing should be stopped. This should include the renderDelay
* @param {Number} link.embeddableCheckTimeout Defines the timeout (in ms) when the embeddable link check should be stopped
* @param {Object} credentials Holds the credentials that can be used to log on the global admin server
* @param {String} credentials.username The username to login with on the global admin server
* @param {String} credentials.password The password to login with on the global admin server
*/
config.previews = {
'enabled': true,
'dir': '/tmp/previews',
'office': {
'binary': '/usr/bin/soffice',
'timeout': 120000
},
'pdf': {
'binary': '/usr/bin/pdftk',
'timeout': 120000
},
'link': {
'renderDelay': 7500,
'renderTimeout': 30000,
'embeddableCheckTimeout': 15000
},
'credentials': {
'username': 'administrator',
'password': 'administrator'
}
};
/**
* `config.signing`
*
* Configuration namespace for the signing logic
*
* @param {String} key This key will be used to sign URLs like profile pictures, content previews, etc.. . It's vital to the security of the system that you change this in production.
*/
config.signing = {
'key': 'A;SLDFJ984FJW398FJWP4GO5IJSLRTKGJ'
};
/**
* `config.activity`
*
* Configuration namespace for activities.
*
* @param {Boolean} [processActivityJobs] Whether or not this server node should produce and route activities. Defaults to `true`
* @param {Number} [activityTtl] The time-to-live (in seconds) for generated activities. After this period of time, an activity in an activity feed is lost permanently. Defaults to 2 weeks
* @param {Number} [aggregateIdleExpiry] The amount of time (in seconds) an aggregate can be idle until it expires. The "idle" time of an aggregate is reset when a new activity occurs that matches the aggregate. Defaults to 3 hours
* @param {Number} [aggregateMaxExpiry] An upper-bound on the amount of time (in seconds) for which an aggregate can live. Defaults to 1 day
* @param {Number} [numberOfProcessingBuckets] The number of buckets available for parallel processing of activities. Defaults to 5
* @param {Number} [collectionExpiry] The maximum amount of time (in seconds) a processing bucket can be locked for at one time. If this is not long enough for an activity processor to collect the number of activities as configured by `collectionBatchSize`, then it will be possible for multiple processors to collect the same bucket concurrently. This will result in duplicate activities, which is not desired. Defaults to 1 minute
* @param {Number} [maxConcurrentCollections] The maximum number of concurrent collection cycles that can be active on a process at once. Defaults to 3
* @param {Number} [maxConcurrentRouters] The maximum number of activities that will be routed by one node at one time. This should be used to ensure activities are not routed faster than they can be collected, to ensure the redis collection buckets do not grow in size uncontrollably under unanticipated load. Defaults to 8
* @param {Number} [collectionPollingFrequency] How often (in seconds) the processing buckets are polled for new activities. If -1, polling will be disabled. If polling is disabled, activities will not function, so do not set to -1 in production. Defaults to 5 seconds.
* @param {Number} [collectionBatchSize] The number of items to process at a time when collecting bucketed activities. After one batch has been collected, the activity processor will immediately continue to process the next batch from that bucket, and so on. Defaults to 500
* @param {Object} [redis] Configuration for dedicated redis server. If not specified, will use the same pool as the rest of the container (i.e., as specified by `config.redis`)
* @param {String} [redis.host] The host of the dedicated redis server
* @param {Number} [redis.port] The port of the dedicated redis server
* @param {String} [redis.pass] The password to the dedicated redis server
* @param {Number} [redis.dbIndex] The index number of the dedicated redis server index
*/
config.activity = {
'processActivityJobs': true,
'activityTtl': 2 * 7 * 24 * 60 * 60,
'aggregateIdleExpiry': 3 * 60 * 60,
'aggregateMaxExpiry': 24 * 60 * 60,
'numberOfProcessingBuckets': 3,
'collectionExpiry': 60,
'maxConcurrentCollections': 1,
'maxConcurrentRouters': 5,
'collectionPollingFrequency': 5,
'collectionBatchSize': 1000,
'redis': null
};
/**
* `config.email`
*
* Configuration namespace for emails.
*
* @param {Boolean} [debug] Determines whether or not email is in debug mode. If in debug mode, email messages are logged, not actually sent through any service.
* @param {String} [customEmailTemplatesDir] Specifies a directory that holds the tenant-specific email template overrides
* @param {String} transport Which method of e-mail transport should be used. Either `SMTP` or `sendmail`.
* @param {Object} [sendmailTransport] An object with a `path` key which value points to the sendmail binary.
* @param {Object} [smtpTransport] The SMTP connection information for sending emails. This is the settings object that will be used by nodemailer to form an smtp connection: https://github.com/andris9/Nodemailer
*/
config.email = {
'debug': true,
'customEmailTemplatesDir': null,
'transport': 'SMTP',
'sendmailTransport': {
'path': '/usr/sbin/sendmail'
},
'smtpTransport': {
'host': 'localhost',
'port': 25
}
};
/**
* `config.saml`
*
* Configuration namespace for the saml logic
*
* @param {String} SAMLParserJarPath The path towards the Java binary that can be used to decrypt SAML messages. This only needs to be configured if you want to enable the Shibboleth strategy. See https://github.com/oaeproject/SAMLParser
*/
config.saml = {
'SAMLParserJarPath': '/opt/org.sakaiproject.Hilary.SAMLParser-1.0-SNAPSHOT-jar-with-dependencies.jar'
};
/**
* `config.etherpad`
*
* Configuration namespace for the etherpad logic.
*
* @param {String} apikey The key that can be used to communicate with the etherpad API.
* @param {Object[]} hosts The internal hosts or IP addresses where etherpad instances can be found. It's important that you add *all* your etherpad instances in this array, as the number of configured servers will be used to do (some very rudimentary) sharding.
* @param {String} hosts[i].host The hostname or IP address on which Hilary will be accessing the Etherpad API.
* @param {Number} hosts[i].port The port number on which Hilary will be accessing the etherpad API.
*/
config.etherpad = {
'apikey': 'LSKDFJA0W9FJAOSIDFJ',
'hosts': [
{
'host': '127.0.0.1',
'port': 9001
},
]
};
/**
* `config.tincanapi`
*
* Configuration namespace for the TinCan API logic
*
* @param {Number} timeout Defines the timeout (in ms) when the request to the LRS should be killed
*/
config.tincanapi = {
'timeout': 4000
};