From 3d3d4539e536895b77f253d7ad68177ce122c255 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rg=20Thalheim?= Date: Sat, 4 Nov 2023 18:46:19 +0100 Subject: [PATCH 1/2] wiki: fix owner after restoring database --- modules/nixos-wiki/backup.nix | 1 + 1 file changed, 1 insertion(+) diff --git a/modules/nixos-wiki/backup.nix b/modules/nixos-wiki/backup.nix index 7a57658..959a860 100644 --- a/modules/nixos-wiki/backup.nix +++ b/modules/nixos-wiki/backup.nix @@ -32,6 +32,7 @@ let systemctl stop phpfpm-mediawiki.service runuser -u postgres -- dropdb mediawiki systemctl restart postgresql + runuser -u postgres -- psql -c "ALTER DATABASE mediawiki OWNER TO mediawiki" systemctl restart mediawiki-init.service cat < Date: Sat, 4 Nov 2023 19:30:54 +0100 Subject: [PATCH 2/2] mediawiki: fix api --- ...Stream-write-add-missing-return-type.patch | 32 +++++++++++++++++++ modules/nixos-wiki/default.nix | 3 ++ 2 files changed, 35 insertions(+) create mode 100644 modules/nixos-wiki/0001-MWCallbackStream-write-add-missing-return-type.patch diff --git a/modules/nixos-wiki/0001-MWCallbackStream-write-add-missing-return-type.patch b/modules/nixos-wiki/0001-MWCallbackStream-write-add-missing-return-type.patch new file mode 100644 index 0000000..6f6da2f --- /dev/null +++ b/modules/nixos-wiki/0001-MWCallbackStream-write-add-missing-return-type.patch @@ -0,0 +1,32 @@ +From c88ac02c0ef24025f00d359e0bec96dbf2583357 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?J=C3=B6rg=20Thalheim?= +Date: Sat, 4 Nov 2023 18:28:03 +0000 +Subject: [PATCH] MWCallbackStream::write: add missing return type +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +PHP Fatal Error from line 49 of /nix/store/rh28r8z3fqnqlfmqf0yn3ka1laysw1cm-mediawiki-full-1.40.1/share/mediawiki/includes/http/MWCallbackStream.php: +Declaration of MWCallbackStream::write($string) must be compatible with Psr\Http\Message\StreamInterface::write(string $string): int + +Signed-off-by: Jörg Thalheim +--- + includes/http/MWCallbackStream.php | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/includes/http/MWCallbackStream.php b/includes/http/MWCallbackStream.php +index 3566019dcd6..c1bc911940b 100644 +--- a/includes/http/MWCallbackStream.php ++++ b/includes/http/MWCallbackStream.php +@@ -46,7 +46,7 @@ public function __construct( callable $cb ) { + $this->callback = $cb; + } + +- public function write( $string ) { ++ public function write( $string ): int { + return call_user_func( $this->callback, $this, $string ); + } + } +-- +2.42.0 + diff --git a/modules/nixos-wiki/default.nix b/modules/nixos-wiki/default.nix index e492810..b10e03e 100644 --- a/modules/nixos-wiki/default.nix +++ b/modules/nixos-wiki/default.nix @@ -23,6 +23,9 @@ nginx.hostName = config.services.nixos-wiki.hostname; uploadsDir = "/var/lib/mediawiki-uploads/"; passwordFile = config.sops.secrets."nixos-wiki".path; + package = pkgs.mediawiki.overrideAttrs (old: { + patches = [ ./0001-MWCallbackStream-write-add-missing-return-type.patch ]; + }); extensions.SyntaxHighlight_GeSHi = null; # provides tags extensions.ParserFunctions = null;