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
This commit is contained in:
Timo Tijhof 2021-09-10 23:29:28 +01:00 committed by DannyS712
parent 69a0352f38
commit d2a8c94d6b
2 changed files with 4 additions and 3 deletions

View file

@ -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`

View file

@ -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'