From d2a8c94d6b32b5088df0f8c89152ced028109515 Mon Sep 17 00:00:00 2001 From: Timo Tijhof Date: Fri, 10 Sep 2021 23:29:28 +0100 Subject: [PATCH] MediaWiki-Docker: Remove injection of MW_SCRIPT_PATH Injecting it does nothing other than break the wiki with 404 errors. The only thing that uses it is the install.sh script, which then one-time substitutes it in LocalSettings.php. It isn't used by the mount logic for /var/www/w, and it isn't used by the Apache config in the referenced Docker images either. While the injection is removed, I have kept the following two: 1. It is still set for the docker images so that the env variable can still be read, to allow new additions to the dev images to not have to hardcode it, and to perhaps one day actually support this. It seems useful to retain as abstraction layer from that perspective. 2. It is still part of the recommended `.env` file. For the same reason as the previous point, but not theoretical. Our test tools (Selenium, QUnit, fresh-node, etc.) all expect this env variable for discovery and those tools are not specific to MediaWiki-Docker so they need this indeed. After this change, there remains one weak link, which is someone copying the recommended .env file and then deciding to change MW_SCRIPT_PATH for some reason. What will happen is that the wiki continues to work and identify with "/w", and the only impact is that external tooling will look for their custom path, and not find a wiki there. Bug: T273529 Change-Id: I4aa71f8994810ea0fbe2950958097c223c88916c --- DEVELOPERS.md | 5 +++-- docker-compose.yml | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/DEVELOPERS.md b/DEVELOPERS.md index 2754939e23f..087876eaee0 100644 --- a/DEVELOPERS.md +++ b/DEVELOPERS.md @@ -129,7 +129,7 @@ docker-compose exec mediawiki php tests/phpunit/phpunit.php Run a single test: ```sh -docker-compose exec mediawiki php tests/phpunit/phpunit.php /path/to/test +docker-compose exec mediawiki php tests/phpunit/phpunit.php ./path/to/test ``` See [PHPUnit Testing][phpunit-testing] on MediaWiki.org for more help. @@ -186,7 +186,8 @@ If you need root on the container to install packages for troubleshooting, you can open a shell as root with `docker-compose exec --user root mediawiki bash`. -#### Using Extensions and Skins +#### Using extensions and skins + Using extensions and skins requires the extension or skin directory to exist in the appropriate folder within the core directory, or added as a volume in `docker-compose.override.yml` diff --git a/docker-compose.yml b/docker-compose.yml index 3d245e381f2..544b1c25bb4 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -16,7 +16,7 @@ services: environment: COMPOSER_CACHE_DIR: '/var/www/html/w/cache/composer' MW_SERVER: 'http://localhost:${MW_DOCKER_PORT:-8080}' - MW_SCRIPT_PATH: '${MW_SCRIPT_PATH:-/w}' + MW_SCRIPT_PATH: '/w' MW_DBPATH: '/var/www/html/w/cache/sqlite' MW_DBTYPE: 'sqlite' MW_LANG: 'en'