-
Notifications
You must be signed in to change notification settings - Fork 34
/
global.php
264 lines (244 loc) · 9.76 KB
/
global.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
<?php
/**
* Global Configuration Override.
*
* You can use this file for overriding configuration values from modules, etc.
* You would place values in here that are agnostic to the environment and not
* sensitive to security.
*
* @NOTE: In practice, this file will typically be INCLUDED in your source
* control, so do not include passwords or other sensitive information in this
* file.
*/
declare(strict_types=1);
use Application\Extensions\Doctrine\Rand;
use Application\Extensions\Doctrine\Year;
use Application\Router\LanguageAwareTreeRouteStack;
use Jfcherng\Diff\Differ;
use Jfcherng\Diff\Renderer\RendererConstant;
use Laminas\Session\Storage\SessionArrayStorage;
use Laminas\Session\Validator\HttpUserAgent;
return [
/**
* Change the default route class (`TreeRouteStack`) with our custom implementation that can infer the locale from
* the URL.
*/
'router' => [
'router_class' => LanguageAwareTreeRouteStack::class,
],
/*
* Bcrypt cost.
*
* DO NOT CHANGE THE PASSWORD HASH SETTINGS FROM THEIR DEFAULTS
* Unless A) you have done sufficient research and fully understand exactly
* what you are changing, AND B) you have a very specific reason to deviate
* from the default settings and know what you're doing.
*
* The password hash settings may be changed at any time without
* invalidating existing user accounts.
*
* The number represents the base-2 logarithm of the iteration count used for
* hashing. Default is 13 (about 20 hashes per second on an i5).
*/
'passwords' => [
'bcrypt_cost' => 13,
'min_length_user' => 12,
'min_length_companyUser' => 16,
'pwned_passwords_host' => getenv('PWNED_PASSWORDS_HOST'),
],
/*
* Subnets in use by the TU/e. All IP addresses in a listed subnet will be allowed more base rights, like being able
* to download exams.
*
* Note: the subnets must be provided in CIDR format.
*/
'tue_ranges' => [
'131.155.0.0/16',
'100.64.0.0/10',
],
'login_rate_limits' => [
'user' => 5,
'company' => 5,
'ip' => 50,
'lockout_time' => 10,
],
'storage' => [
'storage_dir' => 'public/data',
'public_dir' => 'data',
'cache_dir' => 'data/cache',
'dir_mode' => 0777, // rwx by default
],
/*
* Exam and Summary upload directory configuration.
*/
'education' => [
'upload_dir' => 'public/data/education',
'public_dir' => 'data/education',
'dir_mode' => 0777, // rwx by default
],
/*
* Exam and Summary temporary upload directory configuration.
*/
'education_temp' => [
'upload_exam_dir' => 'public/data/education_temp_exams',
'upload_summary_dir' => 'public/data/education_temp_summaries',
'public_exam_dir' => 'data/education_temp_exams',
'public_summary_dir' => 'data/education_temp_summaries',
],
/*
* Path for JWT keypairs
*/
'jwt_key_path' => 'data/keys/jwt-key',
'jwt_pub_key_path' => 'data/keys/jwt-key.pub',
/*
* Settings for Monolog logger
*/
'logging' => [
'logfile_path' => 'data/logs/gewisweb.log',
'max_rotate_file_count' => 10,
'minimal_log_level' => 'INFO',
],
/*
* Photo's upload directory configuration
*/
'photo' => [
'upload_dir' => 'public/data/photo',
'public_dir' => 'data/photo',
'max_photos_page' => 20,
'dir_mode' => 0777, // rwx by default
'small_thumb_size' => [
/*
* Max. width and height which a thumbnail may have. Height param must be greater than width, for
* landscape images.
*/
'width' => 320,
'height' => 640,
],
'large_thumb_size' => [
/*
* Max. width and height which a thumbnail may have.
*/
'width' => 1920,
'height' => 1920,
],
'album_cover' => [
'width' => 320,
'height' => 180,
'inner_border' => 2,
'outer_border' => 0,
'cols' => 2,
'rows' => 2,
'background' => '#ffffff',
],
],
'organ_information' => [
'cover_width' => 2000,
'cover_height' => 625,
'thumbnail_width' => 512,
'thumbnail_height' => 288,
],
'frontpage' => [
'activity_count' => 3, // Number of activities to display
'news_count' => 3, // Number of news items to display
],
'regulations' => [
'activity-policy' => 'Policies%20&%20Regulations/Activity%20Policy',
'alcohol-policy' => 'Policies%20&%20Regulations/Alcohol%20Policy',
'board-policies' => 'Policies%20&%20Regulations/Board%20Policies',
'borrel-policy' => 'Policies%20&%20Regulations/Borrel%20Policy',
'house-rules' => 'Policies%20&%20Regulations/House%20rules',
'ict-policy' => 'Policies%20&%20Regulations/ICT%20Policy',
'key-policy' => 'Policies%20&%20Regulations/Key%20Policy',
'poster-policy' => 'Policies%20&%20Regulations/Poster%20Policy',
'privacy-policy' => 'Policies%20&%20Regulations/Privacy%20Policy',
],
'php-diff' => [
'differ' => [
// show how many neighbor lines
// Differ::CONTEXT_ALL can be used to show the whole file
'context' => Differ::CONTEXT_ALL,
// ignore case difference
'ignoreCase' => false,
// ignore line ending difference
'ignoreLineEnding' => false,
// ignore whitespace difference
'ignoreWhitespace' => false,
// if the input sequence is too long, it will just gives up (especially for char-level diff)
'lengthLimit' => 2000,
// if truthy, when inputs are identical, the whole inputs will be rendered in the output
'fullContextIfIdentical' => true,
],
'renderer' => [
// how detailed the rendered HTML is? (none, line, word, char)
'detailLevel' => 'word',
// renderer language: eng, cht, chs, jpn, ...
// or an array which has the same keys with a language file
// check the "Custom Language" section in the readme for more advanced usage
'language' => 'eng',
// show line numbers in HTML renderers
'lineNumbers' => false,
// show a separator between different diff hunks in HTML renderers
'separateBlock' => true,
// show the (table) header
'showHeader' => false,
// convert spaces/tabs into HTML codes like `<span class="ch sp"> </span>`
// and the frontend is responsible for rendering them with CSS.
// when using this, "spacesToNbsp" should be false and "tabSize" is not respected.
'spaceToHtmlTag' => false,
// the frontend HTML could use CSS "white-space: pre;" to visualize consecutive whitespaces
// but if you want to visualize them in the backend with " ", you can set this to true
'spacesToNbsp' => false,
// HTML renderer tab width (negative = do not convert into spaces)
'tabSize' => 4,
// this option is currently only for the Combined renderer.
// it determines whether a replace-type block should be merged or not
// depending on the content changed ratio, which values between 0 and 1.
'mergeThreshold' => 1.0,
// this option is currently only for the Unified and the Context renderers.
// RendererConstant::CLI_COLOR_AUTO = colorize the output if possible (default)
// RendererConstant::CLI_COLOR_ENABLE = force to colorize the output
// RendererConstant::CLI_COLOR_DISABLE = force not to colorize the output
'cliColorization' => RendererConstant::CLI_COLOR_AUTO,
// this option is currently only for the Json renderer.
// internally, ops (tags) are all int type but this is not good for human reading.
// set this to "true" to convert them into string form before outputting.
'outputTagAsString' => false,
// this option is currently only for the Json renderer.
// it controls how the output JSON is formatted.
// see available options on https://www.php.net/manual/en/function.json-encode.php
'jsonEncodeFlags' => JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE,
// this option is currently effective when the "detailLevel" is "word"
// characters listed in this array can be used to make diff segments into a whole
// for example, making "<del>good</del>-<del>looking</del>" into "<del>good-looking</del>"
// this should bring better readability but set this to empty array if you do not want it
'wordGlues' => [' ', '-'],
// change this value to a string as the returned diff if the two input strings are identical
'resultForIdenticals' => null,
// extra HTML classes added to the DOM of the diff container
'wrapperClasses' => ['diff-wrapper'],
],
],
/*
* Doctrine global configuration, like functions
*/
'doctrine' => [
'configuration' => [
'orm_default' => [
'numeric_functions' => [
'RAND' => Rand::class,
'YEAR' => Year::class,
],
],
],
],
'session_config' => [],
'session_storage' => [
'type' => SessionArrayStorage::class,
],
'session_manager' => [
'validators' => [
HttpUserAgent::class,
],
'enable_default_container_manager' => true,
],
];