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 |
|
|
cd $d7_site_dir
|
10 |
|
|
fi
|
11 |
|
|
|
12 |
|
|
current_timestamp=`date "+%s"`
|
13 |
|
|
|
14 |
|
|
random_1=`dd if=/dev/urandom count=1 2> /dev/null | cksum | cut -f1 -d" "`
|
15 |
|
|
random_2=`dd if=/dev/urandom count=1 2> /dev/null | cksum | cut -f1 -d" "`
|
16 |
|
|
|
17 |
|
|
####### General variables
|
18 |
|
|
drush -y vset --always-set reverse_proxy TRUE
|
19 |
|
|
drush -y vset --always-set --format=json reverse_proxy_addresses '["147.94.19.16","147.94.19.17"]'
|
20 |
|
|
drush -y ev "variable_set('update_notify_emails', array('$email_multi_assos'));"
|
21 |
|
|
drush -y vset error_level 0
|
22 |
|
|
drush -y vset dblog_row_limit 1000
|
23 |
|
|
|
24 |
|
|
###### Hidden captcha
|
25 |
|
|
drush -y en hidden_captcha
|
26 |
|
|
# Log wrong answers.
|
27 |
|
|
drush -y vset captcha_log_wrong_responses 1
|
28 |
|
|
# Use hidden captcha for all forms.
|
29 |
|
|
drush -y sqlq --db-prefix "UPDATE {captcha_points} SET module = 'hidden_captcha', captcha_type = 'Hidden CAPTCHA' WHERE module is NULL;"
|
30 |
|
|
# Flush captcha cache.
|
31 |
|
|
drush -y vdel captcha_placement_map_cache
|
32 |
|
|
# Randomely generate a math question as the label of the hidden captcha field.
|
33 |
|
|
drush -y vset hidden_captcha_label "$random_1 + $random_2"
|
34 |
|
|
|
35 |
|
|
|
36 |
|
|
####### Piwik
|
37 |
|
|
drush -y en piwik
|
38 |
|
|
drush -y vset piwik_site_id "101"
|
39 |
|
|
drush -y vset piwik_url_http "http://piwik.centrale-marseille.fr/"
|
40 |
|
|
drush -y vset piwik_url_https "https://piwik.centrale-marseille.fr/"
|
41 |
|
|
# Piwik cache.
|
42 |
|
|
drush -y vset piwik_cache 1
|
43 |
|
|
drush -y vset piwik_visibility_roles "1"
|
44 |
|
|
# Piwik is enable for everyone except the administrator
|
45 |
|
|
drush -y vset --format=json piwik_roles '[3]'
|
46 |
|
|
drush -y vset piwik_page_title_hierarchy 1
|
47 |
|
|
# Activate local search.
|
48 |
|
|
drush -y vset piwik_site_search 1
|
49 |
|
|
|
50 |
|
|
|
51 |
|
|
###### Security review
|
52 |
|
|
# For untrusted roles:
|
53 |
|
|
# 1: anonymous user
|
54 |
|
|
# 2: authenticated user
|
55 |
|
|
# 3: administrator
|
56 |
|
|
drush -y en security_review
|
57 |
|
|
drush -y ev "variable_set('security_review_untrusted_roles', array('1'));"
|
58 |
|
|
# Used to initialise entries in the database schema.
|
59 |
|
|
drush security-review --store
|
60 |
|
|
# Security review can't check for files permissions on multi_assos if launched within the web interface.
|
61 |
|
|
drush -y sqlq --db-prefix "UPDATE {security_review} SET skip = '1', skiptime = $current_timestamp, skipuid = '1' WHERE reviewcheck IN ('file_perms');"
|
62 |
|
|
drush -y sqlq --db-prefix "UPDATE {security_review} SET skip = '0', skiptime = '0', skipuid = NULL WHERE reviewcheck NOT IN ('file_perms');" |