<?php
# This file was automatically generated by the MediaWiki 1.40.0
# installer. If you make manual changes, please keep track in case you
# need to recreate them later.
#
# See includes/MainConfigSchema.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

# Protect against web entry
if ( !defined( 'MEDIAWIKI' ) ) {
	exit;
}

$wikis = [
    'wiki.bnbmc.net' => 'bnbmc',
    'osfirsttimer.wiki' => 'osft',
    'wiki.shiftos.dev' => 'shiftos',
];
if ( defined( 'MW_DB' ) ) {
    // Automatically set from --wiki option to maintenance scripts
    $wikiID = MW_DB;
} else {
    // Use MW_DB environment variable or map the domain name
    $wikiID = $_SERVER['MW_DB'] ?? $wikis[ $_SERVER['SERVER_NAME'] ?? '' ] ?? null;
}

if ( $wikiID ) {
    require_once "/var/www/html/mediawiki/sites/LocalSettings_$wikiID.php";
} else {
    die( 'Unknown wiki.' );
}

## Uncomment this to disable output compression
# $wgDisableOutputCompression = true;

## 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 = "/w";
$wgArticlePath = "/wiki/$1";
$wgUsePathInfo = true;

## The URL path to static resources (images, scripts, etc.)
$wgResourceBasePath = $wgScriptPath;

## UPO means: this is also a user preference option

$wgEnableEmail = true;
$wgEnableUserEmail = true; # UPO

$wgEmergencyContact = "email@example.com";

$wgEnotifUserTalk = true; # UPO
$wgEnotifWatchlist = false; # UPO
$wgEmailAuthentication = true;


# MySQL specific settings
$wgDBprefix = "";

# MySQL table options to use during installation or update
$wgDBTableOptions = "ENGINE=InnoDB, DEFAULT CHARSET=binary";

# Shared database table
# This has no effect unless $wgSharedDB is also set.
$wgSharedTables[] = "actor";

## Shared memory settings
$wgMainCacheType = CACHE_ACCEL;
$wgMemCachedServers = [];

## To enable image uploads, make sure the 'images' directory
## is writable, then set this to true:
$wgEnableUploads = true;
$wgUseImageMagick = true;
$wgImageMagickConvertCommand = "/usr/bin/convert";

$wgFileExtensions = [ 'png', 'gif', 'jpg', 'jpeg', 'pdf', 'tiff', 'bmp', 'webp', 'svg' ];

$wgSVGConverter = 'rsvg';
$wgSVGNativeRendering = true;

# InstantCommons allows wiki to use images from https://commons.wikimedia.org
$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 = true;

# Site language code, should be one of the list in ./includes/languages/data/Names.php
$wgLanguageCode = "en";

# Time zone
$wgLocaltimezone = "America/Toronto";

## Set $wgCacheDirectory to a writable directory on the web server
## to make your wiki go slightly faster. The directory should not
## be publicly accessible from the web.
$wgCacheDirectory = "/tmp/mediawiki_cache/$wikiID";

$wgUseRCPatrol = false;
$wgUseNPPatrol = false;
$wgUseFilePatrol = false;

$wgSecretKey = "generateanewsecretkey";

# 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 = "upgradekey";

# Path to the GNU diff3 utility. Used for conflict resolution.
$wgDiff3 = "/usr/bin/diff3";

$wgMaxImageArea = 10e7; 

# The following permissions were set based on your choice in the installer
$wgGroupPermissions['bureaucrat']['usermerge'] = true;
$wgGroupPermissions['sysop']['usermerge'] = true;
$wgGroupPermissions['user']['oathauth-enable'] = true;
$wgGroupPermissions['bureaucrat']['deleterevision'] = true;
$wgGroupPermissions['bureaucrat']['deletelogentry'] = true;

$wgGroupPermissions['sysop']['interwiki'] = true;
$wgGroupPermissions['bureaucrat']['replacetext'] = true;

$wgDefaultUserOptions['visualeditor-enable'] = 1;
$wgDefaultUserOptions[ 'usecodemirror' ] = true;

$wgGroupPermissions['sysop']['mwoauthproposeconsumer'] = true;

## Default skin: you can change the default skin. Use the internal symbolic
## names, e.g. 'vector' or 'monobook':
$wgDefaultSkin = "vector";
$wgDefaultMobileSkin = 'citizen';

# Enabled skins.
# The following skins were automatically enabled:
wfLoadSkin( 'Vector' );
wfLoadSkin( 'MinervaNeue' );
wfLoadSkin( 'MonoBook' );
wfLoadSkin( 'Timeless' );

wfLoadSkin( 'Cosmos' );
wfLoadSkin( 'Nostalgia' );
wfLoadSkin( 'Citizen' );
wfLoadSkin( 'Modern' );

# Enabled Extensions
wfLoadExtension( 'MobileFrontend' );
wfLoadExtension( 'TemplateStyles' );
wfLoadExtension( 'Description2' );
wfLoadExtension( 'CodeMirror' );
wfLoadExtension( 'WebAuthn' ); 
wfLoadExtensions([ 'ConfirmEdit', 'ConfirmEdit/Turnstile' ]);
wfLoadExtension( 'Variables' );
wfLoadExtension( 'VariablesLua' );
wfLoadExtension( 'SimpleBatchUpload' );
wfLoadExtension( 'DarkMode' );
wfLoadExtension( 'Popups' );
wfLoadExtension( 'TemplateWizard' );
wfLoadExtension( 'Discord' );
wfLoadExtension( 'OAuth' );
wfLoadExtension( 'EmbedVideo' );
wfLoadExtension( 'Analytics' );
wfLoadExtension( 'TorBlock' );
wfLoadExtension( 'AntiSpoof' );

# Built-in extensions
wfLoadExtension( 'OATHAuth' ); 
wfLoadExtension( 'UserMerge' );
wfLoadExtension( 'MultimediaViewer' );
wfLoadExtension( 'VisualEditor' );
wfLoadExtension( 'WikiEditor' );
wfLoadExtension( 'Echo' );
wfLoadExtension( 'Thanks' );
wfLoadExtension( 'LoginNotify' );
wfLoadExtension( 'Cite' );
wfLoadExtension( 'Linter' );
wfLoadExtension( 'ParserFunctions' );
wfLoadExtension( 'CodeEditor' );
wfLoadExtension( 'DiscussionTools' );
wfLoadExtension( 'Gadgets' );
wfLoadExtension( 'SyntaxHighlight_GeSHi' );
wfLoadExtension( 'CategoryTree' );
wfLoadExtension( 'Interwiki' );
wfLoadExtension( 'ReplaceText' );
wfLoadExtension( 'Scribunto' );
wfLoadExtension( 'PageImages' );
wfLoadExtension( 'TextExtracts' );
wfLoadExtension( 'TemplateData' );
wfLoadExtension( 'Nuke' );
wfLoadExtension( 'AbuseFilter' );
wfLoadExtension( 'SpamBlacklist' );
wfLoadExtension( 'TitleBlacklist' );

# Extensions Settings
$wgScribuntoDefaultEngine = 'luastandalone';

$wgRestrictDisplayTitle = false;
$wgMediaViewerEnableByDefault = true;
$wgMediaViewerEnableByDefaultForAnonymous = true;

$wgEnableMetaDescriptionFunctions = true;

$wgCosmosWordmark = $wgLogos['svg'];

#$wgShowExceptionDetails = true;
?>
