2015-10-30 23:10:43 +00:00
|
|
|
{ config, lib, pkgs, ... }:
|
2015-08-13 20:26:07 +00:00
|
|
|
|
2016-10-20 18:54:38 +00:00
|
|
|
with import <stockholm/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-shodan.pubkey
|
2017-02-02 23:22:10 +00:00
|
|
|
lass-icarus.pubkey
|
2016-08-09 15:14:15 +00:00
|
|
|
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;
|
2016-12-26 13:18:43 +00:00
|
|
|
port = 9091;
|
|
|
|
basicAuth = import <secrets/torrent-auth>;
|
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
|
|
|
];
|
|
|
|
};
|
|
|
|
}
|