nixpkgs/pkgs/servers/mattermost/default.nix
Thomas Gerbet 9d9fa00664 mattermost: 7.8.1 -> 7.8.3
Fixes CVE-2023-1831 / MMSA-2023-00146, MMSA-2023-00160 and MMSA-2023-00162.

Changelogs:
https://docs.mattermost.com/install/self-managed-changelog.html#release-v7-8-extended-support-release
2023-04-27 11:05:03 +02:00

56 lines
1.8 KiB
Nix

{ lib
, buildGoModule
, fetchFromGitHub
, fetchurl
, nixosTests
}:
buildGoModule rec {
pname = "mattermost";
version = "7.8.3";
src = fetchFromGitHub {
owner = "mattermost";
repo = "mattermost-server";
rev = "v${version}";
hash = "sha256-MJAYKBMQEf82YkDOpLHnL7Jxlz6i0K0B8E99pRxGHgc=";
};
webapp = fetchurl {
url = "https://releases.mattermost.com/${version}/mattermost-${version}-linux-amd64.tar.gz";
hash = "sha256-4VOEDrCKZI5HR5U2m49Dfbs5Mc+i8l4N41jIy8+5D1k=";
};
vendorHash = "sha256-VvGLYOESyoBpFmIibHWxazliHcscMxf3KcQ46NQ4syk=";
subPackages = [ "cmd/mattermost" ];
ldflags = [
"-s"
"-w"
"-X github.com/mattermost/mattermost-server/v6/model.Version=${version}"
"-X github.com/mattermost/mattermost-server/v6/model.BuildNumber=${version}-nixpkgs"
"-X github.com/mattermost/mattermost-server/v6/model.BuildDate=1970-01-01"
"-X github.com/mattermost/mattermost-server/v6/model.BuildHash=v${version}"
"-X github.com/mattermost/mattermost-server/v6/model.BuildHashEnterprise=v${version}"
"-X github.com/mattermost/mattermost-server/v6/model.BuildEnterpriseReady=false"
];
postInstall = ''
tar --strip 1 --directory $out -xf $webapp \
mattermost/{client,i18n,fonts,templates,config}
# For some reason a bunch of these files are executable
find $out/{client,i18n,fonts,templates,config} -type f -exec chmod -x {} \;
'';
passthru.tests.mattermost = nixosTests.mattermost;
meta = with lib; {
description = "Mattermost is an open source platform for secure collaboration across the entire software development lifecycle";
homepage = "https://www.mattermost.org";
license = with licenses; [ agpl3 asl20 ];
maintainers = with maintainers; [ ryantm numinit kranzes ];
};
}