Hi there!
Initially, I wonder whether I should write this doubt in "VisualEditor/Installation on a shared host" discussion page or if in "Manual:Moving a wiki" discussion page, so I decided to post it here.
I'm having trouble in recreating the Parsoid app, to make the VisualEditor extension in my shared host works, and I really need your help to solve the issues.
Let me share more details: I have to change completely the domain of my wiki. In other words, if the url was www.a.com, now the url is www.b.com. Once the VisualEditor used to work regularly before this web address replacement, and as the parsoid setup needs to specify exactly the URL of api.php, I needed to recreate it on Heroku.
But, unfortunately, I tried to redid it several times, but no one works. In all cases I got this error: "apierror-visualeditor-docserver-http: HTTP 404"
Below, I'll redo in all the steps described in VisualEditor/Installation on a shared host (in real time, as I'm describing it here):
Part 1: Heroku.com
* Sign up with Heroku.com (ok)
* Create a new app (ok, in US region)
* Go to your app settings (ok)
* Scroll to the Buildpack section (ok)
* Add a new buildpack (ok)
* Select Node.js (ok and changes saved: "Your new buildpack configuration will be used when this app is next deployed.")
Part 2: Your local computer
* Install the Heroku Command Line Interface and log in (ok)
* Clone Parsoid with git clone https://gerrit.wikimedia.org/r/mediawiki/services/parsoid (ok)
* Enter the Parsoid directory you just created, for example with cd parsoid (ok)
* Edit the hidden file .gitignore and remove the lines config.yaml and composer.lock (ok)
* Create your config file by copying config.example.yaml and renaming it to config.yaml (ok)
* Edit the config.yaml file you just created by changing the example URI for the URL of your API, for example uri: 'http://www.mywiki.com/w/api.php' (ok - I tried with "http://" and without it too)
* If your wiki uses https, then uncomment the line strictSSL: false (my wiki has https, but it's not default - if you type "https" manually, it works, but if you consider only the regular rule, the website works only with http, so I didn't uncommented it)
* If the domain: 'localhost' line is uncommented, comment it (helps to avoid the "Invalid domain" error) (ok)
* Save the changes (ok)
* Add the Heroku remote to your git repo with heroku git:remote -a APPNAME (ok, and the message was "set git remote heroku to https://git.heroku.com/xxxxx.git" - xxxxx as the real appname.)
* Stage the edited config files for committing with git add . (ok, with no system reply)
* Commit your changes with git commit -am "Initial commit" (ok, and the message was "2 files changed, 111 insertions (+), 2 deletions (-) /// create mode 100644 config.yaml")
* Push and deploy your changes with git push heroku master (ok - below, all system messages)
Enumerating objects: 71991, done.
Counting objects: 100x (71991/71991), done.
Delta compression using up to 4 threads
Compressing objects: 100x (12548/12548), done.
Writing objects: 100x (71991/71991), 28.58 MiB : 121.00 KiB/s, done.
Total 71991 (delta 59004), reused 71813 (delta 58887), pack-reused 0
remote: Compressing source files... done.
remote: Building source:
remote:
remote: -----> Node.js app detected
remote:
remote: -----> Creating runtime environment
remote:
remote: NPM_CONFIG_LOGLEUEL=error
remote: NODE_ENV=production
remote: NODE_MODULES_CACHE=true
remote: NODE_VERBOSE=false
remote:
remote: -----> Installing binaries
remote: engines.node (package.json): unspecified
remote: engines.npm (package.json): unspecified (use default)
remote:
remote: Resolving node version 12.x...
remote: Downloading and installing node 12.16.3...
remote: Using default npm version: 6.14.4
remote:
remote: -----> Installing dependencies
remote: Installing node modules
remote:
remote: > unix-dgram@2.0.4 install /tmp/build_0609a9aSccfc940SS7b4f848139 b128/node_modules/unix-dgram
remote: > node-gyp rebuild
remote:
remote: make: Entering directory '/tmp/build_0609a9a5ccfc940557b418481398 128/node_modules/unix-dgram/build'
remote: CXX(target> Release/obj.target/unix_dgram/src/unix_dgram.o
remote: SOLINH_MODULatarget) Release/obj.target/unix_dgram.node
remote: COPY Release/unix_dgram.node
remote: make: Leaving directory '/tmp/build_0609a9a5ccfc940557b418481398b 28/node_modules/unix-dgram/build'
remote:
remote: > heapdum00.3.15 install /tmp/build_0609a9aSccfc940SS7b4f8481398 128/node_modules/heapdump
remote: > node-gyp rebuild
remote:
remote: make: Entering directory '/tmp/build_0609a9a5ccfc940557b418481398 128/node_modules/heapdump/build'
remote: CXX(target) Release/obj.target/addon/src/heapdump.o
remote: SOLINK_MODULE(target) Release/obj.target/addon.node
remote: COPY Release/addon.node
remote: make: Leaving directory '/tmp/build_0609a9a5ccfc940557b418481398b 28/node_modules/heapdump/build'
remote:
remote: > gc-statsG1.4.0 install /tmp/build_0609a9a5ccfc940557b4f8481398b 28/node_modules/gc-stats
remote: > node-pre-gyp install --fallback-to-build
remote:
remote: [gc-stats1] Success: "/tmp/build_0609a9a5ccfc940557b4f8481398b128/ ode_modules/gc-stats/build/gcstats/v1.4.0/Release/node-v72-linux-x64/gcstats.no e" is installed via remote
remote:
remote: > dtrace-provider80.8.8 install /tmp/build_0609a9aSccfc940SS7b4f8 81398b128/node_modules/dtrace-provider
remote: > node-gyp rebuild :: node suppress-error.js
remote:
remote: make: Entering directory '/tmp/build_0609a9a5ccfc940557b418481398 128/node_modules/dtrace-provider/build'
remote: TOUCH Release/obj.target/DTraceProviderStub.stamp
remote: make: Leaving directory '/tmp/build_0609a9a5ccfc940557b418481398b 28/node_modules/dtrace-provider/build'
remote:
remote: > core-jsG2.6.11 post install /tmp/build_0609a9a5ccfc940557b4f8481 98b128/node_modules/core-js
remote: > node -e "try(require('1'./postinstall')>catch(e){}"
remote:
remote: added 418 packages in 21.712s
remote:
remote: -----> Build
remote:
remote: -----> Caching build
remote: — node_modules
remote:
remote: -----> Pruning devDependencies
remote: removed 193 packages, updated 3 packages and audited 294 packages in 4.82s
remote:
remote: 3 packages are looking for funding
remote: run 'npm fund' for details
remote:
remote: found 3 low severity vulnerabilities
remote: run 'npm audit fix' to fix them, or 'npm audit' for details
remote:
remote: -----> Build succeeded!
remote: -----> Discovering process types
remote: Procfile declares types —> (none)
remote: Default types for buildpack —> web
remote:
remote: -----> Compressing...
remote: Done: 84.7M
remote: -----> Launching...
remote: Released v3
remote: https://xxxxx.herokuapp.com/ deployed to Heroku
remote:
remote: Verifying deploy... done.
To https://git.heroku.com/xxxxx.git
* [new branch] master —> master
* Visit https://APPNAME.herokuapp.com to verify that your Parsoid service works (it works! I got the message "Welcome to the Parsoid web service. See the API documentation on mediawiki.org.")
Part 3: Your wiki
* Download VisualEditor (don't forget to run git submodule update --init as explained in the link) (I have already VisualEditor installed, once I had modified the URL only, I didn't reinstall it)
* Add to your LocalSettings.php (I tried with the code below and the older code that I used earlier, but both without success):
wfLoadExtension( 'VisualEditor' );
$wgVisualEditorEnableWikitext = true;
$wgDefaultUserOptions['visualeditor-newwikitext'] = 1;
$wgDefaultUserOptions['visualeditor-enable'] = 1;
$wgDefaultUserOptions['visualeditor-editor'] = 'visualeditor';
$wgVirtualRestConfig['modules']['parsoid'] = [
'forwardCookies' => true,
'url' => 'https://xxxxx.herokuapp.com/'
];
(older code):
wfLoadExtension( 'VisualEditor' );
//Enable VisualEditor 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;
// Parsoid configuration
$wgVirtualRestConfig['modules']['parsoid'] = array(
// URL to the Parsoid instance
// Use port 8142 if you use the Debian package
// url must not end in a slash, otherwise it might give a 404 error
'url' => 'xxxxx.herokuapp.com',
// Parsoid "domain", see below (optional)
'domain' => 'localhost',
// Parsoid "prefix", see below (optional)
'prefix' => 'your prefix here', //no site fala pra por "localhost" também
//If you run a private wiki then you have to set the following variable to true:
'forwardCookies' => true
);
* Done! Visit your wiki, edit any page and save the changes to test it out! (unfortunately, it didnt works :( Again, I'm receiving the error "apierror-visualeditor-docserver-http: HTTP 404." )
Does anyone know what could be happening?
It's important to say that I use MW 1.33.0.
Thank you in advance for your help.