2015-08-07 23:10:20 +00:00
|
|
|
# Transmission with WebUI and OpenVPN
|
2015-08-18 20:23:04 +00:00
|
|
|
Docker container which runs Transmission torrent client with WebUI while connecting to OpenVPN.
|
|
|
|
It bundles certificates and configurations for the following VPN providers:
|
|
|
|
* Private Internet Access
|
|
|
|
* BTGuard
|
2015-08-18 20:28:00 +00:00
|
|
|
* TigerVPN
|
2015-08-31 17:20:37 +00:00
|
|
|
* FrootVPN
|
2015-09-05 14:13:51 +00:00
|
|
|
* TorGuard
|
2015-10-07 16:49:30 +00:00
|
|
|
* NordVPN
|
2015-11-15 19:57:18 +00:00
|
|
|
* UsenetServerVPN
|
|
|
|
* IPVanish
|
2015-11-28 01:00:57 +00:00
|
|
|
* Anonine
|
2015-12-26 14:34:26 +00:00
|
|
|
* HideMe
|
2015-08-18 20:23:04 +00:00
|
|
|
|
2015-08-07 23:10:20 +00:00
|
|
|
When using PIA as provider it will update Transmission hourly with assigned open port. Please read the instructions below.
|
2014-11-09 15:23:18 +00:00
|
|
|
|
2015-05-24 19:09:00 +00:00
|
|
|
## Run container from Docker registry
|
2015-09-10 20:37:03 +00:00
|
|
|
The container is available from the Docker registry and this is the simplest way to get it.
|
|
|
|
To run the container use this command:
|
2014-11-09 15:55:18 +00:00
|
|
|
|
2014-11-16 14:18:02 +00:00
|
|
|
```
|
2015-05-09 17:22:07 +00:00
|
|
|
$ docker run --privileged -d \
|
|
|
|
-v /your/storage/path/:/data \
|
2015-08-07 23:10:20 +00:00
|
|
|
-e "OPENVPN_PROVIDER=PIA" \
|
|
|
|
-e "OPENVPN_CONFIG=Netherlands" \
|
2015-08-07 21:07:55 +00:00
|
|
|
-e "OPENVPN_USERNAME=user" \
|
|
|
|
-e "OPENVPN_PASSWORD=pass" \
|
2015-05-09 17:22:07 +00:00
|
|
|
-p 9091:9091 \
|
|
|
|
haugene/transmission-openvpn
|
|
|
|
```
|
2015-05-10 20:25:43 +00:00
|
|
|
|
2015-08-18 20:23:04 +00:00
|
|
|
You must set the environment variables `OPENVPN_PROVIDER`, `OPENVPN_USERNAME` and `OPENVPN_PASSWORD` to provide basic connection details.
|
2015-05-10 20:25:43 +00:00
|
|
|
|
2015-08-18 20:23:04 +00:00
|
|
|
The `OPENVPN_CONFIG` is an optional variable. If no config is given, a default config will be selected for the provider you have chosen.
|
|
|
|
Find available OpenVPN configurations by looking in the openvpn folder of the GitHub repository.
|
2014-11-16 14:18:02 +00:00
|
|
|
|
2015-08-15 16:22:19 +00:00
|
|
|
As you can see, the container also expects a data volume to be mounted.
|
|
|
|
This is where Transmission will store your downloads, incomplete downloads and look for a watch directory for new .torrent files.
|
2015-09-10 20:37:03 +00:00
|
|
|
By default a folder named transmission-home will also be created under /data, this is where Transmission stores its state.
|
2014-11-16 14:18:02 +00:00
|
|
|
|
|
|
|
|
2015-05-24 19:09:00 +00:00
|
|
|
### Required environment options
|
2015-05-09 19:49:07 +00:00
|
|
|
| Variable | Function | Example |
|
|
|
|
|----------|----------|-------|
|
2015-12-26 14:34:26 +00:00
|
|
|
|`OPENVPN_PROVIDER` | Sets the OpenVPN provider to use. | `OPENVPN_PROVIDER=provider`. Supported providers are `PIA`, `BTGUARD`, `TIGER`, `FROOT`, `TORGUARD`, `NORDVPN`, `USENETSERVER`, `IPVANISH`, `ANONINE` and `HIDEME` |
|
2015-08-07 23:10:20 +00:00
|
|
|
|`OPENVPN_USERNAME`|Your OpenVPN username |`OPENVPN_USERNAME=asdf`|
|
|
|
|
|`OPENVPN_PASSWORD`|Your OpenVPN password |`OPENVPN_PASSWORD=asdf`|
|
2015-05-09 19:49:07 +00:00
|
|
|
|
2015-05-24 19:09:00 +00:00
|
|
|
### Network configuration options
|
2015-05-09 19:49:07 +00:00
|
|
|
| Variable | Function | Example |
|
|
|
|
|----------|----------|-------|
|
2015-08-07 23:10:20 +00:00
|
|
|
|`OPENVPN_CONFIG` | Sets the OpenVPN endpoint to connect to. | `OPENVPN_CONFIG=UK Southampton`|
|
2015-05-09 19:49:07 +00:00
|
|
|
|
2015-05-24 19:09:00 +00:00
|
|
|
### Transmission configuration options
|
2015-05-09 19:49:07 +00:00
|
|
|
|
|
|
|
You may override transmission options by setting the appropriate environment variable.
|
|
|
|
|
2015-09-10 20:37:03 +00:00
|
|
|
The environment variables are the same name as used in the transmission settings.json file
|
|
|
|
and follow the format given in these examples:
|
2015-05-09 19:49:07 +00:00
|
|
|
|
|
|
|
| Transmission variable name | Environment variable name |
|
|
|
|
|----------------------------|---------------------------|
|
|
|
|
| `speed-limit-up` | `TRANSMISSION_SPEED_LIMIT_UP` |
|
|
|
|
| `speed-limit-up-enabled` | `TRANSMISSION_SPEED_LIMIT_UP_ENABLED` |
|
|
|
|
| `ratio-limit` | `TRANSMISSION_RATIO_LIMIT` |
|
|
|
|
| `ratio-limit-enabled` | `TRANSMISSION_RATIO_LIMIT_ENABLED` |
|
|
|
|
|
|
|
|
As you can see the variables are prefixed with `TRANSMISSION_`, the variable is capitalized, and `-` is converted to `_`.
|
|
|
|
|
2015-09-10 20:37:03 +00:00
|
|
|
PS: `TRANSMISSION_BIND_ADDRESS_IPV4` will be overridden to the IP assigned to your OpenVPN tunnel interface.
|
|
|
|
This is to prevent leaking the host IP.
|
2015-05-24 19:09:00 +00:00
|
|
|
|
|
|
|
## Access the WebUI
|
2014-11-09 15:55:18 +00:00
|
|
|
But what's going on? My http://my-host:9091 isn't responding?
|
2015-09-10 20:37:03 +00:00
|
|
|
This is because the VPN is active, and since docker is running in a different ip range than your client the response
|
|
|
|
to your request will be treated as "non-local" traffic and therefore be routed out through the VPN interface.
|
2014-11-09 15:55:18 +00:00
|
|
|
|
|
|
|
### How to fix this
|
2015-09-10 20:37:03 +00:00
|
|
|
There are several ways to fix this. You can pipe and do fancy iptables or ip route configurations on the host and in
|
|
|
|
the container. But I found that the simplest solution is just to proxy my traffic. Start an nginx container like this:
|
2014-11-16 14:28:16 +00:00
|
|
|
|
2014-11-09 15:55:18 +00:00
|
|
|
```
|
2015-08-07 23:55:50 +00:00
|
|
|
$ docker run -d \
|
|
|
|
-v /path/to/nginx.conf:/etc/nginx/nginx.conf:ro \
|
|
|
|
-p 8080:8080 \
|
|
|
|
nginx
|
2014-11-09 15:55:18 +00:00
|
|
|
```
|
2015-08-07 23:55:50 +00:00
|
|
|
|
2014-11-09 15:55:18 +00:00
|
|
|
Where /path/to/nginx.conf has this content:
|
2014-11-16 14:28:16 +00:00
|
|
|
|
2014-11-09 15:55:18 +00:00
|
|
|
```
|
|
|
|
events {
|
|
|
|
worker_connections 1024;
|
|
|
|
}
|
|
|
|
|
|
|
|
http {
|
|
|
|
server {
|
2014-11-16 14:18:02 +00:00
|
|
|
listen 8080;
|
2014-11-09 15:55:18 +00:00
|
|
|
location / {
|
|
|
|
proxy_pass http://host.ip.address.here:9091;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
```
|
2014-11-09 16:09:07 +00:00
|
|
|
Your Transmission WebUI should now be avaliable at "your.host.ip.addr:8080/transmission/web/".
|
2014-11-09 15:55:18 +00:00
|
|
|
Change the port in the docker run command if 8080 is not suitable for you.
|
|
|
|
|
2015-09-10 20:37:03 +00:00
|
|
|
## Known issues
|
|
|
|
Some have encountered problems with DNS resolving inside the docker container.
|
|
|
|
This causes trouble because OpenVPN will not be able to resolve the host to connect to.
|
|
|
|
If you have this problem use dockers --dns flag to override the resolv.conf of the container.
|
|
|
|
For example use googles dns servers by adding --dns 8.8.8.8 --dns 8.8.4.4 as parameters to the usual run command.
|
2015-08-15 23:45:53 +00:00
|
|
|
|
2015-09-10 20:37:03 +00:00
|
|
|
If you are having issues with this container please submit an issue on GitHub.
|
|
|
|
Please provide logs, docker version and other information that can simplify reproducing the issue.
|
|
|
|
Using the latest stable verison of Docker is always recommended. Support for older version is on a best-effort basis.
|
2015-08-15 23:45:53 +00:00
|
|
|
|
|
|
|
## Building the container yourself
|
|
|
|
To build this container, clone the repository and cd into it.
|
|
|
|
|
|
|
|
### Build it:
|
|
|
|
```
|
|
|
|
$ cd /repo/location/docker-transmission-openvpn
|
2015-09-10 20:37:03 +00:00
|
|
|
$ docker build -t transmission-openvpn .
|
2015-08-15 23:45:53 +00:00
|
|
|
```
|
|
|
|
### Run it:
|
|
|
|
```
|
|
|
|
$ docker run --privileged -d \
|
|
|
|
-v /your/storage/path/:/data \
|
|
|
|
-e "OPENVPN_PROVIDER=PIA" \
|
|
|
|
-e "OPENVPN_CONFIG=Netherlands" \
|
|
|
|
-e "OPENVPN_USERNAME=user" \
|
|
|
|
-e "OPENVPN_PASSWORD=pass" \
|
|
|
|
-p 9091:9091 \
|
2015-09-10 20:37:03 +00:00
|
|
|
transmission-openvpn
|
2015-08-15 23:45:53 +00:00
|
|
|
```
|
|
|
|
|
|
|
|
This will start a container as described in the "Run container from Docker registry" section.
|
|
|
|
|
2015-05-24 19:09:00 +00:00
|
|
|
## Controlling Transmission remotely
|
2015-08-15 16:22:19 +00:00
|
|
|
The container exposes /config as a volume. This is the directory where the supplied transmission and OpenVPN credentials will be stored.
|
2015-09-10 20:37:03 +00:00
|
|
|
If you have transmission authentication enabled and want scripts in another container to access and
|
|
|
|
control the transmission-daemon, this can be a handy way to access the credentials.
|
2015-05-24 19:09:00 +00:00
|
|
|
For example, another container may pause or restrict transmission speeds while the server is streaming video.
|