Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Restart on VPN problem, support PIA port forwarding #96

Open
wants to merge 10 commits into
base: focal
Choose a base branch
from

Conversation

Tailslide
Copy link

Addresses Issues #60 and #88

Sample Compose.yml

Here is a sample compose file I am using to run this. These settings allow tunnel access and also auto restart the container since these changes cause the container to exit if the VPN becomes unresponsive or the client crashes:

    devices:
      - /dev/net/tun
    cap_add:
      - NET_ADMIN
    restart: always

New environment variable is PIA_PORT_FORWARD that handles port forwarding on PIA servers that have this feature enabled.

version: '3.4'

services:
  dockerqbittorrentvpn:
    image: tailslide/dockerqbittorrentvpn:latest
    environment:
      - VPN_ENABLED=yes
      - PIA_PORT_FORWARD=yes
      - PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
      - NAME_SERVERS=8.8.8.8,8.8.4.4
      - LAN_NETWORK=192.168.12.0/24
      - TZ=Canada/Mountain
      - DEBIAN_FRONTEND=noninteractive
    ports:
      - "8080:8080"
    devices:
      - /dev/net/tun
    cap_add:
      - NET_ADMIN
    restart: always
    volumes: 
      - /volume1/IncomingTV:/IncomingTV
      - /volume1/temp:/temp
      - /volume1/torrents:/torrents
      - /volume1/docker/qbittorrent:/config
    networks:
      - torrent
networks:
  torrent:
    external: true

Sample output

[info] PIA Port forwarding configured, calling pia_port_forwarding.sh
Starting script
getting token
6b6d303509d68b8f11c8a77dc72ad58581c48900f7aea5ed52d58a18504de6aaa9d006a19d61d7e666a96136f4f71a7b9eff0eb343da8e839cce9b0330de273ef
done getting token
starting port forwarding check
Tue May 25 09:37:22 MDT 2021: Getting PF token
Tue May 25 09:37:22 MDT 2021: Obtained PF token. Expires at 2021-07-27T03:38:33.079193308Z
Tue May 25 09:37:23 MDT 2021: Server accepted PF bind
Tue May 25 09:37:23 MDT 2021: Forwarding on port 36290
Current Port: 32761
pia-port: Current port forward: 32761
pia-port: New port number (36290) inserted into config file /config/qBittorrent/config/qBittorrent.conf.
Logging to /config/qBittorrent/data/logs/qbittorrent-daemon.log.
2021-05-25 09:37:31.520319 [info] Started qBittorrent daemon successfully...
Tue May 25 09:37:31 MDT 2021: Rebind interval: 900 seconds

@Tailslide Tailslide closed this May 25, 2021
@Tailslide
Copy link
Author

Needs some work

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant