pumpio service: adjust upload directory config for 3.0.0

These changes are backwards compatible.
This commit is contained in:
Rodney Lorrimar 2017-03-10 22:34:42 +00:00 committed by Jörg Thalheim
parent 252e58a95e
commit f1a1490135
No known key found for this signature in database
GPG key ID: CA4106B8D7CC79FA

View file

@ -57,7 +57,8 @@ let
smtpfrom = cfg.smtpFrom;
nologger = false;
uploaddir = "${dataDir}/uploads";
enableUploads = cfg.enableUploads;
datadir = dataDir;
debugClient = false;
firehose = cfg.firehose;
disableRegistration = cfg.disableRegistration;
@ -152,6 +153,15 @@ in
'';
};
enableUploads = mkOption {
type = types.bool;
default = true;
description = ''
If you want to disable file uploads, set this to false. Uploaded files will be stored
in ${dataDir}/uploads.
'';
};
sslKey = mkOption {
type = types.path;
example = "${dataDir}/myserver.key";
@ -341,7 +351,15 @@ in
{ description = "pump.io social network stream server";
after = [ "network.target" ];
wantedBy = [ "multi-user.target" ];
preStart = ''
mkdir -p ${dataDir}/uploads
chown pumpio:pumpio ${dataDir}/uploads
chmod 770 ${dataDir}/uploads
'';
serviceConfig.ExecStart = "${pkgs.pumpio}/bin/pump -c /etc/pump.io.json";
PermissionsStartOnly = true;
serviceConfig.User = if cfg.port < 1024 then "root" else user;
serviceConfig.Group = user;
};