System Theta's implementation of multitenancy within MediaWiki.
Go to file
Ampera b6f6dc4264 Added GenerateAllSitemaps.ps1 2023-03-12 08:41:20 -04:00
wikiconf minor config changes, update to 1.39.2 2023-03-12 08:36:16 -04:00
wikidata Added placeholders to keep empty dirs 2022-10-24 11:31:27 -04:00
wikiroot minor config changes, update to 1.39.2 2023-03-12 08:36:16 -04:00
wikiutil Added GenerateAllSitemaps.ps1 2023-03-12 08:41:20 -04:00
LICENSE Initial commit 2022-10-23 15:45:51 +00:00
README.md Update 'README.md' 2022-10-24 15:57:58 +00:00

README.md

openwiki-mtmw

This is MultiTenant MediaWiki, created by Ampera and Soveia of System Theta.

MultiTenant MediaWiki solves a distinct problem when hosting multiple instances of MediaWiki on a single server, as is intended for The OpenWiki Project. Instead of having to run several complete installations of MediaWiki, most of the code and configuration options can be shared. This drastically reduces hosting complexity, and allows managing of dozens of mediawiki instances at once.

MTMW was created to be as simple as possible. It's really just a loose collection of scripts, and some conveniently named directories. MediaWiki has its own support for multitenancy, which it calls a wiki-family or wiki farm. A lot of those ideas are represented on this article, of which similarities are accidental or inevitable.

This is because MTMW was created in a vacuum, as well as before experimental multi-config support was integrated into MW 1.38. While this resulted in a proprietary solution, it's still a clean and reasonable one.

This repository also serves to host our light fork of MediaWiki, kept largely up to date with upstream, but with the potential for minor changes needed to facilitate cache purges, or to fix environmental problems. As such, MTMW shares mediawiki's license.

Structure

MTMW is split up into four main directories: wikiconf wikiroot wikidata and wikiutil When implementing, these directories should all live in the same directory.

wikiconf

wikiconf is the core of MTMW. Configs are split up into shared/global and site-specific configs. For global configs, there are the following files:

MTSettings.php - Primarily contains the load order for each file, and also contains any code which may need to execute for all sites, such as setting the entire stack to read-only in the event of maintenance

GlobalSettings.php - This file contains any general settings to which load order is not important. Only settings present within MediaWiki or MTMW itself should go here.

GlobalMaintenance.php - Any values like db suffix, read-only, and read-only message which are useful during site upgrades/maintenance should go here.

LoadableSettings.php - Where extensions get loaded, and where any extension-specific global settings should go.

Site specific configs are stored in wikiconf/sites in a directory like openwikiproject.org.d, which is the site domain followed by '.d'. The following files exist here:

settings.php - Site-specific general MediaWiki settings. Only settings present within MediaWiki or MTMW itself should go here.

maintenance.php - Site-specfific maintenance values, used to set a single site to read-only, or if a per-wiki db/version suffix needs to be set.

secrets.php - This should contain any secret information, like passwords/keys. This simply keeps them all in one place, to be more easily secured.

loadables.php - This is where skins and extensions should be loaded, and where the default skin is set

extvars.php - Any per-site settings that are supposed to apply to extensions should go here. This file is executed after extensions are loaded.

permissions.php - Any and all permissions settings should go here. This file is executed after extensions are loaded, and should be safe to configure any extension-specific permissions.

wikiroot

Webroots for each mediawiki version. This is a largely off-the-shelf copy of mediawiki, with all non-essential files removed. LocalSettings.php contains a small script to load MTMW based off the HTTP_HOST header.

wikidata

This just holds directories for any per-site data, particularly that which may have to changes

wikiutils

A collection of maintenance scripts