Difference between revisions of "MediaWiki SaaS"

From Nasqueron Agora
(Created page with "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 t...")
 
 
(One intermediate revision by the same user not shown)
Line 22: Line 22:
 
## nginx: add your server block to the webserver-legacy role, you need to use <code>include includes/mediawiki-root</code> to serve /Article pages, or <code>include includes/mediawiki-wiki</code> to serve /wiki/Article pages (useful if you've other services than a wiki on this domain)
 
## nginx: add your server block to the webserver-legacy role, you need to use <code>include includes/mediawiki-root</code> to serve /Article pages, or <code>include includes/mediawiki-wiki</code> to 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
 
## data directory: add your canonical host to the pillar/saas/mediawiki.sls file in the mediawiki_datastores section
 +
# Deploy operations changes with Salt
 +
## '''Nginx vhost.''' <code>salt-call --local state.sls roles/webserver-legacy/nginx`</code> or sometimes saas-mediawiki/nginx instead
 +
## '''Datastores.''' <code>salt-call --local state.sls roles/saas-mediawiki/data`</code>
 +
# Declare the dbname/host name pair for the new instance in the configuration
 +
# Create a database
 +
## In every case, <kbd>GRANT ALL PRIVILEGES on wikis.* TO 'mediawiki-saas'@'localhost';</kbd>
 +
## If you migrate an existing wiki from its db: <kbd>mysql yourwiki < dump.sql</kbd> + <kbd>mw update yourwiki</kbd> works well
 +
## If it's a fresh new wiki: <kbd>mw addWiki yourwiki</kbd> will create the database and populate the tables
 +
 +
To deploy changes with Salt
  
 
== How to deploy an extension or a skin? ==
 
== How to deploy an extension or a skin? ==

Latest revision as of 01:16, 5 March 2020

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:

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?

  1. DNS: <your domain> CNAME saas-mediawiki.nasqueron.org
  2. Send a change to the Operations repository
    1. nginx: add your server block to the webserver-legacy role, you need to use include includes/mediawiki-root to serve /Article pages, or include includes/mediawiki-wiki to serve /wiki/Article pages (useful if you've other services than a wiki on this domain)
    2. data directory: add your canonical host to the pillar/saas/mediawiki.sls file in the mediawiki_datastores section
  3. Deploy operations changes with Salt
    1. Nginx vhost. salt-call --local state.sls roles/webserver-legacy/nginx` or sometimes saas-mediawiki/nginx instead
    2. Datastores. salt-call --local state.sls roles/saas-mediawiki/data`
  4. Declare the dbname/host name pair for the new instance in the configuration
  5. Create a database
    1. In every case, GRANT ALL PRIVILEGES on wikis.* TO 'mediawiki-saas'@'localhost';
    2. If you migrate an existing wiki from its db: mysql yourwiki < dump.sql + mw update yourwiki works well
    3. 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

How to run a script against a wiki?

The mw command allow to run a maintenance script to a specific wiki.

For example sudo -u mediawiki mw agora update will run update.php for this wiki.