Difference between revisions of "LocalSettings.php"

From PKC
Jump to navigation Jump to search
 
(2 intermediate revisions by one other user not shown)
Line 1: Line 1:
[[LocalSettings.php]] is the file dedicated to configure [[MediaWiki]]'s features.
<syntaxhighlight lang=PHP>
<?php
# This file was automatically generated by the MediaWiki 1.35.1
# 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


<noinclude>
# Protect against web entry
==Related Pages==
if ( !defined( 'MEDIAWIKI' ) ) {
* [[Logic Model::MediaWiki]]
exit;
* [[Logic Model::PKC]]
}
</noinclude>
 
 
## Uncomment this to disable output compression
# $wgDisableOutputCompression = true;
 
$wgSitename = "XLP";
 
## 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 = "";
 
## The protocol and server name to use in fully-qualified URLs
$wgServer = "http://localhost:9352";
 
## The URL path to static resources (images, scripts, etc.)
$wgResourceBasePath = $wgScriptPath;
 
## The URL paths to the logo.  Make sure you change this from the default,
## or else you'll overwrite your logo when you upgrade!
$wgLogos = [ '1x' => "$wgResourceBasePath/resources/assets/xlp.png" ];;
 
## UPO means: this is also a user preference option
 
$wgEnableEmail = true;
$wgEnableUserEmail = true; # UPO
 
$wgEmergencyContact = "apache@🌻.invalid";
$wgPasswordSender = "apache@🌻.invalid";
 
$wgEnotifUserTalk = false; # UPO
$wgEnotifWatchlist = false; # UPO
$wgEmailAuthentication = true;
 
## Database settings
$wgDBtype = "mysql";
$wgDBserver = "database:3306";
$wgDBname = "my_wiki";
$wgDBuser = "wikiuser";
$wgDBpassword = "example";
 
# 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";
 
# Requires that a user be registered before they can edit.
$wgGroupPermissions['*']['edit'] = false;
 
# Prevent new user registrations except by sysops
$wgGroupPermissions['*']['createaccount'] = false;
 
## 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";
 
## Set the maximum file update size to about 50MB.
# This number is already set in the docker image's /usr/local/etc/php/php.ini
# $wgMaxUploadSize = 50000000;
 
#ini_set( 'post_max_size', '50M' );
#ini_set( 'upload_max_filesize', '50M' );
 
## Add new file types that allows for more File Types to be uploaded.
$wgFileExtensions = array( 'png', 'gif', 'jpg', 'jpeg', 'doc',
    'xls', 'mpp', 'pdf', 'ppt', 'tiff', 'bmp', 'docx', 'xlsx',
    'pptx', 'ps', 'odt', 'ods', 'odp', 'odg', 'mp4', 'zip',
    'stl', 'sla', 'svg'
);
 
$wgFileExtensions = array_merge(
    $wgFileExtensions, array(
        'json', '3dj', '3djson', 'three',
        'buff', 'buffjson',
        'obj',
        'stl', 'stlb'
    )
  );
 
$wgTrustedMediaFormats[] = 'application/zip';
 
# 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;
 
## 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. This should ideally be set to an English
## language locale so that the behaviour of C library functions will
## be consistent with typical installations. Use $wgLanguageCode to
## localise the wiki.
$wgShellLocale = "C.UTF-8";
 
## 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 = "$IP/cache";
 
# Site language code, should be one of the list in ./languages/data/Names.php
$wgLanguageCode = "en";
 
$wgSecretKey = "f8cdcb8841e977f39f01280c0bc8a23fb6e14fe1ce585bb4557e70e2de35f565";
 
# 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 = "977590988d0f7c29";
 
## 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";
 
 
 
# Enabled skins.
# The following skins were automatically enabled:
wfLoadSkin( 'MonoBook' );
wfLoadSkin( 'Timeless' );
wfLoadSkin( 'Vector' );
wfLoadSkin( 'Medik' );
wfLoadSkin( 'Refreshed' );
 
## Default skin: you can change the default skin. Use the internal symbolic
## names, ie 'vector', 'monobook', 'medik':
$wgDefaultSkin = "vector";
$wgMedikColor = "#0582AD";
 
 
# Enabled extensions. Most of the extensions are enabled by adding
# wfLoadExtension( 'ExtensionName' );
# to LocalSettings.php. Check specific extension documentation for more details.
# The following extensions were automatically enabled:
wfLoadExtension( 'CategoryTree' );
wfLoadExtension( 'Cite' );
$wgAllowCiteGroups = true;
$wgCiteBookReferencing = true;
 
wfLoadExtension( 'CiteThisPage' );
wfLoadExtension( 'CodeEditor' );
wfLoadExtension( 'ConfirmEdit' );
wfLoadExtension( 'Gadgets' );
wfLoadExtension( 'ImageMap' );
wfLoadExtension( 'InputBox' );
wfLoadExtension( 'Interwiki' );
wfLoadExtension( 'LocalisationUpdate' );
wfLoadExtension( 'MultimediaViewer' );
wfLoadExtension( 'Nuke' );
wfLoadExtension( 'PageImages' );
wfLoadExtension( 'ParserFunctions' );
wfLoadExtension( 'PdfHandler' );
wfLoadExtension( 'Poem' );
wfLoadExtension( 'Renameuser' );
wfLoadExtension( 'ReplaceText' );
 
# According to MediaWiki.org, https://www.mediawiki.org/wiki/Extension_talk:Scribunto, the following line should only points to lua5.1
$wgScribuntoEngineConf['luastandalone']['luaPath'] = '/usr/bin/lua5.1';
 
wfLoadExtension( 'Scribunto' );
wfLoadExtension( 'SemanticScribunto' );
 
 
wfLoadExtension( 'SecureLinkFixer' );
wfLoadExtension( 'SpamBlacklist' );
wfLoadExtension( 'SyntaxHighlight_GeSHi' );
wfLoadExtension( 'TemplateData' );
wfLoadExtension( 'TextExtracts' );
wfLoadExtension( 'TitleBlacklist' );
# The following extension requires to installation of Parsoid server
# wfLoadExtension( 'VisualEditor' );
wfLoadExtension( 'WikiEditor' );
wfLoadExtension( 'DrawioEditor' );
 
 
# End of automatically generated settings.
# Add more configuration options below.
# The following extensions are added in the Dockerfile implemented for bkoo/mediawiki:1.35
 
wfLoadExtension( 'intersection' );
 
# Try to handle PDF uploaded files
wfLoadExtension( 'PdfHandler' );
wfLoadExtension( 'PDFEmbed' );
 
 
 
// Default width for the PDF object container.
$wgPdfEmbed['width'] = 800;
 
// Default height for the PDF object container.
$wgPdfEmbed['height'] = 1090;
 
// Enable Media Playing
wfLoadExtension("EmbedVideo");
 
wfLoadExtension( 'MultimediaViewer' );
 
//Allow user the usage of the pdf tag
$wgGroupPermissions['*']['embed_pdf'] = true;
 
wfLoadExtension( '3D' );
 
$wg3dProcessor = [
    '/usr/bin/xvfb-run',
    '-a',
    '-s',
    '-ac -screen 0 1280x1024x24',
    '/var/www/html/extensions/3d2png/3d2png.js'
];
 
$wgUploadWizardConfig['patents'] = [
'extensions' => [ 'stl' ],
'template' => '3dpatent',
'url' => [
'legalcode' => '//wikimediafoundation.org/wiki/Wikimedia_3D_file_patent_license',
'warranty' => '//meta.wikimedia.org/wiki/Wikilegal/3D_files_and_3D_printing',
'license' => '//meta.wikimedia.org/wiki/Wikilegal/3D_files_and_3D_printing',
'weapons' => '//meta.wikimedia.org/wiki/Wikilegal/3D_files_and_3D_printing#Weapons',
],
];
 
$wgTrustedMediaFormats[] = "application/sla";
$wgTrustedMediaFormats[] = "application/octet-stream";
 
$wgMediaViewerExtensions['stl'] = 'mmv.3d';
 
wfLoadExtension( '3DAlloy' );
 
# Loading Math extension
wfLoadExtension( 'Math' );
 
wfLoadExtension( 'GeoData' );
 
wfLoadExtension( 'JsonConfig' );
 
wfLoadExtension( 'Kartographer' );
 
wfLoadExtension( 'EmbedSpotify' );
 
wfLoadExtension( 'PageForms' );
 
 
$egMapsGMaps3ApiKey = 'AIzaSyBQuxfm0meYxGrQfdVY1FeiINS0nAW3avo';
$egMapsDefaultService = 'leaflet';
wfLoadExtension( 'Maps' );
 
$wgShowExceptionDetails = true;
 
wfLoadExtension( 'Cargo' );
wfLoadExtension( 'Widgets' );
 
wfLoadExtension( 'GoogleDocs4MW' );
wfLoadExtension( 'TemplateWizard' );
 
# wfLoadExtension( 'HeadScript' );
 
#wfLoadExtension( 'Matomo' );
 
#wfLoadExtension( 'MatomoAnalytics' );
#$wgMatomoAnalyticsServerURL = 'http://localhost:8080';
#$wgMatomoAnalyticsTokenAuth = '0c55c14282fc1f35e120decc02f86504';
 
 
# The following statements are for OATHAuth
wfLoadExtension( 'OATHAuth' );
$wgMWOAuthCentralWiki = false;
$wgOATHAuthWindowRadius = 4;
$wgOATHAuthDatabase = false;
$wgOATHAuthSecret=false;
$wgOATHAuthAccountPrefix=false;
$wgOATHExclusiveRights=[];
$wgGroupPermissions['user']['oathauth-enable'] = true;
 
# The following statements are for OATHAuth
wfLoadExtension( 'OAuth' );
$wgMWOAuthCentralWiki = false;
$wgMWOAuthSharedUserSource = null;
$wgMWOAuthRequestExpirationAge= 2592000;
$wgMWOAuthSecureTokenTransfer=false;
$wgOAuthSecretKey=null;
$wgOAuthGroupsToNotify=[];
$wgMWOauthDisabledApiModules=[];
$wgMWOAuthReadOnly=false;
$wgMWOAuthSessionCacheType=$wgSessionCacheType;
$wgOAuth2EnabledGrantTypes = [
    "authorization_code",
    "refresh_token",
    "client_credentials"
    ];
$wgOAuth2PrivateKey = "";
$wgOAuth2PublicKey = "";
$wgOAuth2GrantExpirationInterval="PT1H";
$wgOAuth2RefreshTokenTTL="PT1M";
 
# The following statement is only used for Semantic MediaWiki  
enableSemantics();
 
 
wfLoadExtension( 'MW-OAuth2Client' );
 
# The following two lines contains information on Github's OAuth service. You will have to apply for your own information to get things to work.
$wgOAuth2Client['client']['id'] = "83698ede718fea93a79e";
$wgOAuth2Client['client']['secret'] = "290648a66406e1bb3c5655a96c34b62fac5e4e9a";
 
$wgOAuth2Client['configuration']['authorize_endpoint']    = 'https://github.com/login/oauth/authorize'; // Authorization URL
$wgOAuth2Client['configuration']['access_token_endpoint']  = 'https://github.com/login/oauth/access_token'; // Token URL
$wgOAuth2Client['configuration']['api_endpoint']          = 'https://api.github.com/user'; // URL to fetch user JSON
$wgOAuth2Client['configuration']['redirect_uri'] = "http://localhost:9352/index.php/Special:OAuth2Client/callback";
$wgOAuth2Client['configuration']['username'] = 'login'; // JSON path to username
$wgOAuth2Client['configuration']['email'] = 'email'; // JSON path to email
$wgOAuth2Client['configuration']['scopes'] = 'openid email profile'; //Permissions
$wgOAuth2Client['configuration']['service_name'] = 'Oauth Registry'; // the name of your service
$wgOAuth2Client['configuration']['service_login_link_text'] = 'Login through Github'; // the text of the login link
 
// remove login and logout buttons for all users
function StripLogin(&$personal_urls, &$wgTitle) { 
    unset( $personal_urls["login"] );
    # unset( $personal_urls["logout"] );
    unset( $personal_urls['anonlogin'] );
    return true;
}
 
$wgHooks['PersonalUrls'][] = 'StripLogin';
 
## 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 = "License"; # Set to the title of a wiki page that describes your license/copyright
$wgRightsIcon = "$wgResourceBasePath/resources/assets/by-sa.png";
$wgRightsUrl = 'https://creativecommons.org/licenses/by-sa/3.0/';
$wgRightsText = "a Creative Commons Attribution-NonCommercial-ShareAlike 3.0 License";
 
$wgHooks['BeforePageDisplay'][] = function( OutputPage &$out, Skin &$skin ) {
  $code = <<<HTML
<!-- Matomo -->
<script type="text/javascript">
  var _paq = window._paq = window._paq || [];
  /* tracker methods like "setCustomDimension" should be called before "trackPageView" */
  _paq.push(["setDocumentTitle", document.domain + "/" + document.title]);
  _paq.push(["setCookieDomain", "*.localhost"]);
  _paq.push(["setDomains", ["*.localhost"]]);
  _paq.push(['trackPageView']);
  _paq.push(['enableLinkTracking']);
  (function() {
    var u="//localhost:8080/";
    _paq.push(['setTrackerUrl', u+'matomo.php']);
    _paq.push(['setSiteId', '2']);
    var d=document, g=d.createElement('script'), s=d.getElementsByTagName('script')[0];
    g.type='text/javascript'; g.async=true; g.src=u+'matomo.js'; s.parentNode.insertBefore(g,s);
  })();
</script>
<noscript><p><img src="//localhost:8080/matomo.php?idsite=2&amp;rec=1" style="border:0;" alt="" /></p></noscript>
<!-- End Matomo Code -->
HTML;
 
  $out->addHeadItem( 'gtag-insert', $code );
  return true;
};
 
$wgGroupPermissions['user']['skipcaptcha'] = true;
 
// Semantic Result Format
wfLoadExtension( 'SemanticResultFormats' );
 
$srfgFormats = [
  'icalendar',
  'vcard', 'bibtex', 'calendar',
  'eventcalendar', 'eventline', 'timeline',
  'outline', 'gallery', 'jqplotchart', 'jqplotseries',
  'sum', 'average', 'min', 'max', 'median', 'product',
  'tagcloud', 'valuerank', 'array',
  'tree', 'ultree', 'oltree', 'd3chart', 'latest', 'earliest', 'filtered', 'slideshow', 'timeseries', 'sparkline',
  'listwidget', 'pagewidget', 'dygraphs', 'media', 'datatables'
];
 
</syntaxhighlight>
 
[[Category:Devops]]

Latest revision as of 05:39, 20 February 2022

<?php
# This file was automatically generated by the MediaWiki 1.35.1
# 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

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


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

$wgSitename = "XLP";

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

## The protocol and server name to use in fully-qualified URLs
$wgServer = "http://localhost:9352";

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

## The URL paths to the logo.  Make sure you change this from the default,
## or else you'll overwrite your logo when you upgrade!
$wgLogos = [ '1x' => "$wgResourceBasePath/resources/assets/xlp.png" ];;

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

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

$wgEmergencyContact = "apache@🌻.invalid";
$wgPasswordSender = "apache@🌻.invalid";

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

## Database settings
$wgDBtype = "mysql";
$wgDBserver = "database:3306";
$wgDBname = "my_wiki";
$wgDBuser = "wikiuser";
$wgDBpassword = "example";

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

# Requires that a user be registered before they can edit.
$wgGroupPermissions['*']['edit'] = false;

# Prevent new user registrations except by sysops
$wgGroupPermissions['*']['createaccount'] = false;

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

## Set the maximum file update size to about 50MB.
# This number is already set in the docker image's /usr/local/etc/php/php.ini
# $wgMaxUploadSize = 50000000;

#ini_set( 'post_max_size', '50M' );
#ini_set( 'upload_max_filesize', '50M' );

## Add new file types that allows for more File Types to be uploaded.
$wgFileExtensions = array( 'png', 'gif', 'jpg', 'jpeg', 'doc',
    'xls', 'mpp', 'pdf', 'ppt', 'tiff', 'bmp', 'docx', 'xlsx',
    'pptx', 'ps', 'odt', 'ods', 'odp', 'odg', 'mp4', 'zip',
    'stl', 'sla', 'svg'
);

$wgFileExtensions = array_merge(
    $wgFileExtensions, array(
        'json', '3dj', '3djson', 'three',
        'buff', 'buffjson',
        'obj',
        'stl', 'stlb'
    )
  );

$wgTrustedMediaFormats[] = 'application/zip';

# 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;

## 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. This should ideally be set to an English
## language locale so that the behaviour of C library functions will
## be consistent with typical installations. Use $wgLanguageCode to
## localise the wiki.
$wgShellLocale = "C.UTF-8";

## 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 = "$IP/cache";

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

$wgSecretKey = "f8cdcb8841e977f39f01280c0bc8a23fb6e14fe1ce585bb4557e70e2de35f565";

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

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



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

## Default skin: you can change the default skin. Use the internal symbolic
## names, ie 'vector', 'monobook', 'medik':
$wgDefaultSkin = "vector";
$wgMedikColor = "#0582AD";


# Enabled extensions. Most of the extensions are enabled by adding
# wfLoadExtension( 'ExtensionName' );
# to LocalSettings.php. Check specific extension documentation for more details.
# The following extensions were automatically enabled:
wfLoadExtension( 'CategoryTree' );
wfLoadExtension( 'Cite' );
$wgAllowCiteGroups = true; 
$wgCiteBookReferencing = true;

wfLoadExtension( 'CiteThisPage' );
wfLoadExtension( 'CodeEditor' );
wfLoadExtension( 'ConfirmEdit' );
wfLoadExtension( 'Gadgets' );
wfLoadExtension( 'ImageMap' );
wfLoadExtension( 'InputBox' );
wfLoadExtension( 'Interwiki' );
wfLoadExtension( 'LocalisationUpdate' );
wfLoadExtension( 'MultimediaViewer' );
wfLoadExtension( 'Nuke' );
wfLoadExtension( 'PageImages' );
wfLoadExtension( 'ParserFunctions' );
wfLoadExtension( 'PdfHandler' );
wfLoadExtension( 'Poem' );
wfLoadExtension( 'Renameuser' );
wfLoadExtension( 'ReplaceText' );

# According to MediaWiki.org, https://www.mediawiki.org/wiki/Extension_talk:Scribunto, the following line should only points to lua5.1
$wgScribuntoEngineConf['luastandalone']['luaPath'] = '/usr/bin/lua5.1';

wfLoadExtension( 'Scribunto' );
wfLoadExtension( 'SemanticScribunto' );


wfLoadExtension( 'SecureLinkFixer' );
wfLoadExtension( 'SpamBlacklist' );
wfLoadExtension( 'SyntaxHighlight_GeSHi' );
wfLoadExtension( 'TemplateData' );
wfLoadExtension( 'TextExtracts' );
wfLoadExtension( 'TitleBlacklist' );
# The following extension requires to installation of Parsoid server
# wfLoadExtension( 'VisualEditor' );
wfLoadExtension( 'WikiEditor' );
wfLoadExtension( 'DrawioEditor' );


# End of automatically generated settings.
# Add more configuration options below.
# The following extensions are added in the Dockerfile implemented for bkoo/mediawiki:1.35

wfLoadExtension( 'intersection' );

# Try to handle PDF uploaded files
wfLoadExtension( 'PdfHandler' );
wfLoadExtension( 'PDFEmbed' );



// Default width for the PDF object container.
$wgPdfEmbed['width'] = 800;

// Default height for the PDF object container.
$wgPdfEmbed['height'] = 1090;

// Enable Media Playing
wfLoadExtension("EmbedVideo");

wfLoadExtension( 'MultimediaViewer' );

//Allow user the usage of the pdf tag
$wgGroupPermissions['*']['embed_pdf'] = true;

wfLoadExtension( '3D' );

$wg3dProcessor = [
    '/usr/bin/xvfb-run',
    '-a',
    '-s',
    '-ac -screen 0 1280x1024x24',
    '/var/www/html/extensions/3d2png/3d2png.js'
];

$wgUploadWizardConfig['patents'] = [
	'extensions' => [ 'stl' ],
	'template' => '3dpatent',
	'url' => [
		'legalcode' => '//wikimediafoundation.org/wiki/Wikimedia_3D_file_patent_license',
		'warranty' => '//meta.wikimedia.org/wiki/Wikilegal/3D_files_and_3D_printing',
		'license' => '//meta.wikimedia.org/wiki/Wikilegal/3D_files_and_3D_printing',
		'weapons' => '//meta.wikimedia.org/wiki/Wikilegal/3D_files_and_3D_printing#Weapons',
	],
];

$wgTrustedMediaFormats[] = "application/sla";
$wgTrustedMediaFormats[] = "application/octet-stream";

$wgMediaViewerExtensions['stl'] = 'mmv.3d';

wfLoadExtension( '3DAlloy' );

# Loading Math extension
wfLoadExtension( 'Math' );

wfLoadExtension( 'GeoData' );

wfLoadExtension( 'JsonConfig' );

wfLoadExtension( 'Kartographer' );

wfLoadExtension( 'EmbedSpotify' );

wfLoadExtension( 'PageForms' );


$egMapsGMaps3ApiKey = 'AIzaSyBQuxfm0meYxGrQfdVY1FeiINS0nAW3avo';
$egMapsDefaultService = 'leaflet';
wfLoadExtension( 'Maps' );

$wgShowExceptionDetails = true;

wfLoadExtension( 'Cargo' );
wfLoadExtension( 'Widgets' );

wfLoadExtension( 'GoogleDocs4MW' );
wfLoadExtension( 'TemplateWizard' );

# wfLoadExtension( 'HeadScript' );

#wfLoadExtension( 'Matomo' );

#wfLoadExtension( 'MatomoAnalytics' );
#$wgMatomoAnalyticsServerURL = 'http://localhost:8080';
#$wgMatomoAnalyticsTokenAuth = '0c55c14282fc1f35e120decc02f86504';


# The following statements are for OATHAuth
wfLoadExtension( 'OATHAuth' );
$wgMWOAuthCentralWiki = false;
$wgOATHAuthWindowRadius = 4;
$wgOATHAuthDatabase = false;
$wgOATHAuthSecret=false;
$wgOATHAuthAccountPrefix=false;
$wgOATHExclusiveRights=[];
$wgGroupPermissions['user']['oathauth-enable'] = true;

# The following statements are for OATHAuth
wfLoadExtension( 'OAuth' );
$wgMWOAuthCentralWiki = false;
$wgMWOAuthSharedUserSource = null;
$wgMWOAuthRequestExpirationAge= 2592000;
$wgMWOAuthSecureTokenTransfer=false;
$wgOAuthSecretKey=null;
$wgOAuthGroupsToNotify=[];
$wgMWOauthDisabledApiModules=[];
$wgMWOAuthReadOnly=false;
$wgMWOAuthSessionCacheType=$wgSessionCacheType;
$wgOAuth2EnabledGrantTypes = [
    "authorization_code",
    "refresh_token",
    "client_credentials"
    ];
$wgOAuth2PrivateKey = "";
$wgOAuth2PublicKey = "";
$wgOAuth2GrantExpirationInterval="PT1H";
$wgOAuth2RefreshTokenTTL="PT1M";

# The following statement is only used for Semantic MediaWiki 
enableSemantics();


wfLoadExtension( 'MW-OAuth2Client' );

# The following two lines contains information on Github's OAuth service. You will have to apply for your own information to get things to work.
$wgOAuth2Client['client']['id'] = "83698ede718fea93a79e";
$wgOAuth2Client['client']['secret'] = "290648a66406e1bb3c5655a96c34b62fac5e4e9a";

$wgOAuth2Client['configuration']['authorize_endpoint']     = 'https://github.com/login/oauth/authorize'; // Authorization URL
$wgOAuth2Client['configuration']['access_token_endpoint']  = 'https://github.com/login/oauth/access_token'; // Token URL
$wgOAuth2Client['configuration']['api_endpoint']           = 'https://api.github.com/user'; // URL to fetch user JSON
$wgOAuth2Client['configuration']['redirect_uri'] = "http://localhost:9352/index.php/Special:OAuth2Client/callback";
$wgOAuth2Client['configuration']['username'] = 'login'; // JSON path to username
$wgOAuth2Client['configuration']['email'] = 'email'; // JSON path to email
$wgOAuth2Client['configuration']['scopes'] = 'openid email profile'; //Permissions
$wgOAuth2Client['configuration']['service_name'] = 'Oauth Registry'; // the name of your service
$wgOAuth2Client['configuration']['service_login_link_text'] = 'Login through Github'; // the text of the login link

// remove login and logout buttons for all users
function StripLogin(&$personal_urls, &$wgTitle) {  
    unset( $personal_urls["login"] );
    # unset( $personal_urls["logout"] );
    unset( $personal_urls['anonlogin'] );
    return true;
}

$wgHooks['PersonalUrls'][] = 'StripLogin';

## 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 = "License"; # Set to the title of a wiki page that describes your license/copyright
$wgRightsIcon = "$wgResourceBasePath/resources/assets/by-sa.png";
$wgRightsUrl = 'https://creativecommons.org/licenses/by-sa/3.0/';
$wgRightsText = "a Creative Commons Attribution-NonCommercial-ShareAlike 3.0 License";

$wgHooks['BeforePageDisplay'][] = function( OutputPage &$out, Skin &$skin ) {
  $code = <<<HTML
<!-- Matomo -->
<script type="text/javascript">
  var _paq = window._paq = window._paq || [];
  /* tracker methods like "setCustomDimension" should be called before "trackPageView" */
  _paq.push(["setDocumentTitle", document.domain + "/" + document.title]);
  _paq.push(["setCookieDomain", "*.localhost"]);
  _paq.push(["setDomains", ["*.localhost"]]);
  _paq.push(['trackPageView']);
  _paq.push(['enableLinkTracking']);
  (function() {
    var u="//localhost:8080/";
    _paq.push(['setTrackerUrl', u+'matomo.php']);
    _paq.push(['setSiteId', '2']);
    var d=document, g=d.createElement('script'), s=d.getElementsByTagName('script')[0];
    g.type='text/javascript'; g.async=true; g.src=u+'matomo.js'; s.parentNode.insertBefore(g,s);
  })();
</script>
<noscript><p><img src="//localhost:8080/matomo.php?idsite=2&amp;rec=1" style="border:0;" alt="" /></p></noscript>
<!-- End Matomo Code -->
HTML;

  $out->addHeadItem( 'gtag-insert', $code );
  return true;
};

$wgGroupPermissions['user']['skipcaptcha'] = true;

// Semantic Result Format
wfLoadExtension( 'SemanticResultFormats' );

$srfgFormats = [
  'icalendar', 
  'vcard', 'bibtex', 'calendar', 
  'eventcalendar', 'eventline', 'timeline', 
  'outline', 'gallery', 'jqplotchart', 'jqplotseries', 
  'sum', 'average', 'min', 'max', 'median', 'product', 
  'tagcloud', 'valuerank', 'array', 
  'tree', 'ultree', 'oltree', 'd3chart', 'latest', 'earliest', 'filtered', 'slideshow', 'timeseries', 'sparkline', 
  'listwidget', 'pagewidget', 'dygraphs', 'media', 'datatables'
];