summaryrefslogtreecommitdiffstats
path: root/makefu/2configs/torrent.nix
diff options
context:
space:
mode:
authorlassulus <lass@blue.r>2018-11-10 19:42:46 +0100
committerlassulus <lass@blue.r>2018-11-10 19:42:46 +0100
commiteff97662c02f385b1740929639817fc5b8318f07 (patch)
treef11710101eed0dcc8d75304939f06e819339d9f0 /makefu/2configs/torrent.nix
parent0028e3dde3dcb8e5e9394f7d230c7224b6177b79 (diff)
parent254e9e62b95951cecadd2b4800c03ef96f95b3c0 (diff)
Merge remote-tracking branch 'nextgum/master'
Diffstat (limited to 'makefu/2configs/torrent.nix')
-rw-r--r--makefu/2configs/torrent.nix20
1 files changed, 5 insertions, 15 deletions
diff --git a/makefu/2configs/torrent.nix b/makefu/2configs/torrent.nix
index 3df0ddbfe..ca368dbf0 100644
--- a/makefu/2configs/torrent.nix
+++ b/makefu/2configs/torrent.nix
@@ -3,12 +3,11 @@
with import <stockholm/lib>;
let
- daemon-user = "tor";
basicAuth = import <torrent-secrets/auth.nix>;
peer-port = 51412;
web-port = 8112;
daemon-port = 58846;
- base-dir = config.makefu.dl-dir;
+ base-dir = config.krebs.rtorrent.workDir;
in {
users.users = {
@@ -23,17 +22,6 @@ in {
};
};
- # todo: race condition, do this after download user has been created
- system.activationScripts."download-dir-chmod" = ''
- for i in finished watch; do
- if test ! -d $i;then
- mkdir -p "${base-dir}/$i"
- chown rtorrent:download "${base-dir}/$i"
- chmod 775 "${base-dir}/$i"
- fi
- done
- '';
-
users.extraGroups = {
download = {
gid = lib.mkDefault (genid "download");
@@ -57,15 +45,17 @@ in {
rutorrent.enable = true;
enableXMLRPC = true;
listenPort = peer-port;
- downloadDir = base-dir + "/finished";
- watchDir = base-dir + "/watch";
+ downloadDir = config.makefu.dl-dir;
# dump old torrents into watch folder to have them re-added
};
+ services.nginx.virtualHosts."torrent.${config.krebs.build.host.name}.r".locations."/" = { proxyPass = "http://localhost:${toString web-port}/"; };
+
networking.firewall.extraCommands = ''
iptables -A INPUT -i retiolum -p tcp --dport ${toString web-port} -j ACCEPT
'';
networking.firewall.allowedTCPPorts = [ peer-port ];
networking.firewall.allowedUDPPorts = [ peer-port ];
+ state = [ config.krebs.rtorrent.sessionDir ]; # state which torrents were loaded
}