Switch transmission to haugene/transmission-openvpn (real VPN tunneling)#36
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (5)
✅ Files skipped from review due to trivial changes (1)
🚧 Files skipped from review as they are similar to previous changes (1)
📝 WalkthroughWalkthroughThe PR migrates the Transmission service to run behind ChangesTransmission VPN Integration
Sequence Diagram(s)sequenceDiagram
participant UserBrowser as User Browser
participant Transmission as Transmission Container
participant OpenVPN as OpenVPN Client
participant VPNProvider as Internet/VPN Provider
UserBrowser->>Transmission: HTTP RPC / Web UI request
Transmission->>OpenVPN: Route torrent traffic and outbound connections via VPN
OpenVPN->>VPNProvider: Encrypted traffic to provider
Estimated code review effort🎯 4 (Complex) | ⏱️ ~45 minutes Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
The previous compose service used linuxserver/transmission, which has
no VPN support — despite the README claiming VPN tunneling and
.env.example listing OPENVPN_* variables. This PR makes that real.
docker-compose.yml:
- Swap image to haugene/transmission-openvpn.
- Add cap_add NET_ADMIN and devices /dev/net/tun (required by the
in-container OpenVPN client).
- Pass through OPENVPN_PROVIDER/CONFIG/USERNAME/PASSWORD plus
LOCAL_NETWORK (with a 192.168.0.0/16 default so the most common
home subnets work out of the box).
- Volume changes from /config to /data (haugene's convention covers
config + downloads + watch dir under one tree); host path moves
from ${USERDIR}/transmission/config to ${USERDIR}/transmission/data.
- Pass TRANSMISSION_RPC_USERNAME/PASSWORD optionally (blank = no
web UI auth).
.env.example:
- Generic placeholders for OPENVPN_* (no implied provider endorsement)
and a comment pointing at the supported-providers list.
- Add LOCAL_NETWORK with a comment explaining why it matters.
README.md:
- New "Transmission VPN setup" section with required vars, an
IP-leak check command, and the most common failure mode
(web UI unreachable -> wrong LOCAL_NETWORK).
- Add OpenVPN credentials to Prerequisites alongside the other
hard-required values.
CLAUDE.md: replace the "VPN is aspirational" warning with the new
operational facts (volume path, cap_add, LOCAL_NETWORK pitfall).
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
29cc11b to
013b4a5
Compare
There was a problem hiding this comment.
Actionable comments posted: 3
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@CLAUDE.md`:
- Line 42: The docs contradict each other about OPENVPN_*: update the "env
contract" section to mark OPENVPN_PROVIDER, OPENVPN_CONFIG, OPENVPN_USERNAME and
OPENVPN_PASSWORD as required/used (remove any "unused" label), and add a short
note that Transmission uses haugene/transmission-openvpn (data volume is /data,
not /config) and that LOCAL_NETWORK (default 192.168.0.0/16) controls which
destinations bypass the VPN; also mention the compose service requires cap_add:
NET_ADMIN and devices: /dev/net/tun so readers get one consistent rule set.
In `@docker-compose.yml`:
- Line 211: Replace the absolute host bind mount "-
/etc/localtime:/etc/localtime:ro" so it is rooted under the repo's ${USERDIR}
convention: e.g. change the volume entry to use
"${USERDIR}/etc/localtime:/etc/localtime:ro" (or remove the host bind entirely
and configure timezone inside the container) ensuring the mount path references
${USERDIR} rather than an absolute "/etc/localtime".
- Around line 202-205: The compose file is allowing empty OpenVPN env vars
(OPENVPN_PROVIDER, OPENVPN_CONFIG, OPENVPN_USERNAME, OPENVPN_PASSWORD) which
delays failure to runtime; update the environment variable interpolations in
docker-compose.yml to use Docker Compose's fail-fast parameter expansion (the
${VAR:?error} form) for each of these identifiers so docker compose up fails
early with a clear message when any of OPENVPN_PROVIDER, OPENVPN_CONFIG,
OPENVPN_USERNAME, or OPENVPN_PASSWORD is missing or empty.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: 89f01aa9-c5ee-43eb-ad73-c295f1f3fe71
📒 Files selected for processing (4)
.env.exampleCLAUDE.mdREADME.mddocker-compose.yml
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In @.env.example:
- Around line 31-33: The .env.example uses TRANSMISSION_USERNAME /
TRANSMISSION_PASSWORD but the compose setup expects TRANSMISSION_RPC_USERNAME /
TRANSMISSION_RPC_PASSWORD; update the .env.example to use
TRANSMISSION_RPC_USERNAME and TRANSMISSION_RPC_PASSWORD so the env keys match
the compose contract (prefer TRANSMISSION_RPC_* for haugene compatibility), and
ensure any related documentation or references to TRANSMISSION_USERNAME /
TRANSMISSION_PASSWORD are updated to the RPC variants to keep the .env file as
the source of truth.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: b7192962-d905-4eee-ae39-acb71bc9ff1c
📒 Files selected for processing (4)
.env.exampleCLAUDE.mdREADME.mddocker-compose.yml
✅ Files skipped from review due to trivial changes (2)
- CLAUDE.md
- README.md
🚧 Files skipped from review as they are similar to previous changes (1)
- docker-compose.yml
- compose: switch OPENVPN_PROVIDER/CONFIG/USERNAME/PASSWORD to the
fail-fast `${VAR:?must be set}` form so missing credentials are
caught at `docker compose up` instead of inside the container.
Matches the Tracearr secrets pattern.
- compose: drop the /etc/localtime bind mount. TZ=${TZ} handles
container timezone and the repo convention is that bind mounts
are rooted at ${USERDIR}.
- compose + .env.example: rename TRANSMISSION_USERNAME/PASSWORD to
TRANSMISSION_RPC_USERNAME/PASSWORD so the .env contract matches
the haugene image's env-var contract one-to-one (no in-compose
rewriting of var names).
- .env.example: OPENVPN_* values are now blank placeholders (paired
with the new fail-fast). LOCAL_NETWORK keeps its 192.168.0.0/16
default for the common case.
- CI: compose-validate.yml fills in the OPENVPN_* placeholders so
the workflow's `cp .env.example .env` step still produces an
interpolation-clean .env.
- CLAUDE.md: env-var contract section updated to list OPENVPN_* as
hard-required (previously contradicted the Transmission
paragraph). Removed OPENVPN_* from the "older version" examples.
- README: rename the optional auth vars in the VPN setup section.
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Summary
The previous transmission service used
linuxserver/transmission, which has no VPN support — even though the README claimed VPN tunneling and.env.examplelistedOPENVPN_*variables. This swaps inhaugene/transmission-openvpnso the documented behavior matches the actual stack.What changed
docker-compose.yml— image swap,cap_add: [NET_ADMIN]+devices: [/dev/net/tun](required by the in-container OpenVPN client), pass-through ofOPENVPN_*andLOCAL_NETWORK, volume moved from/configto/data(haugene's convention)..env.example— generic placeholders forOPENVPN_*(no implied provider endorsement), newLOCAL_NETWORKwith a comment, and the existing comment block updated to point at the supported-providers list.README.md— new "Transmission VPN setup" section walking through required vars, an IP-leak check (docker compose exec transmission curl ipinfo.io), and the most common failure mode (web UI unreachable whenLOCAL_NETWORKdoesn't cover your LAN subnet). OpenVPN credentials added to Prerequisites.CLAUDE.md— replaces the "VPN is aspirational" warning with the operational facts.Breaking changes
${USERDIR}/transmission/configto${USERDIR}/transmission/data. Existing users will need to either move their transmission state or update the bind mount.Type of change
feat/)fix/) — the README has always claimed VPN support that didn't existdocs/)Validation
docker compose configresolves cleanly with placeholder env (see commit description).env.exampleRelated
Conflicts with #35 on
.env.example— that PR removesOPENVPN_*for being unused; this PR re-uses them. Whichever merges second will need a small rebase on the Transmission/OpenVPN section of.env.example. Suggested order: merge #35 first, then rebase this onto main and re-apply the.env.examplechanges from this PR's diff.Summary by CodeRabbit
New Features
Documentation