upade fileshare

This commit is contained in:
Kopatz
2024-06-02 11:57:14 +02:00
parent 28cd081419
commit 1f1562ebdf
3 changed files with 18 additions and 8 deletions

View File

@@ -15,6 +15,11 @@ 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";
};
};
};
@@ -25,7 +30,7 @@ in {
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}";
};
};
};

View File

@@ -6,7 +6,7 @@ buildGoModule rec {
src = fetchGit {
url = "git@github.com:kropatz/kop-fileshare.git";
ref = "master";
rev = "3556ccab052233c0d5d70baa631ba8b56ee8ebdb";
rev = "73456c32d3d070d457f95973403ca94bdddea95d";
};
vendorHash = "sha256-OQ6rNgOQHrrhE7DT+ulwpWJCDJ4DeJiDzriAu3mfS7I=";

View File

@@ -17,7 +17,10 @@
};
services = {
#adam-site.enable = true;
kop-fileshare.enable = true;
kop-fileshare = {
enable = true;
basePath = "/stash";
};
};
graphical = { lxqt.enable = true; };
};
@@ -29,7 +32,7 @@
"localhost" = {
forceSSL = false;
enableACME = false;
locations."/".proxyPass = "http://127.0.0.1:7777";
locations."/stash".proxyPass = "http://127.0.0.1:7777";
};
};
};