Currently, the Wikibase docker distribution uses envsubst to render settings declared in environment variables from a template file into a single LocalSettings.php. If users do not like this, they have to provide their own LocalSettings.php and map it into the container.
There are several issues with this approach:
- The envsubst approach is rather exotic and requires the essential $ character in PHP to be escaped as ${DOLLAR}.
- Users that map their own LocalSettings.php need to make sure that it still contains all the settings made in the default file. This is especially crucial during version updates. Unfortunately, the source code for the default LocalSettings.php file is distributed across two docker containers (1, 2), wikibase base and bundle, and as described above pretty hard to parse and error-prone to adopt.
Instead, the default LocalSettings.php should be changed to read configuration settings via the standard PHP function getenv() and then load optional user-specific configuration from a directory. This would allow users to leave the default LocalSettings.php just as provided by the docker distribution. Instead of mapping a custom LocalSettings.php into the container, they would map a directory containing _additional_ configuration, for instance loading more extensions or skins.
Here is an example of how the official LocalSettings.php could look, as in use by Rhizome:
https://gist.github.com/despens/1fb618747488298f6f83ea9468661fd3
Additional configuration is loaded from a directory called LocalSettings.php.d—of course that could be named differently.
That directory is mapped into the container and holds the files 000_main.php, 100_namespaces.php,200_extensions-wikibase.php, 201_extensions-localmedia.php, 202_extensions-scribuntu.php, 203_extensions-geshi.php, 204_extensions-sendgrid.php, 205_extensions-visualeditor.php, 301_theming-rhizome.php, 400_permissions.php, 500_debugging.php — you get the idea.
This approach allows for the following mindblowing workflows:
- Users can upgrade Wikibase without having to weed through the default LocalSettings.php that is required for just basic operation, and compare it against their customized version.
- Should they need to examine the default file, it will be easily readable and they could copy lines verbatim from the git repository.
- On upgrades, users will benefit of new features being enabled and not accidentally miss the good stuff or end up with a misconfiguration.
- Different team members can focus on configuring specific parts of their Wikibase and not worry about the rest of the configuration.
- Version control will be improved.