summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Provision/Config.php5
-rw-r--r--Provision/Config/Drupal/Settings.php29
-rw-r--r--Provision/Config/Drupal/provision_drupal_settings.tpl.php15
-rw-r--r--aegir-dev.make7
-rw-r--r--aegir-release.make7
-rw-r--r--[l---------]aegir.make16
-rw-r--r--db/Provision/Service/db/mysql.php8
-rw-r--r--debian/control2
-rw-r--r--http/Provision/Config/Nginx/Inc/vhost_include.tpl.php45
-rw-r--r--http/Provision/Config/Nginx/server.tpl.php12
-rw-r--r--http/Provision/Config/Nginx/subdir.tpl.php31
-rw-r--r--migrate.hostmaster.inc3
-rw-r--r--platform/backup.provision.inc4
-rw-r--r--platform/clone.provision.inc21
-rw-r--r--platform/drupal/clear_6.inc32
-rw-r--r--platform/drupal/clear_7.inc45
-rw-r--r--platform/drupal/import_7.inc2
-rw-r--r--platform/drupal/install_6.inc22
-rw-r--r--platform/import.provision.inc6
-rw-r--r--platform/migrate.provision.inc55
-rw-r--r--platform/provision_drupal.drush.inc215
-rw-r--r--platform/verify.provision.inc104
-rw-r--r--provision.drush.inc6
23 files changed, 628 insertions, 64 deletions
diff --git a/Provision/Config.php b/Provision/Config.php
index e3a76e8..30e5c0e 100644
--- a/Provision/Config.php
+++ b/Provision/Config.php
@@ -184,11 +184,16 @@ class Provision_Config {
*/
function write() {
$filename = $this->filename();
+ // Debug tmp
+ drush_log("DEBUG A: filename is $filename");
// Make directory structure if it does not exist.
if ($filename && !provision_file()->exists(dirname($filename))->status()) {
provision_file()->mkdir(dirname($filename))
->succeed('Created directory @path.')
->fail('Could not create directory @path.');
+ // Debug tmp
+ $this_dirname = dirname($filename);
+ drush_log("DEBUG B: this_dirname is $this_dirname");
}
$status = FALSE;
diff --git a/Provision/Config/Drupal/Settings.php b/Provision/Config/Drupal/Settings.php
index ee8a698..f72378b 100644
--- a/Provision/Config/Drupal/Settings.php
+++ b/Provision/Config/Drupal/Settings.php
@@ -15,11 +15,16 @@ class Provision_Config_Drupal_Settings extends Provision_Config {
}
function process() {
+ if (drush_drupal_major_version() >= 8) {
+ $this->data['config_directories_active_var'] = 'config_directories_active';
+ $this->data['config_directories_staging_var'] = 'config_directories_staging';
+ }
if (drush_drupal_major_version() >= 7) {
$this->data['db_type'] = ($this->data['db_type'] == 'mysqli') ? 'mysql' : $this->data['db_type'];
$this->data['file_directory_path_var'] = 'file_public_path';
$this->data['file_directory_temp_var'] = 'file_temporary_path';
$this->data['file_directory_private_var'] = 'file_private_path';
+ $this->data['drupal_hash_salt_var'] = 'empty';
}
else {
$this->data['file_directory_path_var'] = 'file_directory_path';
@@ -48,5 +53,29 @@ class Provision_Config_Drupal_Settings extends Provision_Config {
// then react to this and change any settings we don't want backed up.
$backup_file = drush_get_option('backup_file');
$this->backup_in_progress = !empty($backup_file);
+
+ // Create a blank local.settings.php file if not exists.
+ $local_settings = $this->site_path . '/local.settings.php';
+ $local_settings_blank = "<?php # local settings.php \n";
+ $local_description = 'Drupal local.settings.php file';
+ if (!provision_file()->exists($local_settings)->status()) {
+ provision_file()->file_put_contents($local_settings, $local_settings_blank)
+ ->succeed('Generated blank ' . $local_description)
+ ->fail('Could not generate ' . $local_description);
+ provision_file()->chgrp($local_settings, $this->group)
+ ->succeed('Changed group ownership of <code>@path</code> to @gid')
+ ->fail('Could not change group ownership of <code>@path</code> to @gid');
+ provision_file()->chmod($local_settings, $this->mode | 0440)
+ ->succeed('Changed permissions of <code>@path</code> to @perm')
+ ->fail('Could not change permissions of <code>@path</code> to @perm');
+ }
+ else {
+ provision_file()->chgrp($local_settings, $this->group)
+ ->succeed('Changed group ownership of <code>@path</code> to @gid')
+ ->fail('Could not change group ownership of <code>@path</code> to @gid');
+ provision_file()->chmod($local_settings, $this->mode | 0440)
+ ->succeed('Changed permissions of <code>@path</code> to @perm')
+ ->fail('Could not change permissions of <code>@path</code> to @perm');
+ }
}
}
diff --git a/Provision/Config/Drupal/provision_drupal_settings.tpl.php b/Provision/Config/Drupal/provision_drupal_settings.tpl.php
index 66749ae..6abc637 100644
--- a/Provision/Config/Drupal/provision_drupal_settings.tpl.php
+++ b/Provision/Config/Drupal/provision_drupal_settings.tpl.php
@@ -118,11 +118,9 @@ if (isset($_SERVER['db_name'])) {
@ini_set('arg_separator.output', '&amp;');
@ini_set('magic_quotes_runtime', 0);
@ini_set('magic_quotes_sybase', 0);
- @ini_set('session.cache_expire', 200000);
@ini_set('session.cache_limiter', 'none');
- @ini_set('session.cookie_lifetime', 0);
- @ini_set('session.gc_maxlifetime', 200000);
@ini_set('session.save_handler', 'user');
+ @ini_set('session.use_cookies', 1);
@ini_set('session.use_only_cookies', 1);
@ini_set('session.use_trans_sid', 0);
@ini_set('url_rewriter.tags', '');
@@ -140,6 +138,17 @@ if (isset($_SERVER['db_name'])) {
<?php if (isset($file_directory_private_var)): ?>
$conf['<?php print $file_directory_private_var ?>'] = 'sites/<?php print $this->uri ?>/private/files';
<?php endif; ?>
+<?php if (isset($drupal_hash_salt_var)): ?>
+ $drupal_hash_salt = '';
+<?php endif; ?>
+<?php if (isset($config_directories_active_var)): ?>
+ $config_directories['active']['path'] = 'sites/<?php print $this->uri ?>/private/config/active';
+ $config_directories['active']['absolute'] = TRUE;
+<?php endif; ?>
+<?php if (isset($config_directories_staging_var)): ?>
+ $config_directories['staging']['path'] = 'sites/<?php print $this->uri ?>/private/config/staging';
+ $config_directories['staging']['absolute'] = TRUE;
+<?php endif; ?>
$conf['clean_url'] = 1;
$conf['aegir_api'] = <?php print !$this->backup_in_progress ? $this->api_version : 0 ?>;
diff --git a/aegir-dev.make b/aegir-dev.make
index e7b17a6..9df4fa8 100644
--- a/aegir-dev.make
+++ b/aegir-dev.make
@@ -1,5 +1,10 @@
-core = 6.x
+; Aegir Provision makefile
+;
+
api = 2
+core = 6.x
+
+; BOA-2.3.6
; this makefile fetches the latest Aegir code from git from drupal.org
; it shouldn't really change at all apart from major upgrades, where
diff --git a/aegir-release.make b/aegir-release.make
index edddaf7..b0eace8 100644
--- a/aegir-release.make
+++ b/aegir-release.make
@@ -1,5 +1,10 @@
-core = 6.x
+; Aegir Provision makefile
+;
+
api = 2
+core = 6.x
+
+; BOA-2.3.6
; this makefile fetches the latest release from Drupal.org
; it is maintained through the release.sh script
diff --git a/aegir.make b/aegir.make
index 4292e82..796e4a5 120000..100644
--- a/aegir.make
+++ b/aegir.make
@@ -1 +1,15 @@
-aegir-dev.make \ No newline at end of file
+; Aegir Provision makefile
+;
+
+api = 2
+core = 6.x
+
+; BOA-2.3.6
+
+projects[pressflow][type] = "core"
+projects[pressflow][download][type] = "get"
+projects[pressflow][download][url] = "http://files.aegir.cc/core/pressflow-6.33.1.tar.gz"
+
+projects[hostmaster][type] = "profile"
+projects[hostmaster][download][type] = "get"
+projects[hostmaster][download][url] = "http://files.aegir.cc/versions/stable/tar/hostmaster-BOA-2.3.6.tar.gz"
diff --git a/db/Provision/Service/db/mysql.php b/db/Provision/Service/db/mysql.php
index 38bc481..d744bb8 100644
--- a/db/Provision/Service/db/mysql.php
+++ b/db/Provision/Service/db/mysql.php
@@ -55,6 +55,9 @@ class Provision_Service_db_mysql extends Provision_Service_db_pdo {
}
function grant($name, $username, $password, $host = '') {
+ if (provision_file()->exists('/data/conf/clstr.cnf')->status()) {
+ $host = '%';
+ }
$host = ($host) ? $host : '%';
if ($host != "127.0.0.1") {
$extra_host = "127.0.0.1";
@@ -65,6 +68,9 @@ class Provision_Service_db_mysql extends Provision_Service_db_pdo {
}
function revoke($name, $username, $host = '') {
+ if (provision_file()->exists('/data/conf/clstr.cnf')->status()) {
+ $host = '%';
+ }
$host = ($host) ? $host : '%';
$success = $this->query("REVOKE ALL PRIVILEGES ON `%s`.* FROM `%s`@`%s`", $name, $username, $host);
@@ -148,7 +154,7 @@ class Provision_Service_db_mysql extends Provision_Service_db_pdo {
// non-readable by the webserver.
umask(0077);
// Mixed copy-paste of drush_shell_exec and provision_shell_exec.
- $cmd = sprintf("mysqldump --defaults-file=/dev/fd/3 --single-transaction --quick %s | sed 's|/\\*!50001 CREATE ALGORITHM=UNDEFINED \\*/|/\\*!50001 CREATE \\*/|g; s|/\\*!50017 DEFINER=`[^`]*`@`[^`]*`\s*\\*/||g' | sed '/\\*!50013 DEFINER=.*/ d' > %s/database.sql", escapeshellcmd(drush_get_option('db_name')), escapeshellcmd(d()->site_path));
+ $cmd = sprintf("mysqldump --defaults-file=/dev/fd/3 --opt --skip-lock-tables --order-by-primary --default-character-set=utf8 -Q --hex-blob --single-transaction --quick %s | sed 's|/\\*!50001 CREATE ALGORITHM=UNDEFINED \\*/|/\\*!50001 CREATE \\*/|g; s|/\\*!50017 DEFINER=`[^`]*`@`[^`]*`\s*\\*/||g' | sed '/\\*!50013 DEFINER=.*/ d' > %s/database.sql", escapeshellcmd(drush_get_option('db_name')), escapeshellcmd(d()->site_path));
$success = $this->safe_shell_exec($cmd, drush_get_option('db_host'), urldecode(drush_get_option('db_user')), urldecode(drush_get_option('db_passwd')));
$dump_size_too_small = filesize(d()->site_path . '/database.sql') < 1024;
diff --git a/debian/control b/debian/control
index f920c08..a18b632 100644
--- a/debian/control
+++ b/debian/control
@@ -45,7 +45,7 @@ Description: mass Drupal hosting system - frontend
.
This package provides the frontend web interface that users generally
interact with. It's made up of a regular Drupal site with a custom
- install profile, module and theme.
+ installation profile, module and theme.
.
This meta-package will dynamically install the frontend using drush
and provision and as such doesn't bundle any files itself. Everything
diff --git a/http/Provision/Config/Nginx/Inc/vhost_include.tpl.php b/http/Provision/Config/Nginx/Inc/vhost_include.tpl.php
index 12b9957..0d05b11 100644
--- a/http/Provision/Config/Nginx/Inc/vhost_include.tpl.php
+++ b/http/Provision/Config/Nginx/Inc/vhost_include.tpl.php
@@ -49,6 +49,13 @@ if ($is_crawler) {
}
###
+### Block semalt botnet.
+###
+if ($is_botnet) {
+ return 403;
+}
+
+###
### Include high load protection config if exists.
###
include /data/conf/nginx_high_load.c*;
@@ -164,7 +171,9 @@ location = /fpm-status {
access_log off;
allow 127.0.0.1;
deny all;
-<?php if ($phpfpm_mode == 'port'): ?>
+<?php if ($satellite_mode == 'boa'): ?>
+ fastcgi_pass unix:/var/run/www53.fpm.socket;
+<?php elseif ($phpfpm_mode == 'port'): ?>
fastcgi_pass 127.0.0.1:9000;
<?php else: ?>
fastcgi_pass unix:/var/run/php5-fpm.sock;
@@ -178,7 +187,9 @@ location = /fpm-ping {
access_log off;
allow 127.0.0.1;
deny all;
-<?php if ($phpfpm_mode == 'port'): ?>
+<?php if ($satellite_mode == 'boa'): ?>
+ fastcgi_pass unix:/var/run/www53.fpm.socket;
+<?php elseif ($phpfpm_mode == 'port'): ?>
fastcgi_pass 127.0.0.1:9000;
<?php else: ?>
fastcgi_pass unix:/var/run/php5-fpm.sock;
@@ -200,7 +211,9 @@ location = /cron.php {
deny all;
<?php endif; ?>
try_files $uri =404;
-<?php if ($phpfpm_mode == 'port'): ?>
+<?php if ($satellite_mode == 'boa'): ?>
+ fastcgi_pass unix:/var/run/www53.fpm.socket;
+<?php elseif ($phpfpm_mode == 'port'): ?>
fastcgi_pass 127.0.0.1:9000;
<?php else: ?>
fastcgi_pass unix:/var/run/php5-fpm.sock;
@@ -220,7 +233,9 @@ location = /core/cron.php {
deny all;
<?php endif; ?>
try_files $uri =404;
-<?php if ($phpfpm_mode == 'port'): ?>
+<?php if ($satellite_mode == 'boa'): ?>
+ fastcgi_pass unix:/var/run/www53.fpm.socket;
+<?php elseif ($phpfpm_mode == 'port'): ?>
fastcgi_pass 127.0.0.1:9000;
<?php else: ?>
fastcgi_pass unix:/var/run/php5-fpm.sock;
@@ -798,7 +813,9 @@ location ~* /(?:modules|libraries)/(?:contrib/)?(?:ad|tinybrowser|f?ckeditor|tin
return 403;
}
try_files $uri =404;
-<?php if ($phpfpm_mode == 'port'): ?>
+<?php if ($satellite_mode == 'boa'): ?>
+ fastcgi_pass unix:/var/run/www53.fpm.socket;
+<?php elseif ($phpfpm_mode == 'port'): ?>
fastcgi_pass 127.0.0.1:9000;
<?php else: ?>
fastcgi_pass unix:/var/run/php5-fpm.sock;
@@ -941,7 +958,13 @@ location ~ ^/(?<esi>esi/.*)"$ {
###
fastcgi_param QUERY_STRING q=$esi;
fastcgi_param SCRIPT_FILENAME $document_root/index.php;
+<?php if ($satellite_mode == 'boa'): ?>
+ fastcgi_pass unix:/var/run/www53.fpm.socket;
+<?php elseif ($phpfpm_mode == 'port'): ?>
fastcgi_pass 127.0.0.1:9000;
+<?php else: ?>
+ fastcgi_pass unix:/var/run/php5-fpm.sock;
+<?php endif; ?>
###
### Use Nginx cache for all visitors.
###
@@ -1080,7 +1103,9 @@ location = /index.php {
tcp_nopush off;
keepalive_requests 0;
try_files $uri =404; ### check for existence of php file first
-<?php if ($phpfpm_mode == 'port'): ?>
+<?php if ($satellite_mode == 'boa'): ?>
+ fastcgi_pass unix:/var/run/www53.fpm.socket;
+<?php elseif ($phpfpm_mode == 'port'): ?>
fastcgi_pass 127.0.0.1:9000;
<?php else: ?>
fastcgi_pass unix:/var/run/php5-fpm.sock;
@@ -1131,7 +1156,9 @@ location ~* ^/(?:index|cron|boost_stats|update|authorize)\.php$ {
keepalive_requests 0;
access_log off;
try_files $uri =404; ### check for existence of php file first
-<?php if ($phpfpm_mode == 'port'): ?>
+<?php if ($satellite_mode == 'boa'): ?>
+ fastcgi_pass unix:/var/run/www53.fpm.socket;
+<?php elseif ($phpfpm_mode == 'port'): ?>
fastcgi_pass 127.0.0.1:9000;
<?php else: ?>
fastcgi_pass unix:/var/run/php5-fpm.sock;
@@ -1159,7 +1186,9 @@ location @allowupdate {
keepalive_requests 0;
access_log off;
try_files $uri =404; ### check for existence of php file first
-<?php if ($phpfpm_mode == 'port'): ?>
+<?php if ($satellite_mode == 'boa'): ?>
+ fastcgi_pass unix:/var/run/www53.fpm.socket;
+<?php elseif ($phpfpm_mode == 'port'): ?>
fastcgi_pass 127.0.0.1:9000;
<?php else: ?>
fastcgi_pass unix:/var/run/php5-fpm.sock;
diff --git a/http/Provision/Config/Nginx/server.tpl.php b/http/Provision/Config/Nginx/server.tpl.php
index 5aa2c0f..4fe8823 100644
--- a/http/Provision/Config/Nginx/server.tpl.php
+++ b/http/Provision/Config/Nginx/server.tpl.php
@@ -222,7 +222,17 @@ map $request_uri $key_uri {
###
map $http_user_agent $is_crawler {
default '';
- ~*HTTrack|BrokenLinkCheck|2009042316.*Firefox.*3\.0\.10|MJ12|HTMLParser|PECL|Automatic|SiteBot|BuzzTrack|Sistrix|Offline|Nutch|Mireo|SWEB|Morfeus|GSLFbot|HiScan|Riddler|DBot|CCBot is_crawler;
+ ~*HTTrack|BrokenLinkCheck|2009042316.*Firefox.*3\.0\.10|MJ12|HTMLParser|PECL|Automatic|CCBot is_crawler;
+ ~*SiteBot|BuzzTrack|Sistrix|Offline|Nutch|Mireo|SWEB|Morfeus|GSLFbot|HiScan|Riddler|DBot is_crawler;
+}
+
+###
+### Block semalt botnet.
+###
+map $http_referer $is_botnet {
+ default '';
+ ~*semalt\.com|kambasoft\.com|savetubevideo\.com|bottlenose\.com|yapoga\.com is_botnet;
+ ~*descargar-musica-gratis\.net|baixar-musicas-gratis\.com is_botnet;
}
###
diff --git a/http/Provision/Config/Nginx/subdir.tpl.php b/http/Provision/Config/Nginx/subdir.tpl.php
index d53bb06..e912d7d 100644
--- a/http/Provision/Config/Nginx/subdir.tpl.php
+++ b/http/Provision/Config/Nginx/subdir.tpl.php
@@ -56,6 +56,13 @@ location ^~ /<?php print $subdir; ?> {
}
###
+ ### Block semalt botnet.
+ ###
+ if ($is_botnet) {
+ return 403;
+ }
+
+ ###
### Include high load protection config if exists.
###
include /data/conf/nginx_high_load.c*;
@@ -189,7 +196,9 @@ location ^~ /<?php print $subdir; ?>/cdn/farfuture/ {
deny all;
<?php endif; ?>
try_files /cron.php $uri =404;
-<?php if ($phpfpm_mode == 'port'): ?>
+<?php if ($satellite_mode == 'boa'): ?>
+ fastcgi_pass unix:/var/run/www53.fpm.socket;
+<?php elseif ($phpfpm_mode == 'port'): ?>
fastcgi_pass 127.0.0.1:9000;
<?php else: ?>
fastcgi_pass unix:/var/run/php5-fpm.sock;
@@ -565,7 +574,9 @@ location ^~ /<?php print $subdir; ?>/cdn/farfuture/ {
return 403;
}
try_files /$1 $uri =404;
-<?php if ($phpfpm_mode == 'port'): ?>
+<?php if ($satellite_mode == 'boa'): ?>
+ fastcgi_pass unix:/var/run/www53.fpm.socket;
+<?php elseif ($phpfpm_mode == 'port'): ?>
fastcgi_pass 127.0.0.1:9000;
<?php else: ?>
fastcgi_pass unix:/var/run/php5-fpm.sock;
@@ -745,10 +756,12 @@ location ^~ /<?php print $subdir; ?>/cdn/farfuture/ {
keepalive_requests 0;
access_log off;
try_files /$1.php =404; ### check for existence of php file first
-<?php if ($phpfpm_mode == 'port'): ?>
- fastcgi_pass 127.0.0.1:9000;
+<?php if ($satellite_mode == 'boa'): ?>
+ fastcgi_pass unix:/var/run/www53.fpm.socket;
+<?php elseif ($phpfpm_mode == 'port'): ?>
+ fastcgi_pass 127.0.0.1:9000;
<?php else: ?>
- fastcgi_pass unix:/var/run/php5-fpm.sock;
+ fastcgi_pass unix:/var/run/php5-fpm.sock;
<?php endif; ?>
}
@@ -818,7 +831,9 @@ location ^~ /<?php print $subdir; ?>/cdn/farfuture/ {
tcp_nopush off;
keepalive_requests 0;
try_files /index.php =404; ### check for existence of php file first
-<?php if ($phpfpm_mode == 'port'): ?>
+<?php if ($satellite_mode == 'boa'): ?>
+ fastcgi_pass unix:/var/run/www53.fpm.socket;
+<?php elseif ($phpfpm_mode == 'port'): ?>
fastcgi_pass 127.0.0.1:9000;
<?php else: ?>
fastcgi_pass unix:/var/run/php5-fpm.sock;
@@ -959,7 +974,9 @@ location @allowupdate_<?php print $subdir; ?> {
access_log off;
try_files /$real_fastcgi_script_name =404; ### check for existence of php file first
-<?php if ($phpfpm_mode == 'port'): ?>
+<?php if ($satellite_mode == 'boa'): ?>
+ fastcgi_pass unix:/var/run/www53.fpm.socket;
+<?php elseif ($phpfpm_mode == 'port'): ?>
fastcgi_pass 127.0.0.1:9000;
<?php else: ?>
fastcgi_pass unix:/var/run/php5-fpm.sock;
diff --git a/migrate.hostmaster.inc b/migrate.hostmaster.inc
index 66fa542..a31a9bb 100644
--- a/migrate.hostmaster.inc
+++ b/migrate.hostmaster.inc
@@ -162,5 +162,8 @@ function drush_provision_post_hostmaster_migrate($site, $platform) {
'old_platform_name' => drush_get_option('old_platform'),
'new_platform_name' => drush_get_option('new_platform'),
));
+ // We need to re-verify @server_master via frontend to re-generate
+ // its drush alias and to update Nginx configuration files.
+ provision_backend_invoke('@hostmaster', 'hosting-task', array(@server_master, 'verify'), array('force' => TRUE));
}
diff --git a/platform/backup.provision.inc b/platform/backup.provision.inc
index db20f44..7859209 100644
--- a/platform/backup.provision.inc
+++ b/platform/backup.provision.inc
@@ -20,7 +20,7 @@ function drush_provision_drupal_provision_backup_validate($backup_file = NULL) {
drush_set_error('PROVISION_DRUPAL_SITE_NOT_FOUND');
}
- // This is the actual drupal provisioning requirements.
+ // This is the actual drupal provisioning requirements.
if (!is_dir(d()->platform->server->backup_path)) {
drush_set_error('PROVISION_BACKUP_PATH_NOT_FOUND');
}
@@ -126,7 +126,7 @@ function drush_provision_drupal_post_provision_backup() {
*/
function drush_provision_drupal_provision_backup_rollback() {
$backup_file = drush_get_option('backup_file');
- if (file_exists($backup_file)) {
+ if (is_readable($backup_file) && is_file($backup_file)) {
provision_file()->unlink($backup_file)
->succeed('Removed stale backup file @path')
->fail('Failed deleting backup file @path');
diff --git a/platform/clone.provision.inc b/platform/clone.provision.inc
index 5334f23..c70cc6f 100644
--- a/platform/clone.provision.inc
+++ b/platform/clone.provision.inc
@@ -38,6 +38,19 @@ function drush_provision_drupal_pre_provision_clone_rollback($new_uri, $platform
function drush_provision_drupal_provision_clone($new_uri, $platform = null) {
drush_set_option('old_platform', d()->platform->name);
+ // If the site is cloned between platforms and not just in the same platform,
+ // we should update the info collected about source and target platform first.
+ if (!is_null(d($platform)->name) && (d($platform)->name != d()->platform->name)) {
+ provision_backend_invoke('@hostmaster', 'hosting-task', array(d()->platform->name, 'verify'), array('force' => TRUE));
+ sleep(5); // A small trick to avoid high load and race conditions.
+ provision_backend_invoke('@hostmaster', 'hosting-task', array(d($platform)->name, 'verify'), array('force' => TRUE));
+ sleep(5); // A small trick to avoid high load and race conditions.
+ }
+ // We should update also the info collected about the site before running clone.
+ $local_uri_verify = '@' . d()->uri;
+ provision_backend_invoke('@hostmaster', 'hosting-task', array($local_uri_verify, 'verify'), array('force' => TRUE));
+ sleep(5); // A small trick to avoid high load and race conditions.
+
$options = d()->options;
$options['uri'] = ltrim($new_uri, '@');
$hash_name = drush_get_option('#name') ? '#name' : 'name';
@@ -54,6 +67,10 @@ function drush_provision_drupal_provision_clone($new_uri, $platform = null) {
$options['ssl_enabled'] = 0;
unset($options['ssl_key']);
+ // Do not copy CDN aliases to the cloned site --CDN vhost
+ $options['cdn'] = 0;
+ unset($options['cdn']);
+
if ($profile = drush_get_option('profile', FALSE)) {
$options['profile'] = $profile;
}
@@ -68,7 +85,11 @@ function drush_provision_drupal_provision_clone($new_uri, $platform = null) {
provision_backend_invoke($new_uri, 'provision-deploy', array(drush_get_option('backup_file')), array('old_uri' => d()->uri));
if (!drush_get_error()) {
+ // Verify the newly cloned site.
provision_backend_invoke($new_uri, 'provision-verify');
+ sleep(5); // A small trick to avoid high load and race conditions.
+ // Verify again also original site via frontend to avoid issue #1004526
+ provision_backend_invoke('@hostmaster', 'hosting-task', array($local_uri_verify, 'verify'), array('force' => TRUE));
}
provision_reload_config('site', d()->site_path . '/drushrc.php');
diff --git a/platform/drupal/clear_6.inc b/platform/drupal/clear_6.inc
index 3a5d31f..619fe58 100644
--- a/platform/drupal/clear_6.inc
+++ b/platform/drupal/clear_6.inc
@@ -4,8 +4,40 @@
* Rebuild all the caches
*/
+module_list(TRUE, FALSE);
module_rebuild_cache();
drush_log(dt('Rebuilt module cache'));
+cache_clear_all('*', 'cache_form', TRUE); // This bin is excluded in drupal_flush_all_caches()
+ // but if not purged, it may break tasks with
+ // mysterious errors thanks to garbage collected.
drupal_flush_all_caches();
drush_log(dt('All caches flushed'));
+
+// function drupal_flush_all_caches() {
+// // Change query-strings on css/js files to enforce reload for all users.
+// _drupal_flush_css_js();
+//
+// drupal_clear_css_cache();
+// drupal_clear_js_cache();
+//
+// // If invoked from update.php, we must not update the theme information in the
+// // database, or this will result in all themes being disabled.
+// if (defined('MAINTENANCE_MODE') && MAINTENANCE_MODE == 'update') {
+// _system_theme_data();
+// }
+// else {
+// system_theme_data();
+// }
+//
+// drupal_rebuild_theme_registry();
+// menu_rebuild();
+// node_types_rebuild();
+// // Don't clear cache_form - in-progress form submissions may break.
+// // Ordered so clearing the page cache will always be the last action.
+// $core = array('cache', 'cache_block', 'cache_filter', 'cache_page');
+// $cache_tables = array_merge(module_invoke_all('flush_caches'), $core);
+// foreach ($cache_tables as $table) {
+// cache_clear_all('*', $table, TRUE);
+// }
+// }
diff --git a/platform/drupal/clear_7.inc b/platform/drupal/clear_7.inc
index c9d71cd..a667f76 100644
--- a/platform/drupal/clear_7.inc
+++ b/platform/drupal/clear_7.inc
@@ -4,5 +4,50 @@
* Rebuild all the caches
*/
+cache_clear_all('*', 'cache_form', TRUE); // This bin is excluded in drupal_flush_all_caches()
+ // but if not purged, it may break tasks with
+ // mysterious errors thanks to garbage collected.
drupal_flush_all_caches();
drush_log(dt('All caches flushed'));
+
+// function drupal_flush_all_caches() {
+// // Change query-strings on css/js files to enforce reload for all users.
+// _drupal_flush_css_js();
+//
+// registry_rebuild();
+// drupal_clear_css_cache();
+// drupal_clear_js_cache();
+//
+// // Rebuild the theme data. Note that the module data is rebuilt above, as
+// // part of registry_rebuild().
+// system_rebuild_theme_data();
+// drupal_theme_rebuild();
+//
+// entity_info_cache_clear();
+// node_types_rebuild();
+// // node_menu() defines menu items based on node types so it needs to come
+// // after node types are rebuilt.
+// menu_rebuild();
+//
+// // Synchronize to catch any actions that were added or removed.
+// actions_synchronize();
+//
+// // Don't clear cache_form - in-progress form submissions may break.
+// // Ordered so clearing the page cache will always be the last action.
+// $core = array(
+// 'cache',
+// 'cache_path',
+// 'cache_filter',
+// 'cache_bootstrap',
+// 'cache_page',
+// );
+// $cache_tables = array_merge(module_invoke_all('flush_caches'), $core);
+// foreach ($cache_tables as $table) {
+// cache_clear_all('*', $table, TRUE);
+// }
+//
+// // Rebuild the bootstrap module list. We do this here so that developers
+// // can get new hook_boot() implementations registered without having to
+// // write a hook_update_N() function.
+// _system_update_bootstrap_status();
+// }
diff --git a/platform/drupal/import_7.inc b/platform/drupal/import_7.inc
index d1e9773..df9a461 100644
--- a/platform/drupal/import_7.inc
+++ b/platform/drupal/import_7.inc
@@ -7,7 +7,7 @@ if ($db = $databases['default']['default']) {
drush_set_option('db_passwd', urldecode($db['password']), 'site');
drush_set_option('db_name', urldecode($db['database']), 'site');
- drush_set_option('profile', variable_get('install_profile', 'default'), 'site');
+ drush_set_option('profile', variable_get('install_profile', 'standard'), 'site');
$language = language_default();
drush_set_option('language', $language->language, 'site');
}
diff --git a/platform/drupal/install_6.inc b/platform/drupal/install_6.inc
index dc400ca..8ae004c 100644
--- a/platform/drupal/install_6.inc
+++ b/platform/drupal/install_6.inc
@@ -35,14 +35,18 @@ function install_verify_settings() {
// @todo why are we setting those variables if they are not
// reachable outside this scope?!
$url = parse_url(is_array($db_url) ? $db_url['default'] : $db_url);
- $db_user = urldecode($url['user']);
- $db_pass = urldecode($url['pass']);
- $db_host = urldecode($url['host']);
- $db_port = isset($url['port']) ? urldecode($url['port']) : '3306';
- $db_path = ltrim(urldecode($url['path']), '/');
- $settings_file = './'. conf_path() .'/settings.php';
-
- return TRUE;
+ if (!empty($url['user']) && !empty($url['pass']) && !empty($url['host'])) {
+ $db_user = urldecode($url['user']);
+ $db_pass = urldecode($url['pass']);
+ $db_host = urldecode($url['host']);
+ $db_port = isset($url['port']) ? urldecode($url['port']) : '3306';
+ $db_path = ltrim(urldecode($url['path']), '/');
+ $settings_file = './'. conf_path() .'/settings.php';
+ return TRUE;
+ }
+ else {
+ return FALSE;
+ }
}
return FALSE;
}
@@ -231,6 +235,7 @@ function install_main() {
db_query("INSERT INTO {system} (filename, name, type, owner, status, throttle, bootstrap, schema_version) VALUES('%s', '%s', '%s', '%s', %d, %d, %d, %d)", $system_path .'/system.module', 'system', 'module', '', 1, 0, 0, $system_version);
// Now that we've installed things properly, bootstrap the full Drupal environment
+ module_list(TRUE, FALSE);
module_rebuild_cache();
drush_bootstrap(DRUSH_BOOTSTRAP_DRUPAL_FULL);
$modules = array_diff($modules, array('system'));
@@ -296,6 +301,7 @@ function install_main() {
if (function_exists($function)) {
while (!in_array($task, array('profile-finished', 'finished'))) {
drush_log(dt("Running profile specific task : !task", array('!task' => $task)));
+ module_list(TRUE, FALSE);
module_rebuild_cache();
module_load_all();
// stop batch api from re-directing. ever.
diff --git a/platform/import.provision.inc b/platform/import.provision.inc
index 1102b90..8f7a558 100644
--- a/platform/import.provision.inc
+++ b/platform/import.provision.inc
@@ -34,8 +34,14 @@ function drush_provision_drupal_post_provision_import() {
// Do not automatically save the drushrc at the end of the command.
drush_set_option('provision_save_config', false);
+ // We run this original verify via backend to avoid unexpected issues.
provision_backend_invoke(d()->name, 'provision-verify');
+ sleep(5); // A small trick to avoid high load and race conditions.
+
+ // We run this extra verify via frontend to avoid issue #1004526.
+ provision_backend_invoke('@hostmaster', 'hosting-task', array(d()->name, 'verify'), array('force' => TRUE));
+
drush_include_engine('drupal', 'cron_key');
provision_reload_config('site');
diff --git a/platform/migrate.provision.inc b/platform/migrate.provision.inc
index de15b30..daabd64 100644
--- a/platform/migrate.provision.inc
+++ b/platform/migrate.provision.inc
@@ -81,11 +81,64 @@ function drush_provision_drupal_provision_migrate($platform, $new_uri = NULL) {
$options['uri'] = d()->uri;
+ // If the site is migrated between platforms and not just renamed,
+ // we should update the info collected about source and target platform first.
+ // Note that we have to exclude Hostmaster platform from this extra verify.
+ if (d()->profile != 'hostmaster') {
+ if (!is_null(d($platform)->name) && (d($platform)->name != d()->platform->name)) {
+ provision_backend_invoke('@hostmaster', 'hosting-task', array(d()->platform->name, 'verify'), array('force' => TRUE));
+ sleep(5); // A small trick to avoid high load and race conditions.
+ provision_backend_invoke('@hostmaster', 'hosting-task', array(d($platform)->name, 'verify'), array('force' => TRUE));
+ sleep(5); // A small trick to avoid high load and race conditions.
+ }
+ }
+
if (!is_null($new_uri) && ($new_uri != d()->uri)) {
$options = d()->options;
$options['uri'] = ltrim($new_uri, '@');
$hash_name = drush_get_option('#name') ? '#name' : 'name';
$options[$hash_name] = $new_uri;
+ $new_aliases = array();
+ $old_aliases = (is_array($options['aliases'])) ? $options['aliases'] : FALSE;
+ $pre_old_uri = ltrim(d()->uri, '@');
+ $pre_new_uri = ltrim($new_uri, '@');
+ $raw_old_uri = preg_replace('/^www\./', '', $pre_old_uri);
+ $raw_new_uri = preg_replace('/^www\./', '', $pre_new_uri);
+ $www_old_uri = "www." . $raw_old_uri;
+ $www_new_uri = "www." . $raw_new_uri;
+ if (is_array($old_aliases)) {
+ foreach ($old_aliases as $alias) {
+ if (!preg_match("/^www\./", $pre_old_uri) && preg_match("/^www\./", $pre_new_uri)) {
+ $new_aliases[] = str_replace($www_old_uri, $raw_new_uri, $alias);
+ }
+ elseif (preg_match("/^www\./", $pre_old_uri) && !preg_match("/^www\./", $pre_new_uri)) {
+ $new_aliases[] = str_replace($raw_old_uri, $www_new_uri, $alias);
+ }
+ elseif (!preg_match("/^www\./", $pre_old_uri) && !preg_match("/^www\./", $pre_new_uri)) {
+ $new_aliases[] = str_replace($www_old_uri, $www_new_uri, $alias);
+ }
+ elseif (preg_match("/^www\./", $pre_old_uri) && preg_match("/^www\./", $pre_new_uri)) {
+ $new_aliases[] = str_replace($raw_old_uri, $raw_new_uri, $alias);
+ }
+ }
+ $unique_aliases = array_unique($new_aliases); // Make sure there are no duplicates.
+ $options['aliases'] = array(); // Reset original aliases array.
+ $options['aliases'] = $unique_aliases; // Use rewritten aliases array.
+ }
+ // Warning: do not try to re-verify the original site here
+ // even with backend-only verify, because it would create
+ // (and never delete) duplicate vhost with old domain
+ // and all aliases included - see issue #1067702.
+ }
+ else {
+ // We have to exclude Hostmaster site from any extra verify steps.
+ if (d()->profile != 'hostmaster') {
+ // We should update also the info collected about the site before running migrate task.
+ // Doing this is safe only when the site is migrated with the same name - see issue #1067702.
+ $local_uri_verify = '@' . d()->uri;
+ provision_backend_invoke('@hostmaster', 'hosting-task', array($local_uri_verify, 'verify'), array('force' => TRUE));
+ sleep(5); // A small trick to avoid high load and race conditions.
+ }
}
$options['platform'] = $platform;
$options['root'] = d($platform)->root;
@@ -135,8 +188,6 @@ function drush_provision_drupal_post_provision_migrate($platform, $new_uri = NUL
d()->service('http')->sync(d()->site_path);
}
-
-
if (!is_null($new_uri) && ($new_uri != d()->uri)) {
// remove the existing alias
$config = new Provision_Config_Drushrc_Alias(d()->name);
diff --git a/platform/provision_drupal.drush.inc b/platform/provision_drupal.drush.inc
index fca4bdb..7fbfe6f 100644
--- a/platform/provision_drupal.drush.inc
+++ b/platform/provision_drupal.drush.inc
@@ -55,6 +55,96 @@ function provision_drupal_drush_exit() {
if (preg_match("/^provision-/", $command[0]) && drush_get_option('provision_save_config', TRUE)) {
if (d()->type === 'site') {
+ if (preg_match("/^provision-login-reset/", $command[0])) {
+ // Make site and platform directories world writable temporarily,
+ // until the next site verify, but only if apps module and
+ // control file both exist.
+ $ctrl_modules_apps = d()->root . '/sites/all/modules/apps-allow.info';
+ if (provision_file()->exists($ctrl_modules_apps)->status()) {
+ $profile = drush_get_option('profile');
+ $site_modules_apps = d()->site_path . '/modules/apps/apps.module';
+ $allp_modules_apps = d()->root . '/sites/all/modules/apps/apps.module';
+ $dist_modules_apps = d()->root . '/profiles/' . $profile . '/modules/apps/apps.module';
+ $dist_contrib_apps = d()->root . '/profiles/' . $profile . '/modules/contrib/apps/apps.module';
+ if (provision_file()->exists($site_modules_apps)->status() ||
+ provision_file()->exists($allp_modules_apps)->status() ||
+ provision_file()->exists($dist_modules_apps)->status() ||
+ provision_file()->exists($dist_contrib_apps)->status()) {
+ provision_file()->chmod(d()->site_path, 0777)
+ ->succeed('Changed permissions of <code>@path</code> to @perm')
+ ->fail('Could not change permissions of <code>@path</code> to @perm');
+ provision_file()->chmod(d()->root . '/sites/all/modules', 0777)
+ ->succeed('Changed permissions of <code>@path</code> to @perm')
+ ->fail('Could not change permissions of <code>@path</code> to @perm');
+ provision_file()->chmod(d()->root . '/sites/all/themes', 0777)
+ ->succeed('Changed permissions of <code>@path</code> to @perm')
+ ->fail('Could not change permissions of <code>@path</code> to @perm');
+ provision_file()->chmod(d()->root . '/sites/all/libraries', 0777)
+ ->succeed('Changed permissions of <code>@path</code> to @perm')
+ ->fail('Could not change permissions of <code>@path</code> to @perm');
+ provision_file()->chmod(d()->root . '/sites/all', 0777)
+ ->succeed('Changed permissions of <code>@path</code> to @perm')
+ ->fail('Could not change permissions of <code>@path</code> to @perm');
+ }
+ }
+ // Make local.settings.php file group writable temporarily,
+ // until the next site verify, but only if control file exists.
+ $ctrl_local_settings = d()->site_path . '/modules/local-allow.info';
+ $local_settings = d()->site_path . '/local.settings.php';
+ if (provision_file()->exists($ctrl_local_settings)->status() &&
+ provision_file()->exists($local_settings)->status()) {
+ provision_file()->chmod($local_settings, 0660)
+ ->succeed('Changed permissions of <code>@path</code> to @perm')
+ ->fail('Could not change permissions of <code>@path</code> to @perm');
+ }
+ // Make civicrm.settings.php file group writable temporarily,
+ // until the next site verify, but only if control file exists.
+ $ctrl_local_settings = d()->site_path . '/modules/local-allow.info';
+ $local_settings = d()->site_path . '/civicrm.settings.php';
+ if (provision_file()->exists($ctrl_local_settings)->status() &&
+ provision_file()->exists($local_settings)->status()) {
+ provision_file()->chmod($local_settings, 0660)
+ ->succeed('Changed permissions of <code>@path</code> to @perm')
+ ->fail('Could not change permissions of <code>@path</code> to @perm');
+ }
+ }
+ elseif (preg_match("/^provision-verify/", $command[0])) {
+ // Revert site and platform directories permissions to default.
+ provision_file()->chmod(d()->site_path, 0755)
+ ->succeed('Changed permissions of <code>@path</code> to @perm')
+ ->fail('Could not change permissions of <code>@path</code> to @perm');
+ if (d()->profile != 'hostmaster') {
+ provision_file()->chmod(d()->root . '/sites/all/modules', 02775)
+ ->succeed('Changed permissions of <code>@path</code> to @perm')
+ ->fail('Could not change permissions of <code>@path</code> to @perm');
+ provision_file()->chmod(d()->root . '/sites/all/themes', 02775)
+ ->succeed('Changed permissions of <code>@path</code> to @perm')
+ ->fail('Could not change permissions of <code>@path</code> to @perm');
+ provision_file()->chmod(d()->root . '/sites/all/libraries', 02775)
+ ->succeed('Changed permissions of <code>@path</code> to @perm')
+ ->fail('Could not change permissions of <code>@path</code> to @perm');
+ }
+ provision_file()->chmod(d()->root . '/sites/all', 0751)
+ ->succeed('Changed permissions of <code>@path</code> to @perm')
+ ->fail('Could not change permissions of <code>@path</code> to @perm');
+ provision_file()->chmod(d()->root . '/sites', 0751)
+ ->succeed('Changed permissions of <code>@path</code> to @perm')
+ ->fail('Could not change permissions of <code>@path</code> to @perm');
+ // Revert local.settings.php permissions to default.
+ $local_settings = d()->site_path . '/local.settings.php';
+ if (provision_file()->exists($local_settings)->status()) {
+ provision_file()->chmod($local_settings, 0440)
+ ->succeed('Changed permissions of <code>@path</code> to @perm')
+ ->fail('Could not change permissions of <code>@path</code> to @perm');
+ }
+ // Revert civicrm.settings.php permissions to default.
+ $local_settings = d()->site_path . '/civicrm.settings.php';
+ if (provision_file()->exists($local_settings)->status()) {
+ provision_file()->chmod($local_settings, 0640)
+ ->succeed('Changed permissions of <code>@path</code> to @perm')
+ ->fail('Could not change permissions of <code>@path</code> to @perm');
+ }
+ }
if (drush_get_option('installed')) {
// Don't generate the drushrc.php on provision-save/delete commands.
if (!preg_match("/^provision-(save|delete)/", $command[0])) {
@@ -195,42 +285,100 @@ function _provision_drupal_create_directories($url = NULL) {
$chgrp = array();
// special case: platform. do not handle files dir
if ($url != 'all') {
- $mkdir["sites/$url/files"] = 02770;
+ $mkdir["sites/$url/files"] = 02775;
$chgrp["sites/$url/files"] = d('@server_master')->web_group;
- $mkdir["sites/$url/files/tmp"] = 02770;
+ $mkdir["sites/$url/files/tmp"] = 02775;
$chgrp["sites/$url/files/tmp"] = d('@server_master')->web_group;
- $mkdir["sites/$url/files/images"] = 02770;
+ $mkdir["sites/$url/files/images"] = 02775;
$chgrp["sites/$url/files/images"] = d('@server_master')->web_group;
- $mkdir["sites/$url/files/pictures"] = 02770;
+ $mkdir["sites/$url/files/pictures"] = 02775;
$chgrp["sites/$url/files/pictures"] = d('@server_master')->web_group;
- $mkdir["sites/$url/files/css"] = 02770;
+ $mkdir["sites/$url/files/css"] = 02775;
$chgrp["sites/$url/files/css"] = d('@server_master')->web_group;
- $mkdir["sites/$url/files/js"] = 02770;
+ $mkdir["sites/$url/files/js"] = 02775;
$chgrp["sites/$url/files/js"] = d('@server_master')->web_group;
- $mkdir["sites/$url/files/ctools"] = 02770;
+ $mkdir["sites/$url/files/advagg_css"] = 02775;
+ $chgrp["sites/$url/files/advagg_css"] = d('@server_master')->web_group;
+
+ $mkdir["sites/$url/files/advagg_js"] = 02775;
+ $chgrp["sites/$url/files/advagg_js"] = d('@server_master')->web_group;
+
+ $mkdir["sites/$url/files/ctools"] = 02775;
$chgrp["sites/$url/files/ctools"] = d('@server_master')->web_group;
- $mkdir["sites/$url/files/imagecache"] = 02770;
+ $mkdir["sites/$url/files/ctools/css"] = 02775;
+ $chgrp["sites/$url/files/ctools/css"] = d('@server_master')->web_group;
+
+ $mkdir["sites/$url/files/imagecache"] = 02775;
$chgrp["sites/$url/files/imagecache"] = d('@server_master')->web_group;
- $mkdir["sites/$url/files/locations"] = 02770;
+ $mkdir["sites/$url/files/locations"] = 02775;
$chgrp["sites/$url/files/locations"] = d('@server_master')->web_group;
+ $mkdir["sites/$url/files/xmlsitemap"] = 02775;
+ $chgrp["sites/$url/files/xmlsitemap"] = d('@server_master')->web_group;
+
+ $mkdir["sites/$url/files/deployment"] = 02775;
+ $chgrp["sites/$url/files/deployment"] = d('@server_master')->web_group;
+
// d7 support
- $mkdir["sites/$url/private"] = 02770;
+ $mkdir["sites/$url/private"] = 02775;
$chgrp["sites/$url/private"] = d('@server_master')->web_group;
- $mkdir["sites/$url/private/files"] = 02770;
+ $mkdir["sites/$url/private/files"] = 02775;
$chgrp["sites/$url/private/files"] = d('@server_master')->web_group;
- $mkdir["sites/$url/private/temp"] = 02770;
+ $mkdir["sites/$url/private/temp"] = 02775;
$chgrp["sites/$url/private/temp"] = d('@server_master')->web_group;
+
+ $mkdir["sites/$url/files/styles"] = 02775;
+ $chgrp["sites/$url/files/styles"] = d('@server_master')->web_group;
+
+ // backup_migrate support
+ $mkdir["sites/$url/private/files/backup_migrate"] = 02775;
+ $chgrp["sites/$url/private/files/backup_migrate"] = d('@server_master')->web_group;
+
+ $mkdir["sites/$url/private/files/backup_migrate/manual"] = 02775;
+ $chgrp["sites/$url/private/files/backup_migrate/manual"] = d('@server_master')->web_group;
+
+ $mkdir["sites/$url/private/files/backup_migrate/scheduled"] = 02775;
+ $chgrp["sites/$url/private/files/backup_migrate/scheduled"] = d('@server_master')->web_group;
+
+ // feeds support
+ $mkdir["sites/$url/files/feeds"] = 02775;
+ $chgrp["sites/$url/files/feeds"] = d('@server_master')->web_group;
+
+ $mkdir["sites/$url/private/files/feeds"] = 02775;
+ $chgrp["sites/$url/private/files/feeds"] = d('@server_master')->web_group;
+
+ // d8 support
+ $mkdir["sites/$url/private/config"] = 02775;
+ $chgrp["sites/$url/private/config"] = d('@server_master')->web_group;
+
+ $mkdir["sites/$url/private/config/active"] = 02775;
+ $chgrp["sites/$url/private/config/active"] = d('@server_master')->web_group;
+
+ $mkdir["sites/$url/private/config/staging"] = 02775;
+ $chgrp["sites/$url/private/config/staging"] = d('@server_master')->web_group;
+
+ // civicrm support
+ $mkdir["sites/$url/files/civicrm"] = 02775;
+ $chgrp["sites/$url/files/civicrm"] = d('@server_master')->web_group;
+
+ $mkdir["sites/$url/files/civicrm/ConfigAndLog"] = 02775;
+ $chgrp["sites/$url/files/civicrm/ConfigAndLog"] = d('@server_master')->web_group;
+
+ $mkdir["sites/$url/files/civicrm/custom"] = 02775;
+ $chgrp["sites/$url/files/civicrm/custom"] = d('@server_master')->web_group;
+
+ $mkdir["sites/$url/files/civicrm/dynamic"] = 02775;
+ $chgrp["sites/$url/files/civicrm/dynamic"] = d('@server_master')->web_group;
}
// These paths should not have recursive operations performed on them.
@@ -242,12 +390,25 @@ function _provision_drupal_create_directories($url = NULL) {
"sites/$url/files/pictures",
"sites/$url/files/css",
"sites/$url/files/js",
+ "sites/$url/files/advagg_css",
+ "sites/$url/files/advagg_js",
"sites/$url/files/ctools",
+ "sites/$url/files/ctools/css",
"sites/$url/files/imagecache",
"sites/$url/files/locations",
+ "sites/$url/modules",
+ "sites/$url/libraries",
+ "sites/$url/themes",
+ "sites/$url/files/xmlsitemap",
+ "sites/$url/files/deployment",
"sites/$url/private",
"sites/$url/private/files",
- "sites/$url/private/temp"
+ "sites/$url/private/temp",
+ "sites/$url/files/styles",
+ "sites/$url/files/private",
+ "sites/$url/private/config",
+ "sites/$url/private/config/active",
+ "sites/$url/private/config/staging"
);
// Allow other commands to add or alter the directories to be created.
@@ -400,14 +561,34 @@ function _provision_find_profiles() {
}
$profile->info['languages'] = array_keys($languages);
- // Drupal 7 renamed the default install profile to 'standard'
+ // Drupal 7 renamed the default installation profile to 'standard'
// Aegir now allows projects to specify an "old short name" to provide an upgrade path when projects get renamed.
+ if (empty($profile->info['old_short_name'])) {
if ($profile->name == 'standard') {
$profile->info['old_short_name'] = 'default';
}
+ elseif ($profile->name == 'minimal') {
+ $profile->info['old_short_name'] = 'acquia';
+ }
+ elseif ($profile->name == 'testing') {
+ $profile->info['old_short_name'] = 'uberdrupal';
+ }
+ elseif ($profile->name == 'default') {
+ $profile->info['old_short_name'] = 'acquia';
+ }
+ elseif ($profile->name == 'acquia') {
+ $profile->info['old_short_name'] = 'default';
+ }
+ elseif ($profile->name == 'commons') {
+ $profile->info['old_short_name'] = 'drupal_commons';
+ }
+ elseif ($profile->name == 'commerce_kickstart') {
+ $profile->info['old_short_name'] = 'commercedev';
+ }
+ }
$return[$name] = $profile;
- drush_log(dt('Found install profile %name', array('%name' => $name)));
+ drush_log(dt('Found installation profile %name', array('%name' => $name)));
}
return $return;
@@ -549,11 +730,11 @@ function provision_find_packages() {
// Create a package for the Drupal release
$packages['base']['platforms'] = _provision_find_platforms();
- // Find install profiles.
+ // Find installation profiles.
$profiles = _provision_find_profiles();
drush_set_option('profiles', array_keys((array) $profiles), 'drupal');
- // Iterate through the install profiles, finding the profile specific packages
+ // Iterate through the installation profiles, finding the profile specific packages
foreach ($profiles as $profile => $info) {
_provision_cvs_deploy($info);
if (!$info->version) {
diff --git a/platform/verify.provision.inc b/platform/verify.provision.inc
index c72c72c..e10df9e 100644
--- a/platform/verify.provision.inc
+++ b/platform/verify.provision.inc
@@ -9,14 +9,15 @@ function drush_provision_drupal_provision_verify_validate() {
if (d()->type === 'site') {
drush_bootstrap(DRUSH_BOOTSTRAP_DRUPAL_SITE);
provision_prepare_environment();
-
_provision_drupal_create_settings_file();
provision_drupal_push_site();
-
drush_errors_on();
+ if (drush_drupal_major_version() < 8 && d()->profile != 'hostmaster') {
+ provision_backend_invoke(d()->name, 'registry-rebuild');
+ drush_log(dt('Completed registry-rebuild without --no-cache-clear option'));
+ }
drush_bootstrap(DRUSH_BOOTSTRAP_DRUPAL_FULL);
}
-
}
@@ -29,9 +30,9 @@ function drush_provision_drupal_pre_provision_verify() {
$config_root = dirname(d()->config_path);
provision_file()->create_dir($config_root, dt('Provision configuration root'), 0711);
provision_file()->create_dir(d()->config_path, dt('Provision configuration'), 0711);
- provision_file()->create_dir(d()->clients_path, dt('Provision client home'), 0711);
+ provision_file()->create_dir(d()->clients_path, dt('Provision client home'), 0750);
if (d()->name == '@server_master') {
- provision_file()->create_dir(d()->backup_path, dt('Backup'), 0700);
+ provision_file()->create_dir(d()->backup_path, dt('Backup'), 0750);
provision_file()->create_dir(d()->include_path, dt('Provision PHP configuration'), 0711);
if (!provision_file()->exists(d()->include_path . '/global.inc')->succeed('Global configuration file exists')->status()) {
// Create an empty global.inc so the include doesn't fail with
@@ -75,14 +76,96 @@ function drush_provision_drupal_pre_provision_verify() {
->succeed('Drupal sites directory @path is writable by the provisioning script')
->fail('Drupal sites directory @path is not writable by the provisioning script', 'PROVISION_SITES_DIR_NOT_WRITABLE');
- drush_set_option('sites', array_keys((array) provision_drupal_find_sites()), 'drupal');
+ drush_set_option('sites', array_keys((array) provision_drupal_find_sites()), 'drupal');
drush_log(dt("This platform is running @short_name @version", array('@short_name' => 'drupal', '@version' => VERSION)));
drush_set_option('packages', _scrub_object(provision_find_packages()), 'drupal');
+
+ // Determine latest BOA contrib directory name and add INI template if missing.
+ $pathAll = '/data/all/';
+ $pathDrc = d()->root . '/sites/all/drush';
+ $iniFile = d()->root . '/sites/all/modules/default.boa_platform_control.ini';
+ $iniTpl = '/data/conf/default.boa_platform_control.ini';
+
+ if (!provision_file()->exists($iniFile)->status() && provision_file()->exists($iniTpl)->status()) {
+ provision_file()->copy($iniTpl, $iniFile);
+ }
+
+ if (!preg_match("/\/static\//", d()->root)) {
+ if (d()->profile != 'hostmaster') {
+ provision_file()->chmod(d()->root . '/sites/all/modules', 02775)
+ ->succeed('Changed permissions of <code>@path</code> to @perm')
+ ->fail('Could not change permissions of <code>@path</code> to @perm');
+ provision_file()->chmod(d()->root . '/sites/all/themes', 02775)
+ ->succeed('Changed permissions of <code>@path</code> to @perm')
+ ->fail('Could not change permissions of <code>@path</code> to @perm');
+ provision_file()->chmod(d()->root . '/sites/all/libraries', 02775)
+ ->succeed('Changed permissions of <code>@path</code> to @perm')
+ ->fail('Could not change permissions of <code>@path</code> to @perm');
+ }
+ provision_file()->chmod(d()->root . '/sites/all', 0751)
+ ->succeed('Changed permissions of <code>@path</code> to @perm')
+ ->fail('Could not change permissions of <code>@path</code> to @perm');
+ provision_file()->chmod(d()->root . '/sites', 0751)
+ ->succeed('Changed permissions of <code>@path</code> to @perm')
+ ->fail('Could not change permissions of <code>@path</code> to @perm');
+ }
+
+ if (provision_file()->exists($pathDrc)->status()) {
+ provision_file()->chmod(d()->root . '/sites/all/drush', 0700)
+ ->succeed('Changed permissions of <code>@path</code> to @perm')
+ ->fail('Could not change permissions of <code>@path</code> to @perm');
+ }
+
+ if (provision_file()->exists($pathAll)->status() && preg_match("/\/static\//", d()->root)) {
+ $sortedDirs = array();
+ foreach(scandir($pathAll) as $dir) {
+ if(is_dir($pathAll . $dir)) {
+ array_push($sortedDirs, $dir);
+ }
+ }
+ $latestDir = max($sortedDirs);
+ drush_log(dt('Contrib latestDir: !latest', array('!latest' => $latestDir)), 'message');
+
+ if (is_numeric($latestDir)) {
+ $core6_contrib_dir = '/data/all/' . $latestDir . '/o_contrib';
+ $core7_contrib_dir = '/data/all/' . $latestDir . '/o_contrib_seven';
+ }
+ else {
+ $core6_contrib_dir = '/data/all/000/modules/o_contrib';
+ $core7_contrib_dir = '/data/all/000/modules/o_contrib_seven';
+ }
+
+ $core6_version_id = d()->root . '/modules/path_alias_cache';
+ $core6_contrib_symlink = d()->root . '/modules/o_contrib';
+ $core7_version_id = d()->root . '/modules/overlay';
+ $core7_contrib_symlink = d()->root . '/modules/o_contrib_seven';
+
+ // Make sure the core modules directory is writable, but only if it is a BOA system.
+ if (provision_file()->exists($core6_contrib_dir)->status() || provision_file()->exists($core7_contrib_dir)->status()) {
+ provision_file()->writable(d()->root . '/modules')
+ ->succeed('Drupal core modules directory @path is writable by the provisioning script')
+ ->fail('Drupal core modules directory @path is not writable by the provisioning script', 'PROVISION_MODULES_DIR_NOT_WRITABLE');
+ }
+
+ // Add symlink to BOA specific contrib in Pressflow 6.
+ if (provision_file()->exists($core6_contrib_dir)->status() && provision_file()->exists($core6_version_id)->status() && !provision_file()->exists($core6_contrib_symlink)->status()) {
+ provision_file()->symlink($core6_contrib_dir, $core6_contrib_symlink)
+ ->succeed('Created symlink @path to @target')
+ ->fail('Could not create symlink @path to @target: @reason');
+ }
+
+ // Add symlink to BOA specific contrib in Drupal 7.
+ if (provision_file()->exists($core7_contrib_dir)->status() && provision_file()->exists($core7_version_id)->status() && !provision_file()->exists($core7_contrib_symlink)->status()) {
+ provision_file()->symlink($core7_contrib_dir, $core7_contrib_symlink)
+ ->succeed('Created symlink @path to @target')
+ ->fail('Could not create symlink @path to @target: @reason');
+ }
+ }
provision_drupal_push_site();
}
elseif (d()->type === 'site') {
drush_set_option('packages', _scrub_object(provision_drupal_system_map()), 'site');
- // This is the actual drupal provisioning requirements.
+ // This is the actual drupal provisioning requirements.
_provision_drupal_create_directories();
_provision_drupal_maintain_aliases();
_provision_drupal_ensure_htaccess_update();
@@ -111,6 +194,13 @@ function drush_provision_drupal_post_provision_verify() {
_provision_client_create_symlink();
drush_include_engine('drupal', 'cron_key');
+
+ $iniFile = d()->root . '/sites/' . d()->uri . '/modules/default.boa_site_control.ini';
+ $iniTpl = '/data/conf/default.boa_site_control.ini';
+
+ if (!provision_file()->exists($iniFile)->status() && provision_file()->exists($iniTpl)->status()) {
+ provision_file()->copy($iniTpl, $iniFile);
+ }
}
}
diff --git a/provision.drush.inc b/provision.drush.inc
index 5f64ea9..b099ead 100644
--- a/provision.drush.inc
+++ b/provision.drush.inc
@@ -430,7 +430,7 @@ function provision_count_cpus() {
*
* We base our evaluation on the number of CPUs on the servers. If there are
* more than 5 processes waiting per CPU, we abort completely. If we ignore the
- * number of available CPUs, we assume a critical limit is a load of 10.
+ * number of available CPUs, we assume a critical limit is a load of 50.
*
* @see sys_getloadavg()
*/
@@ -443,8 +443,8 @@ function provision_load_critical($load = NULL, $threshold = NULL) {
$threshold = $ncpus * 5;
}
else {
- // can't determine the number of CPU, we hardcode at load 10
- $threshold = 10;
+ // can't determine the number of CPU, we hardcode at load 50
+ $threshold = 50;
}
}
return ($load[0] > $threshold);