diameter / rtorrent-rutorrent

Docker container with supervisor/rtorrent/nginx/ruTorrent 64/32 bit
155 stars 72 forks source link

VPN Support - OpenVPN #21

Open wjbeckett opened 8 years ago

wjbeckett commented 8 years ago

I'd love the ability to have OpenVPN supported to push all torrent traffic over the VPN but still leaving port 80 accessible locally for the web ui.

Is this possible?

Vagabon666 commented 7 years ago

Hello,

I am looking for the same improvement, is ther any chance it comes ?

Thank you

diameter commented 7 years ago

Hello @Vagabon666 I do not use vpn and don't have any vpn accounts, so I can't implement and debug this improvement. And, I think that vpn connection should be established on the docker host, then you'll just need to bind your container to established vpn network interface (https://docs.docker.com/engine/userguide/networking/default_network/binding/) Though I may be wrong, didn't do any research on this.

Vagabon666 commented 7 years ago

Hi, Sorry for the late reply, I was away.

Does it help if I told you that this container is working like a charm, except it is not rutorrent :-) : haugene/transmission-openvpn

Thank you.

leviwheatcroft commented 6 years ago

2 years late to this party...

The best way to do this is to install a docker container running a vpn client, and then add this container to your vpn container's network stack.

There's a few around but the one I've been playing around with is dperson/vpn-client. The readme on that repo explains how to do this.

I don't yet have a working configuration... if you're reading this and interested just ask, by that time I might have it sorted out!

Vagabon666 commented 6 years ago

Hello,

Thank you for your reply, I am still interested. I already tried this container but wasn't able to use it on synology. If you found the way to do it that would be great !!!

See you, Vagabon.

leviwheatcroft commented 6 years ago

@Vagabon666 It's working now, using docker-compose.

Basically, you create two containers, one from this repo to run rutorrent, and then one to run a vpn client. Then configure the rutorrent container with network_mode: service:vpn-client which adds rutorrent container to vpn container's network stack, as though they're behind the same physical adapter.

you make a docker-compose.yml like:

version: '3'

services:
  vpn-client:
    image: dperson/openvpn-client
    cap_add:
      - net_admin
    environment:
      - TZ=${TZ}
    volumes:
      - /dev/net:/dev/net:z
      - /srv/config/vpn-client:/vpn
    read_only: false
    tmpfs:
      - /tmp
    restart: unless-stopped
    security_opt:
      - label:disable
    stdin_open: true
    tty: true

    command: -d
  rutorrent:
    image: diameter/rtorrent-rutorrent
    cap_add:
      - net_admin
    depends_on:
      - vpn-client
    environment:
      - PGID=${PGID}
      - PUID=${PUID}
      - TZ=${TZ}
    network_mode: service:vpn-client
    volumes:
      - /srv/config/rutorrent:/config
      - /srv/rutorrent:/downloads
      - /srv/complete:/complete

and a .env like (id <user> to get uid & gid):

PUID=999
PGID=999
TZ=Australia/Perth

This works great... except of course that rutorrent won't be connectable behind a vpn, so now I'm trying to figure out how to "proxify" rutorrent...

KunJakob commented 5 years ago

@leviwheatcroft I know this is 1½ years ago, but did you ever find a solution to splitting the VPN?

Vagabon666 commented 5 years ago

Hello, Sorry for the late reply, unfortunately I didn't succeed easily to reach the container behind the vpn. And as reboot of docker compose is a bit complex I switch to virtual DSM with deluge package. Regards,