Skip to content

Instantly share code, notes, and snippets.

@sgimeno
Created January 11, 2022 10:02
Show Gist options
  • Save sgimeno/74837e5ce7223c7b3388b15e9ea170ed to your computer and use it in GitHub Desktop.
Save sgimeno/74837e5ce7223c7b3388b15e9ea170ed to your computer and use it in GitHub Desktop.
<?php
# This file was automatically generated by the MediaWiki 1.38.0-alpha
# 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 = "dev";
$wgMetaNamespace = "Dev";
## 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";
## The protocol and server name to use in fully-qualified URLs
$wgServer = "http://localhost:8080";
## 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/wiki.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 = "localhost";
$wgDBname = "my_wiki";
$wgDBuser = "root";
$wgDBpassword = "root";
# 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_MEMCACHED;
$wgMemCachedServers = [
"127.0.0.1:11211"
];
## To enable image uploads, make sure the 'images' directory
## is writable, then set this to true:
$wgEnableUploads = false;
#$wgUseImageMagick = true;
#$wgImageMagickConvertCommand = "/usr/bin/convert";
# InstantCommons allows wiki to use images from https://commons.wikimedia.org
$wgUseInstantCommons = true;
# 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 ./languages/data/Names.php
$wgLanguageCode = "en";
# Time zone
$wgLocaltimezone = "UTC";
## 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";
$wgSecretKey = "82fd83aa5c5cc1830c564232c6035125d3e08b6095443f7594bd044b390aff9b";
# 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 = "d0a81156d107a6ce";
## 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, e.g. 'vector' or 'monobook':
$wgDefaultSkin = "vector";
$wgVectorDefaultSkinVersion = 2;
# Enabled skins.
# The following skins were automatically enabled:
wfLoadSkin( 'MinervaNeue' );
wfLoadSkin( 'Vector' );
# 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( 'MobileFrontend' );
wfLoadExtension( 'PageViewInfo' );
# End of automatically generated settings.
# Add more configuration options below.
wfLoadExtension( 'Echo' );
wfLoadExtension( 'Elastica' );
wfLoadExtension( 'CirrusSearch' );
wfLoadExtension( 'GrowthExperiments' );
wfLoadExtension( 'VisualEditor' );
wfLoadExtension( 'EventLogging' );
wfLoadExtension( 'EventStreamConfig' );
wfLoadExtension( 'GuidedTour' );
wfLoadExtension( 'WikiEditor' );
wfLoadExtension( 'CodeEditor' );
$wgDefaultUserOptions['usebetatoolbar'] = 1; // user option provided by WikiEditor extension
$wgGEDeveloperSetup = true;
require_once "$IP/extensions/CirrusSearch/tests/jenkins/FullyFeaturedConfig.php";
$wgCirrusSearchServers = [ 'localhost' ];
$wgCirrusSearchWMFExtraFeatures = [
'weighted_tags' => [ 'build' => true, 'use' => true ]
];
//use GrowthExperiments\NewcomerTasks\AddImage\SubpageImageRecommendationProvider;
//use GrowthExperiments\NewcomerTasks\AddLink\SubpageLinkRecommendationProvider;
//use GrowthExperiments\NewcomerTasks\Task\Task;
//use GrowthExperiments\NewcomerTasks\TaskSuggester\StaticTaskSuggesterFactory;
//use GrowthExperiments\NewcomerTasks\TaskSuggester\TaskSuggesterFactory;
//use GrowthExperiments\NewcomerTasks\TaskType\ImageRecommendationTaskType;
//use GrowthExperiments\NewcomerTasks\TaskType\LinkRecommendationTaskType;
//use GrowthExperiments\NewcomerTasks\TaskType\TaskType;
//use MediaWiki\MediaWikiServices;
//
//$wgHooks['MediaWikiServices'][] = static function ( MediaWikiServices $services ) {
// $imageRecommendationTaskType = new ImageRecommendationTaskType(
// 'image-recommendation', GrowthExperiments\NewcomerTasks\TaskType\TaskType::DIFFICULTY_MEDIUM, []
// );
// $linkRecommendationTaskType = new LinkRecommendationTaskType(
// 'link-recommendation', TaskType::DIFFICULTY_EASY, []
// );
//
// # Mock the task suggester to specify what article(s) will be suggested.
// $services->redefineService(
// 'GrowthExperimentsTaskSuggesterFactory',
// static function () use (
// $imageRecommendationTaskType, $linkRecommendationTaskType, $services
// ): TaskSuggesterFactory {
// return new StaticTaskSuggesterFactory( [
// new Task( $imageRecommendationTaskType, new TitleValue( NS_MAIN, "Staple_right" ) ),
// new Task( $imageRecommendationTaskType, new TitleValue( NS_MAIN, "1886_in_Chile" ) ),
// new Task( $linkRecommendationTaskType, new TitleValue( NS_MAIN, 'Douglas Adams' ) ),
// new Task(
// $linkRecommendationTaskType, new TitleValue( NS_MAIN, "Santoshgad" )
// )
// ], $services->getTitleFactory() );
// }
// );
//};
//
//# Set up SubpageLinkRecommendationProvider, which will take the recommendation from the article's /addlink.json subpage,
//# e.g. [[Douglas Adams/addlink.json]]. The output of https://addlink-simple.toolforge.org can be copied there.
//$wgHooks['MediaWikiServices'][] = SubpageLinkRecommendationProvider::class . '::onMediaWikiServices';
//$wgHooks['ContentHandlerDefaultModelFor'][] =
// SubpageLinkRecommendationProvider::class . '::onContentHandlerDefaultModelFor';
//# Same for image recommendations, with addimage.json and http://image-suggestion-api.wmcloud.org/?doc
//$wgHooks['MediaWikiServices'][] = SubpageImageRecommendationProvider::class . '::onMediaWikiServices';
//$wgHooks['ContentHandlerDefaultModelFor'][] =
// SubpageImageRecommendationProvider::class . '::onContentHandlerDefaultModelFor';
# VisualEditor settings
$PARSOID_INSTALL_DIR = "$IP/vendor/wikimedia/parsoid";
wfLoadExtension( 'Parsoid', "$PARSOID_INSTALL_DIR/extension.json" );
// Enable VisualEditor
$wgDefaultUserOptions['visualeditor-enable'] = 1;
$wgVisualEditorNamespaces[] = NS_USER;
# Manually configure Parsoid
$wgVisualEditorParsoidAutoConfig = false;
$wgParsoidSettings = [
'useSelser' => true,
'rtTestMode' => false,
'linting' => false,
];
$wgVirtualRestConfig['modules']['parsoid'] = [];
$wgDefaultUserOptions['visualeditor-editor'] = "visualeditor";
# Logs settings
putenv("MW_LOG_DIR=$IP/logs");
$logDir = "$IP/logs";
if ( $logDir ) {
if ( $wgCommandLineMode ) {
$wgDebugLogFile = "$logDir/mw-debug-cli.log";
} else {
$wgDebugLogFile = "$logDir/mw-debug-www.log";
}
$wgDBerrorLog = "$logDir/mw-dberror.log";
$wgDebugLogGroups['ratelimit'] = "$logDir/mw-ratelimit.log";
$wgDebugLogGroups['error'] = "$logDir/mw-error.log";
$wgDebugLogGroups['exception'] = "$logDir/mw-error.log";
$wgDebugLogGroups['GrowthExperiments'] = [
'destination' => "$logDir/growthexperiments.log",
'level' => 'debug'
];
}
unset( $logDir );
# GE settings
# Newcomer tasks topics
$wgGENewcomerTasksTopicType = 'ores';
$wgGERestbaseUrl = 'https://en.wikipedia.org/api/rest_v1';
$wgGENewcomerTasksGuidanceEnabled = true;
# Link recommendations
$wgGELinkRecommendationServiceWikiIdMasquerade = "enwiki";
$wgGELinkRecommendationServiceAccessToken = 'eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiJ9.eyJhdWQiOiI4MmRiOGI5NzIxN2NmZGUzM2Y5MTEyYTllNDA3MTE5NiIsImp0aSI6ImFiOGUwNWNkYmQ1MzkxNTg3YjMzNWY1ZmRjOTZhZjA2NmE4MTY0ZGM3ODI5ZjYzMmIxOGRmZmMzYzc1OTQzZWUwZTI2NWYxMWFlZmMyMWU3IiwiaWF0IjoxNjMzOTU5NzE5LCJuYmYiOjE2MzM5NTk3MTksImV4cCI6MzMxOTA4Njg1MTksInN1YiI6IjY3Njk5MDI4IiwiaXNzIjoiaHR0cHM6XC9cL21ldGEud2lraW1lZGlhLm9yZyIsInJhdGVsaW1pdCI6eyJyZXF1ZXN0c19wZXJfdW5pdCI6NTAwMCwidW5pdCI6IkhPVVIifSwic2NvcGVzIjpbImJhc2ljIl19.oti9HVeMIX8uvAETnze0eza3GULfQW-DmMX_ey1wpwlzRC9hOwKaJx8HYGVa4xif-AsWtqTC1ojwf936Z2fzXzpAxlA0VKBTpG9ADmXaTFOwLQdYOg9cwSPL2Le26gW7qNGAaifOnsYFX4RwgKvTWVj_UGa_X9RmwQvRfohnhZQ4PdyIlxn0wkCd8nr3H4Y5EfGY41HxSJGmIZsnsokRWO4p3ZfiLo1NgD9A2uUtbx_QVW-PHtB_vkSvzHm8P0_rFdKFENNxpdzoIgLN8_3zWtexd31GAIAumrETeiTaJhUL1eXGjQjl9jQfnFgujxxlYwAZQWUtcv3BfLNqSN7-JfqTeeaMjP3SXHWOk3feRU35T-LAPc0WLtTTLXBNMAxkAW5EdwiJjRoxCqkFGkmh8HbVCifvISzINQ8wpNE-k1G2iJGKx-GvVfNBxasKt1bcsUSbKyUDE_MNLpcmy1zgwCWlZS_j90WLiWeiqgkrfeHy1cjpdxucJBvTYsmIVdjul18TizDfgUf7LjWAxnUUC7WUg9DjcCWv96M30wkF7D_1zTzNcebqQRZS-vAZp2WMMb4Q7hbOFlCQrvwkB6gEalsxa3FW-6TPiwqpNGVl_eenzrnszI0uzUdERbseTqmwXPyQURcg5c5HN5qWr5xDFSZ1qlvdKD8Vhw8WuyMZAvg';
$wgGELinkRecommendationServiceUrl = 'https://api.wikimedia.org/service/linkrecommendation';
// Set up service URL for images.
$wgGEImageRecommendationServiceUrl = 'https://image-suggestion-api.wmcloud.org';
// Use Commons as a foreign file repository.
$wgUseInstantCommons = true;
# EventLogging config
$wgEventLoggingServiceUri = 'http://localhost:8192/v1/events';
$wgEventLoggingQueueLingerSeconds = 1;
$wgEnableEventBus = 'TYPE_EVENT';
$wgEventServices = [
'eventbus' => [
'url' => 'http://localhost:8192/v1/events',
],
'eventgate-analytics-external' => [
'url' => 'http://localhost:8192/v1/events',
],
'eventgate' => [
'url' => 'http://localhost:8192/v1/events',
],
];
$wgEventGateServiceDefault = 'eventgate';
$wgEventLoggingStreamNames = false;
//$wgGECampaignPattern = '/^growth-JOSA-jan2021$/';
# $class = \GrowthExperiments\NewcomerTasks\AddLink\SubpageLinkRecommendationProvider::class;
# $wgHooks['MediaWikiServices'][] = "$class::onMediaWikiServices";
# $wgHooks['ContentHandlerDefaultModelFor'][] = "$class::onContentHandlerDefaultModelFor";
# Profiling setup
//$wgProfiler['class'] = 'ProfilerXhprof';
//$wgProfiler['output'] = [ 'ProfilerOutputText' ];
//$wgProfiler['visible'] = true;
$wgLocalisationCacheConf = [
'class' => LocalisationCache::class,
'store' => 'files',
'storeClass' => false,
'storeDirectory' => false,
'storeServer' => [],
'forceRecache' => false,
'manualRecache' => false,
];
$wgSessionCacheType = CACHE_MEMCACHED;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment