Difference between revisions of "Parsoid installation"

From Biowikifarm Metawiki
Jump to: navigation, search
(Introduction and link to Visual Editor)
m (added category Visual Editor)
 
Line 48: Line 48:
 
If new wikis are added to the Biowikifarm in the future, they need to be added here as well, in order to work with the Visual Editor. After adding the corresponding line, parsoid needs to be restarted:  
 
If new wikis are added to the Biowikifarm in the future, they need to be added here as well, in order to work with the Visual Editor. After adding the corresponding line, parsoid needs to be restarted:  
 
  sudo service parsoid restart
 
  sudo service parsoid restart
 +
 +
[[Category:Visual Editor]]

Latest revision as of 11:59, 18 December 2018

This article describes how nodejs, parsoid and the VisualEditor extension were installed on the Biowikifarm, for future references. To enable the VisualEditor on any of the Biowikifarm wikis, see the page Visual Editor.

On 2018-12-13 new versions of nodejs and parsoid were installed to finally get the VisualEditor to work. There were some difficulties installing them, which will be documented here for future references.

Installing NodeJS

Parsoid requires at least NodeJS 6.0 but the installation candidate for debian was still the previously installed 0.10.29

According to the installation guide the following commands were required to install a newer version:

curl -sL https://deb.nodesource.com/setup_6.x | sudo bash -
sudo apt-get install -y nodejs

This however didn't work, as it still wanted to install the old package. The trick was to give the new source priority over the default one, by creating a file /etc/apt/preferences.d/nodejs with the content

Package: *
Pin: origin deb.nodesource.com
Pin-Priority: 1002

Afterwards nodejs could be installed with the proper version

sudo apt-get install -y nodejs
nodejs -v
    v6.15.0

Installin Parsoid

The following steps are the installation according to the Parsoid Setup Guide

sudo apt install dirmngr
sudo apt-key advanced --keyserver keys.gnupg.net --recv-keys 90E9F83F22250DD7
sudo apt-add-repository "deb https://releases.wikimedia.org/debian jessie-mediawiki main"
sudo apt-get install software-properties-common
echo "deb https://releases.wikimedia.org/debian jessie-mediawiki main" | sudo tee /etc/apt/sources.list.d/parsoid.list
sudo apt install apt-transport-https
sudo apt update && sudo apt install parsoid

This however did not work, as the package downloaded from the repository was damaged in the current version 0.10.0. An alternative was to install an older version of the package manually:

wget https://people.wikimedia.org/~ssastry/parsoid/debs/parsoid_0.8.0all_all.deb
sudo dpkg -i parsoid_0.8.0all_all.deb
sudo apt-get install -f

This worked.

Install VisualEditor Extension

This was already installed in the version that fits the biowikifarm with its current version of 1.26. It had previously been installed via the Extension Distributor and unzipped in /usr/share/mediawiki26/extensions-rich-features.

Configuring Parsoid

The parsoid configuration file is located at /etc/mediawiki/parsoid/settings.js. In order for a wiki to work with parsoid the wiki, the wiki API path has to be registered using a format like this:

parsoidConfig.setMwApi({ uri: 'https://biowikifarm.net/metawiki/api.php', domain: 'metawiki' }); 

All of the working wikis from the current version of the Member Wiki table have been added. The section called "domain" is always identical to $wgDBname, as this allows for easy enabling of the VisualEditor in different wikis, by just adding one line.

If new wikis are added to the Biowikifarm in the future, they need to be added here as well, in order to work with the Visual Editor. After adding the corresponding line, parsoid needs to be restarted:

sudo service parsoid restart