From a59e9cb6ea3b526b58c38f91d61144567640cdf4 Mon Sep 17 00:00:00 2001 From: teutat3s Date: Mon, 8 Jan 2024 14:14:34 +0100 Subject: [PATCH 1/6] feat: update mediawiki to 1.41.0, enable extension TemplateStyles https://gerrit.wikimedia.org/g/mediawiki/core/%2B/REL1_41/RELEASE-NOTES-1.41 --- hosts/nachtigall/apps/mediawiki.nix | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/hosts/nachtigall/apps/mediawiki.nix b/hosts/nachtigall/apps/mediawiki.nix index 8445a79..532a9a2 100644 --- a/hosts/nachtigall/apps/mediawiki.nix +++ b/hosts/nachtigall/apps/mediawiki.nix @@ -114,6 +114,7 @@ wfLoadExtension('OpenIDConnect'); wfLoadExtension('PluggableAuth'); wfLoadExtension('VisualEditor'); + wfLoadExtension('TemplateStyles'); # End of automatically generated settings. # Add more configuration options below. @@ -207,7 +208,7 @@ in { backend = "docker"; containers."mediawiki" = { - image = "git.pub.solar/pub-solar/mediawiki-oidc-docker:latest"; + image = "git.pub.solar/pub-solar/mediawiki-oidc-docker:1.41.0"; user = "1000:${builtins.toString gid}"; autoStart = true; -- 2.44.1 From a7f98c2d45acb04f480a0882a74dacf28b5f40b1 Mon Sep 17 00:00:00 2001 From: teutat3s Date: Mon, 8 Jan 2024 14:35:43 +0100 Subject: [PATCH 2/6] fix: ensure mediawiki logo survives updates --- hosts/nachtigall/apps/mediawiki.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hosts/nachtigall/apps/mediawiki.nix b/hosts/nachtigall/apps/mediawiki.nix index 532a9a2..ab515a1 100644 --- a/hosts/nachtigall/apps/mediawiki.nix +++ b/hosts/nachtigall/apps/mediawiki.nix @@ -40,7 +40,7 @@ ## The URL path to the logo. Make sure you change this from the default, ## or else you'll overwrite your logo when you upgrade! - $wgLogo = "$wgResourceBasePath/resources/assets/wiki.png"; + $wgLogo = "https://pub.solar/assets/pubsolar.svg"; ## UPO means: this is also a user preference option -- 2.44.1 From 1c05fd39a445e1a0dd121b969779e7d1ceb5ea39 Mon Sep 17 00:00:00 2001 From: teutat3s Date: Mon, 8 Jan 2024 14:54:25 +0100 Subject: [PATCH 3/6] docs: how to update mediawiki wiki.pub.solar --- docs/mediawiki-updates.md | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 docs/mediawiki-updates.md diff --git a/docs/mediawiki-updates.md b/docs/mediawiki-updates.md new file mode 100644 index 0000000..4f49b6b --- /dev/null +++ b/docs/mediawiki-updates.md @@ -0,0 +1,31 @@ +# Updating mediawiki docker container + +See the [mediawiki-oidc-docker repository](https://git.pub.solar/pub-solar/mediawiki-oidc-docker#updating-the-docker-image) +for instructions on updating our customized mediawiki docker image. + +To deploy a new docker image to `nachtigall`, first bump the mediawiki version +of the docker image tag in `hosts/nachtigall/apps/mediawiki.nix` (search for +`image`). + +Next, push your changes to https://git.pub.solar and get them reviewed and +approved. + +After approval, create a fresh backup of the database and deploy the changes to +`nachtigall`: + +``` +ssh barkeeper@nachtigall.pub.solar +sudo -u postgres pg_dump --create -Fc mediawiki > mediawiki-db-$(date +%F).dump +exit +``` + +``` +deploy --targets '.#nachtigall' +``` + +Then, finalize the update by running the database migration script: +``` +ssh barkeeper@nachtigall.pub.solar +docker exec -it mediawiki bash +php maintenance/run.php update.php +``` -- 2.44.1 From 05f7dbe262a5e87c232b900fdeb2fc85629bf3da Mon Sep 17 00:00:00 2001 From: teutat3s Date: Mon, 8 Jan 2024 17:42:57 +0100 Subject: [PATCH 4/6] feat: enable wgUseInstantCommons https://commons.wikimedia.org/wiki/Commons:Reusing_content_outside_Wikimedia/technical#InstantCommons --- hosts/nachtigall/apps/mediawiki.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hosts/nachtigall/apps/mediawiki.nix b/hosts/nachtigall/apps/mediawiki.nix index ab515a1..77628ce 100644 --- a/hosts/nachtigall/apps/mediawiki.nix +++ b/hosts/nachtigall/apps/mediawiki.nix @@ -73,7 +73,7 @@ $wgImageMagickConvertCommand = "/usr/bin/convert"; # InstantCommons allows wiki to use images from https://commons.wikimedia.org - $wgUseInstantCommons = false; + $wgUseInstantCommons = true; # Periodically send a pingback to https://www.mediawiki.org/ with basic data # about this MediaWiki instance. The Wikimedia Foundation shares this data -- 2.44.1 From 1d018ade9ba1a2053dbd13edcdf0a66957c7d413 Mon Sep 17 00:00:00 2001 From: teutat3s Date: Mon, 8 Jan 2024 17:56:33 +0100 Subject: [PATCH 5/6] feat: enable InstantCommons https://www.mediawiki.org/wiki/InstantCommons https://commons.wikimedia.org/wiki/Commons:Reusing_content_outside_Wikimedia/technical#InstantCommons --- hosts/nachtigall/apps/mediawiki.nix | 1 + 1 file changed, 1 insertion(+) diff --git a/hosts/nachtigall/apps/mediawiki.nix b/hosts/nachtigall/apps/mediawiki.nix index 77628ce..4fe76f5 100644 --- a/hosts/nachtigall/apps/mediawiki.nix +++ b/hosts/nachtigall/apps/mediawiki.nix @@ -115,6 +115,7 @@ wfLoadExtension('PluggableAuth'); wfLoadExtension('VisualEditor'); wfLoadExtension('TemplateStyles'); + wfLoadExtension('QuickInstantCommons'); # End of automatically generated settings. # Add more configuration options below. -- 2.44.1 From 8d06c61d2f7d10090ed857836566a2b3fa5e81f1 Mon Sep 17 00:00:00 2001 From: teutat3s Date: Mon, 8 Jan 2024 17:56:48 +0100 Subject: [PATCH 6/6] fix: remove duplicate wgLogo setting --- hosts/nachtigall/apps/mediawiki.nix | 1 - 1 file changed, 1 deletion(-) diff --git a/hosts/nachtigall/apps/mediawiki.nix b/hosts/nachtigall/apps/mediawiki.nix index 4fe76f5..b48f03a 100644 --- a/hosts/nachtigall/apps/mediawiki.nix +++ b/hosts/nachtigall/apps/mediawiki.nix @@ -120,7 +120,6 @@ # End of automatically generated settings. # Add more configuration options below. - $wgLogo = "https://pub.solar/assets/pubsolar.svg"; $wgLogos = [ 'svg' => "https://pub.solar/assets/pubsolar.svg", 'icon' => "https://pub.solar/assets/pubsolar.svg", -- 2.44.1