I have a Synology NAS. It has a build of mediawiki that I installed as a app. In a recent upgrade, the “Visual Editor” feature within mediawiki stopped working. After doing some research, I discovered they only offer this as a non-supported add-on and is an old build. So I loaded Docker for Synology and tried to download and install the docker build for mediawiki using mariadb using both the official docker images hosted here using the latest builds of both. I was able to get the site running and following the guidelines others had posted on various other sites.
To my surprise, the Visual Editor still does not work and generates an error. Visual Editor = choose “Edit” on any wiki page… note the “source edit” or non-visual editor works. More research suggests this error seem related (in both cases, original Synology app and Docker version) to Parsoid and possibly when it transitioned from being based on JS to PHP.
Error:
I have rebuilt this image 2x with the same error. I have even tried some several years old suggestions of making changes to the ‘url’ setting for ‘parsoid’. Synology ‘hides’ the docker image, so you must port forward from the docker/synology nas port to the mediawiki port (nas/docker 8080 => mediawiki 80), but that seems fairly normal. I have tried http://localhost/rest.php, http://localhost:8080/rest.php, the same entries using my hostname, my host ip, and … nothing works.
This is an official docker image, I would think it would work “out of the box”. Can anyone suggest how I can fix this. I have looked all over for how to contact mediawiki and this seems to be the only way.
Is the visual editor extension the part of the official image or you need to install it? If it doesn’t come with a built-in visual editor, then it can be an issue with the editor itself.
To be honest, I don’t know. I believe the VisualEditor I believe is bundled as part of mediawiki by default. I only assume that it is part of the docker image. I know that at some point (around 2019 and mediawiki 1.35 or so) the VisualEditor software (parsoid) moved from being based in JS to PHP and it was my understanding that it was then part of the core build.
From mediawiki’s Parsoid page (Parsoid - MediaWiki):
" Parsoid (the PHP version) has been natively bundled with MediaWiki since version 1.35, released in September 2020."
I am not a programmer so I really don’t know for sure how to tell if it is included with the Docker image. It is such a core feature of Wiki, I would think so.
Parsoid is just a wikitext parser, not a visual editor.
I asked if you had to install it Sorry if I was not clear. Your response lets me think that you did not install anything just run the official image, but then how did you get the error message? On the other hand you wrote:
Sou you have built an image. Can you share the Dockerfile?
Clicking on “edit” just opens an HTML text area without any visual editor…
Have you installed mediawiki on your desktop to see if it works?
Sorry, don’t know how to upload images. I had a screen capture of that error and that led me to Parsoid. The error is:
Error contacting the Parsoid/RESTBase server: (curl error: 7) Couldn’t connect to the server
I did look at the MediaWiki page on Extension:VisualEditor and that and the error led me to Parsoid. But maybe that is wrong. Here is from that page ( ):
The VisualEditor extension allows for editing pages as rich content. There is also a project of the same name aiming to create a reliable rich-text editor for the Web and for MediaWiki.
Before MediaWiki 1.35, the VisualEditor extension relied on a separate Parsoid parser service that needed to be installed and enabled in order to edit pages with it; this is now bundled with MediaWiki core.
When I say “built” the image, I am just downloading the official MariaDB and MediaWiki docker image on my NAS, then running through the steps to setup the database via the docker container install/configuration on my NAS and then doing the same for the MediaWiki container while also connecting the MariaDB database to it.
I got the Official MediaWiki image from here (can’t put more link as a new user …) on hub dot docker dot com) and used that as the basis for my Synology NAS docker configuration including ports and file/folders.
Got the Official MariaDB docker image from here too.
Clicking on “edit” just opens an HTML text area without any visual editor…
I click on “Edit” and get the error message above. A bar moves across the top and then the error pops up.
Have you installed mediawiki on your desktop to see if it works?
No, I suppose I can try that too.
I did it from the Synology web interface. There isn’t really a compose file. I did follow some directions that essentially do the compose file settings:
Also, may I ask for the exact synology model, as this image will not run on Disksations with a 3.x kernel.
Running a DS920+ with the latest 7.1 system and all apps are current, including Docker.
I can’t find the original site, but that was changed in my LocalSettings.php file for the Wiki and these are the comments that came with that suggestion:
$wgVirtualRestConfig['modules']['parsoid'] = array(
// URL to the Parsoid instance.
// You should change $wgServer to match the non-local host running Parsoid
// Note! This is a server to server URL (it must be valid within your VM/container)
// For a VM or docker this will probably be correct:
// 'url' => "http://localhost/rest.php",
// Orig: 'url' => $wgServer . $wgScriptPath . '/rest.php'
'url' => 'http://nas1:8080/rest.php',
// Parsoid "domain", see below (optional, rarely needed)
//'domain' => 'localhost',
);
DS920+ should be fine. It should already have a 4.x kernel, which works with the php random mumber generator. I guess the lack of compatiblity with Distkations that still use the 3.x kernel is the reason why they stopped supporting it.
I tried to set it up, just for the sake of it. At the bottom of the page where you register your admin user, there is a radio button to select if the extended installation should be perfomed or the installation should finish. The extended installation dialog allowed to select the VisualEditor.
Update: some words where missing.
Update2: is this the VisualEditor you are refering to?
Yes, that is the visual editor I am referring to. Did you use a Synology NAS? MariaDB setup with a container link or port?
Because I did the install on Synology NAS without any changes from default other on that advanced page except to choose the Visual Editor, as shown below and I got a new error. (On my other installs I changed a few other things like not making it an open wiki, but kept everything default here…)
I tried to upload the screenshots of my config screens, but it will only let me upload 1 picture. So here is the checkbox I made for the VisualEditor:
Nope, mine uses a 3.x kernel. This is why I know it doesn’t work for older models.
I took the very same compose file and run it directly on an Ubuntu 20.04 host - the same compose file is embedded in the dockerhub description of mediawiki.
I clicken on WikiEditor as well and on CodeEditor two. I enabled all three.
update: I just removed everything with docker-compose down -v, removed the mapping for the LocalSettings.php and started from scratch. This time I just picked the VisualEditor → the same ui element appears.
The nas could be overwhelmed. If many containers/apps run on a DS920+ then this might happen. To this day I am riddled why Synology boxes come with lightwight cpus. They recently started to change it for their 21+/22+ models, but some still use the old lightweight cpus.
Then you just configure the container, now I understand.
I was not patient indeed and I skipped that step. Now everything makes sense
Now I tried with the VisualEditor and got the same error message as @cbaker007 . I used Docker Desktop and forwarded port 8080 to 80, then I tried forwarding port 80 to port 80 so it is not about ports, but it does not happen only on a NAS. I still don’t know the reason of this message, I just wanted to let you know that I could reproduce it.
I found out why I got the same error. It looks like the solution you mention @cbaker007 still works, but for me it was an other variable.
First I installed the wiki using port 8080, then I did not install it again, just changed my compose file. By that time I had my LocalSettings.php with this content:
## The protocol and server name to use in fully-qualified URLs
$wgServer = "http://localhost:8080"
This is why I found the cause, because it redirected me to localhost:8080 in an other browser tab. I looked into the config file, removed the port to use port 80 and it worked. So I reinstalled the mediawiki again to comfirm my theory and indeed, mediawiki generates the file using the same port that we forward from the host, but the PHP code which wants to use curl (why???) cannot use that port.
When it was written in JavaScript, it was not a problem since it worked on the client side, but now after you generate the config file, you need to fix the port number.
It should work with the IP address of the NAS, but it would not work with the hostname “nas1” if it is not configured in a DNS server that Docker uses.
@rimelek I went back to my original setup and did as you suggested. My $wgServer was set to the name of my NAS (NAS1). NOTE: That is registered with my Synology NAS because it is running DNS for my network. Machines on my network can reach nas1 and I was accessing the Wiki using “nas1:8080”. That is what I was using to log in. But I think what you are saying is the docker host (mediawiki image) can’t resolve that name when trying to do an “Edit”, maybe due to the port forwarding/bridge network connection of docker…
Regardless, I changed my setting in my LocalSettings.php to the IP for my Synology NAS:
Was - $wgServer= “http://nas1:8080”
Changed to - $wgServer = “http://192.168.100.20:8080”
Rebooted my MediaWiki Docker Container and the VisualEditor (using “Edit”) WORKED!
I see, mine worked, because when the LocalSettings,php is downloaded after the installation, it renders the hostname and port into the configuration, Since mine was a remote docker host, of couse the remote ip and published port where correct. But, the same should be true if the container is instelled on a Syno, as a syno has no desktop to access the installer with “localhost”.
First, thank you for sharing that link to the guide on how to set up Mediawiki via Docker. I have been trying to figure that out for several weeks now and, like you, I’m not a programmer.
Second, when I finished the set up and downloaded the localsettings.php file, there is no folder for me to put it in? I’ve installed the DSM Package Center’s version of Mediawiki before and had no issue finding the appopriate location, but, having installed via Docker, I have gone through every Docker folder I have to no avail.
Did your base installation files end up in a weird place as well? If not, could you tell me where yours are so that I can verify whether I’ve messed up some part of the installation?
Third, I’m glad you were able to work out the Visual Editor problem. I noticed the same issue in another installation of Mediawiki on my Syn NAS. I look forward to trying your solution.
Yeah, this is brushed over and/or ignored on the web site I gave. Essentially in Docker, as I understand it, there are certain “Volumes” that the Docker Image (virtual machine) can “expose” to the Docker host. It is possible to create a local folder (or file in the case where a file is exposed, not a folder) and have the data in it be used by the VM instead of files stored inside the Docker image. So for example, you might want all the images uploaded to the Wiki to be stored on a folder in the NAS. This way if you move the Docker MediaWiki image, upgrade it to a newer version, etc. you don’t loose your data. (FYI: All the other MediaWiki data, text, is stored in the MariaDB.)
So you can create local folders (or files in some cases) that essentially are mapped to folders (or files) in the Docker image. In general these Docker folders/file must be setup in the Docker Image itself to be allowed to be exposed to the local host. Then you must manually map them to a local location to the exact name exposed by the Docker. So if you look at the MediaWiki official Docker page for the image, they say:
So it is possible to create a volume folder to map a local “images” folder to the Docker path of “/var/www/html/images” and a file to “/var/www/html/LocalSettings.php”. You need to setup this LocalSettings.php mapping in your NAS Docker interface. Then you can save your LocalSettings.php created by the MediaWiki when you first login, to this NAS folder. And you can edit this local file to make changes to your MediaWiki config.
So login to your MediaWiki for the first time. Go through the questions and generate a LocalSettings.php (download it). Log onto your Synology. In File Station, were you created folders for MariaDB (say a Docker share), create a new folder for “mediawiki-data” and one for “LocalSettings”. Open that new “LocalSettings” folder and upload your MediaWiki created LocalSettings.php file into that folder.
Open Synology Docker control panel. Stop the MediaWiki container. Highlight the MediaWiki container and choose Edit (to change the settings). Click on the Volume Settings and create Folder Mapping from your local “mediawiki-data” to “/var/www/html/images” and create a File Mapping from your local “LocalSettings\LocalSettings.php” file, with a Docker file named “/var/www/html/LocalSettings.php”.
Save, restart Docker container. You should be good. Can stop Docker container, edit local file, start Docker to make any changes going forward.