Mediawiki docker image with OIDC extension
Find a file
2025-02-13 16:24:50 +00:00
.forgejo/workflows ci: build and push in separate jobs, to only push new image 2025-02-13 15:56:46 +01:00
Dockerfile update mediawiki + extension to 1.43.0 2025-02-13 15:56:18 +01:00
README.md ci: build and push in separate jobs, to only push new image 2025-02-13 15:56:46 +01:00

Mediawiki docker image with OIDC extension

This image is based on the community maintained mediawiki docker image.

Currently used mediawiki extensions in this customized docker image:

Updating the docker image

Check for new releases of mediawiki and take a moment to read the release notes. For a good starting point, read the upgrading manual 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 by the community.

First, update the FROM image tag in the Dockerfile to the newest version, for example 1.41.0.

Then, update the tag in the .forgejo/workflows/build-image.yml script, so the container will get published with the new tag.

Next, download the newest version of each extension (matching the mediawiki docker image version, e.g. 1.41.0) ...

  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
  4. Language Extension Bundle download https://www.mediawiki.org/wiki/MediaWiki_Language_Extension_Bundle

... and replace the SHA256 hash in Dockerfile for each file by running:

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

NEW_LANGUAGE_EXTENSION_BUNDLE_HASH=$(sha256sum ~/Downloads/MediaWikiLanguageExtensionBundle-2024.07.tar.bz2 | cut -d " " -f1)
sed -i "s/LANGUAGE_EXTENSION_BUNDLE_SHA256SUM= *[^ ]*/LANGUAGE_EXTENSION_BUNDLE_SHA256SUM=${NEW_LANGUAGE_EXTENSION_BUNDLE_HASH}/" Dockerfile

After making your changes and testing them locally, run the following to trigger a CI build of the docker image.

To push a new image version, create a PR and after review and merge, the latest commit on the main branch will be build and pushed to the registry.

Remember to update the image tag version in .forgejo/workflows/push-image.yml

git add --update
git commit
git push

Local testing

Build the docker image locally to test your changes.

docker build --tag git.pub.solar/pub-solar/mediawiki-oidc-docker:test .
docker run --detach --rm --publish 8080:80 git.pub.solar/pub-solar/mediawiki-oidc-docker:test

# open http://localhost:8080 in your browser to test if mediawiki starts fine