MediaWiki customizations

 MediaWiki customizations  are changes to the default install of MediaWiki that the IndieWeb community has made for various reasons to better serve how the community uses the wiki.

IndieWeb extensions
https://github.com/indieweb/mediawiki-extensions


 * AllowAnchorTags - allows inserting  anchor tags into wikitext
 * notitle - adds  tag to stop MediaWiki from adding its own page title
 * raw - lets you embed raw HTML into wiki pages using raw
 * RelWebmention - add webmention endpoint to wiki pages
 * LassoAuth - enables web sign-in/IndieAuth via vouch-proxy
 * See Setting up MediaWiki with IndieAuth for details
 * Calendar - adds tag for creation of a single month calendar

dfn
https://github.com/aaronpk/mediawiki-mf2-dfn

Adds a  tag around the first sentence of a page that contains a   tag

CategoryTree

 * https://www.mediawiki.org/wiki/Extension:CategoryTree

mf2 parser
The wiki requires a Microformats parser to be able to do a few things. Copy the php-mf2 repository to the extensions folder.

enable extensions
wfLoadExtension('Cite'); wfLoadExtension('ParserFunctions'); wfLoadExtension('Auth_remoteuser'); wfLoadExtension('CategoryTree');

require_once('extensions/php-mf2/Mf2/Parser.php'); require_once('extensions/dfn/dfn.php');

require_once('extensions/IndieWeb/raw.php'); require_once('extensions/IndieWeb/notitle.php'); require_once('extensions/IndieWeb/AllowAnchorTags.php'); require_once('extensions/IndieWeb/RelWebmention.php'); require_once('extensions/IndieWeb/Calendar.php'); require_once('extensions/IndieWeb/LassoAuth.php');

extension config
LassoAuth::$auth = 'https://sso.indieweb.org/'; LassoAuth::$wiki = 'https://indieweb.org/';

$wgPingbackEndpoint = 'https://webmention.io/indiewebcamp/xmlrpc'; $wgWebmentionEndpoint = 'https://webmention.io/indiewebcamp/webmention';

editable customizations
See MediaWiki:Common.css for custom CSS used on this wiki.

configuration
Add these to

enable nice urls
The wiki is installed in the  folder on the server, but we want the URLs to be.

$wgScriptPath = '/wiki'; $wgScriptExtension = ".php"; $wgArticlePath = '/$1'; $wgUsePathInfo = true; $wgCapitalLinks = false;

user permissions
$wgGroupPermissions['*']['read'] = true; $wgGroupPermissions['*']['edit'] = false; $wgGroupPermissions['*']['createaccount'] = false; $wgGroupPermissions['*']['autocreateaccount'] = true; $wgGroupPermissions['user']['move'] = true; $wgGroupPermissions['user']['movefile'] = true; $wgGroupPermissions['user']['delete'] = true; $wgGroupPermissions['user']['undelete'] = true; $wgGroupPermissions['user']['browsearchive'] = true; $wgGroupPermissions['user']['rollback'] = true; $wgDefaultUserOptions ['editsection'] = true; $wgAllowUserSkin = true; $wgAllowUserCss = true; $wgAllowUserJs = true;

copyright
$wgEnableCreativeCommonsRdf = true; $wgRightsPage = "IndieWebCamp:Copyrights"; # Set to the title of a wiki page that describes your license/copyright $wgRightsUrl = "http://creativecommons.org/publicdomain/zero/1.0/"; $wgRightsText = "a CC0 public domain dedication"; $wgRightsIcon = "https://i.creativecommons.org/p/zero/1.0/88x31.png"; $wgEnableCreativeCommonsRdf = true;

allow more file uploads
$wgFileExtensions[] = 'pdf'; $wgFileExtensions[] = 'txt'; $wgFileExtensions[] = 'svg'; $wgFileExtensions[] = 'ai';

others
$wgEnableUploads = true; $wgAllowImageTag = true; $wgNoFollowLinks = false; $wgAllowExternalImages = true; $wgCookieExpiration = 180 * 86400; $wgSecureLogin = true; $wgCookieSecure = true;

set up https://www.mediawiki.org/wiki/Manual:$wgRCFeeds to the secret lair of Loqi

skin
We use the default Vector skin for the wiki, with some minor customization to add Microformats markup to pages.

In, make the changes described on https://aaronparecki.com/2018/01/14/3/

front page
MediaWiki refuses to serve the front page from  and insists on redirecting it to   instead. It's possible to rename that page to something like, but even that isn't great. We want the front page to be served at just. To do that, there is a separate  file at the root of the server, which essentially proxies the MediaWiki page.

 'Main_Page'); if(array_key_exists('useskin',$_GET)) $opts['useskin'] = $_GET['useskin']; $ch = curl_init('https://indieweb.org/wiki/index.php?'.http_build_query($opts)); // Pass the HTTP_COOKIE header through for auth if(array_key_exists('HTTP_COOKIE', $_SERVER)) { curl_setopt($ch, CURLOPT_HTTPHEADER, array( 'Cookie: '. $_SERVER['HTTP_COOKIE'] )); }

header('Link: ; rel="webmention"');

// No-cache if the user is logged in if(isset($_SERVER['REMOTE_USER'])) { header('Cache-Control: no-cache'); }

curl_exec($ch);

Why are talk pages disabled
 Talk pages are disabled as most of the talk happens in discussion chat channels. The best pieces or synopses are usually then summarized and added the wiki subsequently.

Also, having multiple places for discussion often fragments the discussion between what’s natural and what feels official.

Related XKCD: http://xkcd.com/1665