User:Varnent/Dog food

From mediawiki.org

Over the years, I have been the system operator for a number of third-party MediaWiki installations. The longest running was WikiQueer, which will be relaunched in the coming year. However, it has been at least three years since I setup from scratch a complete MediaWiki installation for third-party usage. With this "eating our own dog food" page, I am attempting to document my experiences both for my own future reference and potentially for use by others as I install and setup WikiGreed from scratch.

Basics[edit]

At time of setup:

  • Ubuntu 18.04.3 (LTS) x64
  • MediaWiki 1.34.1
  • PHP 7.2.24
  • Apache
  • MySQL 5.7.29
  • ICU 60.2
  • Lua 5.1.5

Impressions[edit]

  • Setup of extensions during initial MediaWiki installation was much easier. A vast majority of the extensions I wanted to utilize were already in the package.
  • VisualEditor is usually an expected hurdle.
  • File upload problems are usually a surprise hurdle.
  • It is easy to overlook a lot of little things that align the end-user experience with that of Wikimedia projects.
  • There are SO MANY template to import from various Wikimedia projects of varying setups (Office Wiki is a handy cheat based on its simple setup). Would be handy if there was an auto updated package of templates and modules you could import for a designated set of basic and common wiki maintenance functions.
    • MBox
    • Copyrights
    • Documentation subpages
    • Reflist formatting
    • Takes approximately 350 pages to get basic wiki setup going
  • Things are not looking right out of the box when links are previewed in platforms - need to look into this.
  • Setting up email was a hassle. Not much support for TLS and other setups beyond basic SMTP.
  • Lack of support for OpenGraph is frustrating.
  • Installing Flow was a bad idea on my part.
    • Broke search when it went to rebuild the index.
    • Removed the two Topic: entries from database fixed the problem - as did reinstalling the extension as a temporary fix.
  • Parser functions do not work in the sidebar - which seems odd given other elements do.
    • This can be achieved using MediaWiki message pages.
  • Setting up Citoid proved more challenging than Parsoid and ultimately wound up using Wikimedia's service.
    • Following on-wiki documentation resulted in nonspecific errors and commands to files that did not exist.
  • All available CAPTCHA solutions are problematic.
    • Will need to investigate adapting Google Analytics extension to work with hCaptcha.

Problems[edit]

VisualEditor[edit]

  • Getting Parsoid to work within Terminal was not too challenging. Getting it linked with VisualEditor was a lot of trial and error. Final coding:
$wgVirtualRestConfig['modules']['parsoid'] = array(
    // URL to the Parsoid instance
    // Use port 8142 if you use the Debian package
    'url' => 'http://localhost:8142',
    // Parsoid "domain", see below (optional)
    'domain' => 'wikigreed.org',
);
  • Problems getting editors to display for everyone as expected. Final coding:
$wgDefaultUserOptions['visualeditor-enable'] = 1;
$wgDefaultUserOptions['visualeditor-newwikitext'] = 1;
$wgVisualEditorEnableWikitext = true;

Uploads[edit]

  • Getting errors at first. Solution was playing around with CHMOD and CHOWN settings as well as this setup (note that the use of 'upload' is just my own personal oddness):
$wgUploadDirectory = "$IP/uploads";
$wgUploadPath = "$wgServer/w/uploads";

Citoid[edit]

Getting the automatic feature of Citoid working was a trick. I missed the need to import this page: MediaWiki:Citoid-template-type-map.json, and final coding:

wfLoadExtension( 'Citoid' );
$wgCitoidFullRestbaseURL = 'https://en.wikipedia.org/api/rest_';

Easy to overlook[edit]

These are things which were easy to overlook:

  • Testing file uploads
  • Setting up and testing email sending
  • Hiding database password further in server
  • All of the other custom settings already default on Wikimedia wikis - for things like custom CSS for users, etc.

Customizations[edit]

Extensions[edit]

I installed these extensions, which were not include with the MediaWiki tar build:

Settings[edit]

Visual Editor[edit]

$wgVirtualRestConfig['modules']['parsoid'] = array(
    // URL to the Parsoid instance
    // Use port 8142 if you use the Debian package
    'url' => 'http://localhost:8142',
    // Parsoid "domain", see below (optional)
    'domain' => 'wikigreed.org',
);
// Enable by default for everybody
$wgDefaultUserOptions['visualeditor-enable'] = 1;
$wgDefaultUserOptions['visualeditor-newwikitext'] = 1;
$wgVisualEditorAvailableNamespaces = [
    "Help" => true,
    "Project" => true
];
$wgVisualEditorEnableWikitext = true;

File uploads[edit]

$wgEnableUploads  = true;
$wgFileExtensions = [ 'png', 'gif', 'jpg', 'jpeg', 'webp', 'svg', 'pdf' ];
$wgSVGConverter = 'rsvg';
$wgUploadDirectory = "$IP/uploads";
$wgUploadPath = "$wgServer/w/uploads";
$wgUseImageMagick = true;

Short URL[edit]

$wgScriptPath = "/w";
$wgScriptExtension = ".php";
$wgArticlePath = "/wiki/$1";

Citoid[edit]

$wgCitoidFullRestbaseURL = 'https://en.wikipedia.org/api/rest_';

Additional settings[edit]

$wgNoFollowDomainExceptions = array( 'wikipedia.org', 'wikimedia.org' );
$wgAllowUserCss = true;
$wgAllowUserJs = true;
$wgAllowHTMLEmail = true;
$wgGroupPermissions['sysop']['deletelogentry'] = true;
$wgGroupPermissions['sysop']['deleterevision'] = true;
$wgAppleTouchIcon = "/w/uploads/thumb/0/0b/WikiGreed_logo_-_white_background.svg/152px-WikiGreed_logo_-_white_background.svg.png";
$wgInvalidUsernameCharacters = '@:$£₾₽₺₴#€';
$wgLocaltimezone = "UTC";
date_default_timezone_set( $wgLocaltimezone );
$wgArticleCountMethod = 'any';
$wgNamespacesWithSubpages[NS_MAIN] = true;

MediaWiki.org pages utilized[edit]