### Test Docker Installation Source: https://github.com/haugene/docker-transmission-openvpn/blob/master/docs/debug.md Verifies that Docker is installed and running correctly on the host system by executing a simple 'hello-world' container. ```bash docker run --rm hello-world ``` -------------------------------- ### Podman Run: Transmission-OpenVPN Setup (Privileged) Source: https://github.com/haugene/docker-transmission-openvpn/blob/master/README.md This example shows how to run the Transmission-OpenVPN container using `podman run`. It uses the `--privileged` flag for full host OS access, maps volumes, sets VPN and network environment variables, configures logging, and maps the Transmission WebUI port. ```bash podman run --privileged -d \ -v /your/storage/path/:/data \ -v /your/config/path/:/config \ -e OPENVPN_PROVIDER=PIA \ -e OPENVPN_CONFIG=france \ -e OPENVPN_USERNAME=user \ -e OPENVPN_PASSWORD=pass \ -e LOCAL_NETWORK=192.168.0.0/16 \ --log-driver k8s-file \ --log-opt max-size=10m \ -p 9091:9091 \ haugene/transmission-openvpn ``` -------------------------------- ### Transmission RSS Configuration File Example Source: https://github.com/haugene/docker-transmission-openvpn/blob/master/docs/rss-plugin.md An example of the transmission-rss.conf file used to configure the Transmission RSS Docker container. It includes settings for feeds, server connection details, and RPC login credentials. ```yaml feeds: - url: download_path: regexp: server: host: transmission port: 9091 rpc_path: /transmission/rpc login: username: password: ``` -------------------------------- ### OpenVPN --up Directive Example Source: https://github.com/haugene/docker-transmission-openvpn/blob/master/docs/building-blocks.md Demonstrates the OpenVPN --up directive, which allows executing a command after a successful TUN/TAP device connection. This is used to trigger the startup sequence for Transmission. ```bash --up cmd ``` -------------------------------- ### Docker Run Command with Credentials File Source: https://github.com/haugene/docker-transmission-openvpn/blob/master/docs/faq.md Example Docker run command to start the transmission-openvpn container, mounting a local credentials file to /config/openvpn-credentials.txt. This method avoids exposing credentials via environment variables. ```bash $ docker run --cap-add=NET_ADMIN -d \ -v /your/storage/path/:/data \ -v ./openvpn-credentials.txt:/config/openvpn-credentials.txt \ -e OPENVPN_PROVIDER=PIA \ -e OPENVPN_CONFIG=france \ -e OPENVPN_USERNAME=**None** \ -e OPENVPN_PASSWORD=**None** \ -e LOCAL_NETWORK=192.168.0.0/16 \ --log-driver json-file \ --log-opt max-size=10m \ -p 9091:9091 \ haugene/transmission-openvpn ``` -------------------------------- ### Privoxy Start Script Source: https://github.com/haugene/docker-transmission-openvpn/blob/master/docs/building-blocks.md References the script used to start the Privoxy proxy server. This script is also executed by 'tunnelUp.sh' as part of the service startup. ```bash privoxy/scripts/start.sh ``` -------------------------------- ### Run Transmission RSS Docker Container Source: https://github.com/haugene/docker-transmission-openvpn/blob/master/docs/rss-plugin.md Starts the Transmission RSS Docker container in detached mode. Requires setting the RSS_URL environment variable and linking to the Transmission container. A default configuration file is created on first run if none is mounted. ```bash $ docker run -d \ -e "RSS_URL=" \ --link :transmission \ --name "transmission-rss" \ haugene/transmission-rss ``` -------------------------------- ### Test Container Internet and DNS Source: https://github.com/haugene/docker-transmission-openvpn/blob/master/docs/debug.md Checks if Docker containers have internet access and can resolve hostnames using DNS. It runs an Alpine container, installs curl, and fetches the public IP address. ```bash docker run --rm -it alpine sh -c "apk add curl && curl ipecho.net/plain" ``` -------------------------------- ### Credentials File Format Source: https://github.com/haugene/docker-transmission-openvpn/blob/master/docs/faq.md Example format for the credentials file, containing the VPN username on the first line and the password on the second line. This file is used by the transmission-openvpn container. ```text this_is_my_username this_is_my_password ``` -------------------------------- ### Transmission Start Script Source: https://github.com/haugene/docker-transmission-openvpn/blob/master/docs/building-blocks.md References the script responsible for initiating the Transmission daemon. This script is called by 'tunnelUp.sh' after a successful VPN connection. ```bash transmission/start.sh ``` -------------------------------- ### TunnelUp.sh Script Execution Source: https://github.com/haugene/docker-transmission-openvpn/blob/master/docs/building-blocks.md Illustrates how the 'tunnelUp.sh' script is invoked by OpenVPN's --up directive. This script orchestrates the startup of Transmission and Privoxy services. ```bash openvpn/tunnelUp.sh ``` -------------------------------- ### Get and Sort Server Load Percentages (curl & jq) Source: https://github.com/haugene/docker-transmission-openvpn/blob/master/docs/provider-specific.md Retrieves server statistics from the NordVPN API, sorts them by load percentage, and displays the server hostname and its load. Requires curl and jq to be installed. ```Shell curl --silent https://api.nordvpn.com/server/stats | jq '. | to_entries|sort_by(.value.percent) | "\(.[].key): \(.[].value.percent)"' ``` -------------------------------- ### Run Docker Transmission OpenVPN with PIA Source: https://github.com/haugene/docker-transmission-openvpn/blob/master/docs/debug.md Starts the Docker container with elevated network privileges and configures it to use PIA (Private Internet Access) as the VPN provider with a specific configuration. It also disables the port updater script. ```docker docker run --rm -it --cap-add=NET_ADMIN \ -e OPENVPN_PROVIDER=PIA \ -e OPENVPN_CONFIG=france \ -e OPENVPN_USERNAME=username \ -e OPENVPN_PASSWORD=password \ -e DISABLE_PORT_UPDATER=true \ haugene/transmission-openvpn ``` -------------------------------- ### Managing the Systemd Service Source: https://github.com/haugene/docker-transmission-openvpn/blob/master/docs/tips-tricks.md These bash commands are used to manage the systemd service for the docker-transmission-openvpn container. `systemctl enable` ensures the service starts on boot, and `systemctl restart` starts or restarts the service immediately. `systemctl stop` is used to stop the service. ```bash sudo systemctl enable /etc/systemd/system/transmission-openvpn.service sudo systemctl restart transmission-openvpn.service ``` ```bash sudo systemctl stop transmission-openvpn.service # Later ... sudo systemctl start transmission-openven.service ``` -------------------------------- ### Get List of Available Server Hostnames (curl & jq) Source: https://github.com/haugene/docker-transmission-openvpn/blob/master/docs/provider-specific.md Retrieves a list of all available NordVPN server hostnames from the server statistics endpoint. Requires curl and jq to be installed. ```Shell curl --silent https://api.nordvpn.com/server/stats | jq '. |to_entries | .[].key') ``` -------------------------------- ### Check Docker Container Status Source: https://github.com/haugene/docker-transmission-openvpn/blob/master/docs/debug.md Lists all running Docker containers. It can be filtered to show only containers from a specific image, such as 'haugene/transmission-openvpn'. ```bash docker ps --filter ancestor=haugene/transmission-openvpn ``` -------------------------------- ### Get Specific Server Load Percentage (curl & jq) Source: https://github.com/haugene/docker-transmission-openvpn/blob/master/docs/provider-specific.md Fetches the load percentage for a specific NordVPN server by its hostname using the NordVPN API. Requires curl and jq to be installed. ```Shell curl --silent https://api.nordvpn.com/server/stats/ca1509.nordvpn.com | jq '.percent' ``` -------------------------------- ### Execute Command Inside Docker Container Source: https://github.com/haugene/docker-transmission-openvpn/blob/master/docs/debug.md Executes a command (e.g., 'bash') inside a running Docker container using its ID. This allows for direct interaction with the container's environment. ```bash docker exec -it bash ``` -------------------------------- ### Configure Local Network for RTNETLINK Source: https://github.com/haugene/docker-transmission-openvpn/blob/master/docs/faq.md This example illustrates the correct format for the LOCAL_NETWORK environment variable to avoid RTNETLINK errors. It emphasizes the need for a valid subnet in CIDR notation. ```shell LOCAL_NETWORK=10.80.0.0/24 ``` -------------------------------- ### Run Docker Transmission OpenVPN Container Source: https://github.com/haugene/docker-transmission-openvpn/blob/master/docs/run-container.md This command starts the transmission-openvpn container with specified configurations. It includes essential parameters for network administration, volume mapping for data and configuration persistence, VPN provider details, and logging preferences. The container is run in detached mode (`-d`) and exposes the Transmission web UI port. ```bash docker run --cap-add=NET_ADMIN -d \ -v /your/storage/path/:/data \ -v /your/config/path/:/config \ -e OPENVPN_PROVIDER=PIA \ -e OPENVPN_CONFIG=france \ -e OPENVPN_USERNAME=user \ -e OPENVPN_PASSWORD=pass \ -e LOCAL_NETWORK=192.168.0.0/16 \ --log-driver json-file \ --log-opt max-size=10m \ -p 9091:9091 \ haugene/transmission-openvpn ``` -------------------------------- ### Set OPENVPN_CONFIG Environment Variable Source: https://github.com/haugene/docker-transmission-openvpn/blob/master/docs/config-options.md This example demonstrates setting the OPENVPN_CONFIG environment variable to define the OpenVPN endpoint for the connection. ```bash OPENVPN_CONFIG=UK Southampton ``` -------------------------------- ### Run Transmission RSS Docker with Custom Config Source: https://github.com/haugene/docker-transmission-openvpn/blob/master/docs/rss-plugin.md Runs the Transmission RSS Docker container with a custom configuration file mounted. This allows for advanced settings like feed URLs, download paths, regex filters, and RPC login credentials. ```bash $ docker run -d \ -v :/etc/transmission-rss.conf \ --link :transmission \ --name "transmission-rss" \ haugene/transmission-rss ``` -------------------------------- ### Set LOCAL_NETWORK Environment Variable Source: https://github.com/haugene/docker-transmission-openvpn/blob/master/docs/config-options.md This example shows how to set the LOCAL_NETWORK environment variable, which specifies the local network that should have access. It accepts a comma-separated list of networks. ```bash LOCAL_NETWORK=192.168.0.0/24 ``` -------------------------------- ### Docker Compose v3.3: Transmission-OpenVPN Configuration Source: https://github.com/haugene/docker-transmission-openvpn/blob/master/README.md This `docker-compose.yml` file configures the Transmission-OpenVPN service using version 3.3. It specifies capabilities, volume mounts, environment variables for VPN and network settings, logging preferences, port mapping for the WebUI, and the Docker image. ```yaml version: '3.3' services: transmission-openvpn: cap_add: - NET_ADMIN volumes: - '/your/storage/path/:/data' - '/your/config/path/:/config' environment: - OPENVPN_PROVIDER=PIA - OPENVPN_CONFIG=france - OPENVPN_USERNAME=user - OPENVPN_PASSWORD=pass - LOCAL_NETWORK=192.168.0.0/16 logging: driver: json-file options: max-size: 10m ports: - '9091:9091' image: haugene/transmission-openvpn ``` -------------------------------- ### Enable TUN Device Creation Source: https://github.com/haugene/docker-transmission-openvpn/blob/master/docs/config-options.md This example demonstrates setting the CREATE_TUN_DEVICE environment variable to 'true'. This action creates a /dev/net/tun device within the container, removing the need to mount the device from the host. ```bash CREATE_TUN_DEVICE=true ``` -------------------------------- ### Update Transmission Settings Script Source: https://github.com/haugene/docker-transmission-openvpn/blob/master/docs/building-blocks.md Highlights the Python script used to update Transmission's configuration file (settings.json). It reads environment variables to override specific settings, such as the bind address. ```python transmission/updateSettings.py ``` -------------------------------- ### Set OPENVPN_PROVIDER Environment Variable Source: https://github.com/haugene/docker-transmission-openvpn/blob/master/docs/config-options.md This example shows how to set the OPENVPN_PROVIDER environment variable to specify the OpenVPN provider. The supported providers and their respective configuration values are detailed elsewhere in the documentation. ```bash OPENVPN_PROVIDER=provider ``` -------------------------------- ### Test Invalid VPN Authentication Source: https://github.com/haugene/docker-transmission-openvpn/blob/master/docs/debug.md Simulates an invalid VPN login attempt to confirm that the container can connect to the VPN server and report authentication failures. This helps verify the VPN connection mechanism. ```bash docker run --rm -it -e OPENVPN_PROVIDER=PIA -e OPENVPN_CONFIG=france -e OPENVPN_USERNAME=donald -e OPENVPN_PASSWORD=duck haugene/transmission-openvpn ``` ```bash docker run --rm -it \ -e OPENVPN_PROVIDER=PIA \ -e OPENVPN_CONFIG=france \ -e OPENVPN_USERNAME=donald \ -e OPENVPN_PASSWORD=duck \ haugene/transmission-openvpn ``` -------------------------------- ### Set OPENVPN_USERNAME Environment Variable Source: https://github.com/haugene/docker-transmission-openvpn/blob/master/docs/config-options.md This example shows how to set the OPENVPN_USERNAME environment variable with your OpenVPN username. ```bash OPENVPN_USERNAME=asdf ``` -------------------------------- ### Docker Compose v2.0: Transmission-OpenVPN Configuration Source: https://github.com/haugene/docker-transmission-openvpn/blob/master/README.md This `docker-compose.yml` file defines the Transmission-OpenVPN service using version 2.0. It includes container naming, capability settings, volume mappings, environment variables for VPN connection and network, logging configuration, port forwarding for the WebUI, and the specific Docker image to use. ```yaml version: "2.0" services: transmission-openvpn: container_name: transmission cap_add: - NET_ADMIN volumes: - '/your/storage/path/:/data' - '/your/config/path/:/config' environment: - OPENVPN_PROVIDER=PIA - OPENVPN_CONFIG=france - OPENVPN_USERNAME=user - OPENVPN_PASSWORD=pass - LOCAL_NETWORK=192.168.0.0/16 logging: driver: "json-file" options: max-size: 10m ports: - 9091:9091 image: haugene/transmission-openvpn ``` -------------------------------- ### Verify VPN Traffic Using curl Source: https://github.com/haugene/docker-transmission-openvpn/blob/master/docs/faq.md This example demonstrates how to check if your containerized traffic is routed through the VPN using the `curl` command inside the container. It fetches the public IP address from different services. ```shell docker exec curl --silent "http://ipinfo.io/ip" ``` ```shell docker exec curl --silent "http://ipecho.net/plain" ``` ```shell docker exec curl --silent "http://icanhazip.com" ``` -------------------------------- ### Access Transmission Web UI via Docker Source: https://github.com/haugene/docker-transmission-openvpn/blob/master/docs/debug.md Runs the Docker container, exposing the Transmission Web UI port (9091) to the host and defining a local network range to prevent tunneling. This allows access to Transmission through a web browser. ```docker docker run --rm -it --cap-add=NET_ADMIN \ -p 9091:9091 \ -e LOCAL_NETWORK=192.168.0.0/16 \ -e OPENVPN_PROVIDER=PIA \ -e OPENVPN_CONFIG=france \ -e OPENVPN_USERNAME=username \ -e OPENVPN_PASSWORD=password \ -e DISABLE_PORT_UPDATER=true \ haugene/transmission-openvpn ``` -------------------------------- ### Run Transmission OpenVPN Proxy Container Source: https://github.com/haugene/docker-transmission-openvpn/blob/master/docs/vpn-networking.md This command starts the transmission-openvpn-proxy container, which can be used to reverse proxy traffic to the Transmission container. It links to the Transmission container and exposes port 8080. ```bash $ docker run -d \ --link :transmission \ -p 8080:8080 \ --name transmission-openvpn-proxy \ haugene/transmission-openvpn-proxy ``` -------------------------------- ### Check Docker Network Configuration Source: https://github.com/haugene/docker-transmission-openvpn/blob/master/docs/debug.md Verifies that the Docker daemon is using a bridge network by default. It runs an Alpine container and prints its iptable routes to check for expected 172.x.0.0/16 addresses. ```bash docker run --rm -it alpine ip r ``` -------------------------------- ### Curl Transmission Web UI from Inside Container Source: https://github.com/haugene/docker-transmission-openvpn/blob/master/docs/debug.md Attempts to access the Transmission Web UI from within the running container by curling the local address and port. A successful response indicates Transmission is running and accessible. ```bash curl localhost:9091 ``` -------------------------------- ### Control PEER_DNS_PIN_ROUTES Source: https://github.com/haugene/docker-transmission-openvpn/blob/master/docs/config-options.md This example demonstrates setting the PEER_DNS_PIN_ROUTES environment variable to 'false'. This action disables the default behavior of forcing traffic to the peer DNS through the OpenVPN tunnel. ```bash PEER_DNS_PIN_ROUTES=false ``` -------------------------------- ### Invalid LOCAL_NETWORK Configuration Example Source: https://github.com/haugene/docker-transmission-openvpn/blob/master/docs/faq.md This snippet shows an invalid configuration for the LOCAL_NETWORK variable that can lead to RTNETLINK errors. It highlights the mistake of using an IP address with a subnet mask instead of a proper subnet. ```shell #Invalid because the subnet for this range would be 10.20.30.0/24 LOCAL_NETWORK=10.20.30.45/24 ``` -------------------------------- ### Docker Compose: Specify DNS Servers Source: https://github.com/haugene/docker-transmission-openvpn/blob/master/docs/faq.md Configures the container to use specific DNS servers within a Docker Compose setup. This ensures consistent DNS resolution across services. ```yaml services: transmission-openvpn: image: haugene/transmission-openvpn dns: - 8.8.8.8 - 8.8.4.4 ``` -------------------------------- ### Docker Compose: Transmission with Dante Socks5 Proxy Source: https://github.com/haugene/docker-transmission-openvpn/blob/master/docs/tips-tricks.md This snippet shows a docker-compose.yml configuration to run the transmission-openvpn container alongside a Dante socks5 proxy. It configures environment variables for OpenVPN, maps ports, and sets up the Dante container to use the transmission-openvpn network and wait for the VPN to connect before starting. ```yaml version: '3.3' services: transmission-openvpn: cap_add: - NET_ADMIN volumes: - '/your/storage/path/:/data' environment: - OPENVPN_PROVIDER=PIA - OPENVPN_CONFIG=france - OPENVPN_USERNAME=user - OPENVPN_PASSWORD=pass - LOCAL_NETWORK=192.168.0.0/16 logging: driver: json-file options: max-size: 10m ports: - '9091:9091' - '1080:1080' # This is Dante Socks5 Port – managed by VPN Service Network restart: unless-stopped image: haugene/transmission-openvpn socks5-proxy: image: wernight/dante restart: unless-stopped network_mode: service:transmission-openvpn depends_on: - transmission-openvpn command: - /bin/sh - -c - | echo "Waiting for VPN to connect . . ." while ! ip link show tun0 >/dev/null 2>&1 || ! ip link show tun0 | grep -q "UP"; do sleep 1; done echo "VPN connected. Starting proxy service . . ." sed -i 's/^\(external:\).*/\1 tun0/' /etc/sockd.conf sockd ``` -------------------------------- ### Set Timezone using TZ Variable Source: https://github.com/haugene/docker-transmission-openvpn/blob/master/docs/config-options.md This example shows how to set the Timezone (TZ) environment variable using a valid tz database format. The default timezone is UTC. ```bash TZ=UTC ``` -------------------------------- ### Set OPENVPN_PASSWORD Environment Variable Source: https://github.com/haugene/docker-transmission-openvpn/blob/master/docs/config-options.md This example shows how to set the OPENVPN_PASSWORD environment variable with your OpenVPN password. It also includes a note about handling special characters differently between Docker run and docker-compose. ```bash OPENVPN_PASSWORD=asdf ``` -------------------------------- ### Configure LOCAL_NETWORK for Web UI Access Source: https://github.com/haugene/docker-transmission-openvpn/blob/master/docs/run-container.md The LOCAL_NETWORK environment variable allows you to specify IP ranges that can access the Transmission Web UI through the VPN. It's crucial for granting access to your local network. You need to set this variable according to your network's IP range and desired specificity, using CIDR notation. For example, if your network is in the 10.x.y.z space, you might use `10.x.0.0/16` or `10.x.y.0/24`. Narrower ranges are generally preferred for security. ```shell LOCAL_NETWORK=192.168.0.0/16 # or LOCAL_NETWORK=10.x.0.0/16 # or LOCAL_NETWORK=10.x.y.0/24 # or for a more specific typical network LOCAL_NETWORK=192.168.1.0/24 ``` -------------------------------- ### Control PEER_DNS Usage Source: https://github.com/haugene/docker-transmission-openvpn/blob/master/docs/config-options.md This example shows how to set the PEER_DNS environment variable. Setting it to 'false' prevents the use of DNS provided by the OpenVPN endpoint, allowing the use of host DNS and potentially preventing DNS leakage. ```bash PEER_DNS=false ``` -------------------------------- ### Enable IPv6 for Mullvad VPN Source: https://github.com/haugene/docker-transmission-openvpn/blob/master/docs/provider-specific.md To ensure Mullvad VPN functions correctly within the Docker Transmission OpenVPN container, IPv6 must be enabled. This can be achieved by setting the `net.ipv6.conf.all.disable_ipv6` sysctl to `0`. The examples show how to do this in both Docker Compose and direct Docker run commands. ```YAML # Docker Compose example to enable IPv6 sysctls: - "net.ipv6.conf.all.disable_ipv6=0" ``` ```Shell # Docker run example to enable IPv6 --sysctl net.ipv6.conf.all.disable_ipv6=0 ``` -------------------------------- ### Docker Compose Configuration for Transmission OpenVPN Source: https://github.com/haugene/docker-transmission-openvpn/blob/master/docs/run-container.md This `docker-compose.yml` file defines the services for running the transmission-openvpn container. It mirrors the functionality of the `docker run` command, specifying network capabilities, volume mounts, environment variables for VPN and user credentials, logging configuration, and port mappings. This declarative approach simplifies container orchestration. ```yaml version: '3.3' services: transmission-openvpn: cap_add: - NET_ADMIN volumes: - '/your/storage/path/:/data' - '/your/config/path/:/config' environment: - OPENVPN_PROVIDER=PIA - OPENVPN_CONFIG=france - OPENVPN_USERNAME=user - OPENVPN_PASSWORD=pass - LOCAL_NETWORK=192.168.0.0/16 logging: driver: json-file options: max-size: 10m ports: - '9091:9091' image: haugene/transmission-openvpn ``` -------------------------------- ### Podman Run Command for docker-transmission-openvpn Source: https://github.com/haugene/docker-transmission-openvpn/blob/master/docs/tips-tricks.md This command demonstrates how to run the docker-transmission-openvpn container using Podman. It is similar to the Docker command but requires additional capabilities (`NET_RAW`, `MKNOD`) for creating tunnels and pinging, alongside `NET_ADMIN`. ```bash podman run \ --name transmission-openvpn \ --cap-add=NET_ADMIN,NET_RAW,MKNOD \ -v /home/bittorrent/data/:/data \ -e "OPENVPN_PROVIDER=TORGUARD" \ -e "OPENVPN_USERNAME=bittorrent@example.com" \ -e "OPENVPN_PASSWORD=hunter2" \ -e "OPENVPN_CONFIG=CA Toronto" \ -e "OPENVPN_OPTS=--inactive 3600 --ping 10 --ping-exit 60" \ -p 9091:9091 \ --dns 8.8.8.8 \ --dns 8.8.4.4 \ haugene/transmission-openvpn ``` -------------------------------- ### Configure Transmission Web UI Authentication via Environment Variables Source: https://github.com/haugene/docker-transmission-openvpn/blob/master/docs/faq.md This snippet shows how to set up authentication for the Transmission web UI using environment variables. It requires setting a username, password, and enabling authentication. Be cautious with special characters in credentials. ```shell export TRANSMISSION_RPC_USERNAME=your_username export TRANSMISSION_RPC_PASSWORD=your_password export TRANSMISSION_RPC_AUTHENTICATION_REQUIRED=true ``` -------------------------------- ### Docker Compose Configuration with Credentials File Source: https://github.com/haugene/docker-transmission-openvpn/blob/master/docs/faq.md Docker Compose configuration for the transmission-openvpn service, mounting a local credentials file. This approach is suitable for single-host Docker deployments. ```yaml version: '3.3' services: transmission-openvpn: cap_add: - NET_ADMIN volumes: - '/your/storage/path/:/data' - './openvpn-credentials.txt:/config/openvpn-credentials.txt' environment: - OPENVPN_PROVIDER=PIA - OPENVPN_CONFIG=france - OPENVPN_USERNAME=**None** - OPENVPN_PASSWORD=**None** - LOCAL_NETWORK=192.168.0.0/16 logging: driver: json-file options: max-size: 10m ports: - '9091:9091' image: haugene/transmission-openvpn ``` -------------------------------- ### Select Alternative Transmission Web UI Source: https://github.com/haugene/docker-transmission-openvpn/blob/master/docs/config-options.md Chooses an alternative web user interface for Transmission from the bundled options. Available options include 'combustion', 'kettu', 'transmission-web-control', 'flood-for-transmission', 'shift', and 'transmissionic'. ```shell TRANSMISSION_WEB_UI=combustion ``` ```shell TRANSMISSION_WEB_UI=kettu ``` ```shell TRANSMISSION_WEB_UI=transmission-web-control ``` ```shell TRANSMISSION_WEB_UI=flood-for-transmission ``` ```shell TRANSMISSION_WEB_UI=shift ``` ```shell TRANSMISSION_WEB_UI=transmissionic ``` -------------------------------- ### Docker Run: Specify DNS Servers Source: https://github.com/haugene/docker-transmission-openvpn/blob/master/docs/faq.md Configures the container to use specific DNS servers using Docker's runtime options. This is useful for ensuring reliable host address resolution. ```bash docker run --dns 8.8.8.8 --dns 8.8.4.4 ... ``` -------------------------------- ### Systemd Service File for docker-transmission-openvpn Source: https://github.com/haugene/docker-transmission-openvpn/blob/master/docs/tips-tricks.md This bash script defines a systemd service for the haugene/docker-transmission-openvpn container. It includes commands to stop and remove any existing container, pull the latest image, and then run the container with specified configurations, including network access, volume mounts, environment variables for OpenVPN, and port mappings. The service is configured to restart automatically if it fails. ```bash [Unit] Description=haugene/transmission-openvpn docker container After=docker.service Requires=docker.service [Service] User=bittorrent TimeoutStartSec=0 ExecStartPre=-/usr/bin/docker kill transmission-openvpn ExecStartPre=-/usr/bin/docker rm transmission-openvpn ExecStartPre=/usr/bin/docker pull haugene/transmission-openvpn ExecStart=/usr/bin/docker run \ --name transmission-openvpn \ --cap-add=NET_ADMIN \ -v /home/bittorrent/data/:/data \ -e "OPENVPN_PROVIDER=TORGUARD" \ -e "OPENVPN_USERNAME=bittorrent@example.com" \ -e "OPENVPN_PASSWORD=hunter2" \ -e "OPENVPN_CONFIG=CA Toronto" \ -e "OPENVPN_OPTS=--inactive 3600 --ping 10 --ping-exit 60" \ -p 9091:9091 \ --dns 8.8.8.8 \ --dns 8.8.4.4 \ haugene/transmission-openvpn Restart=always RestartSec=5 [Install] WantedBy=multi-user.target ``` -------------------------------- ### Docker Compose Volume Mount for Custom OpenVPN Config Source: https://github.com/haugene/docker-transmission-openvpn/blob/master/docs/supported-providers.md This snippet shows how to mount a local directory containing OpenVPN configuration files (like .ovpn and .cert) into the Docker container. This is essential for using custom provider configurations. ```yaml - /volume1/docker/ipvanish/:/etc/openvpn/custom/ ``` -------------------------------- ### Docker Run Environment Variables for Custom OpenVPN Provider Source: https://github.com/haugene/docker-transmission-openvpn/blob/master/docs/supported-providers.md This snippet illustrates how to set the required environment variables using the `-e` flag with the `docker run` command for a custom OpenVPN provider configuration. ```bash -e OPENVPN_PROVIDER=custom \ -e OPENVPN_CONFIG=ipvanish-UK-Maidenhead-lhr-c02 \ -e OPENVPN_USERNAME=user \ -e OPENVPN_PASSWORD=pass \ ``` -------------------------------- ### Docker Compose for Transmission-OpenVPN and Jackett Integration Source: https://github.com/haugene/docker-transmission-openvpn/blob/master/docs/tips-tricks.md This docker-compose configuration defines two services: 'transmission-openvpn' and 'jackett'. It demonstrates how to route Jackett's traffic through the VPN container by placing them on the same service network. The configuration includes environment variables, volumes, ports, restart policies, and health checks. ```yaml version: '3.3' services: transmission-openvpn: cap_add: - NET_ADMIN volumes: - '/your/storage/path/:/data' environment: - OPENVPN_PROVIDER=PIA - OPENVPN_CONFIG=france - OPENVPN_USERNAME=user - OPENVPN_PASSWORD=pass - LOCAL_NETWORK=192.168.0.0/16 logging: driver: json-file options: max-size: 10m ports: - '9091:9091' - '9117:9117' # This is Jackett Port – managed by VPN Service Network image: haugene/transmission-openvpn jackett: image: lscr.io/linuxserver/jackett:latest container_name: jackett environment: - PUID=1000 - PGID=1000 - TZ=Europe/London - AUTO_UPDATE=true #optional - RUN_OPTS= #optional volumes: - :/config - :/downloads # You have to comment ports, they should be managed in transmission-openvpn section now. # ports: # - 9117:9117 restart: unless-stopped network_mode: "service:transmission-openvpn" # Add to the transmission-openvpn Container Network depends_on: - transmission-openvpn # Set dependency on transmission-openvpn Container healthcheck: # Here you will check if transmission is reachable from the Jackett container via localhost test: curl -f http://localhost:9091 || exit 1 # Use this test if you protect your transmission with a username and password # comment the test above and un-comment the line below. #test: curl -f http://${TRANSMISSION_RPC_USERNAME}:${TRANSMISSION_RPC_PASSWORD}@localhost:9091 || exit 1 interval: 5m00s timeout: 10s retries: 2 ``` -------------------------------- ### Reverting to a Previous Docker Image Tag Source: https://github.com/haugene/docker-transmission-openvpn/blob/master/docs/v3.md Instructions on how to revert to a specific previous version of the Docker image if encountering issues with the latest release. This is done by appending the tag to the image name. ```bash docker run -it --rm --name=transmission-openvpn --cap-add=NET_ADMIN -v ".:/etc/transmission-remote:rw" -e "CREATE_TUN_DEVICE=true" -e "OPENVPN_CONFIG=/path/to/your/ovpn/config" haugene/transmission-openvpn:2.14 ``` -------------------------------- ### Docker Compose Environment Variables for Custom OpenVPN Provider Source: https://github.com/haugene/docker-transmission-openvpn/blob/master/docs/supported-providers.md This snippet demonstrates setting the necessary environment variables within a Docker Compose file to specify a custom OpenVPN provider, the configuration file name, and user credentials. ```yaml - OPENVPN_PROVIDER=custom - OPENVPN_CONFIG=ipvanish-UK-Maidenhead-lhr-c02 - OPENVPN_USERNAME=user - OPENVPN_PASSWORD=pass ``` -------------------------------- ### Docker Compose with Docker Secrets for Credentials Source: https://github.com/haugene/docker-transmission-openvpn/blob/master/docs/faq.md Docker Compose configuration for a Swarm environment, utilizing Docker Secrets to securely manage VPN credentials. The secrets are made available to the container at /run/secrets/openvpn_creds. ```yaml version: '3.3' secrets: openvpn_creds: file: './openvpn-credentials.txt' services: transmission-openvpn: cap_add: - NET_ADMIN volumes: - '/your/storage/path/:/data' environment: - OPENVPN_PROVIDER=PIA - OPENVPN_CONFIG=france - OPENVPN_USERNAME=**None** - OPENVPN_PASSWORD=**None** - LOCAL_NETWORK=192.168.0.0/16 logging: driver: json-file options: max-size: 10m secrets: - openvpn_creds ports: - '9091:9091' image: haugene/transmission-openvpn ``` -------------------------------- ### Environment Variables: Override DNS Source: https://github.com/haugene/docker-transmission-openvpn/blob/master/docs/faq.md Sets environment variables to override the container's resolv.conf file, directly specifying DNS servers. This method bypasses Docker's DNS service. ```bash OVERRIDE_DNS_1=8.8.8.8 OVERRIDE_DNS_2=8.8.4.4 ``` -------------------------------- ### Custom Script Execution in Docker Transmission OpenVPN Source: https://github.com/haugene/docker-transmission-openvpn/blob/master/docs/config-options.md This section details the custom scripts that can be executed at various stages of the container's lifecycle. These bash scripts, located in the '/scripts' directory, allow for pre/post execution logic for OpenVPN and Transmission, as well as route management. Scripts must be executable. ```bash #!/bin/bash # Script content goes here chmod a+x /scripts/your-script-name.sh ``` -------------------------------- ### Test Dante Socks5 Proxy with Curl Source: https://github.com/haugene/docker-transmission-openvpn/blob/master/docs/tips-tricks.md This command tests the Dante socks5 proxy by making a request to an IP checking service through the proxy. Replace `{docker-host-ip}` with the actual IP address of your Docker host. ```bash curl -x socks5h://{docker-host-ip}:1080 http://ip.ip-check.net ``` -------------------------------- ### Enable Firewall with UFW Source: https://github.com/haugene/docker-transmission-openvpn/blob/master/docs/config-options.md Enables the Uncomplicated Firewall (UFW) to restrict network access. It allows traffic to the peer port and RPC port from the local network and Docker gateway by default. Additional ports can be opened using UFW_EXTRA_PORTS. ```shell ENABLE_UFW=true ``` -------------------------------- ### Retrieve eth0 IP Address using ip command Source: https://github.com/haugene/docker-transmission-openvpn/blob/master/docs/web-proxy.md This command uses the `ip` utility to find and extract the IPv4 address bound to the eth0 network interface. It's useful for dynamically setting network configurations. ```bash adr=$(ip -4 a show eth0| grep -oP "(?<=inet )([^/]+)") ``` -------------------------------- ### Configure Njal.la VPN with Docker Compose Source: https://github.com/haugene/docker-transmission-openvpn/blob/master/docs/provider-specific.md This Docker Compose configuration sets up the Transmission OpenVPN container to use Njal.la VPN. It includes essential settings like network administration capabilities, volume mounts for configuration and data, DNS settings, device mapping for TUN, sysctl for enabling IPv6, and environment variables for VPN credentials and local network. ```YAML version: '3.3' services: transmission-openvpn: cap_add: - NET_ADMIN volumes: - ./config/Njalla-VPN.ovpn:/etc/openvpn/custom/default.ovpn:rw - ./data:/data:rw dns: - 1.1.1.1 devices: - /dev/net/tun sysctls: # must enable ipv6 to have njal.la work - net.ipv6.conf.all.disable_ipv6=0 environment: - OPENVPN_PROVIDER=CUSTOM - OPENVPN_USERNAME=user - OPENVPN_PASSWORD=pass - LOCAL_NETWORK=192.168.1.0/24 - HEALTH_CHECK_HOST=google.com ports: - '9091:9091' logging: driver: json-file options: max-size: 10m image: haugene/transmission-openvpn:latest ``` -------------------------------- ### Add Extra Ports to UFW Firewall Source: https://github.com/haugene/docker-transmission-openvpn/blob/master/docs/config-options.md Allows a comma-separated list of additional ports to be accessible through the firewall. This setting respects the UFW_ALLOW_GW_NET variable. ```shell UFW_EXTRA_PORTS=9910,23561,443 ``` -------------------------------- ### Configure UFW Gateway Network Access Source: https://github.com/haugene/docker-transmission-openvpn/blob/master/docs/config-options.md Controls whether the gateway network is allowed through the firewall. When set to true, it permits traffic from the gateway. Defaults to only allowing the gateway if not explicitly set. ```shell UFW_ALLOW_GW_NET=true ``` -------------------------------- ### Override Transmission Options with Environment Variables Source: https://github.com/haugene/docker-transmission-openvpn/blob/master/docs/config-options.md Demonstrates how to override Transmission configuration options using environment variables. The format is to prefix the Transmission variable name with 'TRANSMISSION_', convert '-' to '_', and capitalize. This method is an alternative to directly editing configuration files. ```plaintext TRANSMISSION_SPEED_LIMIT_UP TRANSMISSION_SPEED_LIMIT_UP_ENABLED TRANSMISSION_RATIO_LIMIT TRANSMISSION_RATIO_LIMIT_ENABLED ``` -------------------------------- ### docker-compose.yml for Transmission OpenVPN Source: https://github.com/haugene/docker-transmission-openvpn/blob/master/docs/provider-specific.md This docker-compose configuration sets up the Transmission torrent client within a Docker container, connected via OpenVPN using custom ProtonVPN configuration files. It specifies volumes for configuration and data, environment variables for VPN connection details, and port mappings. ```yaml version: "3.7.1" services: transmission-openvpn: container_name: TransmissionVPN restart: on-failure:2 cap_add: - NET_ADMIN volumes: - ./protonvpn/:/etc/openvpn/custom/ - /your/config/path/:/config # where transmission-home is stored - /your/storage/path/:/data # where transmission will store the data environment: - OPENVPN_PROVIDER=custom - OPENVPN_CONFIG=node-.protonvpn.udp - OPENVPN_USERNAME=+pmp - OPENVPN_PASSWORD= - LOCAL_NETWORK=192.168.0.0/16 logging: driver: json-file options: max-size: 10m ports: - 9091:9091 image: haugene/transmission-openvpn ``` -------------------------------- ### Configure Network Health Check Host Source: https://github.com/haugene/docker-transmission-openvpn/blob/master/docs/config-options.md Specifies the host that the container's health check will ping to verify internet connectivity. The check runs every 5 minutes. ```shell HEALTH_CHECK_HOST=google.com ``` -------------------------------- ### Configure OpenVPN Options in Docker Source: https://github.com/haugene/docker-transmission-openvpn/blob/master/docs/faq.md Set OpenVPN options to automatically exit and restart the container if the VPN tunnel becomes unresponsive. This involves using the `OPENVPN_OPTS` environment variable to specify inactivity and ping timeouts. The container's Docker restart policy then handles re-establishing the connection. It also includes an option to ignore pushed 'ping-restart' directives from VPN providers. ```Shell OPENVPN_OPTS="--inactive 3600 --ping 10 --ping-exit 60 --pull-filter ignore ping" ``` -------------------------------- ### Set Transmission User ID (PUID) Source: https://github.com/haugene/docker-transmission-openvpn/blob/master/docs/config-options.md Sets the user ID (UID) that the Transmission process will run as. This is used to manage file permissions for the Transmission user. ```shell PUID=1003 ``` -------------------------------- ### Disable Default Permissions Application Source: https://github.com/haugene/docker-transmission-openvpn/blob/master/docs/config-options.md Globally disables the application of default permissions and ownership to Transmission directories (download, watch, incomplete). ```shell GLOBAL_APPLY_PERMISSIONS=false ``` -------------------------------- ### Enable Debugging Output for Bash Scripts Source: https://github.com/haugene/docker-transmission-openvpn/blob/master/docs/config-options.md To enable command echoing for all bash scripts within the container, set the DEBUG environment variable to any value other than 'false'. This uses `set -x` to print commands before they are executed, aiding in debugging. ```bash DEBUG=true ``` -------------------------------- ### Error Message: Sed Cannot Rename File Source: https://github.com/haugene/docker-transmission-openvpn/blob/master/docs/supported-providers.md This snippet shows a common error message encountered when a single OpenVPN configuration file is mounted directly into the container, preventing the `modify-openvpn-config.sh` script from executing correctly due to resource busy errors. ```bash sed: cannot rename /etc/openvpn/custom/sedHeF3gS: Device or resource busy ``` -------------------------------- ### Set Transmission Group ID (PGID) Source: https://github.com/haugene/docker-transmission-openvpn/blob/master/docs/config-options.md Sets the group ID (GID) for the user that the Transmission process will run as. This is used to manage file permissions for the Transmission user. ```shell PGID=1003 ``` -------------------------------- ### Configure OVPN Connection Details Source: https://github.com/haugene/docker-transmission-openvpn/blob/master/docs/provider-specific.md OVPN utilizes environment variables to specify connection parameters such as protocol, country, city, and connection type. Ensure you use the correct variable names and values as per the provider's specifications. Currently, OVPN only supports UDP protocol. ```Shell # Example: Set OVPN protocol to UDP, connect to US, and use a standard connection OVPN_PROTOCOL=udp OVPN_COUNTRY=us OVPN_CITY=new-york OVPN_CONNECTION=standard ``` -------------------------------- ### Verify Network Connectivity to Transmission via localhost Source: https://github.com/haugene/docker-transmission-openvpn/blob/master/docs/tips-tricks.md This bash command uses 'docker exec' to run 'curl' inside the 'transmission-vpn' container to check if it can reach the Transmission RPC interface (port 9117) via localhost. This confirms that the container is properly connected to the VPN network and can access services running within the same network namespace. ```bash docker exec transmission-vpn curl -Is http://localhost:9117 ``` -------------------------------- ### Configure Transmission to Save Power Source: https://github.com/haugene/docker-transmission-openvpn/blob/master/docs/tips-tricks.md This command-line argument can be added when creating the transmission-openvpn container to disable scraping trackers for paused torrents. This allows the host machine to enter sleep or hibernation states when no torrents are actively downloading or uploading. ```bash -e "TRANSMISSION_SCRAPE_PAUSED_TORRENTS_ENABLED=false" ``` -------------------------------- ### Set OpenVPN Credentials using Docker Secrets Source: https://github.com/haugene/docker-transmission-openvpn/blob/master/docs/config-options.md This snippet demonstrates how to manage OpenVPN username and password securely using Docker secrets. It involves removing the credentials from environment variables and storing them in a separate file referenced in the docker-compose YAML. ```yaml version: '3.8' services: transmission: .... secrets: - openvpn_creds secrets: openvpn_creds: file: ./openvpn_creds ``` -------------------------------- ### Redirect Transmission Logs to Stdout Source: https://github.com/haugene/docker-transmission-openvpn/blob/master/docs/config-options.md By default, Transmission logs to a file. This snippet shows how to redirect logs to stdout by setting the LOG_TO_STDOUT environment variable to 'true'. This is useful for integrating with container logging mechanisms like 'docker logs'. ```bash LOG_TO_STDOUT=true ``` -------------------------------- ### Check Container IP Address using curl Source: https://github.com/haugene/docker-transmission-openvpn/blob/master/docs/tips-tricks.md This bash command executes 'curl' inside a running Docker container (e.g., 'jackett') to fetch the public IP address from api.ipify.org. This is used to verify that the container is indeed using the VPN connection for its internet traffic. ```bash docker exec jackett curl -s https://api.ipify.org ``` -------------------------------- ### Disable IPTables REJECT for UFW Source: https://github.com/haugene/docker-transmission-openvpn/blob/master/docs/config-options.md Disables the use of the 'REJECT' target in iptables rules. This is useful for systems, like Synology NAS, that may lack the 'ipt_REJECT' module. ```shell UFW_DISABLE_IPTABLES_REJECT=true ``` -------------------------------- ### Enable Dropping Default Route with iptables Source: https://github.com/haugene/docker-transmission-openvpn/blob/master/docs/config-options.md This option allows users to drop the default route, preventing untunneled connections. It is achieved by setting the DROP_DEFAULT_ROUTE environment variable to 'true'. Note that this may not be compatible with all VPNs. ```bash DROP_DEFAULT_ROUTE=true ``` -------------------------------- ### Bash Script to Check Transmission VPN IP Address Source: https://github.com/haugene/docker-transmission-openvpn/blob/master/docs/provider-specific.md This bash script checks the current public IP address that the Transmission VPN container is connected to. It identifies the container name using 'docker ps' and then uses 'curl' to query an external service ('ipinfo.io') for IP and location details. ```bash #!/bin/bash f_container_name () { docker ps --format "{{.Names}}"| grep -i transmission } f_find_all () { curl --silent ipinfo.io/$ext_ip } var_cont_name=$(f_container_name) ext_ip=$(docker exec $var_cont_name curl --silent "http://ipinfo.io/ip") echo "Transmission VPN currently connected to IP address: $ext_ip" echo "This IP address is in the following country: " f_find_all ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.