Difference between revisions of "Parsoid installation"
m (added category Visual Editor) |
|||
(3 intermediate revisions by 2 users not shown) | |||
Line 1: | Line 1: | ||
− | + | 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 [https://www.mediawiki.org/wiki/Parsoid/Installing_Node 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 <code>/etc/apt/preferences.d/nodejs</code> 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 [https://www.mediawiki.org/wiki/Parsoid/Setup#Ubuntu_/_Debian 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 [https://www.mediawiki.org/wiki/Special:ExtensionDistributor/VisualEditor Extension Distributor] and unzipped in <code>/usr/share/mediawiki26/extensions-rich-features</code>. | ||
+ | |||
+ | == Configuring Parsoid == | ||
+ | The parsoid configuration file is located at <code>/etc/mediawiki/parsoid/settings.js</code>. 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 [https://biowikifarm.net/metawiki/index.php?title=Member_wikis&oldid=6303 current version of the Member Wiki table] have been added. The section called "domain" is always identical to <code>$wgDBname</code>, 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 | ||
+ | |||
+ | [[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.
Contents
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