upade fileshare
This commit is contained in:
@@ -15,17 +15,22 @@ in {
|
||||
default = "/var/lib/file-upload";
|
||||
description = "Directory to store uploaded files";
|
||||
};
|
||||
basePath = mkOption {
|
||||
type = types.str;
|
||||
default = "/";
|
||||
description = "Location under which the file upload server is reachable";
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
users.users.kop-fileshare = {
|
||||
home = cfg.dataDir;
|
||||
createHome = true;
|
||||
isSystemUser = true;
|
||||
group = "kop-fileshare";
|
||||
home = cfg.dataDir;
|
||||
createHome = true;
|
||||
isSystemUser = true;
|
||||
group = "kop-fileshare";
|
||||
};
|
||||
users.groups.kop-fileshare = {};
|
||||
users.groups.kop-fileshare = { };
|
||||
systemd.services.kop-fileshare = {
|
||||
description = "File Upload Server";
|
||||
wants = [ "network-online.target" ];
|
||||
@@ -35,6 +40,7 @@ in {
|
||||
serviceConfig = {
|
||||
ExecStart = "${pkgs.kop-fileshare}/bin/kop-fileshare";
|
||||
WorkingDirectory = cfg.dataDir;
|
||||
BindPaths = [ "${cfg.dataDir}" ];
|
||||
User = "kop-fileshare";
|
||||
Restart = "on-failure";
|
||||
RestartSec = "5s";
|
||||
@@ -56,6 +62,7 @@ in {
|
||||
environment = {
|
||||
PORT = "${toString cfg.port}";
|
||||
UPLOAD_PATH = "${toString cfg.dataDir}";
|
||||
BASE_PATH = "${cfg.basePath}";
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user