m 2 torrent: use rtorrent by default
This commit is contained in:
parent
cca642ef92
commit
af07bb59a8
|
@ -4,7 +4,7 @@ with config.krebs.lib;
|
||||||
|
|
||||||
let
|
let
|
||||||
daemon-user = "tor";
|
daemon-user = "tor";
|
||||||
daemon-pw = (import <torrent-secrets/daemon-pw>);
|
authfile = <torrent-secrets/authfile>;
|
||||||
peer-port = 51412;
|
peer-port = 51412;
|
||||||
web-port = 8112;
|
web-port = 8112;
|
||||||
daemon-port = 58846;
|
daemon-port = 58846;
|
||||||
|
@ -27,9 +27,10 @@ in {
|
||||||
openssh.authorizedKeys.keys = [ ];
|
openssh.authorizedKeys.keys = [ ];
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
# todo: race condition, do this after download user has been created
|
# todo: race condition, do this after download user has been created
|
||||||
system.activationScripts."download-dir-chmod" = ''
|
system.activationScripts."download-dir-chmod" = ''
|
||||||
for i in finished torrents; do
|
for i in finished watch torrents; do
|
||||||
mkdir -p "${dl-dir}/$i"
|
mkdir -p "${dl-dir}/$i"
|
||||||
chown download:download "${dl-dir}/$i"
|
chown download:download "${dl-dir}/$i"
|
||||||
chmod 770 "${dl-dir}/$i"
|
chmod 770 "${dl-dir}/$i"
|
||||||
|
@ -42,39 +43,30 @@ in {
|
||||||
members = [
|
members = [
|
||||||
config.krebs.build.user.name
|
config.krebs.build.user.name
|
||||||
"download"
|
"download"
|
||||||
"deluge"
|
"rtorrent"
|
||||||
|
"nginx"
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
makefu.deluge = {
|
makefu.rtorrent = {
|
||||||
enable = true;
|
enable = true;
|
||||||
auth = "${daemon-user}:${daemon-pw}:10";
|
web = {
|
||||||
# web.enable = true;
|
enable = true;
|
||||||
cfg = {
|
enableAuth = true;
|
||||||
autoadd_enable = true;
|
listenAddress = toString web-port;
|
||||||
download_location = dl-dir + "/finished";
|
inherit authfile;
|
||||||
torrentfiles_location = dl-dir + "/torrents"; copy_torrent_file = true;
|
|
||||||
lsd = false;
|
|
||||||
dht = false;
|
|
||||||
upnp = false;
|
|
||||||
natpmp = false;
|
|
||||||
add_paused = false;
|
|
||||||
allow_remote = true;
|
|
||||||
remove_seed_at_ratio = false;
|
|
||||||
move_completed = false;
|
|
||||||
daemon_port = daemon-port;
|
|
||||||
random_port = false;
|
|
||||||
random_outgoing_ports = true;
|
|
||||||
listen_ports = [ peer-port peer-port ];
|
|
||||||
# performance tuning
|
|
||||||
cache_expiry = 3600;
|
|
||||||
stop_seed_at_ratio = false;
|
|
||||||
};
|
};
|
||||||
|
rutorrent.enable = true;
|
||||||
|
enableXMLRPC = true;
|
||||||
|
listenPort = peer-port;
|
||||||
|
downloadDir = dl-dir + "/finished";
|
||||||
|
# dump old torrents into watch folder to have them re-added
|
||||||
|
watchDir = dl-dir +"/watch";
|
||||||
};
|
};
|
||||||
|
|
||||||
networking.firewall.extraCommands = ''
|
networking.firewall.extraCommands = ''
|
||||||
iptables -A INPUT -i retiolum -p tcp --dport ${toString daemon-port} -j ACCEPT
|
iptables -A INPUT -i retiolum -p tcp --dport ${toString web-port} -j ACCEPT
|
||||||
'';
|
'';
|
||||||
|
|
||||||
networking.firewall.allowedTCPPorts = [ peer-port ];
|
networking.firewall.allowedTCPPorts = [ peer-port ];
|
||||||
|
|
Loading…
Reference in a new issue