This repository contains the MediaWiki installation used by the Scratch Wikis.
- Latest Apache 2
- PHP version compatible with currently supported MediaWiki version
- Clone the repo:
# Or some other location; absolute path required
REPO=/home/user/web
git clone --recurse-submodules https://github.com/InternationalScratchWiki/wikis $REPO
cd $REPO
- Obtain a clone of
config/private. make- Configure your
%{DOCUMENT_ROOT}to point to$REPO/wiki. pushd config; for subdomain in */; do mkdir -p ../wiki/w/images/$subdomain ../cache/$subdomain; done; popd
Note that a local clone will always be a fork because your config/private repo will be different than production and your local does not use the same domain as production. You can never merge your fork into the base repository.
- Fork this repository on GitHub.
- Production step 1, replacing the GitHub URL with yours.
git remote add upstream https://github.com/InternationalScratchWiki/wikispushd config/private; git init; popd- Provide the following
config/privatefiles:CommonSettings.php- containing$swgDB,$wgUpgradeKey, and$wgSecretKey- see below.htaccess- containing any private Apache configuration, such asDeny fromrules
- Commit these files in both
config/privateand your fork. - (This is the annoying part) Change all references to
scratch-wikito your own domain (watch out for usages in regex). - Production steps 3 onwards.
<?php
$swgDB = [
'wiki-subdomain' => [
'name' => (used for $wgDBname),
'user' => (used for $wgDBuser),
'password' => (used for $wgDBpassword),
'prefix' => (used for $wgDBprefix),
'charset' => ('utf8' or 'binary'),
'uploadHashing' => (used for $wgHashedUploadDirectory),
],
...
]; // not immediately indexed; CS needs all of this for foreign file repos
$wgSecretKey = [
'wiki-subdomain' => (secret key),
...
][$wiki];
$wgUpgradeKey = [
'wiki-subdomain' => (upgrade key),
...
][$wiki];In the extremely infrequent event that a new wiki is to be added, the following must be done to support it:
- Add its subdomain to the
WIKISvariable inMakefileand then runmake. - Add rewrite rules to
.htaccessin the same format as those for existing wikis and then runmake. - Create its database and add its credentials to
config/private. - Generate its
$wgUpgradeKeyand$wgSecretKeyand add them toconfig/private.