Files
app-catalog-felhom.eu/templates/transmission/docker-compose.yml
T

124 lines
7.0 KiB
YAML

# Transmission - Egyszerű torrent letöltő webes felülettel
# Domain: ${SUBDOMAIN}.${DOMAIN}
# Database: none (its settings and torrent state are files in the config volume)
# RAM: ~40M idle, more while downloading (mem_limit: 512M) | Pi-compatible: Yes (amd64, arm64)
#
# WHY A SECOND TORRENT CLIENT (operator ruling 2026-10-12): qBittorrent is the full one; this is the
# light one - the client most NAS owners already know, at a quarter of the memory. Same job, simpler
# surface, and it is the one to offer on a small box.
#
# THE IMAGE IS NOT THE PROJECT'S OWN, and this is the first template in this catalog where that is
# true (operator ruling 2026-10-12, asked and answered before the build). The Transmission project
# publishes NO Docker image; `lscr.io/linuxserver/transmission` is the maintained community one
# (version-4.1.3-r0, built from the upstream release, versioned tags, amd64 + arm64). Checklist 0.3
# wants an official image; the onboarding record carries this as a named exception with its reason.
#
# FIRST ADMIN (class 1 - generated by us at install, FIRST-ADMIN.md). The image's init script sets
# `rpc-authentication-required=true` plus the username and password from USER/PASS on EVERY start, so
# the generated password is re-applied rather than seeded once. With USER/PASS unset the same script
# sets `rpc-authentication-required=false` - an app open to anyone who knows the name. They are never
# unset here.
#
# THE PUBLIC NAME: Transmission validates the Host header through `rpc-host-whitelist`. HOST_WHITELIST
# carries the app's own public name, which is tighter than the image's default (validation off when
# the variable is empty). WHITELIST (the IP allow-list) stays off: traffic arrives from traefik, so an
# address allow-list would either admit everyone behind the proxy or nobody.
#
# NO INBOUND PEER PORT, deliberately - as for qBittorrent. The tunnel carries HTTP only and the box
# opens no port at home (01-topology-and-trust.md §7), so Transmission runs outbound-only: downloads
# work, poorly seeded torrents are slower.
#
# Environment variables:
# DOMAIN - Your domain (e.g., demo-felhom.eu)
# SUBDOMAIN - The name this app answers on
# HDD_PATH - The drive the downloads go to
# TR_ADMIN_PASSWORD - generated at install (deploy_fields), re-applied at every start
#
# Folders: the downloads in ${USERDATA_PATH}/media/transmission (the household sees them in the file
# browser); the settings and the torrent state in the named volume transmission_config (NVMe).
services:
transmission:
image: lscr.io/linuxserver/transmission:version-4.1.3-r0
container_name: transmission
restart: unless-stopped
environment:
- TZ=Europe/Budapest
- PUID=1000
- PGID=1000
- UMASK=022
- USER=admin
- PASS=${TR_ADMIN_PASSWORD}
# The whitelist is a Host-header allow-list and it answers 400 to anything else - the
# container's OWN healthcheck included, which dials 127.0.0.1. Measured on the bench
# 2026-10-12: with the public name alone the app never goes healthy. The local names are
# what Transmission itself allows by default; the point of the list is DNS rebinding from a
# browser, which a request from inside the container is not.
- HOST_WHITELIST=${SUBDOMAIN}.${DOMAIN},localhost,127.0.0.1
- PEERPORT=51413
# The download folder, at the SAME path inside the container as on the box (R-1014): Sonarr and Radarr see the
# file at exactly the path Transmission reports, and hardlink it into the library.
- TR_DL=${USERDATA_PATH}/media/transmission
# The image's init copies /defaults/settings.json on first boot and then patches only what the
# env vars name. `port-forwarding-enabled` is NOT one of them and Transmission's own default is
# TRUE - the app asks the household's router for a forwarded port (read on 9202 2026-10-12:
# "port-forwarding-enabled": true). The box opens no port at home, so it is turned off here,
# before the service starts, with the jq the image already carries.
entrypoint:
- /bin/sh
- -c
- |
CONF=/config/settings.json
if [ ! -f "$$CONF" ]; then
cp /defaults/settings.json "$$CONF"
fi
# The default folders live at the same path as on the box. A fresh config (/defaults: /downloads/complete) and
# an install from before 2026-10-14 are moved the same way; a folder the household chose elsewhere is kept.
# Old torrents keep /downloads/... in their own resume data, and the bind below keeps that path alive.
# ONE incomplete folder for every torrent would sit on one drive and make every other drive's download a
# cross-drive copy at completion — off, written here at start (an RPC setting was lost on a power cut, R-1024).
jq --arg d "$$TR_DL" '.["port-forwarding-enabled"] = false | .["incomplete-dir-enabled"] = false
| (.["download-dir"], .["incomplete-dir"]) |= (if startswith("/downloads") then $$d + .[10:] else . end)' "$$CONF" > /tmp/s.json && mv /tmp/s.json "$$CONF"
exec /init
volumes:
# ONLY the download folder (operator ruling 2026-10-14, D9 = A with a limit): the app can never reach the
# family's photos, music or books. Same path inside as outside.
- ${USERDATA_PATH}/media/transmission:${USERDATA_PATH}/media/transmission
# The SAME folder under its old name, for torrents added before 2026-10-14 (their resume data names /downloads).
- ${USERDATA_PATH}/media/transmission:/downloads
# Dropping a .torrent file into this folder starts it - the household sees the folder in the
# file browser. The image watches /watch and logs an error when it does not exist.
- ${USERDATA_PATH}/media/transmission/watch:/watch
- transmission_config:/config
networks:
- traefik-public
deploy:
resources:
limits:
memory: 512M
healthcheck:
# Transmission answers 401 on EVERY path once authentication is on, so `curl -f` can never
# succeed and the container reads unhealthy for ever (measured on the bench 2026-10-12: exit 22,
# "The requested URL returned error: 401"). A 401 is the web server answering, which is what a
# liveness probe needs; the controller's own `type: http` probe counts any response as alive
# (felhom-controller/internal/stacks/healthprobe.go:292), so the two agree.
test: ["CMD-SHELL", "curl -s -o /dev/null -w '%{http_code}' http://127.0.0.1:9091/transmission/web/ | grep -qE '^(200|401)$$'"]
interval: 30s
timeout: 5s
retries: 3
start_period: 30s
labels:
- "traefik.enable=true"
- "traefik.http.routers.transmission.rule=Host(`${SUBDOMAIN}.${DOMAIN}`)"
- "traefik.http.routers.transmission.entrypoints=websecure"
- "traefik.http.routers.transmission.tls=true"
- "traefik.http.routers.transmission.tls.certresolver=letsencrypt"
- "traefik.http.services.transmission.loadbalancer.server.port=9091"
volumes:
transmission_config:
networks:
traefik-public:
external: true