soxfor / qbittorrent-natmap

The objective of this container is to run a script that requests a port forward (via NAT-PMP) from the VPN provider and upon success changes the listening port of the qBittorrent client when running in Docker
149 stars 18 forks source link

Do you want to include an example in the README #4

Closed BraveLilToaster closed 1 year ago

BraveLilToaster commented 1 year ago

I thought it might be helpful to include an example showing how the container might be configured to work with protonVPN wireguard and gluetun.

Maybe something like this:

version: "3"
services:
  gluetun:
    image: qmcgaw/gluetun
    container_name: gluetun
    cap_add:
      - NET_ADMIN
    network_mode: bridge
    ports:
      - 8888:8888/tcp # HTTP proxy
      - 8388:8388/tcp # Shadowsocks
      - 8388:8388/udp # Shadowsocks
      - 8000:8000/tcp # Built-in HTTP control server
        # other containers ports
      - 6881:6881     # qBittorrent
      - 6881:6881/udp # qBittorrent
      - 8080:8080     # qBittorrent
    environment:
      - VPN_SERVICE_PROVIDER=custom
      - VPN_TYPE=wireguard
      - VPN_ENDPOINT_IP=${VPN_ENDPOINT_IP}
      - VPN_ENDPOINT_PORT=${VPN_ENDPOINT_PORT}
      - WIREGUARD_PUBLIC_KEY=${WIREGUARD_PUBLIC_KEY}
      - WIREGUARD_PRIVATE_KEY=${WIREGUARD_PRIVATE_KEY}
      # - WIREGUARD_PRESHARED_KEY={WIREGUARD_PRESHARED_KEY}
      - WIREGUARD_ADDRESSES=${WIREGUARD_ADDRESSES}
      - VPN_DNS_ADDRESS=${VPN_DNS_ADDRESS}
      # - FIREWALL_OUTBOUND_SUBNETS=192.168.178.0/24
    restart: unless-stopped

  qbittorrent:
    container_name: qbittorrent
    image: lscr.io/linuxserver/qbittorrent:latest
    environment:
      - PUID=1000
      - PGID=1000
      - UMASK=002
      - TZ=${SERVARR_TIMEZONE}
      - WEBUI_PORT=8080
    network_mode: "service:gluetun"
    volumes:
      - /docker/appdata/qbittorrent:/config
      - /data:/downloads
    restart: unless-stopped

  qbittorrent_natmap:
    container_name: qbittorrent_natmap
    image: ghcr.io/soxfor/qbittorrent-natmap:latest
    environment:
      - QBITTORRENT_SERVER=10.2.0.2 
      - VPN_GATEWAY=10.2.0.1
    volumes:
      - /var/run/docker.sock:/var/run/docker.sock
    network_mode: "service:gluetun"
    depends_on:
      gluetun:
        condition: service_healthy
      qbittorrent: 
        condition: service_started
    restart: unless-stopped

Great package btw. Saved me some work and I appreciate it.

soxfor commented 1 year ago

Thank you @BraveLilToaster

That's a good idea, I have a snipped under docker-compose.yml only for this container itself, but yes I'll make note and deploy a full example docker-compose instead