MediaWiki SaaS: Difference between revisions
No edit summary |
Upgrade |
||
| Line 68: | Line 68: | ||
If the lock is for a maintenance, commit it so we've a trace, then simply revert the change when the maintenance is done. | If the lock is for a maintenance, commit it so we've a trace, then simply revert the change when the maintenance is done. | ||
== Upgrade == | |||
=== SaaS entry point === | |||
Should be automated with Jenkins CD. | |||
For now, as mediawiki user: <code>cd /srv/saas/mediawiki && git pull && composer update && restart-php-fpm</code> | |||
=== MediaWiki === | |||
As mediawiki user, assuming a clean branch: | |||
<syntaxhighlight language=bash> | |||
cd /srv/mediawiki | |||
git pull | |||
for dir in extensions/*/; do (cd "$dir" && git pull); done | |||
for dir in skins/*/; do (cd "$dir" && git pull); done | |||
composer update | |||
mw update agora | |||
mw update wolfplex | |||
mw update wikis | |||
</syntaxhighlight> | |||
=== Troubleshoot === | |||
==== Upgrade databases older than 1.39 ==== | |||
Support has been removed for older versions upgrades. | |||
We need to create a temporary installation with that "installation relais" for a by-step update. | |||
There is no automation for that currently. | |||
Latest revision as of 07:47, 29 August 2026
We maintain an up-to-date MediaWiki installation to serve this wiki, and several others.
If you license your content under an open source license like CC-BY, you're welcome to request hosting.
Hosted wikis
The following wikis are hosted on this service:
- https://agora.nasqueron.org/ — this wiki
- https://www.wolfplex.org/wiki/ — Wolfplex Hackerspace wiki
Repositories
- saas-mediawiki: MediaWiki SaaS entry point: contains the wiki configuration and the MediaWiki bootstrap logic
- saas-service: base entry point for SaaS: serves /status requests and contains some base classes
- rOPS: describes the saas-mediawiki role provisioning instructions
How to add a wiki?
- DNS: <your domain> CNAME saas-mediawiki.nasqueron.org
- Send a change to the Operations repository
- nginx: add your server block to the webserver-legacy role, you need to use
include includes/mediawiki-rootto serve /Article pages, orinclude includes/mediawiki-wikito serve /wiki/Article pages (useful if you've other services than a wiki on this domain) - data directory: add your canonical host to the pillar/saas/mediawiki.sls file in the mediawiki_datastores section
- nginx: add your server block to the webserver-legacy role, you need to use
- Deploy operations changes with Salt
- Nginx vhost.
salt-call --local state.sls roles/webserver-legacy/nginxor sometimes saas-mediawiki/nginx instead - Datastores.
salt-call --local state.sls roles/saas-mediawiki/data
- Nginx vhost.
- Declare the dbname/host name pair for the new instance in the configuration
- Create a database
- In every case, GRANT ALL PRIVILEGES on wikis.* TO 'mediawiki-saas'@'localhost';
- If you migrate an existing wiki from its db: mysql yourwiki < dump.sql + mw update yourwiki works well
- If it's a fresh new wiki: mw addWiki yourwiki will create the database and populate the tables
To deploy changes with Salt
How to deploy an extension or a skin?
- Ensure it's available on the service
- If it's hosted on gerrit.wikimedia.org, add it to pillar/saas/mediawiki.sls file in the rOPS repository
- If not, you need to provide custom logic at roles/saas-mediawiki/mediawiki
- Configure it
- Edit the saas-mediawiki config/Settings.php folder, saasUseExtensionFoo will load the Foo extension and saasUseSkinBar will load the bar skin.
- If you need more advanced logic, config/CommonsSettings.php contain a good example for Scribunto
Where to configure settings?
MediaWiki wg variables
Most variables can directly be set in the saas-mediawiki repository under config/Settings.php.
For any special logic, like transform values or set a bunch of values at once, can be added to CommonSettings.php. Feel free to create a task on DevCentral if you need assistance to do so.
Interwiki
Interwiki configuration is peculiar, as it's a database.
To update the interwiki:
- Update the configuration under mediawiki_interwikis at rOPS: pillar/saas/mediawiki.sls
- Deploy with
salt web-001 state.apply roles/saas-mediawiki/mediawiki/interwiki
How to run a script against a wiki?
The mw <script to run> <wiki name> command allow to run a maintenance script to a specific wiki.
For example sudo -u mediawiki mw update agora will run update.php for this wiki.
How to lock a wiki in read-only mode?
Set saasReadOnly to Some("Your explanation message").
An example can be found at D3743.
If the lock is for a maintenance, commit it so we've a trace, then simply revert the change when the maintenance is done.
Upgrade
SaaS entry point
Should be automated with Jenkins CD.
For now, as mediawiki user: cd /srv/saas/mediawiki && git pull && composer update && restart-php-fpm
MediaWiki
As mediawiki user, assuming a clean branch:
cd /srv/mediawiki
git pull
for dir in extensions/*/; do (cd "$dir" && git pull); done
for dir in skins/*/; do (cd "$dir" && git pull); done
composer update
mw update agora
mw update wolfplex
mw update wikisTroubleshoot
Upgrade databases older than 1.39
Support has been removed for older versions upgrades.
We need to create a temporary installation with that "installation relais" for a by-step update.
There is no automation for that currently.
