Page MenuHomePhabricator

change LocalSettings.php on a running system wikibase-docker
Closed, ResolvedPublic

Description

I have a running system that is based on the wikibase docker compose setup.

The system is currently open for editing to everyone by the default configuration. However, I would like to disable editing to anonymous users which means adding the related entries in the LocalSetting.php file

I see the following options, not sure which is the best one or if there is some better alternative

  1. change the file directly in the docker image
    • do the changes persist on restarting?
  2. use the LocalSettings.php.template Volume
    • what if there is one already defined? changing the file and restarting does not take effect as the volume is already mounted
  3. run a new clean setup and re-import

Also, a similar question for installing a new extension in the system

Event Timeline

Restricted Application added a subscriber: Aklapper. · View Herald Transcript
Addshore claimed this task.
Addshore subscribed.

I see the following options, not sure which is the best one or if there is some better alternative

change the file directly in the docker image
    do the changes persist on restarting?

If the container is removed, the changes will not persist.
You should not make changes you want to hang around inside the container by hand.
This is probably not what you want to do.

use the LocalSettings.php.template Volume
    what if there is one already defined? changing the file and restarting does not take effect as the volume is already mounted

This is indeed probably the file that you want to change (if you want the automatic environment substitution to happen).
The location of the file is documented in https://github.com/wmde/wikibase-docker/blob/master/wikibase/README.md
The file of course will already exist, and your file that you will use for the mount should be based on what is provided in the image.
When updating the image to a new version, lets say 1.31 to 1.32 it is possible that the template will change, and you should adopt and changes that you want into the template file you are replacing the default with.

To get rid of the old container and start a new container with the new mounts etc you can for example do:

docker-compose up --force-recreate -d <servicename>
run a new clean setup and re-import

That is probably not ideal, re import sounds like lots of work

Also, a similar question for installing a new extension in the system

If it is an extension that just needs code loaded, you could do that through and new volume mount and a change in localsettings.
Then recreating the container for mediawiki / wikibase.
You can see a blog post that I wrote on this topic at https://addshore.com/2018/06/customizing-wikibase-config-in-the-docker-compose-example/

You can also load the extension using a custom Dockerfile, and in theory here you can also provide your own custom Localsettings template.
You can read some more about that in https://addshore.com/2019/02/creating-a-dockerfile-for-the-wikibase-registry/

If your new extension requires database changes then you will need to run update.php for mediawiki yourself in a container.
The manual for that on mediawiki.org is at https://www.mediawiki.org/wiki/Manual:Update.php
You can read a blog post about walking through a situation like this in https://addshore.com/2019/01/wikibase-docker-mediawiki-wikibase-update/

I hope this answers your questions for now?

Addshore renamed this task from change LocalSettings.php on a running system to change LocalSettings.php on a running system wikibase-docker.Aug 27 2019, 6:20 PM

Thank you for your answer, it is quite detailed and clear