Jump to: navigation, search

Introduction

This wiki runs on MediaWiki software with extensions. Special:Version is the best place to discover which extensions are installed and enabled.

Submitting extensions and customisations

If you wish to work on improvements to the MediaWiki software for running this wiki (both the core software - discouraged - and extensions to it, including custom extensions - encouraged), then please submit them through this page's discussion page.

To have a complete copy of the site for testing you need a backup of the database and filesystem. Backups can be provided to responsible people on request to the server administrator.

Configuration notes

Most noteworthy

  • Editing permissions: pages are not editable by anonymous users - account creation and logging in is required. Sysops can restrict editing for an individual page to sysops-only - this is through a standard MediaWiki function: the 'protect' action appearing on the actions tab to those with a sysop account. Those in the sysop group can unblock anonymous edits on a per-page basis at MediaWiki:Unlockedpages.
  • File upload permissions: as for pages, files (images) may only be uploaded by logged-in users.
  • Syntax highlighting: source code in several languages, most importantly C, can be highlighted with automatic insertion of reference links to keyword/function descriptions: for C code these links point to clc-wiki articles, many of which are as-yet uncreated. This is via the custom GeSHiWrapper extension.
  • Treeview skin: this is installed as the default skin; it is a custom extension.
  • Caching: as we are now hosted on a shared server which gives us access to neither memcached, APC(u) nor WinCache, we are using database caching (that is, $wgMainCacheType is set to CACHE_DB) - this is used to cache messages, parsed page content and other data such as logged-in user details and the Treeview skin's hierarchy. File caching is used to cache full page html for anonymous views. Client caching is not enabled due to concerns about its compatibility with the Treeview skin.

Other

  • Renaming of users is available to those in the 'bureaucrat' group.
  • Passwords can be reset by those in the 'sysop' group.
  • Control over table of contents (TOC) numbering: to suppress TOC numbers, add <div class="noautonum">__TOC__</div> to the top of a page - this is supported by the CSS in MediaWiki:Common.css.

ExcludeHiddenGroups

This extension hides accounts in the 'spambot', 'suspectedspambot', and 'testing' groups from the main user listing at Special:Listusers (these accounts can still be listed by choosing either group from the dropdown menu; the names of the hidden groups are specified via the $wgHiddenGroups setting).

This allows us to hide the (growing) collection of spambots by adding them to the 'spambot' or 'suspectedspambot' groups (through Special:Userrights, accessible to users in the 'bureaucrat' group) without having to delete them: account deletion is discouraged by MediaWiki developers, who suggest that it is fraught (at least, that was the case when this extension was first developed several years back).

The extension is named ExcludeHiddenGroups.php and its code is as follows:

<?php

$wgExtensionCredits['parserhook'][] = array(
	'name' => 'ExcludeHiddenGroups',
	'url' => 'http://clc-wiki.net/wiki/clc-wiki:Config:Wiki#ExcludeHiddenGroups',
	'version' => '1.3',
	'author' => 'Laird Shaw',
        'description' => 'Hides users that are in one of the $wgHiddenGroups from display in the user listing.',
);
$wgHooks['SpecialListusersQueryInfo'][] = 'SpecialListusersQueryInfo_ExcludeHiddenGroups';

function SpecialListusersQueryInfo_ExcludeHiddenGroups($pager, &$query) {
	global $wgHiddenGroups;

	if (!$wgHiddenGroups || isset($query['conds']['ug_group'])) return false;

	$dbr = wfGetDB( DB_SLAVE );
	$user_groups = $dbr->tableName('user_groups');

	$query['conds'][] = "(SELECT count(*) FROM $user_groups WHERE user_id=ug_user AND ug_group in ('".implode("', '", $wgHiddenGroups)."')) <= 0";

	return true; // early return possible
}

?>

Additional configuration files

Two call-out configuration files based outside of the web root directory are included from LocalSettings.php to allow mirror sites to easily override settings to match their configuration, and to keep passwords and usernames private when LocalSettings.php was displayed (for security reasons, the functionality to display syntax-highlighted live files from the filesystem is no longer available).

A template for PrivateSetting.php

This file should be customised and placed in the directory from which it is included in LocalSettings.php:

<?php

$wgDBadminpassword  = '<pw>';
$wgDBname           = 'clcwiki';
$wgDBuser           = '<username>';
$wgDBpassword       = '<pw>';
$wgProxyKey         = '<key1>';
$wgUpgradeKey       = '<key2>';
$wgReCaptchaPrivateKey = '<key3>';
$wgReCaptchaPublicKey = '<key4';
$wgCaptchaQuestions[] = array('question' => '<question>', 'answer' => '<answer>' );

A template for LocalOverrides.php

This file should be customised and placed in the directory from which it is included in LocalSettings.php; it can be empty if your settings match those of the live install:

<?php

# If other mediawiki installations are present, /mediawiki may already
# be used.
$wgScriptPath       = "/<webserver_root_for_mediawiki>";
# Reset this variable since it depends on $wgScriptPath
$wgScript           = "$wgScriptPath/index.php";
# Don't use '/wiki' as the live server is set up with an apache rewrite rule to do;
# instead use MediaWiki's default path
$wgArticlePath      = "$wgScript/$1";

Logo and icon

The original site logo is visible when using a skin other than Treeview. It was put together as an interim solution but stayed for a while; it's not versioned and hasn't changed. [Edit 2018-06-26: this file seems to have been lost during the series of upgrades - it can probably be retrieved from backups if necessary.]

The site icon is documented in the Treeview skin's readme.

Personal tools