Parsoid/Setup/RESTBase

This page documents how to configure RESTBase to point at a local Parsoid instance.

This is intended for developers only. This does not describe production configuration of RESTBase.

Setting up a RESTBase storage backend
First you will need to set up a storage backend for RESTBase. When that is done, you'll need to configure RESTBase, Parsoid, and Visual Editor to point at each other.

Typical small installations
If you aren't Wikipedia, we recommend that you use the SQLite backend. Installation for that is described at https://github.com/wikimedia/restbase-mod-table-sqlite.

Large installations
Large installations can use Cassandra for scalable storage.

Tweaking Cassandra for testing
RESTBase can use Cassandra for backend storage. However, the default configuration of Cassandra (on Debian, at least) is more suited for production than local development. For example, Cassandra's default configuration attempts to consume between 800M and 4G of memory for its heap, which can be a substantial fraction of total memory available on a developer's local machine.

After installing Cassandra, I recommend making the following configuration changes to reduce its memory footprint.

Add the following to : (There are probably already commented-out lines in  defining these; uncomment the lines and tweak the values.)

Make the following changes to :

Pointing RESTBase at a local Parsoid
Checkout RESTBase and copy  to   inside the restbase directory, if you have not already done so.

In your  there is a clause like:

Do what the comment says to do; that is, change the  value to: parsoidHost: http://localhost:8000 Make sure the port matches the value of  set in   (or   if you have followed the developer setup instructions). The default port is 8142 if using the Debian/Ubuntu packages, and 8000 if running Parsoid from a source checkout.

Now you need to add a domain for your local wiki. In  there is a section like: You want to edit it to read: Note that the part after  must match the domain of the api.php endpoint of your local wiki.

If it does not, see the /Arbitrary domains page for configuration information.

There's another section like: If needed, edit the  here to match the URL of the api.php endpoint on your local wiki. For example, if your Parsoid  contains: Then you need:

The  endpoint is very flexible; you can perform some substitutions on the URL in order to configure a multiwiki setup. The above will work fine for a single wiki test instance; see /Arbitrary domains below for more complicated configurations.

You may also wish to change the default restbase port, in the  clause at the bottom of. RESTBase's starts up on port 7231 by default.

Note that RESTBase doesn't care what "prefix" Parsoid uses to describe your wiki (the first argument to ). It just cares about the domain part of the  URL, and both RESTBase, Parsoid, and the web server actually serving   must agree on this.

Configuring VisualEditor
Once https://gerrit.wikimedia.org/r/214351 is merged, configuring VisualEditor to point to your local RESTBase is easy!

Add the following to your : And, optionally, for direct access to the RESTBase server from client-side code: