Connecting an App via a VPN

I had JDownloader2 installed through TrueCharts and connected that to the web via a PIA VPN, using OpenVPN.
My system messed up, so I did a fresh install of the latest TrueNas Scale. Which is when I found TrueCharts wasn’t available. I’ve managed to install JDownload2 from a docker image, but I would still like to connect it through PIA. This is so I can download files from sources that limit speed or connections based on IP address.
How could I go about connecting my JDownloader2 to the PIA VPN now openVPN is depreciated?

did you setup a custom app or are you using the official/community apps? The official/community apps don’t have vpn support. In case of a custom app via docker-compose you can add a gluetun sidecar, just like truecharts did, but it’s a manual setup.
Here’s the link to the gluetun setup guide GitHub - qdm12/gluetun: VPN client in a thin Docker container for multiple VPN providers, written in Go, and using OpenVPN or Wireguard, DNS over TLS, with a few proxy servers built-in.

There are lots of sample compose yaml in this forum + the truenas reddit. I haven’t used jdownloader, so not sure if you can set different interfaces (aka using TUN like qbittorrent does). I have qbt & gluetun done in a single compose, with QBT depending on gluetun to be running. You could use separate compose for jdownloader & gluetun as well.

Thanks for the replies. I used a container I found on Docker Hub, jlesage/jdownloader-2. Now TrueCharts isn’t available, I can’t install Jdownloader2 from there and its not available in the official library of apps. Hence my searching for a solution turned me to Docker.

I’m very new to Docker and to be honest I haven’t a clue what I’m doing. I’m surprised I got jdownloader2 working at all. If gluetun has been used with torrent clients, then hopefully I can find a tutorial.

That dockerhub project has a sample docker run to get it working, there are some resources online that will convert that to compose.

Quick google search gives a working gluteun + jdl2 compose:

https://www.reddit.com/r/jdownloader/comments/163slsb/jdl_docker_and_vpn_docker_container/

You’d need your VPN provider info for Gluetun but it’s project page has relevant config for many VPN providers. The only only thing you’d need to do is figure out which ports you want to use plus create config & download + have them as binds.

Many thanks for the help. It was easier than I thought once I understood what needed to be in the YAML and how to install via YAML.

What I did was, in TrueNAS scale, select Apps, Discover Apps, Install via Yaml (3 dots next to Custom App). Enter a Name, e.g., jd2-vpn, paste the YAML into the Custom Config.

Version: "3"
services:
  gluetun:
    image: qmcgaw/gluetun
    cap_add:
      - NET_ADMIN
    devices:
      - /dev/net/tun:/dev/net/tun
    ports:
      - 5801:5800	# should be 5800:5800, but I already have another jdownloader2 running on 5800
    volumes:
      - ./gluetun:/gluetun
    environment:
      - VPN_SERVICE_PROVIDER=private internet access
      - OPENVPN_USER=<MY USER ID>
      - OPENVPN_PASSWORD=<MY PASSWORD>
      - SERVER_REGIONS=Netherlands

  jdl2:
    image: jlesage/jdownloader-2
    container_name: jdl2
    network_mode: service:gluetun
    volumes:
      - /mnt/<MY DATASET>/jdownloader2-vpn:/config:rw
      - /mnt/<MY DATASET>/jdownloader2-vpn/downloads:/output:rw
    restart: unless-stopped

Next task is to figure out how to change the VPN server or region on the fly.
Again, thanks for pointing me in the right direction.

You’d have to check the gluetun github to see if that’s a feature or to ask for it. From the container logs, it is checking to see if there are changes at endpoints.

Just looked at the github page, someone has created something to do it:

Pretty cool!

Thanks. Does sound interesting, but not available for OpenVPN yet.

All I need to do though is edit the app and change the location in the custom config.

I’ve got the Docker bug now. Next project is to see if I can distribute my own Windows software with WINE in a container.

Your VPN might support wireguard, might need to do some extra work to get that work with Gluetun.

Figured I’d try out getting Gluetun working with Privado wireguard, done. Not sure if it’s possible to use that randomizer with Privado, you need to have an environment for endpoint IP and it looks like it generates a different private key for each region.