Wikimini/Technical documentation

From Meta, a Wikimedia project coordination wiki
Wikimini is currently hosted by a virtual server called wmch-demo owned by Wikimedia CH.

This page contains technical documentation about Wikimini.

For general information see Wikimini.

Overview[edit]

Wikimini is a wiki farm (a single MediaWiki installation serving multiple instances).

The most active Wikimini's wikis are:

Server[edit]

Since 2021, Wikimini is hosted for free on Wikimedia CH infrastructure on a single virtual server called wmch-demo.

Additional documentation can be found here, at the moment available to all WMCH members, but probably this page should be migrated to Meta-wiki:

https://members.wikimedia.ch/wiki/Infrastructure

In short, access to that server is granted via personal users, with sudo.

Quick SSH access with your public key:

ssh my-username@demo.wikimedia.ch

Note that SSH access is only possible via WMCH OpenVPN configuration. Again, the details at the moment are here, available to all WMCH members, but probably this page should be migrated to Meta-wiki:

https://members.wikimedia.ch/wiki/Infrastructure/VPN

The server is managed both by Wikimedia CH system administrators and the Wikimini community system administrators.

Please communicate any change to:

Putting in copy at least these users:

  • ilario
  • valerio-bozzolan

Filesystem[edit]

This is the main Wikimini directory structure on the filesystem:

/var/www/wikimini.org
├── images
├── maintenance-page
├── scripts
├── tmp
├── www
├── www.testing

Notes:

  • the www directory is production (default for all visits)
  • the www.testing directory can be used for testing purposes by changing the WIKIMINI_TESTING environment variable in Apache HTTPd
  • only the www directory is exposed to the webserver
  • only these directories are writable by the webserver:
    • cache
    • images
    • tmp

Position of the public (versioned) configuration:

/var/www/wikimini.org/www/w/LocalSettings.php

Note that the public (versioned) configuration is a symbolic link to this position:

/etc/wmch-infrastructure/servers/demo/projects/wikimini/LocalSettings.php

Position of the private configuration:

/etc/wmch-infrastructure/servers/demo/projects/wikimini/LocalSettings-secret.php

After phabricator:T318342, the file will be published on Wikimedia GitLab.

Webserver[edit]

The Apache HTTPd webserver is in use, since it has a very simple configuration syntax and it's well-known.

Here the standard configuration files:

$ ls -1 /etc/apache2/sites-available/org-wikimini-*
/etc/apache2/sites-available/org-wikimini-00000-ssl.conf
/etc/apache2/sites-available/org-wikimini-00000-txt.conf
/etc/apache2/sites-available/org-wikimini-ar000-ssl.conf
/etc/apache2/sites-available/org-wikimini-ar000-txt.conf
/etc/apache2/sites-available/org-wikimini-en000-ssl.conf
/etc/apache2/sites-available/org-wikimini-en000-txt.conf
/etc/apache2/sites-available/org-wikimini-es000-ssl.conf
/etc/apache2/sites-available/org-wikimini-es000-txt.conf
/etc/apache2/sites-available/org-wikimini-fr000-ssl.conf
/etc/apache2/sites-available/org-wikimini-fr000-txt.conf
/etc/apache2/sites-available/org-wikimini-it000-ssl.conf
/etc/apache2/sites-available/org-wikimini-it000-txt.conf
/etc/apache2/sites-available/org-wikimini-lab00-ssl.conf
/etc/apache2/sites-available/org-wikimini-lab00-txt.conf
/etc/apache2/sites-available/org-wikimini-stock-ssl.conf
/etc/apache2/sites-available/org-wikimini-stock-txt.conf
/etc/apache2/sites-available/org-wikimini-sv000-ssl.conf
/etc/apache2/sites-available/org-wikimini-sv000-txt.conf
/etc/apache2/sites-available/org-wikimini-test-fr000-ssl.conf
/etc/apache2/sites-available/org-wikimini-www00-txt.conf

To enable a configuration file, you can use the Debian-style:

a2ensite org-wikimini-lab00-txt
apache2ctl graceful

To disable a configuration file, also you can use the Debian-style:

a2dissite org-wikimini-lab00-txt
apache2ctl graceful

Resources[edit]

CPU virtual cores:

6

RAM:

8G

Swap:

4G

Disk partitions:

/: 65G

Adding a new language[edit]

To add a new language you need to be a GNU/Linux user with sudo privileges in the #Server.

Important: before following this guide, contact phabricator:tag/wmch-infrastructure. This is a pseudo-guide, never tested.

Note: in this example replace $(LANG) with your new language, like en.

Contact the DNS administrators of the domain wikimini.org (probably you should #File a Task) to deploy a new DNS record. We suggest to simply point a CNAME record, with this value:

demo.wikimedia.ch.

The full BIND9 syntax should be this:

$(LANG)   IN  CNAME "demo.wikimedia.ch."

Note: the trailing dot it's important.

Now create a new MariaDB database:

mysql <<< "CREATE DATABASE wikimini_$(LANG)wiki"

Grant necessary MariaDB privileges to that database:

mysql <<< "GRANT SELECT,UPDATE,INSERT,DELETE TO wikimini_$(LANG)wiki.* TO wikimini_$(LANG)wiki@localhost"

Evaluate if doing the same also for a related testing database:

mysql <<< "CREATE DATABASE wikimini_beta_$(LANG)wiki"
mysql <<< "GRANT SELECT,UPDATE,INSERT,DELETE TO wikimini_$(LANG)wiki.* TO wikimini_beta_$(LANG)wiki@localhost

Now register your new language into the LocalSettings.php (see #Filesystem section).

Precisely, check this constant:

define( 'WIKIMINI_PROJECTS_KNOWN', [ ... ] );

Now enter in the mailserver configuration:

cd /etc/apache2/sites-available

Copy a couple of already-existing files for your new language.

For example creating these new files:

org-wikimini-$(LANG)000-ssl.conf
org-wikimini-$(LANG)000-txt.conf

Then enable these configuration files. Start enabling the plaintext version (txt - so without SSL):

a2ensite org-wikimini-$(LANG)000-txt
apache2ctl graceful

Now that you have a working website (at least in plaintext) deploy the Let's Encrypt certificate:

certbot

Then, enable the SSL version:

a2ensite org-wikimini-$(LANG)000-ssl
apache2ctl graceful

Done. Have fun!

Maintenance Page[edit]

To activate a nice maintenance page, run these:

touch /etc/web-maintenance
apache2ctl graceful

To de-activate the maintenance page, run these:

rm /etc/web-maintenance
apache2ctl graceful

The maintenance enabler works thanks to these configuration files:

/etc/apache2/my-includes/wikimini/include/org-wikimini-maintenance-activation.conf

/etc/apache2/my-includes/wikimini/include/org-wikimini-maintenance.conf

Mail[edit]

From the file Localsettings-secret.php (see #Filesystem to find that) you can change the SMTP email sender.

The outbox email is this one:

wikimini <at> wikimedia.ch

The credentials of this mailbox are managed by User:Ilario.

More information about this mailbox (and similar ones) are available internally in this (semi-private) page:

https://members.wikimedia.ch/wiki/Infrastructure/Emails

File a Task[edit]

For whatever problem please feel free to create a Task in Wikimedia Phabricator, on this tag:

Quick creation link: