qdm12 / gluetun-wiki

Home to the Markdown Wiki page for Gluetun
MIT License
269 stars 31 forks source link

port mappings doesn't make sense at all. #79

Open Strux-DK opened 2 weeks ago

Strux-DK commented 2 weeks ago

Trying to understand what the heck is going on. I see several examples here, here and here that finely describes exactly what i want to do, but for some reason it doesn't work. I know you've probably done a million of these issues and i'm very sorry for that, but i hope you are able to help me. To be precise: I have a sabnzbd container that i want to share the network with gluetun so traffic is going through gluetun. I can't seem to get the port mappings right, so i'm able to reach sabnzbd's web interface.

I tried several different port configurations under gluetun, none of them worked.

As far as i understand, the port mapping is {port you want to reach the service at, but with gluetun IP}:{port the service runs on proprietarily}. If that's correct, in my case the latter should be 8080, because that's what sabnzbd is running on. And i gues the first doesn't matter, as long as it isn't used by something else. Then why doesn't it work?

relevant part of compose:

networks:
  media-network:
    name: media-network
    driver: bridge
    ipam:
      driver: default
      config:
      - subnet: ${DOCKER_SUBNET:?err}
        gateway: ${DOCKER_GATEWAY:?err}

services:
  gluetun:
    image: qmcgaw/gluetun:latest
    container_name: gluetun
    restart: always
    cap_add:
      - NET_ADMIN
    ports:
      - "8080:8080"                                  #SABnzbd Web gui port
      - "9090:9090"
      - "8888:8888/tcp"                                                    # Gluetun Local Network HTTP proxy
      - "8388:8388/tcp"                                                    # Gluetun Local Network Shadowsocks
      - "8388:8388/udp"                                                    # Gluetun Local Network Shadowsocks
    volumes:
      - ${FOLDER_FOR_CONFIGS:?err}/gluetun:/gluetun
    environment:
      - PUID=${PUID:?err}
      - PGID=${PGID:?err}
      - TZ=${TIMEZONE:?err}
      - VPN_SERVICE_PROVIDER=${VPN_SERVICE_PROVIDER:?err}
      - SERVER_COUNTRIES=${SERVER_COUNTRIES:?err}
      - SERVER_CITIES=${SERVER_CITIES}
      - SERVER_HOSTNAMES=${SERVER_HOSTNAMES}
      - FIREWALL_OUTBOUND_SUBNETS=${LOCAL_SUBNET:?err}
      - VPN_TYPE=${VPN_TYPE}
      - VPN_ENDPOINT_IP=${VPN_ENDPOINT_IP}
      - VPN_ENDPOINT_PORT=${VPN_ENDPOINT_PORT}
      - HTTPPROXY=on
      - SHADOWSOCKS=on

    networks:
      - media-network

  sabnzbd:
    image: lscr.io/linuxserver/sabnzbd:latest
    container_name: sabnzbd
    restart: unless-stopped
    volumes:
      - ${FOLDER_FOR_CONFIGS:?err}/sabnzbd:/config
      - ${FOLDER_FOR_MEDIA:?err}/usenet:/data/usenet
#    ports:
#      - "${WEBUI_PORT_SABNZBD:?err}:8080"
    environment:
      - PUID=${PUID:?err}
      - PGID=${PGID:?err}
      - TZ=${TIMEZONE:?err}
      - DOCKER_MODS=ghcr.io/gilbn/theme.park:sabnzbd
      - TP_THEME=${TP_THEME:?err}
    network_mode: "service:gluetun"

log from portainer:

========================================
========================================
=============== gluetun ================
========================================
=========== Made with ❤️ by ============
======= https://github.com/qdm12 =======
========================================
========================================
Running version latest built on 2024-05-18T18:08:57.405Z (commit 4218dba)
🔧 Need help? https://github.com/qdm12/gluetun/discussions/new
🐛 Bug? https://github.com/qdm12/gluetun/issues/new
✨ New feature? https://github.com/qdm12/gluetun/issues/new
☕ Discussion? https://github.com/qdm12/gluetun/discussions/new
💻 Email? quentin.mcgaw@gmail.com
💰 Help me? https://www.paypal.me/qmcgaw https://github.com/sponsors/qdm12
2024-06-09T19:13:42+02:00 INFO [routing] default route found: interface eth0, gateway 172.28.10.1, assigned IP 172.28.10.8 and family v4
2024-06-09T19:13:42+02:00 INFO [routing] local ethernet link found: eth0
2024-06-09T19:13:42+02:00 INFO [routing] local ipnet found: 172.28.10.0/24
2024-06-09T19:13:42+02:00 INFO [firewall] enabling...
2024-06-09T19:13:42+02:00 INFO [firewall] enabled successfully
2024-06-09T19:13:42+02:00 INFO [storage] merging by most recent 19425 hardcoded servers and 19425 servers read from /gluetun/servers.json
2024-06-09T19:13:43+02:00 ERROR VPN settings: OpenVPN settings: user is empty
2024-06-09T19:13:43+02:00 INFO Shutdown successful
drewski3420 commented 2 weeks ago

What makes you think this is a port error? Have you followed up on this line

2024-06-09T19:13:43+02:00 ERROR VPN settings: OpenVPN settings: user is empty