-
Notifications
You must be signed in to change notification settings - Fork 9
/
install
executable file
·469 lines (397 loc) · 13.9 KB
/
install
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
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
#!/bin/bash
txtund=$(tput sgr 0 1) # Underline
txtbld=$(tput bold) # Bold
txtred=$(tput setaf 1) # Red
txtgrn=$(tput setaf 2) # Green
txtylw=$(tput setaf 3) # Yellow
txtblu=$(tput setaf 4) # Blue
txtpur=$(tput setaf 5) # Purple
txtcyn=$(tput setaf 6) # Cyan
txtwht=$(tput setaf 7) # White
txtrst=$(tput sgr0) # Text reset
echo -e "${txtbld}
* * * * * * * * * * * * * * *
* *
* Installeur RdvZ v2.0 *
* *
* * * * * * * * * * * * * * *
Cet installeur part du principe que votre machine est configurée et peut faire
fonctionner symfony (versions 1.3 et 1.4). Si ce n'est pas le cas RvdZ pourrait
mal s'installer, veuillez donc revoir le fichier README.${txtrst}
${txtred}Cet installeur est encore en développement et n'est donc pas très convivial,
il est fortement recommandé d'avoir plusieurs autres terminaux ouverts afin de
récupérer les informations demandées : en effet si vous vous trompez il faudra
tout resaisir.${txtrst}
${txtcyn} ** Configuration base de données...${txtrst}"
read -er -p "Adresse du serveur (localhost si elle est sur cette machine) : " bd_serv
read -er -p "Type [mysql, pgsql, dblib, firebird, ibm, informix, oci, odbc, sqlite] : " bd_pdo
read -er -p "Nom de la base : " bd_name
read -er -p "Nom d'utilisateur (doit absolument avoir les droits sur la base !) : " bd_uname
read -ers -p "Mot de passe utilisateur : " bd_upass
echo -n "
Configuration... "
php symfony configure:database "${bd_pdo}:host=${bd_serv};dbname=${bd_name}" $bd_uname $bd_upass
php symfony doctrine:build-db
echo -e "${txtgrn}[OK]${txtrst}
${txtcyn} ** Configuration authentification...${txtrst}"
PS3="Choisissez (1-3) : "
echo "Quel type d'authentification souhaitez-vous mettre en place?"
select type in "Base de données" "LDAP seul" "CAS + LDAP"
do
break
done
echo -e "Vous avez choisi ${txtbld}$type${txtrst}.
"
echo "all:" > apps/frontend/config/app.yml
if [ "$type" = "Base de données" ]; then
read -er -p "Type de cryptage du mot de passe [sha1, md5, none] : " bdd_crypt
echo "
bdd_server:
host: ${bd_serv}
pdo: ${bd_pdo}
dbname: ${bd_name}
username: ${bd_uname}
password: ${bd_upass}
bdd_infos:
user_pass_encrypt: ${bdd_crypt}
user_table_name: user
user_login_field: login
user_pass_field: pass
user_name_field: name
user_surname_field: surname
user_mail_field: mail
profile_builder_class: uapvProfileBuilderDatabase
authentication_type: bdd
user_id: id
" >> apps/frontend/config/app.yml
echo "
prod:
.settings:
no_script_name: true
logging_enabled: false
dev:
.settings:
error_reporting: <?php echo (E_ALL | E_STRICT).\"\n\" ?>
web_debug: true
cache: false
no_script_name: false
etag: false
test:
.settings:
error_reporting: <?php echo ((E_ALL | E_STRICT) ^ E_NOTICE).\"\n\" ?>
cache: false
web_debug: false
no_script_name: false
etag: false
all:
.settings:
i18n: true
default_culture: fr_FR
# Form security secret (CSRF protection)
csrf_secret: dfac37facb8499c931c70a84c303594a8f9b55e0 # Unique secret to enable CSRF protection or false to disable
enabled_modules: [default, authentication, error, autocomplete]
standard_helpers: [Partial, Cache, Form, I18N]
# Output escaping settings
escaping_strategy: true # Determines how variables are made available to templates. Accepted values: true, false.
escaping_method: ESC_SPECIALCHARS # Function or helper used for escaping. Accepted values: ESC_RAW, ESC_ENTITIES, ESC_JS, ESC_JS_NO_ENTITIES, and ESC_SPECIALCHARS.
# Cache settings
lazy_cache_key: true # Delays creation of a cache key until after checking whether an action or partial is cacheable
.actions:
secure_module: auth
secure_action: wrongcred
error_404_module: error
error_404_action: error404
# Uniquement pour login par
login_module: authentication # base de données ou ldap seul.
login_action: login #
" > apps/frontend/config/settings.yml
echo "
rendering: ~
security: ~
cache: ~
execution: ~
" > apps/frontend/config/filters.yml
echo "
authentication:
is_secure: false
meeting:
is_secure: false
auth:
is_secure: false
all:
is_secure: true
credentials: [[member]]
" > apps/frontend/config/security.yml
elif [ "$type" = "LDAP seul" ]; then
echo -e "${txtcyn} ** Configuration serveur LDAP...${txtrst}"
read -er -p "Adresse du serveur LDAP : " ldap_serv
read -er -p "Port du serveur LDAP (ex : 389 ) : " ldap_port
read -er -p "Branche utilisée pour la recherche d'utilisateurs (basedn) : " ldap_basedn
read -er -p "Champ identifiant utilisateur (ex : uid) : " ldap_user_id
read -er -p "Champ nom utilisateur (ex : sn) : " ldap_user_name
read -er -p "Champ prénom utilisateur (ex : givenname) : " ldap_user_surname
read -er -p "Champ mail utilisateur (ex : mail) : " ldap_user_mail
echo "
ldap_server:
host: ${ldap_serv}
port: ${ldap_port}
basedn: ${ldap_basedn}
options: {<?php echo LDAP_OPT_PROTOCOL_VERSION ?>: 3}
profile_var_translation:
uid: ${ldap_user_id}
name: ${ldap_user_name}
surname: ${ldap_user_surname}
mail: ${ldap_user_mail}
profile_builder_class: uapvProfileBuilderLdap
authentication_type: ldap
user_id: rdvz_user_id
" >> apps/frontend/config/app.yml
echo "
prod:
.settings:
no_script_name: true
logging_enabled: false
dev:
.settings:
error_reporting: <?php echo (E_ALL | E_STRICT).\"\n\" ?>
web_debug: true
cache: false
no_script_name: false
etag: false
test:
.settings:
error_reporting: <?php echo ((E_ALL | E_STRICT) ^ E_NOTICE).\"\n\" ?>
cache: false
web_debug: false
no_script_name: false
etag: false
all:
.settings:
i18n: true
default_culture: fr_FR
# Form security secret (CSRF protection)
csrf_secret: dfac37facb8499c931c70a84c303594a8f9b55e0 # Unique secret to enable CSRF protection or false to disable
enabled_modules: [default, authentication, error, autocomplete]
standard_helpers: [Partial, Cache, Form, I18N]
# Output escaping settings
escaping_strategy: true # Determines how variables are made available to templates. Accepted values: true, false.
escaping_method: ESC_SPECIALCHARS # Function or helper used for escaping. Accepted values: ESC_RAW, ESC_ENTITIES, ESC_JS, ESC_JS_NO_ENTITIES, and ESC_SPECIALCHARS.
# Cache settings
lazy_cache_key: true # Delays creation of a cache key until after checking whether an action or partial is cacheable
.actions:
secure_module: auth
secure_action: wrongcred
error_404_module: error
error_404_action: error404
# Uniquement pour login par
login_module: authentication # base de données ou ldap seul.
login_action: login #
" > apps/frontend/config/settings.yml
echo "
rendering: ~
security: ~
cache: ~
execution: ~
" > apps/frontend/config/filters.yml
echo "
authentication:
is_secure: false
meeting:
is_secure: false
auth:
is_secure: false
all:
is_secure: true
credentials: [[member]]
" > apps/frontend/config/security.yml
elif [ "$type" = "CAS + LDAP" ]; then
echo -e "${txtcyn} ** Configuration serveur CAS...${txtrst}"
read -er -p "Adresse du serveur CAS : " cas_serv
read -er -p "Port du serveur CAS (ex : 443) : " cas_port
echo -e "
${txtcyn} ** Configuration serveur LDAP...${txtrst}"
read -er -p "Adresse du serveur LDAP : " ldap_serv
read -er -p "Port du serveur LDAP (ex : 389) : " ldap_port
read -er -p "Branche utilisée pour la recherche d'utilisateurs (basedn) : " ldap_basedn
read -er -p "Champ identifiant utilisateur (ex : uid) : " ldap_user_id
read -er -p "Champ nom utilisateur (ex : sn) : " ldap_user_name
read -er -p "Champ prénom utilisateur (ex : givenname) : " ldap_user_surname
read -er -p "Champ mail utilisateur (ex : mail) : " ldap_user_mail
echo "
cas_server:
host: ${cas_serv}
port: ${cas_port}
path:
ldap_server:
host: ${ldap_serv}
port: ${ldap_port}
basedn: ${ldap_basedn}
options: {<?php echo LDAP_OPT_PROTOCOL_VERSION ?>: 3}
profile_var_translation:
uid: ${ldap_user_id}
name: ${ldap_user_name}
surname: ${ldap_user_surname}
mail: ${ldap_user_mail}
profile_builder_class: uapvProfileBuilderLdap
authentication_type: ldap
user_id: rdvz_user_id
" >> apps/frontend/config/app.yml
echo "
prod:
.settings:
no_script_name: true
logging_enabled: false
dev:
.settings:
error_reporting: <?php echo (E_ALL | E_STRICT).\"\n\" ?>
web_debug: true
cache: false
no_script_name: false
etag: false
test:
.settings:
error_reporting: <?php echo ((E_ALL | E_STRICT) ^ E_NOTICE).\"\n\" ?>
cache: false
web_debug: false
no_script_name: false
etag: false
all:
.settings:
i18n: true
default_culture: fr_FR
# Form security secret (CSRF protection)
csrf_secret: dfac37facb8499c931c70a84c303594a8f9b55e0 # Unique secret to enable CSRF protection or false to disable
enabled_modules: [default, authentication, error, autocomplete]
standard_helpers: [Partial, Cache, Form, I18N]
# Output escaping settings
escaping_strategy: true # Determines how variables are made available to templates. Accepted values: true, false.
escaping_method: ESC_SPECIALCHARS # Function or helper used for escaping. Accepted values: ESC_RAW, ESC_ENTITIES, ESC_JS, ESC_JS_NO_ENTITIES, and ESC_SPECIALCHARS.
# Cache settings
lazy_cache_key: true # Delays creation of a cache key until after checking whether an action or partial is cacheable
.actions:
secure_module: auth
secure_action: wrongcred
error_404_module: error
error_404_action: error404
" > apps/frontend/config/settings.yml
echo "
rendering: ~
security:
class: uapvSecurityFilterCas
param:
type: security
cache: ~
execution: ~
" > apps/frontend/config/filters.yml
echo "
meeting:
is_secure: false
auth:
is_secure: false
all:
is_secure: true
credentials: [[member]]
" > apps/frontend/config/security.yml
fi
echo -e "
${txtcyn} ** Configuration SMTP...${txtrst}"
PS3="Choisissez (1-2) : "
echo "Voulez-vous utiliser le SMTP en mode SSL?"
select type_a in "Oui" "Non"
do
break
done
if [ "$type_a" = "Non" ]; then
read -er -p "Adresse du serveur SMTP (ex : smtp.univ-avignon.fr) : " smtp_url
read -er -p "Port du SMTP : " smtp_port
smtp_user="~"
smtp_pass="~"
smtp_encrypt="~"
elif [ "$type_a" = "Oui" ]; then
read -er -p "Adresse du serveur SMTP (ex : smtp.univ-avignon.fr) : " smtp_url
read -er -p "Port du SMTP : " smtp_port
read -er -p "Nom d'utilisateur ayant les droits SMTP : " smtp_user
read -ers -p "Mot de passe utilisateur : " smtp_pass
smtp_encrypt="ssl"
fi
echo -e "
${txtcyn} ** Informations complémentaires...${txtrst}"
read -er -p "Nombre de charactères utilisés pour coder les sondages (3 est très correct) : " hash_nb_chars
read -er -p "Url de la page RdvZ (ex : rdvz.univ-avignon.fr) : " url
read -er -p "Nom de votre organisation (ex : Université d'Avignon) : " org
read -er -p "Adresse mail de l'application (ex : rdvz-admin@univ-avignon.fr) : " mail_sender
echo "
prod:
logger:
class: sfFileLogger
param:
level: err
loggers: ~
file: %SF_LOG_DIR%/%SF_APP%_%SF_ENVIRONMENT%.log
cli:
controller:
class: sfConsoleController
request:
class: sfConsoleRequest
response:
class: sfConsoleResponse
test:
storage:
class: sfSessionTestStorage
param:
session_path: %SF_TEST_CACHE_DIR%/sessions
response:
class: sfWebResponse
param:
send_http_headers: false
#prod:
# mailer:
# param:
# delivery_strategy: realtime
dev:
mailer:
param:
delivery_strategy: none
# delivery_strategy: single_address
# delivery_address: romain.deveaud@univ-avignon.fr
all:
mailer:
class: sfMailer
param:
logging: %SF_LOGGING_ENABLED%
charset: %SF_CHARSET%
delivery_strategy: realtime
transport:
class: Swift_SmtpTransport
param:
host: ${smtp_url}
port: ${smtp_port}
encryption: ${smtp_encrypt}
username: ${smtp_user}
password: ${smtp_pass}
routing:
class: sfPatternRouting
param:
generate_shortest_url: true
extra_parameters_as_query_string: true
view_cache_manager:
class: sfViewCacheManager
param:
cache_key_use_vary_headers: true
cache_key_use_host_name: true" > apps/frontend/config/factories.yml
echo "
url: ${url}
org_name: \"${org}\"
mail_sender: \"${mail_sender}\"
hash_nb_chars: ${hash_nb_chars}
.array:
languages:
fr: fr_FR
en: en_US" >> apps/frontend/config/app.yml
echo -n "Ecriture dans les fichiers de configuration... "
echo -e "${txtgrn}[OK]${txtrst}"
echo -n "Création des tables de la base de données..."
php symfony doctrine:build --all-classes --and-migrate
echo -e "${txtgrn}[OK]${txtrst}"
php symfony plugin:publish-assets
php symfony cc