You are browsing a read-only backup copy of Wikitech. The live site can be found at wikitech.wikimedia.org
Configuration files: Difference between revisions
imported>Addshore m (→Other files: "deployment host") |
imported>Lucas Werkmeister (add https://noc.wikimedia.org/conf/ link for convenience) |
||
Line 5: | Line 5: | ||
Many configuration files are in the subdirectory <code>wmf-config</code>. | Many configuration files are in the subdirectory <code>wmf-config</code>. | ||
Most files are maintained in the git repository {{git repo|operations/mediawiki-config}}. | Most files are maintained in the git repository {{git repo|operations/mediawiki-config}}. | ||
A selection of public configuration files is also available online at https://noc.wikimedia.org/conf/. | |||
== InitialiseSettings.php == | == InitialiseSettings.php == |
Revision as of 22:26, 8 January 2019
See also: How to do a configuration change, Heterogeneous deployment.
![]() | This page may be outdated or contain incorrect details. Please update it if you can. |
Our configuration lives in /srv/mediawiki-staging/wmf-config
on the deployment host 'tin', and tools such as scap
sync this directory to /srv/mediawiki
on cluster hosts.
(The same common directory also has subdirectories for each live branch of the MediaWiki codebase.)
Many configuration files are in the subdirectory wmf-config
.
Most files are maintained in the git repository operations/mediawiki-config .
A selection of public configuration files is also available online at https://noc.wikimedia.org/conf/.
InitialiseSettings.php
InitialiseSettings.php
contains a huge array of settings. The format, roughly, is
'wgDefaultSkin' => array( // Variable name, without the $
'default' => 'vector', // Default value, use 'wiki' instead of 'default' to set the value for Wikipedias
'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
all.dblist
- There is a dblist for every wiki family (wikipedia, wikibooks, ...) as well as
'private'
for private wikis and a few others. See*.dblist
to see what's available- After updating a dblist, run
sync-file dblists/
to 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
$wmg
to 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.php
set$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 (assuming it's not going to just be enabled everywhere).
extension-list and ExtensionMessages-XXX.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.
wmf-config/extension-list
lists the paths to the extension setup file (NOT the i18n file!) of every extension enabled on any wiki (except wikitech). The paths start with $IP/extensions
and $IP/skins
and each path is on a line by itself:
$IP/extensions/AbuseFilter/AbuseFilter.php $IP/extensions/AjaxTest/AjaxTest.php $IP/extensions/AntiBot/AntiBot.php ... $IP/skins/Vector/Vector.php
ExtensionMessages-1.NNwmfMM.php
is a PHP file that contains the actual workaround. mw-update-l10n
rebuilds it from wmf-config/extension-list
. You can run it yourself to check for errors. You must use wiki that is deployed to the correct version.
$ cd /srv/mediawiki-staging/wmf-config $ mwscript mergeMessageFileList.php --wiki=testwiki --list-file=extension-list --output=/tmp/junkExtensionMessages.php
After running this, check the output for error messages, and diff it with the current ExtensionMessages.php
to verify the changes are sane.
Other files
abusefilter.php
: configuration for the AbuseFilter extensiondb-*.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 doingflaggedrevs.php
: configuration for the FlaggedRevs extensionliquidthreads.php
: configuration for the LiquidThreads extensionmc.php
: configuration for memcached, mostly a list of available memcached serversmissing.php
: generates the "This wiki doesn't exist" page. Not really a configuration filewmf-config/PrivateSettings.php
: passwords and other non-public things - the real git repository containing this file is on the the deployment host e.g.mwdeploy1001
at/srv/mediawiki-staging/private
. Please commit changes there.wgConf.php
: setup code for the configuration system