2018-09-24 12:20:23 +00:00
|
|
|
{ config, ... }:
|
|
|
|
{
|
2018-09-24 21:32:28 +00:00
|
|
|
krebs.airdcpp = {
|
2018-09-24 12:20:23 +00:00
|
|
|
enable = true;
|
|
|
|
extraGroups = [ "download" ];
|
|
|
|
web.port = 5600;
|
|
|
|
web.users.makefu.password = builtins.readFile <secrets/airdcpp-makefu.pw>; # watch out for newline!
|
|
|
|
hubs."krebshub" =
|
|
|
|
{ Nick = "makefu-${config.krebs.build.host.name}";
|
|
|
|
Password = builtins.readFile <secrets/krebshub.pw>;
|
|
|
|
Server = "adcs://hub.nsupdate.info:411";
|
|
|
|
AutoConnect = true;
|
|
|
|
};
|
|
|
|
dcpp = {
|
|
|
|
shares = {
|
|
|
|
# Incoming must be writeable!
|
2018-09-24 21:32:28 +00:00
|
|
|
incoming = { path = config.makefu.dl-dir + "/finished/dcpp"; incoming = true; };
|
|
|
|
audiobooks.path = config.makefu.dl-dir + "/finished/audiobooks";
|
2018-09-24 12:20:23 +00:00
|
|
|
};
|
|
|
|
Nick = "makefu";
|
|
|
|
DownloadSpeed = "1000";
|
|
|
|
UploadSpeed = "1000";
|
|
|
|
};
|
|
|
|
};
|
|
|
|
networking.firewall.allowedTCPPorts =
|
2018-09-24 21:32:28 +00:00
|
|
|
[ config.krebs.airdcpp.dcpp.InPort
|
|
|
|
config.krebs.airdcpp.dcpp.TLSPort
|
2018-09-24 12:20:23 +00:00
|
|
|
];
|
2018-09-24 21:32:28 +00:00
|
|
|
networking.firewall.allowedUDPPorts = [ config.krebs.airdcpp.dcpp.UDPPort ];
|
2018-09-24 12:20:23 +00:00
|
|
|
|
|
|
|
services.nginx.virtualHosts."dcpp.${config.krebs.build.host.name}.r".locations."/" =
|
2018-09-24 21:32:28 +00:00
|
|
|
{ proxyPass = "http://localhost:${toString config.krebs.airdcpp.web.port}/";
|
2018-09-24 12:20:23 +00:00
|
|
|
|
|
|
|
extraConfig = ''
|
|
|
|
proxy_set_header Host $host;
|
|
|
|
proxy_set_header X-Real-IP $remote_addr;
|
|
|
|
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
|
|
|
gzip_types text/plain application/javascript;
|
|
|
|
|
|
|
|
# Proxy websockets
|
|
|
|
proxy_http_version 1.1;
|
|
|
|
proxy_set_header Upgrade $http_upgrade;
|
|
|
|
proxy_set_header Connection "upgrade";
|
|
|
|
|
|
|
|
'';
|
|
|
|
};
|
2018-10-14 21:47:18 +00:00
|
|
|
state = map (f: "${config.krebs.airdcpp.stateDir}/${f}")
|
|
|
|
[ "Favorites.xml" "DCPlusPlus.xml" "WebServer.xml" "Recents.xml" "IgnoredUsers.xml" ];
|
2018-09-24 12:20:23 +00:00
|
|
|
}
|