Page MenuHomePhabricator

Adopt VisualEditor in wiki.wikimedia.it
Closed, ResolvedPublic3 Estimated Story Points

Description

Several Wikimedia Italia members have expressed great interest in adopting VisualEditor in https://wiki.wikimedia.it/ and this task should describe the steps involved for this adoption.

NOTE: @Laurentius pointed out that there may be incompatibility issues between VisualEditor and the MediaWiki-extensions-Lockdown.

Related Objects

Event Timeline

valerio.bozzolan changed the task status from Open to Stalled.EditedDec 9 2020, 1:51 AM
valerio.bozzolan added a subscriber: Nemo_bis.

Bad news guys.

As mentioned by @Nemo_bis in the mailing list some time ago (right?) it really seems that the current implementation of VisualEditor is broken with private wikis. More precisely it's broken with whatever wiki needing some kind of user access permissions. And yes, we are affected by this, while https://wiki.wikimedia.it/ obviously needs to protect some contents and we cover this need with the Extension:Lockdown.

NOTE: I do not mean that adopting VisualEditor should be considered a security concern by default (more than enabling any other extension). I mean that the current implementation of VisualEditor will simply not work for our use case.
NOTE: Anyway it seems that VisualEditor would work for publicly available pages of https://wiki.wikimedia.it. I don't think it would make members happy to know it would explode on all other pages…

I've just shared some considerations about this issue and some possible approaches here:

For clarity, I'm closing this as Declined. There is currently no plan of allowing the re-enabling of the API on the wiki. It could be re-enabled only on a different wiki, i.e. a completely public (or completely public) wiki.

I agree that being the only semi-private wiki in the world with the Lockdown extension and VisualEditor is not feasible. Anyway, we can reopen this since T273607 makes us think we can just try to abandon Lockdown and do more steps.

I was able to install, adopt and use VisualEditor after playing with T310607: Try to migrate and upgrade wiki.wikimedia.it on server intreccio.

The wiki is still semi-private. It works since VisualEditor do internal loopback connections to itself passing user cookies.

Instructions to do tests are in T310607.

valerio.bozzolan claimed this task.

Yeeeeh!

I've just enabled this extension (that is bundled in our 1.35), in this way:

// Parsoid does connections to the local MediaWiki server
wfLoadExtension( 'Parsoid', 'vendor/wikimedia/parsoid/extension.json' );
$wgVirtualRestConfig['modules']['parsoid'] = [
   // TODO: SSL encryption is useless for loopback connections
   // this could be updated to "http://" only if the webserver will accept loopback connections
   // without redirecting to "https://".
   'url' => 'https://wiki.wikimedia.it/rest.php',

   // this is a semi-private wiki and loopback connections needs original cookies to access pages
   'forwardCookies' => true,
];

Maybe it's not necessary to set the cookie forwarding as true since now we do not use anymore the Lockdown extension and MediaWiki should guess that we are a semi-private wikis (since we use $wgWhitelistReadRegexp) if I understand well that part in the VisualEditor codebase. BTW let's keep for now.

It works also on big pages but sometime it goes on timeout:

Screenshot_2022_08_18_120412.png (821×1 px, 214 KB)

By the way, I don't think nobody should try to edit the homepage via VisualEditor. So let's don't care for now about these timeouts. Re-executing is enough to having it operational (maybe because on the second run the cache is filled).