Trigus42 / alpine-qbittorrentvpn

Multiarch docker image with the latest qBittorrent-nox client (WEB UI) and WireGuard/OpenVPN tunnel
GNU General Public License v3.0
69 stars 10 forks source link

VPN_PORT not found in ovpn file & "Options error: In [CMD-LINE]:1: Error opening configuration file" on Synology #3

Closed fischy667 closed 2 years ago

fischy667 commented 2 years ago

Although the VPN port is defined in the ovpn config file:

image

it is not found by the container:

image

Trigus42 commented 2 years ago

The port needs to part of the remote line. For example:

client
dev tun
proto udp
remote fra.whiskergalaxy.com 443
verify-x509-name fra.windscribe.com name

[...]
fischy667 commented 2 years ago

Thanks, but now I get another error.

image

docker run --restart=always --privileged --cap-add=NET_ADMIN --name=qBittorrent_VPN_trigus -d \
    -p 16882:16882 \
    -p 16882:16882/udp \
    -p 8080:8080 \
    -v /volume1/docker/qBittorrent_VPN_trigus/config:/config \
    -v /volume1/Serien/geladen:/downloads \
    -v /volume1/docker/qBittorrent_VPN_trigus/downloading:/downloading \
    -v /volume1/homes/fischy667/Filme:/Filme \
    -v /volume1/homes/fischy667/Wrestling:/Wrestling \
    -e UNPRIVILEGED=No \
    -e VPN_ENABLED=yes \
    -e VPN_USER=***** \
    -e VPN_PASS=*****\
    -e VPN_TYPE=openvpn \
    -e HEALTH_CHECK_HOST=1.1.1.1 \
    -e HEALTH_CHECK_INTERVAL=300 \
    -e INSTALL_PYTHON3=yes \
    -e LAN_NETWORK=192.168.1.0/24,172.17.0.0/16,10.0.0.0/8 \
    -e NAME_SERVERS=84.200.69.80,37.235.1.174,1.1.1.1,37.235.1.177,84.200.70.40,1.0.0.1 \
    -e UMASK=002 \
    -e PUID=1000 \
    -e PGID=1000 \
    -e TZ=Europe/Berlin \
    trigus42/qbittorrentvpn:testing
Trigus42 commented 2 years ago

This means that openvpn as provided by the apk sources can't read your config file.

Did you write the config file yourself or was it generated by your VPN provider? If so, can you share it here (except of course, any keys or credentials)?

fischy667 commented 2 years ago

It was downloaded from my vpn-provider (VPN Unlimited), but I have to add the port myself.

Attached is the version directly from the provider. (without keys and port)

fr_openvpn.txt

Trigus42 commented 2 years ago

Your config file seems ok and I can't reproduce your issue..

If your host system has selinux check out this answer: https://unix.stackexchange.com/a/162789/415995

fischy667 commented 2 years ago

I'm running your container on a Synology NAS.

Trigus42 commented 2 years ago

Please run and post the output of those commands:

$ docker run --privileged --rm -v /volume1/docker/qBittorrent_VPN_trigus/config:/config -it trigus42/qbittorrentvpn bash

In the container:

$ ls -la /config/openvpn

$ cd /config/openvpn
$ openvpn --config /config/openvpn/myconfig.ovpn --verb 4
fischy667 commented 2 years ago
bash-5.1# ls -la /config/openvpn
total 8
drwxrwxr-x    1 1000     1000            42 Aug 16 18:42 .
drwxrwxrwx    1 1026     users           14 Aug 16 11:30 ..
drwxrwxr-x    1 1000     1000            56 Aug 16 12:16 @eaDir
-rwxrwxr-x    1 1000     1000          5531 Aug 16 18:42 fr_openvpn.ovpn
bash-5.1# openvpn --config /config/openvpn/fr_openvpn.ovpn --verb 4
Options error: In [CMD-LINE]:1: Error opening configuration file: /config/openvpn/fr_openvpn.ovpn
Use --help for more information.
Trigus42 commented 2 years ago

Maybe try this workaround: https://community.synology.com/enu/forum/1/post/143863 Other than that, I don't think I can't help you with this issue because I don't have a Synology NAS or any experience with one.

fischy667 commented 2 years ago

Yes, thanks. The problem was the --privileged in the docker command. Removing this and activating high priority manually over the docker gui was the solution.