guillaumedsde / alpine-qbittorrent-openvpn

qBittorrent docker container with OpenVPN client running as unprivileged user on alpine linux
https://guillaumedsde.gitlab.io/alpine-qbittorrent-openvpn/
GNU General Public License v3.0
216 stars 40 forks source link

bug #33

Closed darrylgibbs closed 4 years ago

darrylgibbs commented 4 years ago

Information

I'm having issues with the server choice. I've used your exact server and others and I get the same error each time.

Output:

pi@nas:~/dc/qbit-vpn $ docker-compose up
Recreating qbit-vpn ... done
Attaching to qbit-vpn
qbit-vpn          | [s6-init] making user provided files available at /var/run/s6/etc...exited 0.
qbit-vpn          | [s6-init] ensuring user provided files have correct perms...exited 0.
qbit-vpn          | [fix-attrs.d] applying ownership & permissions fixes...
qbit-vpn          | [fix-attrs.d] done.
qbit-vpn          | [cont-init.d] executing container initialization scripts...
qbit-vpn          | [cont-init.d] 01-setup-permissions: executing...
qbit-vpn          | [cont-init.d] 01-setup-permissions: exited 0.
qbit-vpn          | [cont-init.d] 02-setup-openvpn: executing...
qbit-vpn          | Tue Nov 10 21:04:40 2020 TUN/TAP device tun0 opened
qbit-vpn          | Tue Nov 10 21:04:40 2020 Persist state set to: ON
qbit-vpn          | INFO: Trying to use OpenVPN provider: PIA
qbit-vpn          | A    pia
qbit-vpn          | A    pia/configure-openvpn.sh
qbit-vpn          | A    pia/update-port.sh
qbit-vpn          | Exported revision 2511.
qbit-vpn          | ERROR: Could not find OpenVPN configuration "France" for provider PIA
qbit-vpn          | [cont-init.d] 02-setup-openvpn: exited 1.
qbit-vpn          | [cont-finish.d] executing container finish scripts...
qbit-vpn          | [cont-finish.d] done.
qbit-vpn          | [s6-finish] waiting for services.
qbit-vpn          | [s6-finish] sending all processes the TERM signal.
qbit-vpn          | [s6-finish] sending all processes the KILL signal and exiting.

Current setup

information about your current setup

docker image tag guillaumedsde/alpine-qbittorrent-openvpn:latest
running on raspberry pi 4

docker-compose.yml file or docker run command

how did you start the container? (don't forget to use backticks for creating a proper code block)


```yaml
version: "3.3"
services:
  qbittorrentvpn:
    image: guillaumedsde/alpine-qbittorrent-openvpn:latest
    container_name: qbit-vpn
    cap_add:
      - NET_ADMIN
    environment:
      - OPENVPN_PROVIDER=PIA
      - OPENVPN_USERNAME=user
      - OPENVPN_PASSWORD=pass
      - OPENVPN_CONFIG=France # choose server
      - LOCAL_NETWORK=192.168.88.0/24
      - PUID=1000 # pi user info
      - PGID=1000 # pi user info
    ports:
      - 9092:9092
    volumes:
      - /media/hdd/docker/config/qbit-vpn/:/config
      - /media/hdd/media/downloads/:/downloads
    restart: unless-stopped

Attempted Fix(es)

I've tried more than 5 different servers but all give the same error. I imagine this maybe a syntax issue? But if it is, I don't know where to find the correct syntax.

josh-sachs commented 4 years ago

Having exact same issue with latest. It looks like this image is not actually downloading the config files for PIA (looks like it is supposed to, but isn't actually working).

I was able to workaround by mapping the following volume:

volumes:
- </path/to/pia/configs>:/etc/openvpn/pia

You'll need to download the PIA next-gen config files (e.g. the ones used by haugene/docker-transmission-openvpn) and unzip them on the host, and map that location into the container.

Ideally this image can be fixed to correctly acquire these files on it's own.

guillaumedsde commented 4 years ago

hi @josh-sachs @darrylgibbs I've implemented a fix in b6db5a706138a61bb872c0a3dcd7f97acf116fb8 it should be available in the development branch, if you want to try it out and let me know whether it fixes the issue you can pull the guillaumedsde/alpine-qbittorrent-openvpn:development image. Let me know if that fixes the issue, then I'll merge it in master :)

darrylgibbs commented 4 years ago

@guillaumedsde the development image does now work in terms of the PIA connection. Thanks!

However, and I'm not sure if this is my fault or not, but I can't get onto the WebUI. I remapped the ports in my docker-compose to 8080:8080 (I think my original 9092:9092 wouldn't have worked anyway since your Dockerfile exposes only 8080) and I still can't get to the UI. It just times out.

Any ideas?

guillaumedsde commented 4 years ago

hum, do you have the container's logs? (you can remap 9092:8080 if you want qbittorrent on port 9092 on your host)

darrylgibbs commented 4 years ago

Ok, this is something that is beyond me... previously I typed "192.168.88.20:8080", which is the IP of my server. This is what I normally do to access the webUI's. I just randomly tried "nas.local:8080" and somehow THAT worked to give me a web UI. Is there a reason for that? My other containers work fine with the full IP, but this container needs the hostname .local?

Here is the output though in case that helps you. Any ideas when you'll be able to push the new 'latest' container? Not pushing :)

Wed Nov 11 17:46:05 2020 Persist state set to: ON

OpenVPN provider not set. Using configuration at /config/openvpn/config.ovpn

[cont-init.d] 02-setup-openvpn: exited 0.

[cont-init.d] 03-setup-iptables: executing... 

[cont-init.d] 03-setup-iptables: exited 0.

[cont-init.d] done.

[services.d] starting services

[services.d] done.

Wed Nov 11 17:46:05 2020 OpenVPN 2.4.9 armv7-alpine-linux-musleabihf [SSL (OpenSSL)] [LZO] [LZ4] [EPOLL] [MH/PKTINFO] [AEAD] built on Apr 20 2020

Wed Nov 11 17:46:05 2020 library versions: OpenSSL 1.1.1g  21 Apr 2020, LZO 2.10

Wed Nov 11 17:46:05 2020 CRL: loaded 1 CRLs from file [[INLINE]]

Wed Nov 11 17:46:05 2020 TCP/UDP: Preserving recently used remote address: [AF_INET]143.244.57.241:1198

Wed Nov 11 17:46:05 2020 UDP link local: (not bound)

Wed Nov 11 17:46:05 2020 UDP link remote: [AF_INET]143.244.57.241:1198

Wed Nov 11 17:46:06 2020 [paris407] Peer Connection Initiated with [AF_INET]143.244.57.241:1198

Wed Nov 11 17:46:07 2020 OpenVPN ROUTE6: OpenVPN needs a gateway parameter for a --route-ipv6 option and no default was specified by either --route-ipv6-gateway or --ifconfig-ipv6 options

Wed Nov 11 17:46:07 2020 OpenVPN ROUTE: failed to parse/resolve route for host/network: 2000::/3

Wed Nov 11 17:46:07 2020 TUN/TAP device tun1 opened

Wed Nov 11 17:46:07 2020 /usr/sbin/ip-su link set dev tun1 up mtu 1500

Wed Nov 11 17:46:07 2020 /usr/sbin/ip-su addr add dev tun1 10.53.112.107/24 broadcast 10.53.112.255

Wed Nov 11 17:46:07 2020 WARNING: OpenVPN was configured to add an IPv6 route over tun1. However, no IPv6 has been configured for this interface, therefore the route installation may fail or may not work as expected.

Wed Nov 11 17:46:07 2020 Initialization Sequence Completed

INFO: no port updater for provider 

******** Information ********

To control qBittorrent, access the Web UI at http://localhost:8080
guillaumedsde commented 4 years ago

This might be linked to the Enable Host header validation in the the WebUI settings for qBittorrent, try unticking it?

RazCrimson commented 4 years ago

Are the openvpn config files now available with the image bu default?

guillaumedsde commented 4 years ago

they are downloaded on startup

PcInfamy commented 4 years ago

The development branch is working for me in terms of the config files for PIA. Thanks!

guillaumedsde commented 4 years ago

alright, i'll merge it in master

guillaumedsde commented 4 years ago

fixed in b6db5a70