2023-11-15 20:37:39 +00:00
|
|
|
# Mediawiki docker image with OIDC extension
|
|
|
|
|
2024-01-08 13:08:44 +00:00
|
|
|
This image is based on the community maintained [mediawiki docker image](https://hub.docker.com/_/mediawiki).
|
|
|
|
|
|
|
|
Currently used mediawiki extensions in this customized docker image:
|
|
|
|
|
|
|
|
* [PluggableAuth](https://www.mediawiki.org/wiki/Extension:PluggableAuth)
|
|
|
|
* [OpenID_Connect](https://www.mediawiki.org/wiki/Extension:OpenID_Connect)
|
|
|
|
* [TemplateStyles](https://www.mediawiki.org/wiki/Extension:TemplateStyles)
|
|
|
|
|
2023-11-18 19:35:37 +00:00
|
|
|
### Updating the docker image
|
2024-01-08 13:08:44 +00:00
|
|
|
|
|
|
|
Check for [new releases of mediawiki](https://www.mediawiki.org/wiki/Download)
|
|
|
|
and take a moment to read the release notes. For a good starting point, read the
|
|
|
|
[upgrading manual](https://www.mediawiki.org/wiki/Manual:Upgrading)
|
|
|
|
though we use a very customized docker image and all steps necessary for
|
|
|
|
upgrading will be mentioned here. You should also check if the newest release
|
|
|
|
is already [published as a docker image](https://hub.docker.com/_/mediawiki)
|
|
|
|
by the community.
|
|
|
|
|
|
|
|
First, update the `FROM` image tag in the `Dockerfile` to the newest version,
|
|
|
|
for example `1.41.0`.
|
|
|
|
|
|
|
|
Next, download the newest version of each extension (matching the mediawiki docker
|
|
|
|
image version, e.g. `1.41.0`) and get the SHA256 hash for each file:
|
|
|
|
|
|
|
|
1. PluggableAuth download https://www.mediawiki.org/wiki/Special:ExtensionDistributor/PluggableAuth
|
|
|
|
2. OpenID_Connect download https://www.mediawiki.org/wiki/Special:ExtensionDistributor/OpenIDConnect
|
|
|
|
3. TemplateStyles download https://www.mediawiki.org/wiki/Special:ExtensionDistributor/TemplateStyles
|
|
|
|
|
|
|
|
```
|
|
|
|
NEW_PLUGGABLE_AUTH_HASH=$(sha256sum ~/Downloads/PluggableAuth-REL1_41-0273c84.tar.gz | cut -d " " -f1)
|
|
|
|
sed -i "s/PLUGGABLE_AUTH_SHA256SUM= *[^ ]*/PLUGGABLE_AUTH_SHA256SUM=${NEW_PLUGGABLE_AUTH_HASH}/" Dockerfile
|
|
|
|
|
|
|
|
NEW_OPENID_CONNECT_HASH=$(sha256sum ~/Downloads/OpenIDConnect-REL1_41-7aa039e.tar.gz | cut -d " " -f1)
|
|
|
|
sed -i "s/OPENID_CONNECT_SHA256SUM= *[^ ]*/OPENID_CONNECT_SHA256SUM=${NEW_OPENID_CONNECT_HASH}/" Dockerfile
|
|
|
|
|
|
|
|
NEW_TEMPLATE_STYLE_HASH=$(sha256sum ~/Downloads/TemplateStyles-REL1_41-a9dde29.tar.gz | cut -d " " -f1)
|
|
|
|
sed -i "s/TEMPLATE_STYLES_SHA256SUM= *[^ ]*/TEMPLATE_STYLES_SHA256SUM=${NEW_TEMPLATE_STYLE_HASH}/" Dockerfile
|
|
|
|
```
|
|
|
|
|
|
|
|
Copy the hash in the output of each command and paste it into the variables
|
|
|
|
`*_SHA256SUM` in `Dockerfile`, replacing the old hashes.
|
|
|
|
|
2023-11-18 19:35:37 +00:00
|
|
|
After making your changes and [testing them locally](#local-testing), run the
|
|
|
|
following to trigger a [CI build and push](https://git.pub.solar/pub-solar/mediawiki-oidc-docker/actions)
|
|
|
|
of the [docker image](https://git.pub.solar/pub-solar/mediawiki-oidc-docker/packages).
|
2024-01-08 13:08:44 +00:00
|
|
|
|
2023-11-18 19:35:37 +00:00
|
|
|
```
|
2024-01-08 13:08:44 +00:00
|
|
|
git add --update
|
2023-11-18 19:35:37 +00:00
|
|
|
git commit
|
|
|
|
git push
|
2023-11-15 20:37:39 +00:00
|
|
|
```
|
|
|
|
|
2023-11-18 19:35:37 +00:00
|
|
|
### Local testing
|
|
|
|
Build the docker image locally to test your changes.
|
2023-11-15 20:37:39 +00:00
|
|
|
```
|
2023-11-18 19:35:37 +00:00
|
|
|
docker build --tag git.pub.solar/pub-solar/mediawiki-oidc-docker:test .
|
2024-01-08 13:08:44 +00:00
|
|
|
docker run --detach --rm --publish 8080:80 git.pub.solar/pub-solar/mediawiki-oidc-docker:test
|
2023-11-18 19:35:37 +00:00
|
|
|
|
2024-01-08 13:08:44 +00:00
|
|
|
# open http://localhost:8080 in your browser to test if mediawiki starts fine
|
|
|
|
```
|