ma dcpp: add client
This commit is contained in:
parent
6c5d362662
commit
bdf8d7a94d
9
makefu/2configs/dcpp/client.nix
Normal file
9
makefu/2configs/dcpp/client.nix
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
{ pkgs, ... }:
|
||||||
|
{ # ncdc
|
||||||
|
environment.systemPackages = [ pkgs.ncdc ];
|
||||||
|
networking.firewall = {
|
||||||
|
allowedUDPPorts = [ 51411 ];
|
||||||
|
allowedTCPPorts = [ 51411 ];
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
@ -30,6 +30,7 @@ let
|
|||||||
|
|
||||||
'') dict)}
|
'') dict)}
|
||||||
'';
|
'';
|
||||||
|
uhubDir = "/var/lib/uhub";
|
||||||
|
|
||||||
in {
|
in {
|
||||||
users.extraUsers = singleton {
|
users.extraUsers = singleton {
|
||||||
@ -65,21 +66,30 @@ in {
|
|||||||
PrivateTmp = true;
|
PrivateTmp = true;
|
||||||
PermissionsStartOnly = true;
|
PermissionsStartOnly = true;
|
||||||
ExecStartPre = pkgs.writeDash "uhub-pre" ''
|
ExecStartPre = pkgs.writeDash "uhub-pre" ''
|
||||||
cp ${toString <secrets/wildcard.krebsco.de.crt>} /tmp/uhub.crt
|
cp -f ${toString <secrets/wildcard.krebsco.de.crt>} ${uhubDir}/uhub.crt
|
||||||
cp ${toString <secrets/wildcard.krebsco.de.key>} /tmp/uhub.key
|
cp -f ${toString <secrets/wildcard.krebsco.de.key>} ${uhubDir}/uhub.key
|
||||||
cp ${toString <secrets/uhub.sql>} /tmp/uhub.sql
|
if test -d ${uhubDir};then
|
||||||
chown uhub /tmp/*
|
echo "Directory ${uhubDir} already exists, skipping db init"
|
||||||
|
else
|
||||||
|
echo "Copying sql user db"
|
||||||
|
cp ${toString <secrets/uhub.sql>} ${uhubDir}/uhub.sql
|
||||||
|
fi
|
||||||
|
chown -R uhub ${uhubDir}
|
||||||
'';
|
'';
|
||||||
|
|
||||||
};
|
};
|
||||||
|
users.users.uhub = {
|
||||||
|
home = uhubDir;
|
||||||
|
createHome = true;
|
||||||
|
};
|
||||||
services.uhub = {
|
services.uhub = {
|
||||||
enable = true;
|
enable = true;
|
||||||
port = 1511;
|
port = 1511;
|
||||||
enableTLS = true;
|
enableTLS = true;
|
||||||
hubConfig = ''
|
hubConfig = ''
|
||||||
hub_name = "krebshub"
|
hub_name = "krebshub"
|
||||||
tls_certificate = /tmp/uhub.crt
|
tls_certificate = ${uhubDir}/uhub.crt
|
||||||
tls_private_key = /tmp/uhub.key
|
tls_private_key = ${uhubDir}/uhub.key
|
||||||
registered_users_only = true
|
registered_users_only = true
|
||||||
'';
|
'';
|
||||||
plugins = {
|
plugins = {
|
||||||
@ -93,7 +103,7 @@ in {
|
|||||||
};
|
};
|
||||||
authSqlite = {
|
authSqlite = {
|
||||||
enable = true;
|
enable = true;
|
||||||
file = "/tmp/uhub.sql";
|
file = "${uhubDir}/uhub.sql";
|
||||||
};
|
};
|
||||||
|
|
||||||
};
|
};
|
||||||
|
Loading…
Reference in New Issue
Block a user