[Fusionforge-commits] FusionForge branch master updated. a223b628ac332b31a9a5a0ad2e68fc7b57c185b6

Sylvain Beucler beuc-inria at fusionforge.org
Wed Jan 21 18:20:10 CET 2015


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "FusionForge".

The branch, master has been updated
       via  a223b628ac332b31a9a5a0ad2e68fc7b57c185b6 (commit)
       via  f71cbdd56d02c598dccf60baf001643868367bec (commit)
       via  3a30b28764aa53cac240b05df6cc99a7c0b0652d (commit)
       via  27b32bc4cd65a654e1388053458af954de46373f (commit)
      from  6ce24bf24bb05f2f6a166ef67694089d6c5b83a6 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit a223b628ac332b31a9a5a0ad2e68fc7b57c185b6
Author: Sylvain Beucler <sylvain.beucler at inria.fr>
Date:   Wed Jan 21 18:04:11 2015 +0100

    reactivity: convert create_vhosts.php

diff --git a/src/common/include/cron_utils.php b/src/common/include/cron_utils.php
index aff933d..4ce3254 100644
--- a/src/common/include/cron_utils.php
+++ b/src/common/include/cron_utils.php
@@ -46,7 +46,7 @@ $cron_arr = array(
 	'HOMEDIR' => 'shell/homedirs.php',  # 25
 	'SCM_REPO' => 'scm/create_scm_repos.php',  # 27
 	28 => 'scm/gather_scm_stats.php',
-	30 => 'web-vhosts/create_vhosts.php',
+	'WEB_VHOSTS' => 'web-vhosts/create_vhosts.php',  # 30
 	);
 
 #	 13 => 'cvs.php',
diff --git a/src/etc/cron.d/fusionforge-web-vhosts b/src/etc/cron.d/fusionforge-web-vhosts
deleted file mode 100644
index e5ec71b..0000000
--- a/src/etc/cron.d/fusionforge-web-vhosts
+++ /dev/null
@@ -1,2 +0,0 @@
-PATH=@bindir@:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
-37 7,19 * * * root forge_run_job web-vhosts/create-vhosts.php
diff --git a/src/www/project/admin/vhost.php b/src/www/project/admin/vhost.php
index 4ef58ae..6d8b3af 100644
--- a/src/www/project/admin/vhost.php
+++ b/src/www/project/admin/vhost.php
@@ -26,6 +26,7 @@
 require_once '../../env.inc.php';
 require_once $gfcommon.'include/pre.php';
 require_once $gfwww.'project/admin/project_admin_utils.php';
+require_once $gfcommon.'include/SysTasksQ.class.php';
 
 global $HTML;
 
@@ -61,6 +62,8 @@ if (getStringFromRequest('createvhost')) {
 		} else {
 			$feedback = _('Virtual Host scheduled for creation.');
 			$group->addHistory('Added vhost '.$vhost_name.' ','');
+			$systasksq = new SysTasksQ();
+			$systasksq->add(SYSTASK_CORE, 'WEB_VHOSTS', $group_id);
 		}
 
 	} else {
@@ -98,7 +101,8 @@ if (getStringFromRequest('deletevhost')) {
 	} else {
 		$feedback .= _('VHOST deleted');
 		$group->addHistory('Virtual Host '.$row_vh['vhost_name'].' Removed','');
-
+		$systasksq = new SysTasksQ();
+		$systasksq->add(SYSTASK_CORE, 'WEB_VHOSTS', $group_id);
 	}
 
 }

commit f71cbdd56d02c598dccf60baf001643868367bec
Author: Sylvain Beucler <sylvain.beucler at inria.fr>
Date:   Wed Jan 21 18:03:28 2015 +0100

    vhosts: reuse httpd configuration (log/ssl-off/block_trace)

diff --git a/src/templates/httpd.conf.d/log.inc b/src/templates/httpd.conf.d/log.inc
index 9b6b69c..1cc1fd6 100644
--- a/src/templates/httpd.conf.d/log.inc
+++ b/src/templates/httpd.conf.d/log.inc
@@ -2,7 +2,5 @@
 
 LogFormat "%h %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" fusionforge
 CustomLog {core/log_path}/access.log fusionforge
-<IfModule mod_ssl.c>
 LogFormat "%{Host}i %h %l %u %t %{SSL_PROTOCOL}x:%{SSL_CIPHER}x \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" combinedvhssl
-</IfModule>
 CustomLog {core/log_path}/awstats.log combinedvhssl
diff --git a/src/templates/httpd.vhosts.tmpl b/src/templates/httpd.vhosts.tmpl
index 94b43a9..40f0925 100644
--- a/src/templates/httpd.vhosts.tmpl
+++ b/src/templates/httpd.vhosts.tmpl
@@ -10,12 +10,7 @@
 		order allow,deny
 		allow from all
 	</Directory>
-	LogFormat "%h %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" fusionforge
-	CustomLog {core/log_path}/access.log fusionforge
-	LogFormat "%{Host}i %h %l %u %t %{SSL_PROTOCOL}x:%{SSL_CIPHER}x \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" combinedvhssl
-	CustomLog {core/log_path}/awstats.log combinedvhssl
-	# Ensure that we don't try to use SSL on SSL Servers
-	<IfModule apache_ssl.c>
-		SSLDisable
-	</IfModule>
+	Include {core/config_path}/httpd.conf.d/block-trace.inc
+	Include {core/config_path}/httpd.conf.d/log.inc
+	Include {core/config_path}/httpd.conf.d/ssl-off.inc
 </VirtualHost>

commit 3a30b28764aa53cac240b05df6cc99a7c0b0652d
Author: Sylvain Beucler <sylvain.beucler at inria.fr>
Date:   Wed Jan 21 18:02:49 2015 +0100

    vhosts: reuse httpd config expansion

diff --git a/src/common/include/config.php b/src/common/include/config.php
index 8f7bf7e..55cb165 100644
--- a/src/common/include/config.php
+++ b/src/common/include/config.php
@@ -285,6 +285,19 @@ function forge_reset_config_item ($var, $section, $default) {
 	$c->reset_value ($section, $var, $default) ;
 }
 
+/**
+ * Interpolate configuration variables between braces
+ * Typically used in httpd conf, e.g. {core/log_path}
+ */
+function forge_expand_config_braces($line) {
+	return preg_replace_callback(
+		',{([a-z_]*)/([a-z_]*)},',
+		function ($matches) {
+			return forge_get_config($matches[2], $matches[1]);
+		},
+		$line);
+}
+
 // Local Variables:
 // mode: php
 // c-file-style: "bsd"
diff --git a/src/cronjobs/web-vhosts/create_vhosts.php b/src/cronjobs/web-vhosts/create_vhosts.php
index bba8eb6..1fb3410 100755
--- a/src/cronjobs/web-vhosts/create_vhosts.php
+++ b/src/cronjobs/web-vhosts/create_vhosts.php
@@ -58,8 +58,7 @@ while ($arr = db_fetch_array($res)) {
 	$str = str_replace('{unix_group_name}', $arr['unix_group_name'], $str);
 	$str = str_replace('{docdir}', $arr['docdir'], $str);
 	$str = str_replace('{cgidir}', $arr['cgidir'], $str);
-	$str = str_replace('{core/log_path}', $logPath, $str);
-	$str = str_replace('{core/groupdir_prefix}', $groupdirPrefix, $str);
+	$str = forge_expand_config_braces($str);
 	file_put_contents($outVhostsFile, $str, FILE_APPEND);
 	$count++;
 }
diff --git a/src/post-install.d/web/expand-conf.php b/src/post-install.d/web/expand-conf.php
index c3758cb..30402c1 100755
--- a/src/post-install.d/web/expand-conf.php
+++ b/src/post-install.d/web/expand-conf.php
@@ -49,12 +49,7 @@ if ($out === FALSE) {
 
 // Replace the variable with the configuration value
 foreach($lines as $line) {
-  $line = preg_replace_callback(
-    ',{([a-z_]*)/([a-z_]*)},',
-    function ($matches) {
-      return forge_get_config($matches[2], $matches[1]);
-    },
-    $line);
-  fwrite($out, $line);
+	$line = forge_expand_config_braces($line);
+	fwrite($out, $line);
 }
 fclose($out);

commit 27b32bc4cd65a654e1388053458af954de46373f
Author: Sylvain Beucler <sylvain.beucler at inria.fr>
Date:   Wed Jan 21 17:34:07 2015 +0100

    vhosts: restart apache unconditionally (like systasksd)

diff --git a/src/cronjobs/web-vhosts/create_vhosts.php b/src/cronjobs/web-vhosts/create_vhosts.php
index dd658d8..bba8eb6 100755
--- a/src/cronjobs/web-vhosts/create_vhosts.php
+++ b/src/cronjobs/web-vhosts/create_vhosts.php
@@ -41,7 +41,6 @@ if (!$res) {
 	cron_entry(30, _('Unable to get list of projects with vhost: ').db_error());
 }
 
-$enableRestart = false;
 $httpdRestartedMsg = _('httpd server not restarted');
 
 $inTemplateVhostFile = forge_get_config('custom_path').'/httpd.vhosts.tmpl';
@@ -65,16 +64,7 @@ while ($arr = db_fetch_array($res)) {
 	$count++;
 }
 
-if ($enableRestart) {
-	// debian specific
-	//$httpd_restart_cmd = '/usr/sbin/invoke-rc.d --quiet apache2 reload';
-	// redhat based
-	//$httpd_restart_cmd = 'service httpd restart';
-	if (isset($httpd_restart_cmd) && !empty($httpd_restart_cmd)) {
-		system($httpd_restart_cmd);
-		$httpdRestartedMsg = _('httpd server automatically restarted');
-	}
-}
+cron_reload_apache();
 
 $output .= $count._(' vhost created.').' '.$httpdRestartedMsg;
 cron_entry(30, $output);

-----------------------------------------------------------------------

Summary of changes:
 src/common/include/config.php             |   13 +++++++++++++
 src/common/include/cron_utils.php         |    2 +-
 src/cronjobs/web-vhosts/create_vhosts.php |   15 ++-------------
 src/etc/cron.d/fusionforge-web-vhosts     |    2 --
 src/post-install.d/web/expand-conf.php    |    9 ++-------
 src/templates/httpd.conf.d/log.inc        |    2 --
 src/templates/httpd.vhosts.tmpl           |   11 +++--------
 src/www/project/admin/vhost.php           |    6 +++++-
 8 files changed, 26 insertions(+), 34 deletions(-)
 delete mode 100644 src/etc/cron.d/fusionforge-web-vhosts


hooks/post-receive
-- 
FusionForge



More information about the Fusionforge-commits mailing list