upade fileshare
This commit is contained in:
@@ -15,6 +15,11 @@ in {
|
|||||||
default = "/var/lib/file-upload";
|
default = "/var/lib/file-upload";
|
||||||
description = "Directory to store uploaded files";
|
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;
|
isSystemUser = true;
|
||||||
group = "kop-fileshare";
|
group = "kop-fileshare";
|
||||||
};
|
};
|
||||||
users.groups.kop-fileshare = {};
|
users.groups.kop-fileshare = { };
|
||||||
systemd.services.kop-fileshare = {
|
systemd.services.kop-fileshare = {
|
||||||
description = "File Upload Server";
|
description = "File Upload Server";
|
||||||
wants = [ "network-online.target" ];
|
wants = [ "network-online.target" ];
|
||||||
@@ -35,6 +40,7 @@ in {
|
|||||||
serviceConfig = {
|
serviceConfig = {
|
||||||
ExecStart = "${pkgs.kop-fileshare}/bin/kop-fileshare";
|
ExecStart = "${pkgs.kop-fileshare}/bin/kop-fileshare";
|
||||||
WorkingDirectory = cfg.dataDir;
|
WorkingDirectory = cfg.dataDir;
|
||||||
|
BindPaths = [ "${cfg.dataDir}" ];
|
||||||
User = "kop-fileshare";
|
User = "kop-fileshare";
|
||||||
Restart = "on-failure";
|
Restart = "on-failure";
|
||||||
RestartSec = "5s";
|
RestartSec = "5s";
|
||||||
@@ -56,6 +62,7 @@ in {
|
|||||||
environment = {
|
environment = {
|
||||||
PORT = "${toString cfg.port}";
|
PORT = "${toString cfg.port}";
|
||||||
UPLOAD_PATH = "${toString cfg.dataDir}";
|
UPLOAD_PATH = "${toString cfg.dataDir}";
|
||||||
|
BASE_PATH = "${cfg.basePath}";
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ buildGoModule rec {
|
|||||||
src = fetchGit {
|
src = fetchGit {
|
||||||
url = "git@github.com:kropatz/kop-fileshare.git";
|
url = "git@github.com:kropatz/kop-fileshare.git";
|
||||||
ref = "master";
|
ref = "master";
|
||||||
rev = "3556ccab052233c0d5d70baa631ba8b56ee8ebdb";
|
rev = "73456c32d3d070d457f95973403ca94bdddea95d";
|
||||||
};
|
};
|
||||||
vendorHash = "sha256-OQ6rNgOQHrrhE7DT+ulwpWJCDJ4DeJiDzriAu3mfS7I=";
|
vendorHash = "sha256-OQ6rNgOQHrrhE7DT+ulwpWJCDJ4DeJiDzriAu3mfS7I=";
|
||||||
|
|
||||||
|
|||||||
@@ -17,7 +17,10 @@
|
|||||||
};
|
};
|
||||||
services = {
|
services = {
|
||||||
#adam-site.enable = true;
|
#adam-site.enable = true;
|
||||||
kop-fileshare.enable = true;
|
kop-fileshare = {
|
||||||
|
enable = true;
|
||||||
|
basePath = "/stash";
|
||||||
|
};
|
||||||
};
|
};
|
||||||
graphical = { lxqt.enable = true; };
|
graphical = { lxqt.enable = true; };
|
||||||
};
|
};
|
||||||
@@ -29,7 +32,7 @@
|
|||||||
"localhost" = {
|
"localhost" = {
|
||||||
forceSSL = false;
|
forceSSL = false;
|
||||||
enableACME = false;
|
enableACME = false;
|
||||||
locations."/".proxyPass = "http://127.0.0.1:7777";
|
locations."/stash".proxyPass = "http://127.0.0.1:7777";
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user