qbittorrent: it listens on the port the mesh gave it, rather than fixing it

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.
This commit is contained in:
2026-09-30 12:32:16 +02:00
parent 5012f61b00
commit 412d7bc377
+7 -10
View File
@@ -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",