3
0
Fork 0
forked from mirrors/nixpkgs
nixpkgs/pkgs/servers/web-apps/mediawiki/default.nix
Thomas Gerbet 571c050fc3 mediawiki: 1.35.1 -> 1.35.2
Fixes CVE-2021-30152, CVE-2021-30159, CVE-2021-30155 and CVE-2021-30458.

Release notes: https://www.mediawiki.org/wiki/Release_notes/1.35#Changes_since_MediaWiki_1.35.1
2021-04-10 09:43:53 +02:00

40 lines
1 KiB
Nix

{ lib, stdenv, fetchurl, makeWrapper, writeText }:
stdenv.mkDerivation rec {
pname = "mediawiki";
version = "1.35.2";
src = with lib; fetchurl {
url = "https://releases.wikimedia.org/mediawiki/${versions.majorMinor version}/${pname}-${version}.tar.gz";
sha256 = "07cch4j2lcncfjv71351c1fxh200p83g2ijb3c9x8rv6nzcmiymz";
};
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 = [ maintainers.redvers ];
};
}