set vpn provider as required param

This commit is contained in:
Kristian Haugene 2015-08-18 22:23:04 +02:00
parent 203219a713
commit 8d8a2c3c8c
3 changed files with 20 additions and 15 deletions

View File

@ -23,7 +23,7 @@ ADD transmission/ /etc/transmission/
ENV OPENVPN_USERNAME=**None** \
OPENVPN_PASSWORD=**None** \
OPENVPN_PROVIDER=PIA \
OPENVPN_PROVIDER=**None** \
"TRANSMISSION_ALT_SPEED_DOWN=50" \
"TRANSMISSION_ALT_SPEED_ENABLED=false" \
"TRANSMISSION_ALT_SPEED_TIME_BEGIN=540" \

View File

@ -1,5 +1,10 @@
# Transmission with WebUI and OpenVPN
This Docker container lets you run Transmission with WebUI while connecting to either BTGUARD or PIA OpenVPN.
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
* tigerVPN
When using PIA as provider it will update Transmission hourly with assigned open port. Please read the instructions below.
## Run container from Docker registry
@ -16,12 +21,10 @@ $ docker run --privileged -d \
haugene/transmission-openvpn
```
The `OPENVPN_PROVIDER` and `OPENVPN_CONFIG` are optional variables. If no provider is given, it will default to PIA.
If no config is given, a default config will be selected for the provider you have chosen.
The only mandatory environment variables are your OpenVPN username and password.
You must set the environment variables `OPENVPN_USERNAME` and `OPENVPN_PASSWORD` to the credentials given by your OpenVPN provider.
You must set the environment variables `OPENVPN_PROVIDER`, `OPENVPN_USERNAME` and `OPENVPN_PASSWORD` to provide basic connection details.
Find the OpenVPN configurations avaliable by looking in the openvpn folder of the GitHub repository.
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.
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.
@ -31,13 +34,13 @@ By default there will also be created a transmission-home folder under /data whe
### Required environment options
| Variable | Function | Example |
|----------|----------|-------|
|`OPENVPN_PROVIDER` | Sets the OpenVPN provider to use. | `OPENVPN_PROVIDER=BTGUARD` or <br>`OPENVPN_PROVIDER=PIA` or <br>`OPENVPN_PROVIDER=TIGER`|
|`OPENVPN_USERNAME`|Your OpenVPN username |`OPENVPN_USERNAME=asdf`|
|`OPENVPN_PASSWORD`|Your OpenVPN password |`OPENVPN_PASSWORD=asdf`|
### Network configuration options
| Variable | Function | Example |
|----------|----------|-------|
|`OPENVPN_PROVIDER` | Sets the OpenVPN provider to use. | `OPENVPN_PROVIDER=BTGUARD` or <br>`OPENVPN_PROVIDER=PIA`|
|`OPENVPN_CONFIG` | Sets the OpenVPN endpoint to connect to. | `OPENVPN_CONFIG=UK Southampton`|
|`RESOLV_OVERRIDE` | The value of this variable will be written to `/etc/resolv.conf`. | `RESOLV_OVERRIDE=nameserver 8.8.8.8\nnameserver 8.8.4.4\n`|

View File

@ -1,17 +1,19 @@
#!/bin/sh
if [ "$OPENVPN_PROVIDER" = "BTGUARD" ]
then
echo "VPN PROVIDER: BTGUARD"
if [ "$OPENVPN_PROVIDER" = "BTGUARD" ]; then
vpn_provider="btguard"
else if [ "$OPENVPN_PROVIDER" = "PIA" ]
echo "VPN PROVIDER: PIA"
elif [ "$OPENVPN_PROVIDER" = "PIA" ]; then
vpn_provider="pia"
else
echo "VPN PROVIDER: TIGER"
elif [ "$OPENVPN_PROVIDER" = "TIGER" ]; then
vpn_provider="tiger"
else
echo "Could not find OpenVPN provider: $OPENVPN_PROVIDER"
echo "Please check your settings."
exit 1
fi
echo "Using OpenVPN provider: $OPENVPN_PROVIDER"
if [ ! -z "$OPENVPN_CONFIG" ]
then
if [ -f /etc/openvpn/$vpn_provider/"${OPENVPN_CONFIG}".ovpn ]