1 |
d52a5b2f
|
jenselme
|
#!/bin/sh
|
2 |
|
|
|
3 |
|
|
. /users/guest/assos/bin/scripts-config.sh
|
4 |
|
|
|
5 |
|
|
# ARGS: [site_name]
|
6 |
|
|
|
7 |
|
|
if [ ! -z $1 ] ; then
|
8 |
|
|
. scripts-config-site.sh $1
|
9 |
10166730
|
Julien Enselme
|
# default is an exception to the rule
|
10 |
44360c7e
|
Julien Enselme
|
if echo $1 | grep default > /dev/null ; then
|
11 |
10166730
|
Julien Enselme
|
cd $d7_dir_sites/default
|
12 |
|
|
else
|
13 |
|
|
cd $d7_site_dir
|
14 |
|
|
fi
|
15 |
d52a5b2f
|
jenselme
|
fi
|
16 |
|
|
|
17 |
|
|
current_timestamp=`date "+%s"`
|
18 |
|
|
|
19 |
|
|
random_1=`dd if=/dev/urandom count=1 2> /dev/null | cksum | cut -f1 -d" "`
|
20 |
|
|
random_2=`dd if=/dev/urandom count=1 2> /dev/null | cksum | cut -f1 -d" "`
|
21 |
|
|
|
22 |
|
|
####### General variables
|
23 |
8c5e4549
|
Julien Enselme
|
drush -yq vset --always-set reverse_proxy TRUE
|
24 |
|
|
drush -yq vset --always-set --format=json reverse_proxy_addresses '["147.94.19.16","147.94.19.17"]'
|
25 |
4ca1d792
|
Julien Enselme
|
drush -yq ev "variable_set('update_notify_emails', array('$email_multi_assos_update'));"
|
26 |
8c5e4549
|
Julien Enselme
|
drush -yq vset error_level 0
|
27 |
|
|
drush -yq vset dblog_row_limit 1000
|
28 |
|
|
drush -yq vset cron_safe_threshold 0
|
29 |
d52a5b2f
|
jenselme
|
|
30 |
|
|
###### Hidden captcha
|
31 |
8c5e4549
|
Julien Enselme
|
drush -yq en hidden_captcha
|
32 |
d52a5b2f
|
jenselme
|
# Log wrong answers.
|
33 |
8c5e4549
|
Julien Enselme
|
drush -yq vset captcha_log_wrong_responses 1
|
34 |
d52a5b2f
|
jenselme
|
# Use hidden captcha for all forms.
|
35 |
8c5e4549
|
Julien Enselme
|
drush -yq sqlq --db-prefix "UPDATE {captcha_points} SET module = 'hidden_captcha', captcha_type = 'Hidden CAPTCHA' WHERE module is NULL;"
|
36 |
d52a5b2f
|
jenselme
|
# Flush captcha cache.
|
37 |
8c5e4549
|
Julien Enselme
|
drush -yq vdel captcha_placement_map_cache
|
38 |
d52a5b2f
|
jenselme
|
# Randomely generate a math question as the label of the hidden captcha field.
|
39 |
8c5e4549
|
Julien Enselme
|
drush -yq vset hidden_captcha_label "$random_1 + $random_2"
|
40 |
d52a5b2f
|
jenselme
|
|
41 |
|
|
|
42 |
|
|
####### Piwik
|
43 |
9d20c579
|
Florent Torregrosa
|
d7-reset-piwik-variables.sh $d7_site_name
|
44 |
d52a5b2f
|
jenselme
|
|
45 |
|
|
###### Security review
|
46 |
|
|
# For untrusted roles:
|
47 |
|
|
# 1: anonymous user
|
48 |
|
|
# 2: authenticated user
|
49 |
|
|
# 3: administrator
|
50 |
8c5e4549
|
Julien Enselme
|
drush -yq en security_review
|
51 |
|
|
drush -yq ev "variable_set('security_review_untrusted_roles', array('1'));"
|
52 |
95df3862
|
Florent Torregrosa
|
# The default method to check settings.php do not work because we include a global and local settings.php
|
53 |
8c5e4549
|
Julien Enselme
|
drush -yq vset security_review_base_url_method include
|
54 |
d52a5b2f
|
jenselme
|
# Used to initialise entries in the database schema.
|
55 |
8c5e4549
|
Julien Enselme
|
drush -yq security-review --store
|
56 |
95df3862
|
Florent Torregrosa
|
# file_perms : Security Review can't check for files permissions on multi_assos if launched within the web interface.
|
57 |
|
|
# private_files : we have chosen a private path in the files repository and Security Review raise errors but this path is secure.
|
58 |
8c5e4549
|
Julien Enselme
|
drush -yq sqlq --db-prefix "UPDATE {security_review} SET skip = '1', skiptime = $current_timestamp, skipuid = '1' WHERE reviewcheck IN ('file_perms', 'private_files');"
|
59 |
|
|
drush -yq sqlq --db-prefix "UPDATE {security_review} SET skip = '0', skiptime = '0', skipuid = NULL WHERE reviewcheck NOT IN ('file_perms', 'private_files');" |