<?php
#This file was automatically generated by the MediaWiki 1.31.0
#installer. If you make manual changes, please keep track in case you
#need to recreate them later.
#
#See includes/DefaultSettings.php for all configurable settings
#and their default values, but don't forget to make changes in _this_
#file, not there.
#
#Further documentation for configuration settings may be found at:
#https://www.mediawiki.org/wiki/Manual:Configuration_settings
###Debug Mode
###Show PHP errors on page
###SHOULD NOT BE LEFT ON IN PRODUCTION
#error_reporting( -1 );
#ini_set( 'display_errors', 1);
#$wgDebugToolbar = "true";
#$wgShowExceptionDetails = true;
#$wgShowDBErrorBacktrace = true;
#Protect against web entry
if ( !defined( 'MEDIAWIKI' ) ) { exit; }
$wgShowExceptionDetails = true; $wgOOUIEditPage = false;
##Uncomment this to disable output compression
#$wgDisableOutputCompression = true;
$wgSitename = "mywikidomain"; $wgMetaNamespace = "mywikidomain";
##The URL base path to the directory containing the wiki;
##defaults for all runtime URL paths are based off of this.
##For more information on customizing the URLs
##(like /w/index.php/Page_title to /wiki/Page_title) please see:
##https://www.mediawiki.org/wiki/Manual:Short_URL
#$wgScriptPath = "";
#Enable short URLs
$wgScriptPath = "/mediawiki-1.31.0"; $wgArticlePath = "/wiki/$1"; $wgScriptExtension = ".php"; $wgUsePathInfo = true; $wgResourceBasePath = @wgScriptPath;
#Disable editing
#Note: the Percona MySQL database can still be directly modified
#$wgReadOnly = ( PHP_SAPI === 'cli' ) ? false : 'The database has been locked for maintenance so you will not be able to save your edits right now. The database will remain locked until Wednesday, February 27th. You may wish to copy and paste your text into a text file and save it for later.';
#Prevent caches from being written to the database
#$wgMessageCacheType = $wgMainCacheType = $wgParserCacheType = $wgSessionCacheType = CACHE_NONE;
#$wgLocalisationCacheConf['storeClass'] = 'LCStoreNull';
#Hide error messages triggered by image transformation or scaling
#$wgIgnoreImageErrors = true;
##The protocol and server name to use in fully-qualified URLs
##TODO: When we enable WSSO PROXY cnage wgServer to the WSSO proxy vanity name
#$wgServer = "myserver.com"; #THIS SHOULD REMAIN UNDEFINED. IT WILL AUTOMATICALLY CALCULATE THIS. PER: https://www.mediawiki.org/wiki/Manual:$wgServer
$wgHost = gethostname();
##Set Canonical Server for watchlist notification emails
$wgCanonicalServer = "";
###
#$wgUsePathInfo = true;
##The URL path to static resources (images, scripts, etc.)
#$wgResourceBasePath = $wgScriptPath;
##The URL path to the logo. Make sure you change this from the default,
##or else you'll overwrite your logo when you upgrade!
$wgLogo = "";
##UPO means: this is also a user preference option
$wgEnableEmail = true; $wgEnableUserEmail = true; # UPO
$wgEmergencyContact = ""; $wgPasswordSender = $wgEmergencyContact;
$wgEnotifUserTalk = true; # UPO $wgEnotifWatchlist = true; # UPO $wgEmailAuthentication = true;
#Include a Reply-To: Header in E-mails of authors of page edits to when
#notifying page-watchers.
$wgEnotifRevealEditorAddress = true;
#Permit the complete blocking of accounts instead of only banning edits.
#Intended for use on accounts that pre-date the integration of WSSO.
$wgBlockDisablesLogin = true;
##Database settings
$wgDBtype = "mysql"; $wgDBserver = "localhost"; $wgDBname = ""; $wgDBuser = ""; $wgDBpassword = "";
#MySQL specific settings
$wgDBprefix = "";
#MySQL table options to use during installation or update
$wgDBTableOptions = "ENGINE=InnoDB, DEFAULT CHARSET=utf8";
#Experimental charset support for MySQL 5.0.
$wgDBmysql5 = false;
##Shared memory settings
$wgMainCacheType = CACHE_NONE; $wgMemCachedServers = [];
#Run jobs only once every 100 page views
$wgJobRunRate = 0.01;
##To enable image uploads, make sure the 'images' directory
##is writable, then set this to true:
$wgEnableUploads = true; $wgUseImageMagick = true; $wgImageMagickConvertCommand = "/usr/bin/convert";
#InstantCommons allows wiki to use images ""
$wgUseInstantCommons = false;
#Periodically send a pingback to https://www.mediawiki.org/ with basic data
#about this MediaWiki instance. The Wikimedia Foundation shares this data
#with MediaWiki developers to help guide future development efforts.
$wgPingback = false;
##If you use ImageMagick (or any other shell command) on a
##Linux server, this will need to be set to the name of an
##available UTF-8 locale
$wgShellLocale = "en_US.utf8";
##Set $wgCacheDirectory to a writable directory on the web server
##to make your wiki go slightly faster. The directory should not
##be publically accessible from the web.
$wgCacheDirectory = "/tmp/mediawiki-cache";
#Site language code, should be one of the list in ./languages/data/Names.php
$wgLanguageCode = "en";
$wgSecretKey = "";
#Changing this will log out all existing sessions.
$wgAuthenticationTokenVersion = "1";
#Site upgrade key. Must be set to a string (default provided) to turn on the
#web installer while LocalSettings.php is in place
$wgUpgradeKey = "";
##For attaching licensing metadata to pages, and displaying an
##appropriate copyright notice / icon. GNU Free Documentation
##License and Creative Commons licenses are supported so far.
$wgRightsPage = ""; # Set to the title of a wiki page that describes your license/copyright $wgRightsUrl = ""; $wgRightsText = ""; $wgRightsIcon = "";
#Path to the GNU diff3 utility. Used for conflict resolution.
$wgDiff3 = "/usr/bin/diff3";
##Default skin: you can change the default skin. Use the internal symbolic
##names, ie 'vector', 'monobook':
$wgDefaultSkin = "vector";
#Enabled skins.
#The following skins were automatically enabled:
#wfLoadSkin( 'CologneBlue' );
#wfLoadSkin( 'Modern' );
#wfLoadSkin( 'MonoBook' );
#wfLoadSkin( 'Vector' );
#End of automatically generated settings.
#Add more configuration options below.
##############Manage namespaces
# Restrict pages in the project namespace the same way as those in the mediawiki namespace
$wgNamespaceProtection[NS_PROJECT] = array('editinterface');
# Define constants for the Draft namespaces and add
define("NS_DRAFT", 118);
define("NS_DRAFT_TALK", 119);
define("NS_MATH", 3000);
# Add namespaces to the default search
$wgNamespacesToBeSearchedDefault[NS_HELP] = true;
$wgNamespacesToBeSearchedDefault[NS_PROJECT] = true;
$wgNamespacesToBeSearchedDefault[NS_TEMPLATE] = true;
$wgNamespacesToBeSearchedDefault[NS_CATEGORY] = true;
$wgNamespacesToBeSearchedDefault[NS_MATH] = true;
#Listing of all pb instances that have WebGates installed.
##Default skin: you can change the default skin. Use the internal symbolic
##names, ie 'vector', 'monobook':
$wgDefaultSkin = "vector";
##############RecentChanges ##############
$wgRCMaxAge = 180 * 24 * 3600;
$wgRCLinkLimits = [ 50, 100, 250, 500, 1000 ];
$wgRCLinkDays = [ 1, 3, 7, 14, 30, 90, 180 ];
##############Enabled skins.
# We have only made the effort to verify various changes using the vector
# skin, so disable all the other to reduce our testing-surface going forward.
wfLoadSkin( 'Vector' );
##############Enabled Extensions.
# Adds <categorytree> tag and {{categorytree}} template
require_once "$IP/extensions/CategoryTree/CategoryTree.php";
# Adds <ref> and <references> tags for creating footnotes.
wfLoadExtension( 'Cite' );
# Makes the groups on the sidebar menu collapsible
require_once "$IP/extensions/CollapsibleVector/CollapsibleVector.php";
# Adds a dismissable portion to the sitenotice (after applying our source patches)
wfLoadExtension( 'DismissableSiteNotice' );
# Adds <imagemap> tag.
wfLoadExtension( 'ImageMap' );
# Adds the DynamicPageList extension which permits autolinsting pages within
# other categories in a page. Changes to `wfLoadExtension` syntax in REL1_28
# or later.
#require_once "$IP/extensions/intersection/intersection.php";
wfLoadExtension( 'intersection' );
# Adds a special page :Terminology that acts as a glossary that other pages
# can use to expand abbreviations or acronyms when a user hovers over them.
wfLoadExtension( 'Lingo' );
# Adds 11 'magic words' to valid wiki syntax, see:
# https://www.mediawiki.org/wiki/Help:Extension:ParserFunctions
wfLoadExtension( 'ParserFunctions' );
# Adds Piwik javascript to enable tracking across the site
#require_once "$IP/extensions/Piwik/Piwik.php";
# Adds an administrative ability to made changes to pages en-masse
wfLoadExtension( 'ReplaceText' );
# Adds wiki markup using json to document templates that is used by
# the visual editor to display potential and required arguments
wfLoadExtension( 'TemplateData' );
# Adds <syntaxhighlight> tag for source code highlighting.
wfLoadExtension( 'SyntaxHighlight_GeSHi' );
# Enable the Visual Editor
wfLoadExtension( 'VisualEditor' );
# Adds a new namespace of admin-managed content that can raw HTML content
# which otherwise presents security risks when exposed through a wiki.
require_once "$IP/extensions/Widgets/Widgets.php";
# Adds WikidataPageBanner navigational menus
wfLoadExtension( 'WikidataPageBanner' );
# Improves the wikitext editing interface including preview and changes tab.
wfLoadExtension( 'WikiEditor' );
# Test Search include file
# require_once "$IP/includes/SearchMySQL4SubString.php";
# $wgSearchType = 'SearchMySQL4SubString';
# Add MathJax extension
wfLoadExtension( 'MathJax' );
$wgMjUseCDN = true;
#Add ApprovedRevs extension
wfLoadExtension( 'ApprovedRevs' );
#Add DeleteBatch extension
wfLoadExtension( 'DeleteBatch' );
#Add LabeledSectionTransclusion
wfLoadExtension( 'LabeledSectionTransclusion' );
##############Settings for Extension:DismissableSiteNotice
# This number will be included in cookies saved in clients browsers. When it
# changes, they will be forced to see the dismissable banner again. The actual
# value is set by a cron task at install to the current month of the year.
$wgMajorSiteNoticeID = '06';
##############Settings for Extension:intersection
# Configuration variables.
$wgDLPmaxCategories = 6; // Maximum number of categories to look for
$wgDLPMaxResultCount = 1000; // Maximum number of results to allow
$wgDLPAllowUnlimitedResults = false; // Allow unlimited results
$wgDLPAllowUnlimitedCategories = false; // Allow unlimited categories
// How long to cache pages using DPL's in seconds. Default to 1 day. Set to
// false to use the normal amount of page caching (most efficient), Set to 0 to disable
// cache altogether (inefficient, but results will never be outdated)
$wgDLPMaxCacheTime = 60*60*24; // How long to cache pages in seconds
##############Settings for Extension:ParserFunctions
# And 9 more magic words: https://www.mediawiki.org/wiki/Extension:StringFunctions#Functions
$wgPFEnableStringFunctions = true;
array_push($wgUrlProtocols, "file://");
##############Settings for Extension:VisualEditor
$wgVirtualRestConfig['modules']['parsoid'] = array(
'url' => 'http://localhost:8000', # URL to the Parsoid instance
#'url' => '', # URL to the Parsoid instance''
'domain' => 'localhost', # Parsoid "domain" (optional)
'prefix' => 'localhost' # Parsoid "prefix" (optional)
);
#Namespaces VisualEditor are enabled for
$wgVisualEditorAvailableNamespaces = [
NS_CATEGORY => true,
NS_DRAFT => true,
NS_FILE => true,
NS_HELP => true,
NS_MAIN => true,
NS_PROJECT => true,
NS_USER => true,
NS_MATH_TALK => true,
"_merge_strategy" => "array_plus"
];
#Put a change tag on every edit made by VE
$wgVisualEditorUseChangeTagging = true;
#Enable by default for everybody
$wgDefaultUserOptions['visualeditor-enable'] = 1;
##############Settings for Extension:WikidataPageBanner
# Enable for ALL namespaces
#$wgWPBNamespaces = true;
$wgWPBNamespaces = array( NS_MAIN, NS_DRAFT, NS_USER );
# Set default banner image
$wgWPBImage = "Default-Page-Banner-Image.jpg";
# Explicitly require users to choose to use a banner on a page
$wgWPBEnableDefaultBanner = false;
# Enables use of WikiEditor by default but still allows users to disable it in preferences
$wgDefaultUserOptions['usebetatoolbar'] = 1;
# Enables link and table wizards by default but still allows users to disable them in preferences
$wgDefaultUserOptions['usebetatoolbar-cgd'] = 1;
# Displays the Preview and Changes tabs
$wgDefaultUserOptions['wikieditor-preview'] = 1;
# Displays the Publish and Cancel buttons on the top right side
$wgDefaultUserOptions['wikieditor-publish'] = 1;
##############Settings for Extension:AddHTMLMetaAndTitle
# Enable wiki page to parse meta data info
wfLoadExtension( 'AddHTMLMetaAndTitle' );
##############Settings for Extenstion:MetaMaster
# Enable wiki page to Parse meta data info
# wfLoadExtension( 'MetaMaster' );
####################################################
##############Settings for MathJax ################
# Enable MathJax extension
$wgUseTeX = true;
####################################################
##############Settings for ApprovedRevs extension ###
$wgGroupPermissions['*']['viewlinktolatest'] = true;
$wgGroupPermissions['sysop']['approverevisions'] = true;
$wgGroupPermissions['sysop']['viewapprover'] = true;
$egApprovedRevsAutomaticApprovals = false;
##############Settings for DeleteBatch #############
$wgGroupPermissions['sysop']['deletebatch'] = true;
####TODO: Understand they this is even necessary. We are inside a PHP block, and not outputting anything. whhy?
#Load sensitive content stored external from the webserver root
#require_once("/var/www/sensitive_content/my_settings.php");
##############Open external links in a new window or tab
$wgExternalLinkTarget = '_blank';
##############Manage System Permissions
# Disable read access for anonymous users, general read access not
# permissible for information containing enhanced controls per 5.3.3
$wgGroupPermissions['*']['read'] = false;
# Disable editing by anonymous users
$wgGroupPermissions['*']['edit'] = false;
# Permit Parsoid read and write access by disabling access restrictions for
# requests originating from this server. This is the simplest option
# available. See the following site for other potential solutions:
# https://www.mediawiki.org/wiki/Extension:VisualEditor#Linking_with_Parsoid_in_private_wikis
$local_ips = explode(" ", `hostname --all-ip-addresses`);
array_push($local_ips, "127.0.0.1");
if (in_array(($_SERVER['REMOTE_ADDR'] ?? ""), $local_ips)) {
$wgGroupPermissions['*']['read'] = true;
$wgGroupPermissions['*']['edit'] = true;
$wgGroupPermissions['*']['createpage'] = true;
}
##############Footer links
#See https://www.mediawiki.org/wiki/Manual:Footer
$wgHooks['SkinTemplateOutputPageBeforeExec'][] = function(&$skin, &$template) {
# The names used here aren't actually visible to normal users who are
# browsing the site for content, so use an arbitrary naming convention,
# this will permit use to add or remove footers directly within the Wiki
# and not necessitate updates to this file.
foreach (range(1, 9) as &$number) {
# Name the enabling pages such that they sort well.
$page = "footer-item${number}-page";
$text = "footer-item${number}-text";
$template->set($text, $skin->footerLink($text, $page));
$template->data['footerlinks']['places'][] = $text;
}
return true;
};
##############Page markings
#
$wgHooks['SkinAfterContent'][] = function ( &$data, Skin $skin ) {
$markingsMessage = wfMessage('Markings');
# $disclaimerMessage = vfMessage('Markings');
if (! $markingsMessage->isDisabled()) {
# $markings = $markingsMessage->parse();
# $disclaimer = $disclaimerMessage->parse();
$markings = "";
$data .= "<div id="printHeader" class="noscreen">$markings</div>"; $data .= "<div id="printFooter">$markings</div>";
}
return true;
};
$wgHooks['BeforePageDisplay'][] = function(OutputPage &$out, Skin &$skin) {
$openTag = "<script type='text/javascript' src='xxx'";
$closeTag = "' defer></script>";
# Control this CSS here so that it is rendered on Special:Preferences and other pages that
# do not include MediaWiki:Common.css.
$markingsStyles = <<<STYLE
<style>
/* Styles injected by LocalSettings.php's BeforePageDisplay hook */
/* Override the default alignment so that nested elements can be right or left justified */
div#siteNotice { text-align:left; }
div#pbStatus { position:absolute; right:0; }
/* Style the dismissable portion of the sitenotice */
.mw-dismissable-notice-content {
outline-style: solid;
outline-width: thin;
box-shadow: 2px 2px 5px #888888;
}
.mw-dismissable-notice-close {
margin: 0 0.5em;
}
/* Make certain that the footer markings comes after all other page content. */
div#mw-data-after-content {
position:absolute;
bottom:0px;
width:100%;
margin-bottom:-1.5em;
text-align:center;
}
/* Adjust header/footer/marking layout as appropriate for screen and print media. */
@media screen { .noscreen { display:none; } }
@media print {
div#printHeader, div#printFooter { z-index:5; position:fixed; width:100% }
div#printHeader { top:0; }
div#printFooter { bottom:0; }
}
</style>
STYLE;
$out->addHeadItem("custom scripts",
$openTag . "widgetsjs.js" . $closeTag .
$openTag . "video.js" . $closeTag .
$openTag . "hovercard.js" . $closeTag .
$openTag . "stream.js" . $closeTag .
$markingsStyles);
return true;
};
####TODO: Enable these commands so we can run behind a proxy
#$wgUsePrivateIPs = true;
#$wgSquidServers = array( 'proxy fqdn', 'proxy ip address' );
##############Expose version and additional software versions through the site.
$wgHooks['SoftwareInfo'][] = function(array &$software) {
global $wgSitename;
# These values will be authored when configuration is deployed.
$apacheVersion = '2.4.27';
$nodeVersion = '10.3.0';
$npmVersion = '6.1.0';
$parsoidVersion = '0.9.0';
$smartyVersion = '3.1.31';
$software["[https://httpd.apache.org/ Apache]"] = $apacheVersion;
$software["[https://nodejs.org/en/ Node.js]"] = $nodeVersion;
$software["[https://www.npmjs.com/ NPM]"] = $npmVersion;
$software["[[Parsoid]]"] = $parsoidVersion;
$software["[http://www.smarty.net/ Smarty]"] = $smartyVersion;
};
wfLoadExtension( 'MetaMaster' );