1e2c1b8372
https://lists.wikimedia.org/hyperkitty/list/mediawiki-announce@lists.wikimedia.org/message/YJNXKPV5Z56NSUQ4G3SXPDUIZG5EQ7UR/ Fixes: CVE-2022-28202, CVE-2022-22801, CVE-2022-28203, CVE-2022-28204
40 lines
1.0 KiB
Nix
40 lines
1.0 KiB
Nix
{ lib, stdenv, fetchurl, writeText }:
|
|
|
|
stdenv.mkDerivation rec {
|
|
pname = "mediawiki";
|
|
version = "1.37.2";
|
|
|
|
src = with lib; fetchurl {
|
|
url = "https://releases.wikimedia.org/mediawiki/${versions.majorMinor version}/${pname}-${version}.tar.gz";
|
|
sha256 = "sha256-WD8HS8r87BfaUBQqVvW7/eXDNml31h2RLX5W/Mo72hs=";
|
|
};
|
|
|
|
prePatch = ''
|
|
sed -i 's|$vars = Installer::getExistingLocalSettings();|$vars = null;|' includes/installer/CliInstaller.php
|
|
'';
|
|
|
|
phpConfig = writeText "LocalSettings.php" ''
|
|
<?php
|
|
return require(getenv('MEDIAWIKI_CONFIG'));
|
|
?>
|
|
'';
|
|
|
|
installPhase = ''
|
|
runHook preInstall
|
|
|
|
mkdir -p $out/share/mediawiki
|
|
cp -r * $out/share/mediawiki
|
|
cp ${phpConfig} $out/share/mediawiki/LocalSettings.php
|
|
|
|
runHook postInstall
|
|
'';
|
|
|
|
meta = with lib; {
|
|
description = "The collaborative editing software that runs Wikipedia";
|
|
license = licenses.gpl2Plus;
|
|
homepage = "https://www.mediawiki.org/";
|
|
platforms = platforms.all;
|
|
maintainers = with maintainers; [ ];
|
|
};
|
|
}
|