qdm12 / gluetun

VPN client in a thin Docker container for multiple VPN providers, written in Go, and using OpenVPN or Wireguard, DNS over TLS, with a few proxy servers built-in.
https://hub.docker.com/r/qmcgaw/gluetun
MIT License
7.52k stars 355 forks source link

Bug: Latest Gluetun container ignored wg0.conf #2183

Closed CplPwnies closed 6 months ago

CplPwnies commented 6 months ago

Is this urgent?

Yes

Host OS

Debian Bullseye

CPU arch

x86_64

VPN service provider

Custom

What are you using to run the container

docker-compose

What is the version of Gluetun

Running version latest built on 2024-03-25T19:19:45.506Z (commit ecc80a5)

What's the problem 🤔

I have a gluetun container where I map in a wg0.conf file instead of defining all the wireguard env variables, and the latest docker container build seems to be ignoring the mapped wg0.conf file and looking for the env variables, then stopping when it does not find them.

Share your logs (at least 10 lines)

gluetun  | ========================================
gluetun  | ========================================
gluetun  | =============== gluetun ================
gluetun  | ========================================
gluetun  | =========== Made with ❤️ by ============
gluetun  | ======= https://github.com/qdm12 =======
gluetun  | ========================================
gluetun  | ========================================
gluetun  |
gluetun  | Running version latest built on 2024-03-25T19:19:45.506Z (commit ecc80a5)
gluetun  |
gluetun  | 🔧 Need help? https://github.com/qdm12/gluetun/discussions/new
gluetun  | 🐛 Bug? https://github.com/qdm12/gluetun/issues/new
gluetun  | ✨ New feature? https://github.com/qdm12/gluetun/issues/new
gluetun  | ☕ Discussion? https://github.com/qdm12/gluetun/discussions/new
gluetun  | 💻 Email? quentin.mcgaw@gmail.com
gluetun  | 💰 Help me? https://www.paypal.me/qmcgaw https://github.com/sponsors/qdm12
gluetun  | 2024-03-25T15:31:13-05:00 WARN You are using the old environment variable HTTPPROXY_LOG, please consider changing it to
gluetun  | 2024-03-25T15:31:13-05:00 INFO [routing] default route found: interface eth0, gateway REDACTED, assigned IP REDACTED and family v4
gluetun  | 2024-03-25T15:31:13-05:00 INFO [routing] local ethernet link found: eth0
gluetun  | 2024-03-25T15:31:13-05:00 INFO [routing] local ipnet found: REDACTED
gluetun  | 2024-03-25T15:31:13-05:00 INFO [routing] local ipnet found: REDACTED
gluetun  | 2024-03-25T15:31:13-05:00 INFO [firewall] enabling...
gluetun  | 2024-03-25T15:31:13-05:00 INFO [firewall] enabled successfully
gluetun  | 2024-03-25T15:31:14-05:00 INFO [storage] merging by most recent 19476 hardcoded servers and 19476 servers read from /gluetun/servers.json
gluetun  | 2024-03-25T15:31:14-05:00 ERROR VPN settings: provider settings: server selection: Wireguard server selection settings: endpoint IP is not set
gluetun  | 2024-03-25T15:31:14-05:00 INFO Shutdown successful

Share your configuration

---
version: "3.8"

services:
  gluetun:
    image: qmcgaw/gluetun:latest
    container_name: gluetun
    restart: unless-stopped
    cap_add:
      - NET_ADMIN
    devices:
      - /dev/net/tun:/dev/net/tun
    environment:
      - TZ=AREDACTED
      - VPN_SERVICE_PROVIDER=custom
      - VPN_TYPE=wireguard
      - FIREWALL_OUTBOUND_SUBNETS=REDACTED
      # - VPN_ENDPOINT_IP=REDACTED
      # - VPN_ENDPOINT_PORT=REDACTED
      # - WIREGUARD_PUBLIC_KEY=REDACTED
      # - WIREGUARD_PRIVATE_KEY=REDACTED
      # - WIREGUARD_ADDRESSES=REDACTED
      # - VPN_DNS_ADDRESS=REDACTED
      - VPN_PORT_FORWARDING=on
      - VPN_PORT_FORWARDING_PROVIDER=protonvpn
      - VPN_PORT_FORWARDING_STATUS_FILE=/gluetun/forwarded_port
      - UPDATER_PERIOD=24h
    volumes:
      - "/path/to/config:/gluetun"
      - "/path/to/wg0.conf:/gluetun/wireguard/wg0.conf"
    ports:
      - "8888:8888/tcp" # HTP Proxy
      - "8388:8388/tcp" # Shadowsocks
      - "8388:8388/udp" # Shadowsocks
      - "8001:8000/tcp" # HTTP Control Server
github-actions[bot] commented 6 months ago

@qdm12 is more or less the only maintainer of this project and works on it in his free time. Please:

mrrfv commented 6 months ago

Set the environment variable WIREGUARD_CONF_SECRETFILE to /gluetun/wireguard/wg0.conf as a workaround.

ryansorr1 commented 6 months ago

setting WIREGUARD_CONF_SECRETFILE didn't work for me either with the latest pull, but I changed my compose file to mount the volume like this and it worked

qdm12 commented 6 months ago

Thanks for reporting this, working on it! It's due to a rather large config rework in ecc80a5a9e3f5ba8c3096eb47c9ed8544a7e8867

You can revert to v3.38.0 for the time being, which is just before this commit.

qdm12 commented 6 months ago

Fixed in e01ce9c6d87172f565b813523314daba7ebb2c5b

The path was changed to /gluetun/wg0.conf, it's now fixed to be back to /gluetun/wireguard/wg0.conf by default.

github-actions[bot] commented 6 months ago

Closed issues are NOT monitored, so commenting here is likely to be not seen. If you think this is still unresolved and have more information to bring, please create another issue.

This is an automated comment setup because @qdm12 is the sole maintainer of this project which became too popular to monitor issues closed.

qdm12 commented 6 months ago

6b2f350ec960a8e07fd1a78fd180260645f1b25e should also further resolve this.