r106606 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r106605‎ | r106606 | r106607 >
Date:21:52, 18 December 2011
Author:hashar
Status:deferred
Tags:ci 
Comment:
testswarm: allow apache to write SQLite databases

This is done by changing the group of SQLite databases files to www-data
and allowing group right. The testswarm user will still be able to do
whatever it wants.
Also rename DB files.
Modified paths:
  • /trunk/tools/testswarm/scripts/fetcher-sample.ini (modified) (history)
  • /trunk/tools/testswarm/scripts/testswarm-mw-fetcher-run.php (modified) (history)
  • /trunk/tools/testswarm/scripts/testswarm-mw-fetcher.php (modified) (history)

Diff [purge]

Index: trunk/tools/testswarm/scripts/testswarm-mw-fetcher-run.php
@@ -72,6 +72,12 @@
7373 }
7474
7575 $fetcher_conf = parse_ini_file( "/etc/testswarm/fetcher.ini", true );
 76+
 77+// Fix up database file permission
 78+$dbFile = "{$main->fetcher->paths['db']}/r{$rev}.sqlite";
 79+chgrp( $dbFile, $fetcher_conf['TestSwarmAPI']['wwwusergroup'] );
 80+chmod( $dbFile, "0664" );
 81+
7682 $api = new TestSwarmAPI(
7783 $main
7884 , $fetcher_conf['TestSwarmAPI']['username']
Index: trunk/tools/testswarm/scripts/fetcher-sample.ini
@@ -26,3 +26,8 @@
2727
2828 ; URL for your TestSwarm repository
2929 url = "http://localhost/testswarm/"
 30+
 31+; User group your webserver is running under
 32+; Debian : www-data
 33+; Mac OS X: _www
 34+wwwusergroup = "www-data"
Index: trunk/tools/testswarm/scripts/testswarm-mw-fetcher.php
@@ -138,8 +138,8 @@
139139 $this->debug( 'No next revision', __METHOD__ );
140140 } else {
141141 // And install it
142 - $fetcher = new TestSwarmMWFetcher( &$this, $nextRev );
143 - $result = $fetcher->run();
 142+ $this->fetcher = new TestSwarmMWFetcher( &$this, $nextRev );
 143+ $result = $this->fetcher->run();
144144 if( $result === true ) {
145145 return $nextRev;
146146 }
@@ -446,7 +446,7 @@
447447
448448 // Now simply run the CLI installer:
449449 $cmd = "php {$this->paths['mw']}/maintenance/install.php \
450 - --dbname=testwarm_mw_r{$this->svnRevId} \
 450+ --dbname=r{$this->svnRevId} \
451451 --dbtype=sqlite \
452452 --dbpath={$this->paths['db']} \
453453 --showexceptions=true \

Status & tagging log