CZ:Technical/LocalSettings.php

From Citizendium
Jump to navigation Jump to search

Below is a slightly modified copy of the live LocalSettings.php file. You can use this to synch your clone with the live wiki, or to check on a particular setting. For more information on what this file is, please see the MediaWiki Manual.

This file differs only slightly to the actual live file. This version of LocalSettings.php had to be modified slightly because the live wiki uses a different directory structure than the repository and test wiki versions. These changes are cosmetic and do not affect the behavior of the executing wiki. Anything marked CHANGE-ME has been redacted for security purposes.

Please only edit this page if are reflecting a change that has been made to the live LocalSettings.php file.

<?php

## Citizendium's master control file
## Don't edit unless you really know what you are doing
## Please checkin any changes with: ci -l LocalSettings.php
## and describe what you did, why, and sign your name
## Also remember to copy this file to the other server
## By convention, changes are made to locke and copied to reid

# Standard way to obtain $IP -dnessett
if( defined( 'MW_INSTALL_PATH' ) ) {
	$IP = MW_INSTALL_PATH;
} else {
	$IP = dirname( __FILE__ );
}

$path = array( $IP, "$IP/includes", "$IP/languages" );
set_include_path( implode( PATH_SEPARATOR, $path ) . PATH_SEPARATOR . get_include_path() );

require_once( "includes/DefaultSettings.php" );

#Using $IP per standard convention -dnessett
$wgUploadDirectory  = "$IP/images";

## Need this off to force pngs for math, otherwise anon math looks funny
$wgDefaultUserOptions['math'] = 0;

if ( $wgCommandLineMode ) {
    if ( isset( $_SERVER ) && array_key_exists( 'REQUEST_METHOD', $_SERVER ) ) {
        die( "This script must be run from the command line\n" );
    }
} elseif ( empty( $wgNoOutputBuffer ) ) {
    ## Compress output if the browser supports it
      if( !ini_get( 'zlib.output_compression' ) ) @ob_start( 'ob_gzhandler' );
}

require_once( "$IP/extensions/Cite/Cite.php" );
$wgUseAjax = true;
require_once( "$IP/extensions/CategoryTree/CategoryTree.php" );
# Default number of entries returned from a CategoryTree search
# is 200. Set this variable to a higher or lower value to control that.
# $wgCategoryTreeMaxChildren=400;

require_once( "$IP/extensions/CharInsert/CharInsert.php" );
require_once( "$IP/extensions/wikihiero/wikihiero.php" );
require_once( "$IP/extensions/inputbox/inputbox.php" );
require_once( "$IP/extensions/ParserFunctions/ParserFunctions.php" );
require_once( "$IP/extensions/ExpandTemplates/ExpandTemplates.php" );
require_once( "$IP/extensions/Timeline/Timeline.php" );

require_once( "$IP/extensions/CheckUser/CheckUser.php" );
# The standard version of CheckUser sets $wgAvailableRights
# and $wgGroupPermissions. CZ doesn't define a 'checkuser'
# group. Instead the 'checkuser' permission is given to
# Sysops. So, we check and unset the $wgGroupPermissions
# permission set by CheckUser. This statement MUST come
# after the require_once() of CheckUser.php -dnessett 4/27/2010

if( isset( $wgGroupPermissions['checkuser']['checkuser'] ) )
      unset( $wgGroupPermissions['checkuser']['checkuser'] );

# Using standard $IP convention -dnessett
$wgCheckUserLog = "CHANGE-ME/cz_checkuser.log";

$wgCUDMaxAge = 5 * 12 * 30 * 24 * 3600; ## Approxmiately 5 years

require_once( "$IP/extensions/Newuserlog/Newuserlog.php" );

require_once( "$IP/extensions/ConfirmAccount/SpecialConfirmAccount.php" );
$wgConfirmAccountSortkey = array( '/^(.+) ([^ ]+)$/', '$2, $1' );
$wgAutoUserBioText = '[[Category:CZ Authors]]';

require_once( "$IP/extensions/ImageMap/ImageMap.php" );
require_once( "$IP/extensions/Renameuser/SpecialRenameuser.php" );
require_once( "$IP/extensions/ConfirmEdit/ConfirmEdit.php" );
require_once( "$IP/extensions/ConfirmEdit/FancyCaptcha.php" );

# Reset defaults of ConfirmEdit extension to CZ specific values

$wgGroupPermissions['sysop']['skipcaptcha'] = false;
$wgCaptchaTriggers['addurl']        = false;  // Check on edits that add URLs
$wgCaptchaTriggers['createaccount'] = false;  // Special:Userlogin&type=signup
$wgCaptchaTriggers['badlogin']      = false;  // Special:Userlogin after failure
$ceAllowConfirmedEmail = true;

# Needed by ConfirmEdit/FancyCaptcha.php.
# Changes the default to the CZ specific directory.
# Also sets the $wgCaptchaSecret from the default.
# This MUST be different for each installation
# These statements MUST come after the require_once()
# of FancyCaptcha -dnessett 4/27/2010
$wgCaptchaDirectory = "$IP/images/captcha_cz";
$wgCaptchaSecret = "SECRET-CHANGE-ME";

require_once( "$IP/extensions/TreeAndMenu/TreeAndMenu.php" );

require_once( "$IP/extensions/EmbedVideo/embedvideo.php" );

## Not working yet: current error is:
## FIXED Call to undefined method Xml::textarea() in ...SpecialNewsletterMassMailer.php on line 192
## FIXED Call to undefined method OutputPage::buildCssLinks() in ..Newsletter.body.php
## Class 'UserMailer' not found in ...Newsletter.body.php

#require_once( "$IP/extensions/Newsletter/Newsletter.setup.php" );
$wgNewsletterSalt = "SALT-CHANGE-ME";
$wgNewsletterExcludedNamespaces = array(NS_USER, NS_USER_TALK, NS_TALK, 101);
$wgGroupPermissions['*']['newslettermassmailer'] = false;
$wgGroupPermissions['*']['newslettermembers'] = false;
$wgGroupPermissions['bureaucrat']['newslettermassmailer'] = true; // Only bureaucrats can send mass e-mails
$wgGroupPermissions['bureaucrat']['newslettermembers'] = true; // Only bureaucrats can send mass e-mails

require_once( "$IP/extensions/LabeledSectionTransclusion/lst.php" );
require_once( "$IP/extensions/LabeledSectionTransclusion/lsth.php" );

#require_once( "$IP/extensions/Bad-Behavior/bad-behavior-mediawiki.php" );
#define('BB2_NO_CREATE', true);

# If PHP's memory limit is very low, some operations may fail.
  ini_set( 'memory_limit', '80M' );

$wgSitename          = "Citizendium, the Citizens' Compendium";
$wgMetaNamespace     = "Citizendium_Pilot";
$wgMetaNamespaceTalk = "Citizendium_Pilot_Talk";
$wgDefaultSkin       = 'pinkwich5';
$wgLanguageCode      = "en";
$wgEmergencyContact  = "CHANGE-ME";
$wgPasswordSender    = "CHANGE-ME";
$wgNoReplyAddress	 = '[email protected]';
$wgVersion			 = '1.13.2 (modified)';

$wgScriptPath        = "";
$wgScript            = "/wiki";
$wgRedirectScript    = "$wgScriptPath/redirect.php";
$wgArticlePath       = "$wgScript/$1";
$wgStylePath         = "$wgScriptPath/skins";
$wgStyleDirectory    = "$IP/skins";
#$wgLogo              = "/czlogo.png";
$wgLogo              = "/images/czlogo.png";
$wgFavicon           = "/images/favicon.ico";
$wgUploadPath        = "/images";
$wgDiff3             = "/usr/bin/diff3";


# turned on for upload wizard - 11 Nov 2007 - emg
$wgForceUIMsgAsContentMsg = array( 'licenses' ); 

#Turned on 3-12-07 for WikiED
$wgAllowUserJs      = true;
$wgAllowUserCss     = true;
$wgUseSiteJs        = true;

$wgEnableEmail         = true;
$wgEnableUserEmail     = true;
$wgEnotifUserTalk      = true;
$wgEnotifWatchlist     = true;
$wgEmailAuthentication = true;
$wgEmailConfirmToEdit  = true;


$wgDBtype           = "postgres";
$wgDBserver         = "CHANGE-ME";
$wgDBmwschema       = "mediawiki";
$wgDBts2schema      = "public";
$wgDBuser           = "cz";
$wgDBport           = "CHANGE-ME";
$wgDBname           = "cz";
$wgDBpassword	    = "";

$wgExtraNamespaces =
       array(100 => "CZ",
             101 => "CZ_Talk",
             102 => "TI",
             103 => "TI_Talk",
             104 => "WYA",
             105 => "WYA_Talk"
             );

$wgNamespacesWithSubpages += array(
        100               => true,
        101               => true,
        102               => true,
        103               => true,
        104               => true,
        105               => true,
        NS_MAIN           => true,
        NS_TALK           => true,
		NS_MEDIAWIKI      => true,
		NS_SPECIAL        => true,
        NS_TEMPLATE       => true,
);


$wgMainCacheType      = CACHE_ACCEL;
$wgParserCacheType    = CACHE_ACCEL;
$wgMessageCacheType   = CACHE_ACCEL;
$wgEnableParserCache  = false;
$wgUseFileCache       = true;

# Using standard $IP convention -dnessett
$wgFileCacheDirectory = "$IP/images/reidcache";

$wgUseGzip            = false;
$wgCachePages         = true;
$wgShowIPinHeader     = false;
$wgUseSquid           = false;
#$wgSquidServers       = array('','');

$wgDisableCounters    = false;

## This setting is to extend watchlists from 7 days to 30 days.
$wgRCMaxAge = 30 * 24 * 3600;

$wgEnableUploads       = true;
$wgUseImageResize      = true;
$wgUseImageMagick      = true;
$wgImageMagickConvertCommand = "/usr/bin/convert";

# enable TeX
$wgTexvc            = "$IP/math/texvc";
$wgUseTeX           = true;
$wgMathPath         = "{$wgUploadPath}/math";
$wgMathDirectory    = "{$wgUploadDirectory}/math";
$wgTmpDirectory     = "{$wgUploadDirectory}/tmp";

$wgLocalInterwiki   = $wgSitename;

$wgSecretKey = "CHANGE-ME";

$wgEnableCreativeCommonsRdf = true;
$wgRightsPage               = ""; # Set to the title of a wiki page that describes your license/copyright
$wgRightsUrl                = "http://www.gnu.org/copyleft/fdl.html";
$wgRightsText               = "GNU Free Documentation License 1.2";


# When you make changes to this configuration file, this will make
# sure that cached pages are cleared.
$configdate = gmdate( 'YmdHis', @filemtime( __FILE__ ) );
$wgCacheEpoch = max( $wgCacheEpoch, $configdate );

# This snippet prevents new registrations from anonymous users
# (Sysops can still create user accounts)
$wgGroupPermissions['*']['createaccount'] = false;

# Implicit group for all visitors
$wgGroupPermissions['*']['createaccount']   = false;
$wgGroupPermissions['*']['read']            = true;
$wgGroupPermissions['*']['edit']            = false;
$wgGroupPermissions['*']['move']            = false;
$wgGroupPermissions['*']['createpage']      = false;
$wgGroupPermissions['*']['createtalk']      = false;

# Implicit group for all logged-in accounts
$wgGroupPermissions['user']['move']            = true;
$wgGroupPermissions['emailconfirmed']['move']  = true;
$wgGroupPermissions['user']['read']            = true;
$wgGroupPermissions['user']['edit']            = true;
$wgGroupPermissions['user']['createpage']      = true;
$wgGroupPermissions['user']['createtalk']      = true;
$wgGroupPermissions['user']['upload']          = true;
$wgGroupPermissions['user']['reupload']        = true;
$wgGroupPermissions['user']['reupload-shared'] = true;
$wgGroupPermissions['user']['minoredit']       = true;

# Implicit group for accounts that pass $wgAutoConfirmAge
$wgGroupPermissions['autoconfirmed']['autoconfirmed'] = true;

# Implicit group for accounts with confirmed email addresses
$wgGroupPermissions['emailconfirmed']['emailconfirmed'] = true;

# Permission to change users' group assignments
$wgGroupPermissions['*']['userrights']          = false;
$wgGroupPermissions['bureaucrat']['userrights'] = true;

# Group for all logged-in accounts who had their email confirmed and have been
# accepted as editors.
$wgGroupPermissions['wikieditor']['move']            = true;
$wgGroupPermissions['wikieditor']['read']            = true;
$wgGroupPermissions['wikieditor']['edit']            = true;
$wgGroupPermissions['wikieditor']['createpage']      = true;
$wgGroupPermissions['wikieditor']['createtalk']      = true;
$wgGroupPermissions['wikieditor']['upload']          = true;
$wgGroupPermissions['wikieditor']['reupload']        = true;
$wgGroupPermissions['wikieditor']['reupload-shared'] = true;
$wgGroupPermissions['wikieditor']['minoredit']       = true;

$wgGroupPermissions['sysop']['move']            = true;
$wgGroupPermissions['sysop']['read']            = true;
$wgGroupPermissions['sysop']['edit']            = true;
$wgGroupPermissions['sysop']['createpage']      = true;
$wgGroupPermissions['sysop']['createtalk']      = true;
$wgGroupPermissions['sysop']['upload']          = true;
$wgGroupPermissions['sysop']['reupload']        = true;
$wgGroupPermissions['sysop']['reupload-shared'] = true;
$wgGroupPermissions['sysop']['minoredit']       = true;
$wgGroupPermissions['sysop']['setstatus']       = true;
$wgGroupPermissions['sysop']['checkuser']       = true;

## CheckUser stuff
$wgGroupPermissions['sysop']['checkuser']       = true;
$wgCheckUserLog = 'CHANGE-ME/cz_checkuser.log';
$wgCUDMaxAge = 5 * 12 * 30 * 24 * 3600; ## Approxmiately 5 years

## EditInterface Group for testing purposes by Chris Key - dnessett
$wgGroupPermissions['EditInt']['editinterface'] = true;

## Temporary turn off all editing
#$wgGroupPermissions['*' ]['edit']       = false;
#$wgGroupPermissions['*' ]['createpage']  = false;
#$wgGroupPermissions['*' ]['createtalk']  = false;
#$wgGroupPermissions['*' ]['upload']  = false;
#$wgGroupPermissions['*' ]['reupload']  = false;

## Handle with care
$wgGroupPermissions['*']['nukerevision'] = false;
$wgGroupPermissions['Dark Knight']['nukerevision'] = true;

## Who can set the "from Wikipedia" flag?
$wgGroupPermissions['*']['setwpfrom'] = true;

$wgWhitelistRead = array ( "Main Page", "Special:Userlogin", "Special:Preferences","Special:Specialpages","Special:Confirmemail", "Special:Userlogout", "SITENAME:Help","MediaWiki:Monobook.css","-" );

## What file types are we allowed to upload?
$wgFileExtensions = array( 'png', 'gif', 'jpg', 'jpeg', 'svg' );

$wgCategoryPagingLimit = 400;

/** Enable for more detailed by-function times in debug log */
$wgProfiling    = true;
/** Only record profiling info for pages that took longer than this */
$wgProfileLimit = 1.0;
/** Don't put non-profiling info into log file */
$wgProfileOnly  = false;
/** Log sums from profiling into "profiling" table in db. */
$wgProfileToDatabase = true;
/** Only profile every n requests when profiling is turned on */
$wgProfileSampleRate = 1;
/** If true, print a raw call tree instead of per-function report */
$wgProfileCallTree = false;
/** If not empty, specifies profiler type to load */
$wgProfilerType = '';

$wgJobRunRate = 0;

$wgNoFollowLinks = false;

## This was so broken it is not even funny
$wgMediaHandlers = array(
	'jpeg' => 'BitmapHandler',
	'image/jpeg' => 'BitmapHandler',
	'image/png' => 'BitmapHandler',
	'png' => 'BitmapHandler',
	'image/gif' => 'BitmapHandler',
	'gif' => 'BitmapHandler',
	'image/x-ms-bmp' => 'BmpHandler',
	'image/svg+xml' => 'SvgHandler',
	'image/svg' => 'SvgHandler',
	'image/vnd.djvu' => 'DjVuHandler',
);


# The following three lines contradict settings later in thie file. moved to here
# for clarification. -emg
## This is causing problems uploading pngs, which come across as text/plain for some reason
#$wgVerifyMimeType= false;
#$wgLoadFileinfoExtension = true;

## Argh - the builtin is not detecting this well, so we need to go external:
# note I'm trying to use the builtin fileinfo PHP module, because 
# using file is not allowing svg or ogg to be uploaded -emg
$wgVerifyMimeType = true;

# commented out by me on 21 Oct 2007 -emg
## This was causing a large mess: the internal routines were not detecting pngs, 
## and the /usr/bin/file was failing at other things, such as svg.
## Final workaround is to use this, which detects both:
## /usr/bin/gnomevfs-info FILE | grep -m1 MIME | cut -c21-
## This is hardcoded into MimeMagic.php -Greg, Nov. 3, 2007
## Although the below is not used, it must be set to something so that 
## the section in MimeMagic.php is called.
$wgMimeDetectorCommand= "/usr/bin/file -bi"; ## Uses /usr/share/file/magic.mime

$wgTrivialMimeDetection= true;

## Confirm Account page rights
$wgGroupPermissions['*']['createaccount'] = false;
$wgGroupPermissions['*']['confirmaccount'] = false;
$wgGroupPermissions['bureaucrat']['confirmaccount'] = true;
$wgGroupPermissions['sysop']['confirmaccount'] = true;
$wgGroupPermissions['epa']['confirmaccount'] = true;
$wgGroupPermissions['epa']['requestips'] = true;

## Allow some other people to rename users
$wgGroupPermissions['Linnaeus']['renameuser'] = true;
$wgGroupPermissions['bureaucrat']['renameuser'] = true;

# 'Approv' covers "Approval" and "Approved"
#$wgExtraRandompageSQL = "NOT page_title ~ '/Approv' AND NOT page_title ~ '/Unused' AND NOT page_title ~ '/Bibliography'";
$wgExtraRandompageSQL = "NOT page_title ~ '/' AND page_len > 20000";

# We don't want to count some things as 'short' pages
$wgExtraShortpageSQL = "
  NOT page_title ~ '/Approv' AND 
  NOT page_title ~ '/Unused' AND 
  NOT page_title ~ '/Bibliography' AND
  NOT page_title ~ '/Related' AND
  NOT page_title ~ '/External' 
";

$wgShowCompleteCategoryCount = true;

## Per Zach's request on November 13, 2007 - Greg
$wgMaxArticleSize = 4096; # Maximum article size in kilobytes

$wgAccountRequestTypes = array( 
  0 => array( 'authors', 'user', '' ),
  1 => array( 'editors', 'wikieditor', '[[Category:CZ Editors]]' )
  );

$wgMinimalPasswordLength = 5;

$wgUploadNavigationUrl = 'http://en.citizendium.org/wiki/CZ:Upload';

$wgEnableMWSuggest = true;

# increase expensive parser function limit from default of 100 to 500
$wgExpensiveParserFunctionLimit = 1000;

## DEBUGGING
## Keep at bottom please, and leave turned off except when absolutely needed 
## for live debugging purposes

$wgShowExceptionDetails = 0;

#$wgDebugLogFile        = "/tmp/mwdebug.log";

#$wgReadOnlyFile         = "$IP/readonly";


?>