Merge pull request #69125 from jslight90/mattermost-5.15
mattermost: 5.9.0 -> 5.15.0
This commit is contained in:
commit
5a358eade8
|
@ -6,14 +6,18 @@ let
|
||||||
|
|
||||||
cfg = config.services.mattermost;
|
cfg = config.services.mattermost;
|
||||||
|
|
||||||
defaultConfig = builtins.fromJSON (readFile "${pkgs.mattermost}/config/config.json");
|
defaultConfig = builtins.fromJSON (builtins.replaceStrings [ "\\u0026" ] [ "&" ]
|
||||||
|
(readFile "${pkgs.mattermost}/config/config.json")
|
||||||
|
);
|
||||||
|
|
||||||
|
database = "postgres://${cfg.localDatabaseUser}:${cfg.localDatabasePassword}@localhost:5432/${cfg.localDatabaseName}?sslmode=disable&connect_timeout=10";
|
||||||
|
|
||||||
mattermostConf = foldl recursiveUpdate defaultConfig
|
mattermostConf = foldl recursiveUpdate defaultConfig
|
||||||
[ { ServiceSettings.SiteURL = cfg.siteUrl;
|
[ { ServiceSettings.SiteURL = cfg.siteUrl;
|
||||||
ServiceSettings.ListenAddress = cfg.listenAddress;
|
ServiceSettings.ListenAddress = cfg.listenAddress;
|
||||||
TeamSettings.SiteName = cfg.siteName;
|
TeamSettings.SiteName = cfg.siteName;
|
||||||
SqlSettings.DriverName = "postgres";
|
SqlSettings.DriverName = "postgres";
|
||||||
SqlSettings.DataSource = "postgres://${cfg.localDatabaseUser}:${cfg.localDatabasePassword}@localhost:5432/${cfg.localDatabaseName}?sslmode=disable&connect_timeout=10";
|
SqlSettings.DataSource = database;
|
||||||
}
|
}
|
||||||
cfg.extraConfig
|
cfg.extraConfig
|
||||||
];
|
];
|
||||||
|
@ -175,7 +179,9 @@ in
|
||||||
mkdir -p ${cfg.statePath}/{data,config,logs}
|
mkdir -p ${cfg.statePath}/{data,config,logs}
|
||||||
ln -sf ${pkgs.mattermost}/{bin,fonts,i18n,templates,client} ${cfg.statePath}
|
ln -sf ${pkgs.mattermost}/{bin,fonts,i18n,templates,client} ${cfg.statePath}
|
||||||
'' + lib.optionalString (!cfg.mutableConfig) ''
|
'' + lib.optionalString (!cfg.mutableConfig) ''
|
||||||
ln -sf ${mattermostConfJSON} ${cfg.statePath}/config/config.json
|
rm -f ${cfg.statePath}/config/config.json
|
||||||
|
cp ${mattermostConfJSON} ${cfg.statePath}/config/config.json
|
||||||
|
${pkgs.mattermost}/bin/mattermost config migrate ${cfg.statePath}/config/config.json ${database}
|
||||||
'' + lib.optionalString cfg.mutableConfig ''
|
'' + lib.optionalString cfg.mutableConfig ''
|
||||||
if ! test -e "${cfg.statePath}/config/.initial-created"; then
|
if ! test -e "${cfg.statePath}/config/.initial-created"; then
|
||||||
rm -f ${cfg.statePath}/config/config.json
|
rm -f ${cfg.statePath}/config/config.json
|
||||||
|
@ -201,7 +207,8 @@ in
|
||||||
PermissionsStartOnly = true;
|
PermissionsStartOnly = true;
|
||||||
User = cfg.user;
|
User = cfg.user;
|
||||||
Group = cfg.group;
|
Group = cfg.group;
|
||||||
ExecStart = "${pkgs.mattermost}/bin/mattermost";
|
ExecStart = "${pkgs.mattermost}/bin/mattermost" +
|
||||||
|
(lib.optionalString (!cfg.mutableConfig) " -c ${database}");
|
||||||
WorkingDirectory = "${cfg.statePath}";
|
WorkingDirectory = "${cfg.statePath}";
|
||||||
Restart = "always";
|
Restart = "always";
|
||||||
RestartSec = "10";
|
RestartSec = "10";
|
||||||
|
@ -227,4 +234,3 @@ in
|
||||||
})
|
})
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
{ stdenv, fetchurl, fetchFromGitHub, buildGoPackage, buildEnv }:
|
{ stdenv, fetchurl, fetchFromGitHub, buildGoPackage, buildEnv }:
|
||||||
|
|
||||||
let
|
let
|
||||||
version = "5.9.0";
|
version = "5.15.0";
|
||||||
|
|
||||||
mattermost-server = buildGoPackage rec {
|
mattermost-server = buildGoPackage rec {
|
||||||
pname = "mattermost-server";
|
pname = "mattermost-server";
|
||||||
|
@ -11,7 +11,7 @@ let
|
||||||
owner = "mattermost";
|
owner = "mattermost";
|
||||||
repo = "mattermost-server";
|
repo = "mattermost-server";
|
||||||
rev = "v${version}";
|
rev = "v${version}";
|
||||||
sha256 = "08h7n9smv6f1njazn4pl6pwkfmqxn93rzg69h6asicp9c4vad3m2";
|
sha256 = "1bh53h0bmpc1qmnbpsmwkfrvj66z18m7b1xg7pqikid57ssqxjx9";
|
||||||
};
|
};
|
||||||
|
|
||||||
goPackagePath = "github.com/mattermost/mattermost-server";
|
goPackagePath = "github.com/mattermost/mattermost-server";
|
||||||
|
@ -29,7 +29,7 @@ let
|
||||||
|
|
||||||
src = fetchurl {
|
src = fetchurl {
|
||||||
url = "https://releases.mattermost.com/${version}/mattermost-${version}-linux-amd64.tar.gz";
|
url = "https://releases.mattermost.com/${version}/mattermost-${version}-linux-amd64.tar.gz";
|
||||||
sha256 = "19ys5mwmw99fbj44gd00vrl2qj09lrwvj1ihic0fsn6nd3hnx3mw";
|
sha256 = "13xmc2y4pp0b0svzaf4v7ynx6rxcvznx3vqmlrpiil414s69xv45";
|
||||||
};
|
};
|
||||||
|
|
||||||
installPhase = ''
|
installPhase = ''
|
||||||
|
|
Loading…
Reference in New Issue