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

PIA port forwarding doesn't update over time #99

Open snowlucas opened 3 years ago

snowlucas commented 3 years ago

Information

When I start with Docker-compose using PIA as my provider I get some errors with CURL but I do get a connection and I do get an open port with port forwarding setup automatically. Within an hour the port is no longer open. The project haugene/docker-transmission-openvpn appears to check the port every 15 mins and opens a new one with PIA if closed. 15 mins appears to be the PIA standard. This project doesnt seem to have the check and update feature but this might be an issue with my setup and the curl errors I'm getting?

"curl: (3) URL using bad/illegal format or missing URL"

qbittorrent | 2021-11-06 23:27:52 TCP/UDP: Preserving recently used remote address: [AF_INET]212.102.36.171:1198 qbittorrent | 2021-11-06 23:27:52 UDP link local: (not bound) qbittorrent | 2021-11-06 23:27:52 UDP link remote: [AF_INET]212.102.36.171:1198 qbittorrent | 2021-11-06 23:27:52 [zurich408] Peer Connection Initiated with [AF_INET]212.102.36.171:1198 qbittorrent | 2021-11-06 23:27:52 WARNING: You have specified redirect-gateway and redirect-private at the same time (or the same option multiple times). This is not well supported and may lead to unexpected results qbittorrent | 2021-11-06 23:27:52 sitnl_send: rtnl: generic error (-101): Network unreachable qbittorrent | 2021-11-06 23:27:52 TUN/TAP device tun1 opened qbittorrent | 2021-11-06 23:27:52 /usr/sbin/ip-su link set dev tun1 up mtu 1500 qbittorrent | 2021-11-06 23:27:52 /usr/sbin/ip-su link set dev tun1 up qbittorrent | 2021-11-06 23:27:52 /usr/sbin/ip-su addr add dev tun1 10.5.112.164/24 qbittorrent | 2021-11-06 23:27:52 WARNING: OpenVPN was configured to add an IPv6 route. However, no IPv6 has been configured for tun1, therefore the route installation may fail or may not work as expected. qbittorrent | 2021-11-06 23:27:52 add_route_ipv6(2000::/3 -> :: metric -1) dev tun1 qbittorrent | 2021-11-06 23:27:52 Initialization Sequence Completed qbittorrent | INFO: configuring port forwarding for PIA qbittorrent | qbittorrent | qbittorrent | qbittorrent | curl: (3) URL using bad/illegal format or missing URL qbittorrent | port is 22763 qbittorrent | curl: (3) URL using bad/illegal format or missing URL qbittorrent | the port has been bound to 22763 Sat Nov 6 23:27:56 GMT 2021 qbittorrent | Got new port 22763 from PIA qbittorrent | qbittorrent | **** Information **** qbittorrent | To control qBittorrent, access the Web UI at http://localhost:8222

Current setup

Docker from image: guillaumedsde/qbittorrent-openvpn:latest

docker-compose.yml file

version: "3"
services:
  qbittorrent:
    image: guillaumedsde/alpine-qbittorrent-openvpn:latest
    volumes:
      - /media/downloads:/media/downloads
      - ${APPDATA}/qbittorrent/config:/config
      - ${APPDATA}/qbittorrent/scripts:/scripts
      - /etc/localtime:/etc/localtime:ro
    environment:
      - QBT_WEBUI_PORT=8222
      - OPENVPN_PROVIDER=PIA
      - OPENVPN_CONFIG=switzerland
      - OPENVPN_USERNAME=1234
      - OPENVPN_PASSWORD=5678
      - PUID=1000
      - PGID=1000
      - LAN=192.168.0.0/16
    ports:
      - 8222:8222
    cap_add:
      - NET_ADMIN
    restart: unless-stopped

Attempted Fix(es)

Searched here and found a reference to the curl: (3) URL using bad/illegal format or missing URL but no real fix. I've tried running the pia port update script from inside the container with the same error.

dn4hc commented 3 years ago

Seems like a keep alive needs to be send every 15 mins to retain the port forward otherwise the api drops it. https://github.com/pia-foss/manual-connections/blob/master/port_forwarding.sh