From 412d7bc3770aa00e552eccce29b10488f3a48836 Mon Sep 17 00:00:00 2001 From: jochens Date: Wed, 30 Sep 2026 12:32:16 +0200 Subject: [PATCH] qbittorrent: it listens on the port the mesh gave it, rather than fixing it MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The manifest published 8112:8112 and 6881:6881 because qBittorrent refuses a Host naming another port and announces its torrent port to peers — so the machine port must equal the software's. Fixing the number in the manifest states a machine port in a definition. Instead the server runs on the host network and listens where the mesh put it (WEBUI_PORT=${port:8112}, TORRENTING_PORT=${port:6881}): the two are equal by construction on every machine, and an assignment still pins 8112/6881 where clients know them. Verified: the pinned image on the host network with WEBUI_PORT=18710 and TORRENTING_PORT=18711 served the web UI on 18710 (200, no Host mismatch) and listened for peers on 18711 tcp+udp. --- modules/qbittorrent/module.json | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/modules/qbittorrent/module.json b/modules/qbittorrent/module.json index 80a1b8a..05c4330 100644 --- a/modules/qbittorrent/module.json +++ b/modules/qbittorrent/module.json @@ -20,21 +20,21 @@ "port": 8112, "protocol": "tcp", "from": "mesh", - "why": "the download client's pages, and the WebUI API its consumers and its own tools call; qBittorrent refuses a request whose Host names a port other than the one it listens on, so a caller dialling the machine port gets in only when the machine publishes the same number" + "why": "the download client's pages, and the WebUI API its consumers and its own tools call. qBittorrent refuses a request whose Host names a port other than the one it listens on, so it listens on the machine port itself (host network, WEBUI_PORT=${port:8112}) and the two cannot differ on any machine" }, { "name": "peers", "port": 6881, "protocol": "tcp", "from": "mesh", - "why": "incoming BitTorrent peer connections; the client announces this number to trackers and peers, so the machine must publish it on the same one" + "why": "incoming BitTorrent peer connections; announced to trackers and peers, so qBittorrent listens on the machine port itself (TORRENTING_PORT=${port:6881})" }, { "name": "peers-udp", "port": 6881, "protocol": "udp", "from": "mesh", - "why": "DHT and uTP on the same number as the peer port; announced like it, so published on the same one" + "why": "DHT and uTP on the same number as the peer port" } ], "accesses": [ @@ -71,17 +71,14 @@ "PUID": "1000", "PGID": "1000", "TZ": "Etc/UTC", - "WEBUI_PORT": "8112" + "WEBUI_PORT": "${port:8112}", + "TORRENTING_PORT": "${port:6881}" }, - "ports": [ - "8112:8112", - "6881:6881", - "6881:6881/udp" - ], "volumes": [ "${dir:config}:/config", "/services/media/downloads:/downloads" - ] + ], + "network": "host" }, { "id": "runtime-config",