-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathclient_config.php.j2
131 lines (113 loc) · 4.57 KB
/
client_config.php.j2
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
<?php
/**
* Local Configuration Override
*
* This configuration override file is for overriding environment-specific and
* security-sensitive configuration information. Copy this file without the
* .dist extension at the end and populate values as needed.
*
* @NOTE: This file is ignored from Git by default with the .gitignore included
* in ZendSkeletonApplication. This is a good practice, as it prevents sensitive
* credentials from accidentally being committed into version control.
*/
$appdir = getenv('APP_DIR') ? getenv('APP_DIR') : '/var/lib/monarc/fo';
$string = file_get_contents($appdir . '/package.json');
if ($string === false) {
$string = file_get_contents('./package.json');
}
$package_json = json_decode($string, true);
return [
'doctrine' => [
'connection' => [
'orm_default' => [
'params' => [
'host' => '{{ master }}',
'user' => '{{ item.value.name }}',
'password' => '{{ item.value.mysql_password }}',
'dbname' => 'monarc_common',
],
],
'orm_cli' => [
'params' => [
'host' => 'localhost',
'user' => '{{ item.value.name }}',
'password' => '{{ item.value.mysql_password }}',
'dbname' => '{{ item.value.name }}',
],
],
],
],
'languages' => [
'fr' => [
'index' => 1,
'label' => 'Français',
],
'en' => [
'index' => 2,
'label' => 'English',
],
'de' => [
'index' => 3,
'label' => 'Deutsch',
],
'nl' => [
'index' => 4,
'label' => 'Nederlands',
],
],
'defaultLanguageIndex' => 1,
'activeLanguages' => ['fr','en','de','nl','es','ro','it','pl','pt','ja'],
'appVersion' => $package_json['version'],
'checkVersion' => true,
'appCheckingURL' => 'https://version.monarc.lu/check/MONARC',
{% if item.value.twoFactorAuthEnforced is defined %}
'twoFactorAuthEnforced' => {{ item.value.twoFactorAuthEnforced }},
{% else %}
'twoFactorAuthEnforced' => {{ twoFactorAuthEnforced | bool if twoFactorAuthEnforced is defined else "false" | bool }},
{% endif %}
'instanceName' => '{{item.value.name}}', // will be used for the label of the 2FA QRCode.
'email' => [
'name' => 'MONARC',
'from' => '{{ emailFrom if emailFrom else "info@monarc.lu" }}',
],
'terms' => '{{ terms if terms is defined else "" }}',
'monarc' => array(
'ttl' => 60, // timeout
'salt' => '{{ item.value.salt }}', // private salt for the password
'cliModel' => 'generic', // model to display for the client, else an ID of model, else 'generic' (empty for all)
),
'mospApiUrl' => 'https://objects.monarc.lu/api/',
'statsApi' => [
'baseUrl' => 'http://{{ master }}:{{ monarc_statsservice_port }}/{{ monarc_statsservice_url | urlsplit('path') }}', // stats service running on the back office
'apiKey' => '{{item.value.statsToken}}' // token of the client generated by "add_inventory.py"
],
'publicHost' => '{{ protocol }}://{{ publicHost }}/{{item.value.name}}{{ '-' + env_prefix if env_prefix else '' }}',
{% if item.value.isBackgroundImportActive is defined %}
'import' => [
'uploadFolder' => '/var/www/{{item.value.name}}/import/files',
'isBackgroundProcessActive' => {{ item.value.isBackgroundImportActive }},
],
{% else %}
'import' => [
'uploadFolder' => '/var/www/{{item.value.name}}/import/files',
'isBackgroundProcessActive' => {{ isBackgroundImportActive | bool if isBackgroundImportActive is defined else "false" | bool }},
],
{% endif %}
'export' => [
'defaultWithEval' => {% if isDefaultExportWithAssessments is defined %}{{ isDefaultExportWithAssessments }}{% else %}false{% endif %},
],
'captcha' => [
'enabled' => {% if isCaptchaEnabled is defined %}{{ isCaptchaEnabled }}{% else %}false{% endif %},
'failedLoginAttempts' => {% if captchaFailedLoginAttempts is defined %}{{ captchaFailedLoginAttempts }}{% else %}3{% endif %},
'params' => [
'name' => 'MonarcCaptcha',
'font' => $appdir . '/data/fonts/arial.ttf',
'fontSize' => 30,
'height' => 60,
'wordLen' => 6,
'timeout' => 300,
'imgDir' => $appdir . '/public/captcha',
'imgUrl' => 'captcha/',
],
],
];