diff options
| author | Mel <mel@rnrd.eu> | 2025-09-05 23:31:37 +0200 |
|---|---|---|
| committer | Mel <mel@rnrd.eu> | 2025-09-05 23:31:37 +0200 |
| commit | f229114af8ffff941fbbd22de1b0edc1d18dbf1b (patch) | |
| tree | 02ef955c1099c45883afdd0f9896f7da21e8b6e0 /services | |
| parent | d33b7b3faa9c296a3439dbe3a9d6132e7436e8b7 (diff) | |
| download | network-f229114af8ffff941fbbd22de1b0edc1d18dbf1b.tar.zst network-f229114af8ffff941fbbd22de1b0edc1d18dbf1b.zip | |
Place alternative web UI (Flood) in front of BT clients
Signed-off-by: Mel <mel@rnrd.eu>
Diffstat (limited to 'services')
| -rw-r--r-- | services/torrent/default.nix | 1 | ||||
| -rw-r--r-- | services/torrent/flood.nix | 66 |
2 files changed, 67 insertions, 0 deletions
diff --git a/services/torrent/default.nix b/services/torrent/default.nix index 4e505ba..7fed955 100644 --- a/services/torrent/default.nix +++ b/services/torrent/default.nix @@ -87,6 +87,7 @@ let in { imports = [ + ./flood.nix # pick current client through import ./transmission.nix #./qbittorrent.nix diff --git a/services/torrent/flood.nix b/services/torrent/flood.nix new file mode 100644 index 0000000..ae0385e --- /dev/null +++ b/services/torrent/flood.nix @@ -0,0 +1,66 @@ +{ + lib, + pkgs, + me, + unstablePkgs, + auxiliaryPkgs, + ... +}: + +let + inherit (pkgs) dockerTools mediainfo; + inherit (auxiliaryPkgs) common; + + flood = unstablePkgs.flood; + + torrentLocalPort = 2018; + torrentWebLocalPort = 2019; + torrentDir = "/srv/torrent"; + + floodImage = dockerTools.streamLayeredImage { + name = "flood"; + tag = flood.version; + fromImage = common.alpine.base; + contents = [ flood mediainfo ]; + }; +in +{ + foundation.services.torrent-webui = { + image = floodImage; + + ports = [ torrentWebLocalPort ]; + + volumes = [ + [ + "${torrentDir}/download" + "/download" + ] + ]; + + entrypoint = lib.getExe flood; + cmd = [ + "--host" "0.0.0.0" + "--port" "${toString torrentWebLocalPort}" + "--rundir" "${torrentDir}/flood" + "--auth" "none" + + # pick one according to which is running! + # "--qburl" "http://${me.tailscale.ip}:${toString torrentLocalPort}" + # "--qbuser" "admin" + # "--qbpass" "admin" + "--trurl" "http://${me.tailscale.ip}:${toString torrentLocalPort}/transmission/rpc" + "--truser" "admin" + "--trpass" "admin" + ]; + }; + + services.nginx.virtualHosts."bt.rnrd.fyi" = { + useACMEHost = "rnrd.fyi"; + forceSSL = true; + listenAddresses = [ me.tailscale.ip ]; + locations."/" = { + proxyPass = "http://127.0.0.1:${toString torrentWebLocalPort}/"; + recommendedProxySettings = true; + }; + }; +} |
