Development:Index: Difference between revisions

From COMP15212 Wiki
pc>Yuron
No edit summary
gravatar W81054ch [userbureaucratinterface-adminsysopPHRhYmxlIGNsYXNzPSJ0d3BvcHVwIj48dHI+PHRkIGNsYXNzPSJ0d3BvcHVwLWVudHJ5dGl0bGUiPkdyb3Vwczo8L3RkPjx0ZD51c2VyPGJyIC8+YnVyZWF1Y3JhdDxiciAvPmludGVyZmFjZS1hZG1pbjxiciAvPnN5c29wPGJyIC8+PC90ZD48L3RyPjwvdGFibGU+] (talk | contribs)
m (1 revision imported)
 
(4 intermediate revisions by 2 users not shown)
Line 22: Line 22:
**[[Special:Contents|Contents]] page
**[[Special:Contents|Contents]] page


*A simple custom extension, ShowWidget, is used to show a widget alone, for embedding in stuff outside of MediaWiki.
*A simple custom extension, [https://gitlab.cs.man.ac.uk/w81054ch/showwidget ShowWidget], is used to show a widget alone, for embedding in stuff outside of MediaWiki.
**This widget provides the special page [[Special:ShowWidget]], which requires an argument widget={widget name} to function properly
**This widget provides the special page [[Special:ShowWidget]], which requires an argument widget={widget name} to function properly


*The skin [https://www.mediawiki.org/wiki/Skin:Chameleon Chameleon] is used to provide a Bootstrap look to the wiki.
*The skin [https://www.mediawiki.org/wiki/Skin:Chameleon Chameleon] is used to provide a Bootstrap look to the wiki.
**'''The Bootstrap extension the Chameleon skin comes with does not include tooltip.js from Bootstrap. Replace line 68 in extensions/Bootstrap/src/Definition/V4ModuleDefinition with ''' <code> 'tooltip'          => [ 'styles' => 'tooltip', 'scripts' => 'tooltip.js', 'dependencies' => [ 'popper', 'js-util' ] ],> </code> ''' to fix this. This needs to be done every time Composer is used to update components, as this change would be overwritten.'''
**'''The Bootstrap extension the Chameleon skin comes with does not include tooltip.js from Bootstrap. Run the command ''' <code>sed -i "s/'styles' => 'tooltip',/& 'scripts' => 'tooltip.js',/" extensions/Bootstrap/src/Definition/V4ModuleDefinition.php</code> ''' from the Mediawiki base directory to fix this. This needs to be done every time Composer is used to update components, as this change would be overwritten.'''


== Migration ==
== Backup ==
#First, copy over the wiki installation, including the extensions, skin, and custom configurations in LocalSettings.php, or start from a fresh installation and append the needed extensions/configurations to LocalSettings.php afterwards.
To backup the contents of the wiki, one needs to obtain the page contents, as well as the media files.
#Second, migrate all pages in the wiki:
*To obtain the page backup, run  <code>php maintenance/dumpBackup.php --current > backup.xml</code>
##cd to the installation directory of MediaWiki.
*To obtain the media file backup, run the bespoke <code>exportImage.sh</code> script to obtain Mediafiles.zip.
##Run <code> php maintenance/dumpBackup.php --current > backup.xml </code> to dump all pages into backup.xml
<code>backup.xml</code> and <code>Mediafiles.zip</code> together comprise a full wiki content backup.
##Restore backup.xml with the special page Special:Import on the target server
 
##*Special:Import also requires an "interwiki prefix", which doesn't matter for a migration
== Re-installation ==
#Third, migrate all images:
#First, run <code>git clone https://gitlab.cs.man.ac.uk/w81054ch/operating-systems-wiki-installer.git .</code> (don't miss the <code>.</code> at the end!) in your MediaWiki installation directory to download the installation pack.
##Run the bespoke <code>exportImage.sh</code> on the source server to obtain MediaFiles.zip in the home directory
#*If the wiki had been edited since the last time that repository is updated, create the two backup files and overwrite the files in the cloned repository. Then, if possible, commit and push the new backups back to the repository.
##Copy MediaFiles.zip to ~/ (user directory) on the destination
#Then, simply run <code>./install.sh</code> to install the wiki, paying attention to the instructions or warnings that may appear.
##Run the bespoke importImage.sh on the destination to restore images
The <code>install.sh</code> should guide you through the rest of re-installation, including automatic restoration of backups.
#Lastly, refresh the extension databases with <code>php maintenance/update.php</code>, and refresh the Semantic Mediawiki database with <code> php extensions/SemanticMediaWiki/maintenance/rebuildData.php </code>


=== Further setup ===
=== Further setup ===
For the rating chart in Special:Profile to work properly, the values UDStartYear, UDStartMonth, UDStartDay, UDStartHour, UDEndWeek and UDVacationWeeks in extensions/UserDash/extension.json must be set to sensible values.
For the rating chart in Special:Profile to work properly, the values UDStartYear, UDStartMonth, UDStartDay, UDStartHour, UDEndWeek and UDVacationWeeks in extensions/UserDash/extension.json must be set to sensible values.

Latest revision as of 10:38, 28 August 2019

This page details information related to the development of this Mediawiki-driven website, serving as documentation for the code written for the wiki. For information regarding how to make use of this wiki's features once it's been set up, refer to Help:Index.

Extensions

  • Scribunto (Lua scripting) is used to provide:
    • Article dependencies (Lua is needed to support adding an arbitrary number of dependencies to a single box)
  • UserDash is the extension that drives most other features specific to this site, including:
    • Special:Profile, various graphs related to a user's progress through this wiki.
    • Special:Dashboard, a page directed towards guiding a user to their next page to read.
    • The rating and page tagging system
    • Page graphs, summoned by the </pagegraph> tag (though a separate template is used to actually include the pagegraph)
    • Contents page
  • A simple custom extension, ShowWidget, is used to show a widget alone, for embedding in stuff outside of MediaWiki.
    • This widget provides the special page Special:ShowWidget, which requires an argument widget={widget name} to function properly
  • The skin Chameleon is used to provide a Bootstrap look to the wiki.
    • The Bootstrap extension the Chameleon skin comes with does not include tooltip.js from Bootstrap. Run the command sed -i "s/'styles' => 'tooltip',/& 'scripts' => 'tooltip.js',/" extensions/Bootstrap/src/Definition/V4ModuleDefinition.php from the Mediawiki base directory to fix this. This needs to be done every time Composer is used to update components, as this change would be overwritten.

Backup

To backup the contents of the wiki, one needs to obtain the page contents, as well as the media files.

  • To obtain the page backup, run php maintenance/dumpBackup.php --current > backup.xml
  • To obtain the media file backup, run the bespoke exportImage.sh script to obtain Mediafiles.zip.

backup.xml and Mediafiles.zip together comprise a full wiki content backup.

Re-installation

  1. First, run git clone https://gitlab.cs.man.ac.uk/w81054ch/operating-systems-wiki-installer.git . (don't miss the . at the end!) in your MediaWiki installation directory to download the installation pack.
    • If the wiki had been edited since the last time that repository is updated, create the two backup files and overwrite the files in the cloned repository. Then, if possible, commit and push the new backups back to the repository.
  2. Then, simply run ./install.sh to install the wiki, paying attention to the instructions or warnings that may appear.

The install.sh should guide you through the rest of re-installation, including automatic restoration of backups.

Further setup

For the rating chart in Special:Profile to work properly, the values UDStartYear, UDStartMonth, UDStartDay, UDStartHour, UDEndWeek and UDVacationWeeks in extensions/UserDash/extension.json must be set to sensible values.