Skip to content

Instantly share code, notes, and snippets.

@WebPlatformDocs
Last active August 29, 2015 14:14
Show Gist options
  • Save WebPlatformDocs/e91bbfdc81dd85c2401a to your computer and use it in GitHub Desktop.
Save WebPlatformDocs/e91bbfdc81dd85c2401a to your computer and use it in GitHub Desktop.
Install MediaWiki Makefile

Installing WebPlatform Docs wiki locally

This gist gives instructions to recreate the exact configuration of WebPlatform Docs wiki.

Steps

  1. Clone MediaWiki Vagrant repo

  2. Follow the instructions

  3. Change the MediaWiki version branch in mediawiki/ folder to 1.25wmf15 (the version we upgraded on 2015-02-05

     git submodule deinit .
     git checkout -b 1.25wmf15-wpd -t origin/wmf/1.25wmf15
    
  4. Use the Makefile provided here, its in two steps

     make init
     make deps
    
  5. Paste the Settings.php file provided here in settings.d/ folder

SHELL := bash
init:
-sed -i "" -e"s#\/p\/#\/#g" .gitmodules
-git commit -am Fork
deps:
git submodule update --init --recursive
test -d extensions/NewSignupPage || git submodule add https://git.wikimedia.org/git/mediawiki/extensions/NewSignupPage extensions/NewSignupPage
test -d extensions/StringFunctionsEscaped || git submodule add https://git.wikimedia.org/git/mediawiki/extensions/StringFunctionsEscaped extensions/String
test -d extensions/LookupUser || git submodule add https://git.wikimedia.org/git/mediawiki/extensions/LookupUser extensions/LookupUser
test -d extensions/SemanticInternalObjects || git submodule add https://git.wikimedia.org/git/mediawiki/extensions/SemanticInternalObjects extensions/Sema
test -d extensions/SocialProfile || git submodule add https://git.wikimedia.org/git/mediawiki/extensions/SocialProfile extensions/SocialProfile
test -d extensions/AdminLinks || git submodule add https://git.wikimedia.org/git/mediawiki/extensions/AdminLinks extensions/AdminLinks
test -d extensions/WebPlatformSearchAutocomplete || git submodule add https://git.wikimedia.org/git/mediawiki/extensions/WebPlatformSearchAutocomplete ext
test -d extensions/ConfirmAccount || git submodule add https://git.wikimedia.org/git/mediawiki/extensions/ConfirmAccount extensions/ConfirmAccount
test -d extensions/WebPlatformMediaWikiExtensionBundle || git submodule add https://github.com/webplatform/mediawiki.git extensions/WebPlatformMediaWikiEx
test -d extensions/AccountRelier || git submodule add https://github.com/webplatform/mediawiki-fxa-sso.git extensions/AccountRelier
#patch -s -p1 --directory extensions/SocialProfile/ < patches/extensions/SocialProfile/changeset-disable-profile-avatar.patch
#patch -s -p1 --directory extensions/SocialProfile/ < patches/extensions/SocialProfile/forbid-edit-profile-if-email-not-confirmed.patch
# Get the patches here:
# - https://gerrit.wikimedia.org/r/#/c/187480/
# - https://gerrit.wikimedia.org/r/#/c/187482/
<?php
// in a mediawiki-vagrant clone instance
// copy contents in settings.d/settings.php
$siteTopLevelDomain = 'webplatform.local';
$wgDefaultRobotPolicy = 'noindex,nofollow';
## ref: http://www.mediawiki.org/wiki/Manual:$wgCanonicalServer
$wgServer = "http://docs.".$siteTopLevelDomain;
#require_once("$IP/extensions/BounceHandler/BounceHandler.php");
require_once("$IP/extensions/WebPlatformSearchAutocomplete/WebPlatformSearchAutocomplete.php"); #TODO, refactor
require_once("$IP/extensions/ContributionTracking/ContributionTracking.php");
#require_once("$IP/extensions/ConfirmAccount/ConfirmAccount.php");
####### trimmed down version below #####
require_once("$IP/extensions/CheckUser/CheckUser.php");
$wgGroupPermissions['sysop']['checkuser'] = true;
$wgGroupPermissions['sysop']['checkuser-log'] = true;
require_once("$IP/extensions/Renameuser/Renameuser.php");
require_once("$IP/extensions/SyntaxHighlight_GeSHi/SyntaxHighlight_GeSHi.php");
$wgSyntaxHighlightDefaultLang = "html5";
require_once("$IP/extensions/Cite/Cite.php");
require_once("$IP/extensions/WikiEditor/WikiEditor.php");
$wgDefaultUserOptions['usebetatoolbar'] = 1;
$wgDefaultUserOptions['usebetatoolbar-cgd'] = 1;
require_once("$IP/extensions/CategoryTree/CategoryTree.php");
require_once("$IP/extensions/Validator/Validator.php");
require_once("$IP/extensions/SemanticMediaWiki/SemanticMediaWiki.php");
enableSemantics('webplatform');
require_once("$IP/extensions/SemanticForms/SemanticForms.php");
$sfgRenameEditTabs = true;
require_once("$IP/extensions/SemanticResultFormats/SemanticResultFormats.php");
require_once("$IP/extensions/AdminLinks/AdminLinks.php");
require_once( "$IP/extensions/ConfirmEdit/ConfirmEdit.php" );
$wgCaptchaTriggers['edit'] = false;
$wgCaptchaTriggers['create'] = false;
$wgCaptchaTriggers['addurl'] = true;
$wgCaptchaTriggers['createaccount'] = true;
$wgCaptchaTriggers['badlogin'] = false;
#require_once( "$IP/extensions/ConfirmEdit/ReCaptcha.php" );
#$wgCaptchaClass = 'ReCaptcha';
#$wgReCaptchaPublicKey = 'a';
#$wgReCaptchaPrivateKey = 'b';
#$wgGroupPermissions['autoconfirmed']['skipcaptcha'] = true;
#$ceAllowConfirmedEmail = true;
#$wgAccountCreationThrottle = 6;
require_once( "$IP/extensions/SpamBlacklist/SpamBlacklist.php" );
$wgBlacklistSettings = array();
$wgBlacklistSettings['spam']['files'][] = "[[MediaWiki:Spam-blacklist]]";
$wgBlacklistSettings['spam']['files'][] = "https://meta.wikimedia.org/w/index.php?title=Spam_blacklist&action=raw&sb_ver=1";
require_once("$IP/extensions/Nuke/Nuke.php");
require_once("$IP/extensions/SubPageList3/SubPageList3.php");
require_once("$IP/extensions/SemanticInternalObjects/SemanticInternalObjects.php");
require_once("$IP/extensions/ParserFunctions/ParserFunctions.php");
$wgPFEnableStringFunctions = true; // Note: this must be after ParserFunctions and before StringFunctionsEscaped
require_once("$IP/extensions/StringFunctionsEscaped/StringFunctionsEscaped.php");
require_once("$IP/extensions/SocialProfile/SocialProfile.php"); # Make sure we applied mediawiki/patches/issue-19.path
$wgUserProfileDisplay['friends'] = true;
$wgUserProfileDisplay['foes'] = false;
$wgUserProfileDisplay['avatar'] = false;
$wgUserProfileThresholds['edits'] = $wgAutoConfirmCount;
$wgEmailConfirmToEdit = true;
require_once("$IP/extensions/NewSignupPage/NewSignupPage.php");
$wgRegisterTrack = true;
$wgUserStatsPointValues['referral_complete'] = 10;
$wgAutoAddFriendOnInvite = true;
$wgForceNewSignupPageInitialization = true;
require_once("$IP/extensions/cldr/cldr.php");
require_once("$IP/extensions/LookupUser/LookupUser.php");
$wgGroupPermissions['*']['lookupuser'] = false;
$wgGroupPermissions['sysop']['lookupuser'] = true;
require_once( "$IP/extensions/UserMerge/UserMerge.php" );
$wgGroupPermissions['bureaucrat']['usermerge'] = true;
require_once( "$IP/extensions/AbuseFilter/AbuseFilter.php" );
$wgGroupPermissions['sysop']['abusefilter-modify'] = true;
$wgGroupPermissions['*']['abusefilter-log-detail'] = true;
$wgGroupPermissions['*']['abusefilter-view'] = true;
$wgGroupPermissions['*']['abusefilter-log'] = true;
$wgGroupPermissions['sysop']['abusefilter-private'] = true;
$wgGroupPermissions['sysop']['abusefilter-modify-restricted'] = true;
$wgGroupPermissions['sysop']['abusefilter-revert'] = true;
require_once("$IP/extensions/WebPlatformMediaWikiExtensionBundle/main.php");
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment