MarkusMcNugen / docker-qBittorrentvpn

Docker container which runs a headless qBittorrent client with WebUI and optional OpenVPN
https://hub.docker.com/r/markusmcnugen/qbittorrentvpn/
GNU General Public License v3.0
171 stars 92 forks source link

unable to reach the webui #27

Open jlim0930 opened 5 years ago

jlim0930 commented 5 years ago

my docker run line /usr/bin/docker run \ --name qbitvpn \ --privileged \ -p 8080:8080 \ -p 6882:6882 \ -p 6882:6882/udp \ -e PUID=1026 \ -e PGID=100 \ -e "VPN_ENABLED=yes" \ -e "NAME_SERVERS=8.8.8.8,1.1.1.1" \ -e "LAN_NETWORK=192.168.1.0/24" \ -v /data/config/qbitvpn:/config \ -v /data/downloads/qbtvpn:/downloads \ --log-driver=journald \ --log-opt tag="|{{.Name}}|{{.ID}}|" \ markusmcnugen/qbittorrentvpn

and i can see that its running and right ports are being exposed and forwarded CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES e5f84be326bc markusmcnugen/qbittorrentvpn "/bin/bash /etc/open…" 1 second ago Up Less than a second 0.0.0.0:6882->6882/tcp, 0.0.0.0:8080->8080/tcp, 0.0.0.0:6882->6882/udp, 8999/tcp, 8999/udp qbitvpn

however something is keep disconnecting me from port 8080 and unable to get to the webui $ telnet localhost 8080 Trying ::1... Connected to localhost. Escape character is '^]'. Connection closed by foreign host.

NathanHRich commented 5 years ago

Any updates on this? I'm having the same issue. EDIT Here's my docker run line:

docker run --privileged  -d \
--name=qbittorrent \
--restart=always \
--log-opt max-size=50m \
-v /docker/containers/qbittorrent:/config \
-v /plex/downloads:/downloads \
-e "VPN_ENABLED=yes" \
-e "LAN_NETWORK=192.168.86.0/24" \
-e "NAME_SERVERS=8.8.8.8,8.8.4.4" \
-e "VPN_USERNAME=##########" \
-e "VPN_PASSWORD=##########" \
-e PGID=1000 -e PUID=1000 \
-p 8080:8080 \
-p 8999:8999 \
-p 8999:8999/udp \
markusmcnugen/qbittorrentvpn
themfinger commented 5 years ago

I think I also have everything well configured; I can read in see the log that everything looks nice with a line finishing:

[info] Started qBittorrent daemon successfully... And during the launch, it shows a the following in the log:

_"[info] WebUI port defined as"_

I set an environment variable "WEBUI_PORT_ENV=8099", which is correctly bridged.

But, when I try to connect, nothing happens.

After reading other issues, it seems the VPN module does't configure the defined WEBUI Port: (N) 2019-08-12T23:20:08 - Using built-in Web UI. (N) 2019-08-12T23:20:08 - Web UI translation for selected locale (en) has been successfully loaded. (N) 2019-08-12T23:20:08 - Web UI: Now listening on IP: *, port: 8080 (I) 2019-08-12T23:20:08 - System network status changed to ONLINE (I) 2019-08-12T23:20:08 - qBittorrent is successfully listening on interface :: port: TCP/8999 (I) 2019-08-12T23:20:08 - qBittorrent is successfully listening on interface 0.0.0.0 port: TCP/8999 (I) 2019-08-12T23:20:08 - qBittorrent is successfully listening on interface 0.0.0.0 port: UDP/8999

IPTABLES: 2019-08-12 23:20:07.971489 [info] iptables defined as follows... -A INPUT -i eth0 -p tcp -m tcp --dport 8080 -j ACCEPT -A INPUT -i eth0 -p tcp -m tcp --sport 8080 -j ACCEPT -A OUTPUT -o eth0 -p tcp -m tcp --dport 8080 -j ACCEPT

Can someone please help? Thanks in advance,

michecode commented 5 years ago

hey the documentation is wrong. i accidentally closed my issue ( #26 ). instead of WEBUI_PORT_ENV you should use WEBUI_PORT

norey commented 4 years ago

I'm unable to reach the WebUI as well. This is how I am running it:

sudo docker run --privileged  -d \
              -v /path/config/:/config \
              -v /path/downloads/:/downloads \
              -e "VPN_ENABLED=yes" \
              -e "LAN_NETWORK=192.168.1.0/24" \
              -e "NAME_SERVERS=8.8.8.8,8.8.4.4" \
              -e "VPN_USERNAME=###" \
              -e "VPN_PASSWORD=###" \
              -e "WEBUI_PORT=8080" \
              -e PUID=1001 \
              -e PGID=1001 \
              -e UMASK=002 \
              -p 9090:8080 \
              -p 9999:8999 \
              -p 9999:8999/udp \
              --name qbt \
              markusmcnugen/qbittorrentvpn

Some logs, well important parts of those

$ sudo docker logs qbt

Sun Oct 13 19:03:30 2019 Initialization Sequence Completed
2019-10-13 19:03:32.167770 [info] WebUI port defined as 8080
2019-10-13 19:03:32.244310 [info] LAN Network defined as 192.168.1.0/24
2019-10-13 19:03:32.320642 [info] Default gateway defined as 172.17.0.1
2019-10-13 19:03:32.394927 [info] ip route defined as follows...
--------------------
...
...
--------------------
2019-10-13 19:03:32.513336 [info] Docker network defined as 172.17.0.0/16
2019-10-13 19:03:32.706395 [info] iptables defined as follows...
--------------------
-P INPUT DROP
-P FORWARD ACCEPT
-P OUTPUT DROP
-A INPUT -i tun0 -j ACCEPT
-A INPUT -s 172.17.0.0/16 -d 172.17.0.0/16 -j ACCEPT
-A INPUT -i eth0 -p udp -m udp --sport 1194 -j ACCEPT
-A INPUT -i eth0 -p tcp -m tcp --dport 8080 -j ACCEPT
-A INPUT -i eth0 -p tcp -m tcp --sport 8080 -j ACCEPT
-A INPUT -s 192.168.1.0/24 -i eth0 -p tcp -m tcp --dport 8999 -j ACCEPT
-A INPUT -p icmp -m icmp --icmp-type 0 -j ACCEPT
-A INPUT -i lo -j ACCEPT
-A OUTPUT -o tun0 -j ACCEPT
-A OUTPUT -s 172.17.0.0/16 -d 172.17.0.0/16 -j ACCEPT
-A OUTPUT -o eth0 -p udp -m udp --dport 1194 -j ACCEPT
-A OUTPUT -o eth0 -p tcp -m tcp --dport 8080 -j ACCEPT
-A OUTPUT -o eth0 -p tcp -m tcp --sport 8080 -j ACCEPT
-A OUTPUT -d 192.168.1.0/24 -o eth0 -p tcp -m tcp --sport 8999 -j ACCEPT
-A OUTPUT -p icmp -m icmp --icmp-type 8 -j ACCEPT
-A OUTPUT -o lo -j ACCEPT
--------------------
Adding 1001 group
Adding 1001 user
2019-10-13 19:03:32.982605 [info] UMASK defined as '002'
2019-10-13 19:03:33.068209 [info] Starting qBittorrent daemon...
Logging to /config/qBittorrent/data/logs/qbittorrent-daemon.log.
2019-10-13 19:03:34.150376 [info] qBittorrent PID: 192
2019-10-13 19:03:34.169745 [info] Started qBittorrent daemon successfully...

$ sudo docker exec qbt cat /config/qBittorrent/data/logs/qbittorrent.log

...
(W) 2019-10-13T05:31:01 - WebUI: Invalid Host header, port mismatch. Request source IP: '::ffff:192.168.1.10'. Server port: '8080'. Received Host header: 'homesv:9090'
(W) 2019-10-13T05:31:02 - WebUI: Invalid Host header, port mismatch. Request source IP: '::ffff:192.168.1.10'. Server port: '8080'. Received Host header: 'homesv:9090'
(W) 2019-10-13T05:31:02 - WebUI: Invalid Host header, port mismatch. Request source IP: '::ffff:192.168.1.10'. Server port: '8080'. Received Host header: 'homesv:9090'
...

I'm really not sure if this the right usage of "WEBUI_PORT" or if there is a need to use it since I changed the ports to 9090/9999 locally since other services are listening on the default ones.

eepohboy commented 4 years ago

I am having the same issue when running the container on my Synology box. What worries me is the log output that says

RTNETLINK answers: Network is unreachable

Also, I notice I can access the WEBUI when I turn off the VPN by setting VPN_ENABLED to 'no'. When I do this I get an External IP set in the qBittorrent logs, but with the VPN on, this last log entry does not appear

Docker logs qbittorrentvpn.docker.log

qBittorrent logs qbittorrent.log

simepy commented 4 years ago

You can try to enable module "iptable_magle" with "modprod" in your host with /sbin/modprobe iptable_mangle

For me it's work :)

eepohboy commented 4 years ago

You can try to enable module "iptable_magle" with "modprod" in your host with /sbin/modprobe iptable_mangle

Does this affect the security of the host in any way?

Altycoder commented 4 years ago

hey the documentation is wrong. i accidentally closed my issue ( #26 ). instead of WEBUI_PORT_ENV you should use WEBUI_PORT

I have tried this but it doesn't work so I've just raised a new issue

norey commented 4 years ago

any updates on this? anyone able to run the docker image correctly and get access to the WebUI?

scb147 commented 4 years ago

Since whatever the last update is, I cannot get the WebUI to work at all. It was working fine with my WEBUI_PORT and WEBUI_PORT_ENV set to 6060, with the VPN enabled. Now I can't even get it to work with the VPN disabled.

nimblebytes commented 4 years ago

There are two issues at play here. As @sarkyscouser stated

hey the documentation is wrong. i accidentally closed my issue ( #26 ). instead of WEBUI_PORT_ENV you should use WEBUI_PORT

I have tried this but it doesn't work so I've just raised a new issue

Secondly, there is an error in the code that messed up the port. Running the container a second time with the same config arguments "fixes" it. See https://github.com/MarkusMcNugen/docker-qBittorrentvpn/issues/33#issuecomment-585420773

redtripleAAA commented 3 years ago

I have Synology NAS Docker Setup PIA is my VPN Provider (Mullvad was my previous but it was giving heck of hard time to get anything connected)

So, I was able to get it working, kinda, and the container is running and connected via VPN now


Adding 0 group
groupadd: GID '0' already exists
Adding 0 user
useradd: UID 0 is not unique
2021-02-07 20:01:50.246901 [warn] UMASK not defined (via -e UMASK), defaulting to '002'
2021-02-07 20:01:50.303396 [info] Starting qBittorrent daemon...
Logging to /config/qBittorrent/data/logs/qbittorrent-daemon.log.
2021-02-07 20:01:51.366776 [info] qBittorrent PID: 185
2021-02-07 20:01:51.384442 [info] Started qBittorrent daemon successfully...

And I was able to shell to the container and run ifconfig to confirm the public IP address is the VPN one, which is great.

root@Synology:~# docker exec -it 4b2377436d22 /bin/sh
# curl ifconfig.io
154.3.42.12

However, still UI is not loading

My docker stack is:

---
version: "2"
services:
  qbittorrentvpn:
    image: markusmcnugen/qbittorrentvpn
    container_name: qbittorrentvpn
    privileged: true   
    environment:
      - VPN_USERNAME=username
      - VPN_PASSWORD=password
      - PUID=0 #optional
      - PGID=0 #optional
      - WEBUI_PORT_ENV=8787 #optional
      - INCOMING_PORT_ENV=8999 #optional
      - VPN_ENABLED=yes
      - LAN_NETWORK=10.0.12.0/24
      - NAME_SERVERS=8.8.8.8,1.1.1.1
    ports:
      - 8787:8787
      - 8999:8999
      - 8999:8999/udp
    volumes:
      - /volume1/docker/qBittorrentVPN/config:/config
      - /volume1/docker/qBittorrentVPN/downloads:/downloads
    restart: unless-stopped

Noticed, one thing, that parameter that needs to be changed

      - WEBUI_PORT_ENV=8787 #optional
      - INCOMING_PORT_ENV=8999 #optional

Use instead this:

      - WEBUI_PORT=8787 #optional
      - INCOMING_PORT=8999 #optional

so when I have update the stack

ran again:

root@Synology:~# docker exec -it de597f9d4765 /bin/sh
# curl ifconfig.io
66.115.142.72

and it worked like charm

triksmelb commented 2 years ago

no luck accessing the webui otherwise the container seems to run.

  1. tried via SSH docker run
  2. below in portainer > stack
  3. ran the command "docker exec -it ""containername"" /bin/sh" which returned "#" Strangely transmissionopenvpn is working fine.

version: "2" services: qbittorrentvpn: image: markusmcnugen/qbittorrentvpn container_name: qbittorrentvpn privileged: true
environment:

noob34433 commented 1 year ago

any updates? having the same issue....

LeqitSebi commented 1 year ago

You can try to enable module "iptable_magle" with "modprod" in your host with /sbin/modprobe iptable_mangle

For me it's work :)

After days of trying, this is the solution that works for me as well!

Tejas9535 commented 1 year ago

You can try to enable module "iptable_magle" with "modprod" in your host with /sbin/modprobe iptable_mangle For me it's work :)

After days of trying, this is the solution that works for me as well!

For me too. been trying for whole day now