MediaWiki

From IndieWeb
(Redirected from mediawiki)
Jump to navigation Jump to search


MediaWiki is open source server wiki-project written in PHP that is used by Wikipedia and IndieWeb.org.

MediaWiki uses MySQL for primary storage.

Why

The IndieWebCamp community uses MediaWiki as a collaborative document editing tool, to capture "what is the current state of something", to make it easier to reference answers, definitions, how tos, etc.

MediaWiki just happens to have better persistence / search discovery than alternatives that are equivalently community accessible (E.g. Etherpad, Google Docs, both of which have the js;dr problem and neither of which are search engine indexed.)

See also:

Building Block Proposals

There are a number of proposals to add indieweb building blocks support to MediaWiki that can quicly and easily satisfy some great use-cases, as well as potentially improving performance (e.g. encouraging switching from polling to notification)

IndieWebCamp Customizations

IndieWeb Examples

Tom Morris

Tom Morris uses MediaWiki on his personal site wiki at: http://wiki.tommorris.org/

Chris Aldrich

Chris Aldrich uses MediaWiki as his personal wiki site at http://wiki.chrisaldrich.net/

Breakfast and Coffee

capjamesg uses MediaWiki to host Breakfast and Coffee, a wiki to share coffee spot and breakfast recommendations. The wiki supports sign in using vouch-proxy and IndieAuth, implemented with help from the IndieWeb mediawiki-customizations guide.

As of February 3rd, 2022, Breakfast and Coffee is the second wiki known to support IndieAuth as its primary method of authenticating users (with the first being the IndieWeb wiki).

Other Independent Examples

Friend of GWG

David Shanske has setup MediaWiki for a friend as a private thing and maintains it for them.

Brainstorming

Setting up MediaWiki with IndieAuth

capjamesg encountered a bit of trouble setting up MediaWiki with IndieAuth.

Setting up MediaWiki itself was not too difficult although he ran into an issue with setting up PHP. MediaWiki, as of February 2022, does not support some specific versions of PHP. Thus, James had to experiment to install a supported version of PHP. Before deploying MediaWiki, it is worth checking that you have a supported version of PHP set up.

After getting MediaWiki set up, James disabled sign ups to the wiki in anticipation of spam. Then, he deployed vouch-proxy, an SSO solution that has a custom extension to support IndieAuth. The Vouch Proxy was quite difficult to set up and James wonders if it would be possible to develop a native MediaWiki extension for IndieAuth.

The following tutorial was helpful in setting up the Vouch Proxy configuration:

However, the tutorial above recommends that you add the "fastcgi_param REMOTE_USER $auth_user;" code after the "auth_request_set" directive in your configuration file. This did not work for James. James instead set the "fastcgi_param REMOTE_USER $auth_user;" directive in the .php location block, like so:

     location ~ \.php$ {
         fastcgi_param REMOTE_USER $auth_user;
         fastcgi_pass unix:/var/run/php/php-fpm.sock;
         fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
         include fastcgi_params;
         include snippets/fastcgi-php.conf;
     }

Before you start trying to use the Vouch Proxy to authenticate, make sure you are running Vouch Proxy. Vouch Proxy does not automatically run as a service or a program. You can either build Vouch Proxy using Go (go build) then run it as a program or run the program using Docker.

Copy over the IndieWeb LassoAuth.php file from the repository listed on mediawiki-customizations into your PHP project. Then, add the file to your LocalSettings.php configuration file. You should also make sure you install and use Auth_remoteuser when setting up authentication. Replace any instances of "indieweb.org" domains with the relevant domain for your project and the domain for your Vouch Proxy instance.

If you notice that you can sign in but your session is not saved, create a test.php file with the following contents:

<?php print_r($_SERVER);

Then, try to authenticate again. If you don't see a REMOTE_USER header, there is likely something wrong with your Nginx configuration. Revisit your configuration file to make sure all the auth_request directives are set up in the right order. Also make sure you use the fastcgi_param directive as described in the .php location code snippet provided earlier on this page.

See Also