Configuration files
See also: How to do a configuration change, Heterogeneous deployment.
Our configuration lives in /home/wikipedia/common/wmf-config .
Contents |
InitialiseSettings.php
InitialiseSettings.php contains a huge array of settings. The format, roughly, is
'wgDefaultSkin' => array( // Variable name, without the $ 'default' => 'vector', // Default value 'nostalgiawiki' => 'nostalgia', // Value for a specific wiki 'wikibooks' => 'monobook', // Value for all wikis listed in /home/wikipedia/common/wikibooks.dblist // etc. ),
Some random useful facts:
- The wiki names used in the keys are database names and are listed in
/home/wikipedia/common/all.dblist - There is a dblist for every wiki family (wikipedia, wikibooks, ...) as well as
'private'for private wikis and a few others. See/home/wikipedia/common/*.dblistto see what's available- After updating a dblist, run
sync-dblistto sync the change
- After updating a dblist, run
- When multiple values apply to one wiki, the most specific one wins (i.e. wiki name beats dblist beats
'default') - We often use variables starting with
$wmgto trigger certain blocks of code inCommonSettings.php(e.g. enabling extensions with$wmgEnableMyExtension) - Extension configuration variables don't work here because the extension setup file will set them back to the defaults; when we do want to configure them here, we'll set
'wmgMyExtensionThingy'instead, then inCommonSettings.phpset$wgMyExtensionThingy = $wmgMyExtensionThingy;after including the extension setup file.
CommonSettings.php
This file includes "configuration code", i.e. configuration that can't be done with simple variable assignments. This includes extensions, dynamic things and a whole lot of other random things that have been piling up here in the past years.
When adding a new extension, you should put its setup code (require_once() plus any other settings) here in an if ( $wmgEnableMyExtension ) block.
extension-list and ExtensionMessages.php
All of our wikis share the same localization cache, but in normal setups this causes problems when the cache is shared between wikis with different sets of enabled extensions. We work around this by listing all extensions enabled on any wiki explicitly.
extension-list lists the paths to the extension setup file (NOT the i18n file!) of every extension enabled on any wiki. The paths start with $IP/extensions and each path is on a line by itself:
$IP/extensions/AbuseFilter/AbuseFilter.php $IP/extensions/AjaxTest/AjaxTest.php $IP/extensions/AntiBot/AntiBot.php ...
ExtensionMessages.php is a PHP file that contains the actual workaround. It's generated from extension-list using the following command:
$ cd /home/wikipeda/common/php/wmf-config $ php ../maintenance/mergeMessageFileList.php --list-file=extension-list --output=ExtensionMessages.php
After running this, check the output for error messages, and run svn diff to verify the changes to ExtensionMessages.php are sane.
Other files
-
abusefilter.php: configuration for the AbuseFilter extension -
checkers.php: code for blocking or logging all kinds of requests. Lots of old stuff has piled up here. The 403-for-no-User-Agent check lives here -
db.php: Defines which wikis are in which section, which database servers are in which section, etc., etc., useful as a reference for DB-related facts like those. Don't mess with this file unless you know what you're doing -
flaggedrevs.php: configuration for the FlaggedRevs extension -
liquidthreads.php: configuration for the LiquidThreads extension -
lucene.php: which wiki uses which search server and other Lucene-related settings -
mc.php: configuration for memcached, mostly a list of available memcached servers -
missing.php: generates the "This wiki doesn't exist" page. Not really a configuration file -
wmf-config/PrivateSettings.php: passwords and other non-public things
this is in SVN, just svn commit from fenari -
reporting-setup.php: fundraiser stuff, no idea what it does -
secret-projects.php: misc stuff, no idea -
secure.php: configuration for the secure gateway -
wgConf.php: setup code for the configuration system