2015-10-30 23:10:43 +00:00
|
|
|
{ config, lib, pkgs, ... }:
|
2015-08-13 20:26:07 +00:00
|
|
|
|
2016-02-14 15:43:44 +00:00
|
|
|
with config.krebs.lib;
|
2015-10-31 14:11:15 +00:00
|
|
|
|
2016-08-24 16:45:19 +00:00
|
|
|
{
|
2015-08-13 20:26:07 +00:00
|
|
|
users.extraUsers = {
|
|
|
|
download = {
|
|
|
|
name = "download";
|
|
|
|
home = "/var/download";
|
|
|
|
createHome = true;
|
2015-10-30 23:10:43 +00:00
|
|
|
useDefaultShell = true;
|
2015-08-13 20:26:07 +00:00
|
|
|
extraGroups = [
|
|
|
|
"download"
|
|
|
|
];
|
2016-08-09 15:14:15 +00:00
|
|
|
openssh.authorizedKeys.keys = with config.krebs.users; [
|
|
|
|
lass.pubkey
|
|
|
|
lass-uriel.pubkey
|
|
|
|
lass-shodan.pubkey
|
|
|
|
makefu.pubkey
|
2015-10-30 23:10:43 +00:00
|
|
|
];
|
2015-08-13 20:26:07 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
transmission = {
|
|
|
|
extraGroups = [
|
|
|
|
"download"
|
|
|
|
];
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
users.extraGroups = {
|
|
|
|
download = {
|
|
|
|
members = [
|
|
|
|
"download"
|
|
|
|
"transmission"
|
|
|
|
];
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
2016-08-24 16:45:19 +00:00
|
|
|
krebs.rtorrent = {
|
2015-08-13 20:26:07 +00:00
|
|
|
enable = true;
|
2016-08-24 16:45:19 +00:00
|
|
|
web = {
|
|
|
|
enable = true;
|
|
|
|
enableAuth = true;
|
|
|
|
listenAddress = "9091";
|
|
|
|
authfile = <secrets/torrent-authfile>;
|
2015-08-13 20:26:07 +00:00
|
|
|
};
|
2016-08-24 16:45:19 +00:00
|
|
|
rutorrent.enable = true;
|
|
|
|
enableXMLRPC = true;
|
|
|
|
listenPort = 51413;
|
|
|
|
downloadDir = "/var/download/finished";
|
|
|
|
# dump old torrents into watch folder to have them re-added
|
|
|
|
watchDir = "/var/download/watch";
|
2015-08-13 20:26:07 +00:00
|
|
|
};
|
|
|
|
|
2015-10-01 20:13:40 +00:00
|
|
|
krebs.iptables = {
|
2015-08-13 20:26:07 +00:00
|
|
|
enable = true;
|
|
|
|
tables.filter.INPUT.rules = [
|
|
|
|
{ predicate = "-p tcp --dport 9091"; target = "ACCEPT"; }
|
2015-10-30 23:11:45 +00:00
|
|
|
{ predicate = "-p tcp --dport 51413"; target = "ACCEPT"; }
|
|
|
|
{ predicate = "-p udp --dport 51413"; target = "ACCEPT"; }
|
2015-08-13 20:26:07 +00:00
|
|
|
];
|
|
|
|
};
|
|
|
|
}
|