Difference between revisions of "WikiServer - Getting VisualEditor working properly"

From The TinkerNet Wiki
Jump to navigation Jump to search
 
(4 intermediate revisions by the same user not shown)
Line 1: Line 1:
<span style="color:#e74c3c">[[mediawikiwiki:Parsing/Parser_Unification|'''<big>Note:</big>'''<big>  Apparently, This is being rolled into WikiMedia 1.35 by default.  '''w00t!!!'''</big>]]</span>
+
<span style="color:#e74c3c">'''<big>Note:</big>'''<big>  Apparently, This is being rolled into WikiMedia 1.35 by default.  '''w00t!!!'''</big></span>
  
==Installing VisualEditor (MediaWiki 1.34 or earlier...)==
+
==<s>Installing VisualEditor (MediaWiki 1.34 or earlier...)</s>==
<span style="color:#e74c3c">'''<big>Note:</big>'''  This is still a work in progress...  Multi-Wiki is a bit of a fail.</span>
+
<span style="color:#e74c3c"><s>'''<big>Note:</big>'''  This is still a work in progress...  Multi-Wiki is a bit of a fail.</s></span>
  
'''<big>"FUCK THIS...WAIT FOR 1.35!"</big>'''
+
'''<big><s>"F*** THIS...WAIT FOR 1.35!"</s></big>'''
  
[[mediawikiwiki:Extension:VisualEditor|Extension:VisualEditor]]
+
<s>(or carry on here if you really want to.  It'll work.  It's just fugly...)</s>
  
<u>'''''VisualEditor does not currently work with private wikis.  Supposedly, there are workarounds, but more research is needed.'''''</u>
+
[[mediawikiwiki:Extension:VisualEditor|<s>Extension:VisualEditor</s>]]
  
===Requirements===
+
<u>'''''<s>VisualEditor does not currently work with private wikis.  Supposedly, there are workarounds.</s>'''''</u>
  
*Parsoid 0.11.0
+
<u>'''''<s>Oh look!  The instructions below for 1.35 do work with 1.34...</s>'''''</u>
*Node.js 12
 
  
====Parsoid Install====
+
===<s>Requirements</s>===
https://www.mediawiki.org/wiki/Parsoid/Setup
 
  
*<code>sudo apt install dirmngr</code>
+
*<s>Parsoid 0.11.0</s>
*<code>sudo apt-key advanced --keyserver keys.gnupg.net --recv-keys AF380A3036A03444</code>
+
*<s>Node.js 12</s>
*<code>echo "deb <nowiki>https://releases.wikimedia.org/debian</nowiki> jessie-mediawiki main" | sudo tee /etc/apt/sources.list.d/parsoid.list</code>
 
*<code>sudo apt install apt-transport-https</code>
 
*<code>sudo apt update && sudo apt install parsoid</code>
 
*<code>sudo vim /etc/mediawiki/parsoid/config.yaml</code>
 
  
<u>'''''This will require further fuckery for the multi-wiki setup with private wiki!'''''</u>
+
====<s>Parsoid Install</s>====
 +
<s>https://www.mediawiki.org/wiki/Parsoid/Setup</s>
  
====VisualEditor Install====
+
*<code><s>sudo apt install dirmngr</s></code>
 +
*<code><s>sudo apt-key advanced --keyserver keys.gnupg.net --recv-keys AF380A3036A03444</s></code>
 +
*<code><s>echo "deb <nowiki>https://releases.wikimedia.org/debian</nowiki> jessie-mediawiki main" | sudo tee /etc/apt/sources.list.d/parsoid.list</s></code>
 +
*<code><s>sudo apt install apt-transport-https</s></code>
 +
*<code><s>sudo apt update && sudo apt install parsoid</s></code>
 +
*<code><s>sudo vim /etc/mediawiki/parsoid/config.yaml</s></code>
  
Find the current version via: [[mediawikiwiki:Special:ExtensionDistributor/VisualEditor|Download MediaWiki extension]]
+
<u>'''''<s>This will require further fuckery for the multi-wiki setup with private wiki!</s>'''''</u>
  
*<code>wget <nowiki>https://extdist.wmflabs.org/dist/extensions/VisualEditor-REL1_34-74116a7.tar.gz</nowiki></code>
+
====<s>VisualEditor Install</s>====
**'''This URL will change!'''
 
*<code>tar -xzf VisualEditor-REL1_34-74116a7.tar.gz</code>
 
*<code>sudo rsync -av VisualEditor /var/www/html/wiki/extensions</code>
 
*<code>sudo vim /var/www/html/wiki/LocalSettings.php</code>
 
  
  wfLoadExtension( 'VisualEditor' );
+
<s>Find the current version via: [[mediawikiwiki:Special:ExtensionDistributor/VisualEditor|Download MediaWiki extension]]</s>
 +
 
 +
*<code><s>wget <nowiki>https://extdist.wmflabs.org/dist/extensions/VisualEditor-REL1_34-74116a7.tar.gz</nowiki></s></code>
 +
**'''<s>This URL will change!</s>'''
 +
*<code><s>tar -xzf VisualEditor-REL1_34-74116a7.tar.gz</s></code>
 +
*<code><s>sudo rsync -av VisualEditor /var/www/html/wiki/extensions</s></code>
 +
*<code><s>sudo vim /var/www/html/wiki/LocalSettings.php</s></code>
 +
 
 +
  <s>wfLoadExtension( 'VisualEditor' );
 
  // Enable by default for everybody
 
  // Enable by default for everybody
 
  $wgDefaultUserOptions['visualeditor-enable'] = 1;
 
  $wgDefaultUserOptions['visualeditor-enable'] = 1;
Line 55: Line 59:
 
         // Parsoid "prefix", see below (optional)
 
         // Parsoid "prefix", see below (optional)
 
         'prefix' => 'localhost'
 
         'prefix' => 'localhost'
  );
+
  );</s>
 
 
===Multiple Wiki Configuration===
 
  
 +
===<s>Multiple Wiki Configuration</s>===
  
Repeat the parts above where stuff is done in the /wiki/ folder
+
<s>Repeat the parts above where stuff is done in the /wiki/ folder</s>
  
(but use the folder for your second wiki... duh...)
+
<s>(but use the folder for your second wiki... duh...)</s>
  
*<code>sudo vim /etc/mediawiki/parsoid/config.yaml</code>
+
*<code><s>sudo vim /etc/mediawiki/parsoid/config.yaml</s></code>
  
  mwApis:
+
  <s>mwApis:
 
      - # This is the only required parameter,
 
      - # This is the only required parameter,
 
        # the URL of you MediaWiki API endpoint.
 
        # the URL of you MediaWiki API endpoint.
Line 75: Line 78:
 
        uri: '<nowiki>http://labnotes.tinkernow.net/api.php'</nowiki>
 
        uri: '<nowiki>http://labnotes.tinkernow.net/api.php'</nowiki>
 
        domain: 'notes'
 
        domain: 'notes'
       prefix: 'notes'
+
       prefix: 'notes'</s>
  
*<code>sudo service parsoid restart</code>
+
*<code><s>sudo service parsoid restart</s></code>
*<code>sudo vim /var/www/html/wiki/LocalSettings.php</code>
+
*<code><s>sudo vim /var/www/html/wiki/LocalSettings.php</s></code>
  
  wfLoadExtension( 'VisualEditor' );
+
  <s>wfLoadExtension( 'VisualEditor' );
 
   
 
   
 
  // Enable by default for everybody
 
  // Enable by default for everybody
Line 97: Line 100:
 
   
 
   
 
  $wgVirtualRestConfig['modules']['parsoid'] = array(
 
  $wgVirtualRestConfig['modules']['parsoid'] = array(
#      'url' => '<nowiki>http://wiki.tinkernow.net:8142'</nowiki>,
 
 
         'url' => '<nowiki>http://localhost:8142'</nowiki>,
 
         'url' => '<nowiki>http://localhost:8142'</nowiki>,
 
         'domain' => 'wiki',
 
         'domain' => 'wiki',
 
         'prefix' => 'wiki'
 
         'prefix' => 'wiki'
  );
+
  );</s>
  
*<code>sudo vim /var/www/html/notes/LocalSettings.php</code>
+
*<code><s>sudo vim /var/www/html/notes/LocalSettings.php</s></code>
  
  wfLoadExtension( 'VisualEditor' );
+
  <s>wfLoadExtension( 'VisualEditor' );
 
   
 
   
 
  // Enable by default for everybody
 
  // Enable by default for everybody
Line 125: Line 127:
 
         'url' => '<nowiki>http://localhost:8142'</nowiki>,
 
         'url' => '<nowiki>http://localhost:8142'</nowiki>,
 
         'domain' => 'notes',
 
         'domain' => 'notes',
         'prefix' => 'notes',
+
         'prefix' => 'notes'
        'forwardCookies' => true
+
  );</s>
  );
 
  
 
==VisualEditor on MediaWiki 1.35 or newer==
 
==VisualEditor on MediaWiki 1.35 or newer==
Line 143: Line 144:
 
#*(details coming...)
 
#*(details coming...)
 
#*Download the extension (do this ON the server...):
 
#*Download the extension (do this ON the server...):
#*For version 1.34
+
#*<s>For version 1.34</s>
#**<code><nowiki>wget https://extdist.wmflabs.org/dist/extensions/NetworkAuth-REL1_34-68393b9.tar.gz</nowiki></code>
+
#**<code><s>wget <nowiki>https://extdist.wmflabs.org/dist/extensions/NetworkAuth-REL1_34-68393b9.tar.gz</nowiki></s></code>
 
#*For version 1.35
 
#*For version 1.35
 
#**<code><nowiki>wget https://extdist.wmflabs.org/dist/extensions/NetworkAuth-REL1_35-9f2e881.tar.gz</nowiki></code>
 
#**<code><nowiki>wget https://extdist.wmflabs.org/dist/extensions/NetworkAuth-REL1_35-9f2e881.tar.gz</nowiki></code>
 
#**(You may need to find the latest or possibly correct version at some point...)
 
#**(You may need to find the latest or possibly correct version at some point...)
 
#*Copy it into your Private Wiki:
 
#*Copy it into your Private Wiki:
#**<code>tar -xzf NetworkAuth-*.tar.gz -C /var/www/privatewiki/extensions</code>
+
#**<code>sudo tar -xzf NetworkAuth-*.tar.gz -C /var/www/privatewiki/extensions</code>
 
#**(do adjust for the ACTUAL root of your wiki...)
 
#**(do adjust for the ACTUAL root of your wiki...)
 
#Create a user named "'''parsoid'''" on your wiki.
 
#Create a user named "'''parsoid'''" on your wiki.

Latest revision as of 14:49, 26 September 2020

Note:  Apparently, This is being rolled into WikiMedia 1.35 by default. w00t!!!

Installing VisualEditor (MediaWiki 1.34 or earlier...)

Note:  This is still a work in progress...  Multi-Wiki is a bit of a fail.

"F*** THIS...WAIT FOR 1.35!"

(or carry on here if you really want to. It'll work. It's just fugly...)

Extension:VisualEditor

VisualEditor does not currently work with private wikis. Supposedly, there are workarounds.

Oh look! The instructions below for 1.35 do work with 1.34...

Requirements

  • Parsoid 0.11.0
  • Node.js 12

Parsoid Install

https://www.mediawiki.org/wiki/Parsoid/Setup

  • sudo apt install dirmngr
  • sudo apt-key advanced --keyserver keys.gnupg.net --recv-keys AF380A3036A03444
  • 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
  • sudo vim /etc/mediawiki/parsoid/config.yaml

This will require further fuckery for the multi-wiki setup with private wiki!

VisualEditor Install

Find the current version via: Download MediaWiki extension

  • wget https://extdist.wmflabs.org/dist/extensions/VisualEditor-REL1_34-74116a7.tar.gz
    • This URL will change!
  • tar -xzf VisualEditor-REL1_34-74116a7.tar.gz
  • sudo rsync -av VisualEditor /var/www/html/wiki/extensions
  • sudo vim /var/www/html/wiki/LocalSettings.php
wfLoadExtension( 'VisualEditor' );
// Enable by default for everybody
$wgDefaultUserOptions['visualeditor-enable'] = 1;
// Optional: Set VisualEditor as the default for anonymous users
// otherwise they will have to switch to VE
// $wgDefaultUserOptions['visualeditor-editor'] = "visualeditor";
// Don't allow users to disable it
$wgHiddenPrefs[] = 'visualeditor-enable';
// OPTIONAL: Enable VisualEditor's experimental code features
#$wgDefaultUserOptions['visualeditor-enable-experimental'] = 1;
$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' => 'localhost',
       // Parsoid "prefix", see below (optional)
       'prefix' => 'localhost'
);

Multiple Wiki Configuration

Repeat the parts above where stuff is done in the /wiki/ folder

(but use the folder for your second wiki... duh...)

  • sudo vim /etc/mediawiki/parsoid/config.yaml
mwApis:
    - # This is the only required parameter,
      # the URL of you MediaWiki API endpoint.
      uri: 'http://wiki.tinkernow.net/api.php'
      domain: 'wiki'
      prefix: 'wiki'
    - # and another MediaWiki
      uri: 'http://labnotes.tinkernow.net/api.php'
      domain: 'notes'
      prefix: 'notes'
  • sudo service parsoid restart
  • sudo vim /var/www/html/wiki/LocalSettings.php
wfLoadExtension( 'VisualEditor' );

// Enable by default for everybody
$wgDefaultUserOptions['visualeditor-enable'] = 1;

// Optional: Set VisualEditor as the default for anonymous users
// otherwise they will have to switch to VE
// $wgDefaultUserOptions['visualeditor-editor'] = "visualeditor";

// Don't allow users to disable it
$wgHiddenPrefs[] = 'visualeditor-enable';

// OPTIONAL: Enable VisualEditor's experimental code features
#$wgDefaultUserOptions['visualeditor-enable-experimental'] = 1;


$wgVirtualRestConfig['modules']['parsoid'] = array(
       'url' => 'http://localhost:8142',
       'domain' => 'wiki',
       'prefix' => 'wiki'
);
  • sudo vim /var/www/html/notes/LocalSettings.php
wfLoadExtension( 'VisualEditor' );

// Enable by default for everybody
$wgDefaultUserOptions['visualeditor-enable'] = 1;

// Optional: Set VisualEditor as the default for anonymous users
// otherwise they will have to switch to VE
// $wgDefaultUserOptions['visualeditor-editor'] = "visualeditor";

// Don't allow users to disable it
$wgHiddenPrefs[] = 'visualeditor-enable';

// OPTIONAL: Enable VisualEditor's experimental code features
#$wgDefaultUserOptions['visualeditor-enable-experimental'] = 1;

#$wgVirtualRestConfig['modules']['parsoid']['forwardCookies'] = true;

$wgVirtualRestConfig['modules']['parsoid'] = array(
       'url' => 'http://localhost:8142',
       'domain' => 'notes',
       'prefix' => 'notes'
);

VisualEditor on MediaWiki 1.35 or newer

Why yes... It IS rolled in.

Either enable it during setup or add

WfLoadExtension( 'VisualEditor' );

to the list in LocalSettings.php.

Enabling VisualEditor on a Private Wiki

  1. Install the NetworkAuth extension
    • (details coming...)
    • Download the extension (do this ON the server...):
    • For version 1.34
      • wget https://extdist.wmflabs.org/dist/extensions/NetworkAuth-REL1_34-68393b9.tar.gz
    • For version 1.35
      • wget https://extdist.wmflabs.org/dist/extensions/NetworkAuth-REL1_35-9f2e881.tar.gz
      • (You may need to find the latest or possibly correct version at some point...)
    • Copy it into your Private Wiki:
      • sudo tar -xzf NetworkAuth-*.tar.gz -C /var/www/privatewiki/extensions
      • (do adjust for the ACTUAL root of your wiki...)
  2. Create a user named "parsoid" on your wiki.
  3. Add the following to LocalSettings.php on your Private Wiki:
    • replace 127.0.0.1 with the actual IP address of your Wiki Server
require_once "$IP/extensions/NetworkAuth/NetworkAuth.php";
 $wgNetworkAuthUsers[] = [
        'iprange' => [ '127.0.0.1' ],
        'user'    => 'parsoid'
 ];
  1. enjoy