rtorrent downloads, but doesn't upload yet
This commit is contained in:
parent
36f1b046bb
commit
aed18e9a93
5 changed files with 86 additions and 5 deletions
|
|
@ -17,8 +17,10 @@
|
|||
};
|
||||
};
|
||||
|
||||
users.users.flood.group = "flood";
|
||||
users.extraUsers.flood = {
|
||||
isNormalUser = true;
|
||||
extraGroups = [ "rtorrent" "users" ];
|
||||
};
|
||||
|
||||
systemd.services = {
|
||||
|
|
@ -31,7 +33,7 @@
|
|||
Restart = "on-failure";
|
||||
};
|
||||
wantedBy = [ "multi-user.target" ];
|
||||
after = [ "network.target" ];
|
||||
after = [ "network.target" "rtorrent.service" ];
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,16 +1,34 @@
|
|||
{ pkgs, finalDir, downloadDir, watchDir }:
|
||||
let
|
||||
dhtPort = 40000;
|
||||
in
|
||||
{
|
||||
|
||||
environment.systemPackages = with pkgs; [ rtorrent ];
|
||||
|
||||
users.extraUsers.rtorrent.extraGroups = [ "users" ];
|
||||
|
||||
services.rtorrent = {
|
||||
enable = true;
|
||||
downloadDir = downloadDir;
|
||||
group = "users";
|
||||
# flood needs to be able to access the datadir
|
||||
dataDir = downloadDir;
|
||||
configText =
|
||||
builtins.readFile (pkgs.substituteAll {
|
||||
src = ./rtorrent.rc;
|
||||
watchDir = watchDir;
|
||||
finalDir = finalDir;
|
||||
dhtPort = builtins.toString dhtPort;
|
||||
});
|
||||
};
|
||||
|
||||
networking.firewall = {
|
||||
allowedTCPPorts = [
|
||||
# rtorrent default
|
||||
50000
|
||||
];
|
||||
allowedUDPPorts = [
|
||||
dhtPort
|
||||
];
|
||||
};
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,3 +1,17 @@
|
|||
# Set an interface with IPv4 address to bind to:
|
||||
method.insert = cfg.interface.bind, string|const|private, (cat,"wg0")
|
||||
# Get IPv4 address of a given interface
|
||||
method.insert = get_interface_ipv4_address, simple|private, "execute.capture=bash,-c,\"$cat=\\\"echo -n \$(ip -o -4 addr show \\\",$argument.0=,\\\" | grep -Po 'inet \\\\\\\\\\K[\\\\\\\\\\d.]+')\\\"\""
|
||||
# The IP address the listening socket and outgoing connections is bound to. (bind)
|
||||
schedule2 = set_bind_address, 0, 0, \
|
||||
"branch=((cfg.interface.bind)), \
|
||||
((network.bind_address.set,(get_interface_ipv4_address,(cfg.interface.bind))))"
|
||||
|
||||
dht.mode.set = on
|
||||
dht.port.set = @dhtPort@
|
||||
protocol.pex.set = yes
|
||||
trackers.use_udp.set = yes
|
||||
|
||||
# Enable the default ratio group.
|
||||
ratio.enable=
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue