forked from FNNDSC/chrisreloaded
/
config.inc.php
390 lines (355 loc) · 13.2 KB
/
config.inc.php
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
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
<?php
/**
*
* sSSs .S S. .S_sSSs .S sSSs
* d%%SP .SS SS. .SS~YS%%b .SS d%%SP
* d%S' S%S S%S S%S `S%b S%S d%S'
* S%S S%S S%S S%S S%S S%S S%|
* S&S S%S SSSS%S S%S d* S S&S S&S
* S&S S&S SSS&S S&S .S* S S&S Y&Ss
* S&S S&S S&S S&S_sdSSS S&S `S&&S
* S&S S&S S&S S&S~YSY%b S&S `S*S
* S*b S*S S*S S*S `S%b S*S l*S
* S*S. S*S S*S S*S S%S S*S .S*P
* SSSbs S*S S*S S*S S&S S*S sSS*S
* YSSP SSS S*S S*S SSS S*S YSS'
* SP SP SP
* Y Y Y
*
* R E L O A D E D
*
* (c) 2012 Fetal-Neonatal Neuroimaging & Developmental Science Center
* Boston Children's Hospital
*
* http://childrenshospital.org/FNNDSC/
* dev@babyMRI.org
*/
// prevent direct calls
if(!defined('__CHRIS_ENTRY_POINT__')) die('Invalid access.');
// include the utilities
require_once(dirname(__FILE__).'/controller/_util.inc.php');
// --------------------------------------------------------------------------
//
// GENERAL CONFIGURATION
//
// --------------------------------------------------------------------------
/**
* The version.
* It appears at the bottom of the home page.
*/
define('CHRIS_VERSION', '2.9-experimental');
/**
* The timezone.
* It must be defined when we use getTime in php.
*/
define('CHRIS_TIMEZONE', 'America/New_York');
date_default_timezone_set(CHRIS_TIMEZONE);
/**
* The maintenance mode.
* If true, the users will not be able to use chris and will be presented the
* maintenance page.
*/
define('CHRIS_MAINTENANCE', false);
/**
* The chris user home directory.
* We use it to find the chris user .ssh/id_rsa to allow passwordless ssh
* between 2 instances of ChRIS.
* We also use it in this configuration file as a base directory for all the
* directories ChRIS relies on, such as 'src', 'users', 'log', etc.
*/
define('CHRIS_HOME', '/neuro/users/chris/dev');
/**
* The transfer protocol.
* We use it to generate the CHRIS_URL.
* deprecated: Alos used to push a dicom scene to SliceDrop through the api.php.
*/
define('CHRIS_TRANSFER_PROTOCOL', 'http');
/**
* The ChRIS url.
* It is being used in several places, for instance when we want to send a curl
* request to our ChRIS server, from the cluster where the job is running.
*/
define('CHRIS_URL', CHRIS_TRANSFER_PROTOCOL.'://chris/rudolph');
/**
* The ChRIS mail suffix.
* When a user logs in for the first time, we assing him an email address.
* The email address follows the format: username + CHRIS_MAIL_SUFFIX.
* We use this address to contact user when a plugin has finished, etc.
*/
define('CHRIS_MAIL_SUFFIX', '@childrens.harvard.edu');
/**
* The plugin email from field.
* When a plugin finishes, it emails the user that started it.
* When the user receives the email, this is what appears in the 'from' email
* field.
*/
define('CHRIS_PLUGIN_EMAIL_FROM', 'plugin@chris.org');
/**
* The ChRIS source location.
* This is the full name of the directory containing the ChRIS source code.
* This directory contains the index.php file.
*/
define('CHRIS_SRC', joinPaths(CHRIS_HOME, 'rudolph'));
/**
* The ChRIS data location.
* This is the full name of the directory containing the ChRIS data.
* This directory contains all the data which has been received through the
* dicom listener.
* The contained data is organized by: MRN/STUDY/SERIES
*/
define('CHRIS_DATA', joinPaths(CHRIS_HOME, 'data'));
/**
* The ChRIS tmp location.
* This is the full name of the directory containing the ChRIS tmp data.
* This directory contains the files received by the dicom listener, before
* before being processed.
* It also can contain the data sent from a remote ChRIS instance.
*/
define('CHRIS_TMP', joinPaths(CHRIS_HOME, 'tmp'));
/**
* The ChRIS users location.
* This is the full name of the directory containing the ChRIS users data.
* This directory contains all the data generated by the users running plugins.
* The data is organized by: username/pluginname/feedid
*/
define('CHRIS_USERS', joinPaths(CHRIS_HOME, 'users'));
/**
* The ChRIS log location.
* This is the full name of the directory containing the ChRIS log information.
* It can contain useful debug information.
* It logs some of the user activity such as, new user creation and received
* data.
*
* NONE OF THIS DATA IS SHARED WITH NSA
*/
define('CHRIS_LOG', joinPaths(CHRIS_HOME, 'log'));
/**
* The ChRIS root directory name.
* The name of the directory containing the index.php.
*/
define('CHRIS_WWWROOT', dirname(__FILE__));
/**
* The model folder.
* The location of the model folder, relative to the wwwroot directory.
*/
define('CHRIS_MODEL_FOLDER', joinPaths(CHRIS_WWWROOT,'model'));
/**
* The view folder.
* The location of the view folder, relative to the wwwroot directory.
*/
define('CHRIS_VIEW_FOLDER', joinPaths(CHRIS_WWWROOT,'view'));
/**
* The template folder.
* The location of the template folder, relative to the wwwroot directory.
*/
define('CHRIS_TEMPLATE_FOLDER', joinPaths(CHRIS_VIEW_FOLDER,'template'));
/**
* The controller folder.
* The location of the controller folder, relative to the wwwroot directory.
*/
define('CHRIS_CONTROLLER_FOLDER', joinPaths(CHRIS_WWWROOT,'controller'));
/**
* The location of the library/tools provided by ChRIS, such as the mri_info.
* Those libs are not used by the plugins but by ChRIS core infrastructure.
* For instance, mri_info is being used by ChRIS dicom listener to order the
* incoming files properly.
*/
define('CHRIS_LIB_FOLDER', joinPaths(CHRIS_WWWROOT,'lib'));
/**
* The plugins folder.
* The location of the plugins folder, relative to the wwwroot directory.
*/
define('CHRIS_PLUGINS_FOLDER', joinPaths(CHRIS_WWWROOT,'plugins'));
/**
* The plugins folder.
* The location of the plugins folder, relative to the file system root directory.
*/
define('CHRIS_PLUGINS_FOLDER_NET', joinPaths(CHRIS_SRC,'plugins'));
/**
* The plugins folder.
*/
define('CHRIS_PLUGINS_FOLDER_RELATIVE', 'plugins');
// --------------------------------------------------------------------------
//
// DATABASE
//
// --------------------------------------------------------------------------
/**
* The SQL Host name.
* This is the name of the machine hosting the ChRIS database.
*/
define('SQL_HOST', 'chris');
/**
* The SQL Username.
* This is the name of user we use to interact with the ChRIS database.
* This user must have privileges on the target database.
*/
define('SQL_USERNAME', 'chris');
/**
* The SQL User password.
*/
define('SQL_PASSWORD', 'YOURPASSWORD');
/**
* The SQL Database.
* The name of the database which contains all the ChRIS information.
*/
define('SQL_DATABASE', 'chrisdev');
// --------------------------------------------------------------------------
//
// DICOM LISTENER
//
// --------------------------------------------------------------------------
/**
* The Dicom email to.
* The list of administrators who should receive an email on incoming data
* through the dicom listener.
* It supports multiple users, i.e. 'rudolp@bch,nicolas@hcb,jorge@chb'
*/
define('CHRIS_DICOM_EMAIL_TO', 'rudolph.pienaar@childrens.harvard.edu');
/**
* The Dicom email from.
* The name of the database which contains all the ChRIS information.
*/
define('CHRIS_DICOM_EMAIL_FROM', 'dicom@chris.org');
/**
* The destination AETITLE.
* The remote machine where the data will be pushed after a pacs_pull retrieval.
*/
define('DICOM_DESTINATION_AETITLE', 'FNNDSC-CHRISDEV');
/**
* DCMTK binaries.
* TODO: It should probably be sitting in the CHRIS/LIBS directory, with the
* mri_convert.
*/
define('DICOM_DCMTK_FINDSCU', '/usr/bin/findscu');
define('DICOM_DCMTK_MOVESCU', '/usr/bin/movescu');
define('DICOM_DCMTK_ECHOSCU', '/usr/bin/echoscu');
/**
* The ChRIS known scanners.
* Convenience variable to also email the scanner administrator when something
* was sent from his scanner.
*/
define('CHRIS_SCANNERS', serialize(array(
"MRC25948" => "borjan.gagoski@childrens.harvard.edu",
"MRWAL2" => "borjan.gagoski@childrens.harvard.edu",
"MR1" => "borjan.gagoski@childrens.harvard.edu")));
// --------------------------------------------------------------------------
//
// REMOTE CHRIS
//
// --------------------------------------------------------------------------
/**
* The Remote ChRIS instances.
* Contains all the necessary information to ssh/dicom_push to a remote host.
* src is relative to the target host.
* It requires a passwordless ssh connection for the chris user between the
* remotes in order to work.
*/
define('CHRIS_REMOTES', serialize(array(
"MGH" => serialize(array(
"sshhost" => "johannesburg",
"sshport" => "1148",
"dicomhost" => "johannesburg",
"dicomport" => "10301",
"src" => "/home/chris/src/chrisreloaded")),
"BCH" => serialize(array(
"sshhost" => "localhost",
"sshport" => "22",
"dicomhost" => "pretoria",
"dicomport" => "10401",
"src" => "/neuro/users/chris/dev/rudolph"))
)));
// --------------------------------------------------------------------------
//
// USERS CONFIGURATION
//
// --------------------------------------------------------------------------
/**
* The user configuration directory.
* This is the name of the directory that contains user specific documentation.
* This directory is located in CHRIS_USERS/username/CHRIS_USERS_CONFIG_DIR
*/
define('CHRIS_USERS_CONFIG_DIR', 'config');
/**
* The user configuration file.
* This is the name of the file containing the user specific configuration.
* This file is located in the user configuration directory.
*/
define('CHRIS_USERS_CONFIG_FILE', '.chris.conf');
/**
* The user id rsa file.
* This is a file generated on log in if it doesn't exist.
* It allows user to perform passwordless ssh between different machine.
* It is currently being used in crun (see mri_convert plugin).
*/
define('CHRIS_USERS_CONFIG_SSHKEY', 'id_rsa');
// --------------------------------------------------------------------------
//
// PLUGINS
//
// --------------------------------------------------------------------------
/**
* The plugins which will run locally.
* Those plugins will not be run on the cluster.
* The main use case is if a plugins requires something that the cluster doesn't
* provide, i.e. php5.
*/
define('CHRIS_RUN_AS_CHRIS_LOCAL', 'pacs_pull,search,pacs_push,chris_push');
// --------------------------------------------------------------------------
//
// CLUSTER
//
// --------------------------------------------------------------------------
/**
* The cluster head machine.
* We connect to this machine to scedule jobs on the cluster.
* This is our *ONLY* way to communicate to the cluster.
*/
define('CLUSTER_HOST', 'rc-golden');
/**
* The cluster type.
* We specify the cluster type in order for crun to know how to handle the
* communication.
* Valid cluster types:
* crun_hpc_mosix or crun_hpc_lsf or crun_hpc_launchpad or local
*/
define('CLUSTER_TYPE', 'crun_hpc_mosix');
/**
* The cluster run command.
* We specify the command to schedule a job on the cluster.
* It will be used by the launcher.php to schedule jobs properly.
* {MEMORY} will be replaced in the launcher with the plugin required memory
* {COMMAND} will be replaced in the launcher with the plugin required command
* {FEED_ID} will be replaced in the launcher with the correct FEEDID.
* FEED_ID is important to be able to kill a job.
*/
define('CLUSTER_RUN', 'nohup /bin/mosbatch -q -b -J{FEED_ID} -m{MEMORY} {COMMAND} < /dev/null & echo $!;');
/**
* The cluster kill command.
* We specify the command to terminate a job on the cluster.
* {FEED_ID} will be replaced in the launcher with the plugin required id, in
* the feed.controller.php
*/
define('CLUSTER_KILL', 'moskillall -9 -J{FEED_ID}');
// --------------------------------------------------------------------------
//
// TESTING
//
// --------------------------------------------------------------------------
define('SIMPLETEST_CHRIS', joinPaths(CHRIS_WWWROOT,'testing/simpletest_chris.php'));
define('SIMPLETEST_HTML_CHRIS', joinPaths(CHRIS_WWWROOT,'testing/html_chris.php'));
define('SIMPLETEST_XML_CHRIS', joinPaths(CHRIS_WWWROOT,'testing/xml_chris.php'));
define('SIMPLETEST_SIMPLETEST', joinPaths(CHRIS_WWWROOT,'lib/simpletest/simpletest.php'));
define('SIMPLETEST_AUTORUN', joinPaths(CHRIS_WWWROOT,'lib/simpletest/autorun.php'));
// GOOGLE ANALYTICS
define('ANALYTICS_ACCOUNT', 'UA-39303022-1');
// if CHRIS_DEBUG is defined, print all constants
if(defined('CHRIS_CONFIG_DEBUG')) {
$all_constants = get_defined_constants(true);
print_r($all_constants['user']);
}
// setup phpseclib for SSH access
set_include_path(get_include_path() . PATH_SEPARATOR . joinPaths(CHRIS_LIB_FOLDER, 'phpseclib', 'phpseclib'));
// FLAG showing that the config was parsed
define('CHRIS_CONFIG_PARSED', true);
?>