From 4b30b43c7fdbdd27cab8fda2509706fa2ddaddd2 Mon Sep 17 00:00:00 2001 From: Julien Lutran Date: Mon, 17 Aug 2026 17:38:43 +0200 Subject: [PATCH] nuc/transmission-bt: document the watch folder for auto-adding torrents scp a .torrent into /srv/media/.watchdir and Transmission auto-downloads it. Documents the settings (watch-dir-force-generic + trash-original), the correct active config path (--config-dir .../info), and the perms. Co-Authored-By: Claude Opus 4.8 --- nuc/transmission-bt.md | 47 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 47 insertions(+) diff --git a/nuc/transmission-bt.md b/nuc/transmission-bt.md index a6d9b3c..45d19be 100644 --- a/nuc/transmission-bt.md +++ b/nuc/transmission-bt.md @@ -15,6 +15,8 @@ the container simply has no path to the internet. - Downloads: `/media/downloads` (= `usb4t/media`, same dataset Jellyfin reads); in-progress files in `/media/.incomplete` so Jellyfin never scans partials +- Watch folder: `scp` a `.torrent` into `/srv/media/.watchdir` on the host + and it auto-downloads (see "Watch folder" below) - `transmission-daemon` is `BindsTo=wg-quick@wg0.service` and binds peer traffic to `10.8.0.21` — three independent layers against leaks (no default route, unit binding, socket binding) @@ -125,6 +127,51 @@ incus exec wireguard -- wg set wg0 peer allowed-ips 10.8.0.21/32 incus exec wireguard -- wg-quick save wg0 ``` +## Watch folder (auto-add torrents) + +Drop a `.torrent` into `/srv/media/.watchdir` on the host and Transmission +auto-adds it and starts downloading — no web UI needed. The folder lives on +the shared `usb4t/media` dataset (`/media/.watchdir` inside the container). + +Edit the **active** config only while the daemon is stopped (it rewrites +`settings.json` on exit). The active file is +`/var/lib/transmission-daemon/info/settings.json` — the daemon runs with +`--config-dir /var/lib/transmission-daemon/info` from +`/etc/default/transmission-daemon`, *not* the `.config` dir. + +```bash +incus exec transmission-bt -- install -d -o debian-transmission \ + -g debian-transmission -m 0775 /media/.watchdir +incus exec transmission-bt -- systemctl stop transmission-daemon +incus exec transmission-bt -- python3 - <<'PY' +import json +p = "/var/lib/transmission-daemon/info/settings.json" +c = json.load(open(p)) +c.update({ + "watch-dir": "/media/.watchdir", + "watch-dir-enabled": True, + "watch-dir-force-generic": True, # poll (reliable across the shift mount) + "trash-original-torrent-files": True, # delete the .torrent once added +}) +json.dump(c, open(p, "w"), indent=4) +PY +incus exec transmission-bt -- systemctl start transmission-daemon +``` + +Usage — the `.torrent` is consumed within a few seconds: + +```sh +scp some.torrent root@192.168.0.3:/srv/media/.watchdir/ +``` + +- `watch-dir-force-generic: true` makes Transmission **poll** the folder + instead of using inotify, so it reliably sees files written from the host + side across the shift-mounted share. +- `trash-original-torrent-files: true` self-cleans the folder. A *malformed* + `.torrent` is not trashed and gets retried each poll — delete it by hand. +- The watchdir is owned by `debian-transmission` (0775): root's `scp` writes + fine, and Transmission can read the file and remove it after adding. + ## Verification ```sh