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
8.08k stars 373 forks source link

Trim spaces from each CSV element for filter values #2230

Open backcountrymountains opened 7 months ago

backcountrymountains commented 7 months ago

Is this urgent?

No

Host OS

Debian buster

CPU arch

x86_64

VPN service provider

NordVPN

What are you using to run the container

Portainer

What is the version of Gluetun

Running version v3.38.0 built on 2024-03-25T15:53:33.983Z (commit b3ceece)

What's the problem πŸ€”

EDIT: I think the issue might actually be the space between United States and Canada. Using united states,canada doesn't throw an error. Perchance this is and issue with spaces, not cases!

Using NordVPN: SERVER_COUNTRIES with United States, Canada fails the country specified is not valid: value is not one of the possible choices: value canada, choices available are ... Cambodia, Canada, Cayman Islands, Chile, ... I'm using Portainer with the Environment variables section and the following does not work: image but image does work.

Could this be a Portainer-specific issue?

Anyway, the quick fix for me is to note that the comma separated list must not contain spaces between items. Perhaps this could be added to the wiki?

Everything else is great!

Share your logs (at least 10 lines)

Running version v3.38.0 built on 2024-03-25T15:53:33.983Z (commit b3ceece)
2024-04-18T11:20:45-06:00 ERROR VPN settings: provider settings: server selection: for VPN service provider nordvpn: the country specified is not valid: value is not one of the possible choices: value  canada, choices available are Albania, Algeria, Andorra, Argentina, Armenia, Australia, Austria, Azerbaijan, Bahamas, Bangladesh, Belgium, Belize, Bermuda, Bhutan, Bolivia, Bosnia and Herzegovina, Brazil, Brunei Darussalam, Bulgaria, Cambodia, Canada, Cayman Islands, Chile, Colombia, Costa Rica, Croatia, Cyprus, Czech Republic, Denmark, Dominican Republic, Ecuador, Egypt, El Salvador, Estonia, Finland, France, Georgia, Germany, Ghana, Greece, Greenland, Guam, Guatemala, Honduras, Hong Kong, Hungary, Iceland, India, Indonesia, Ireland, Isle of Man, Israel, Italy, Jamaica, Japan, Jersey, Kazakhstan, Kenya, Lao People's Democratic Republic, Latvia, Lebanon, Liechtenstein, Lithuania, Luxembourg, Malaysia, Malta, Mexico, Moldova, Monaco, Mongolia, Montenegro, Morocco, Myanmar, Nepal, Netherlands, New Zealand, Nigeria, North Macedonia, Norway, Pakistan, Panama, Papua New Guinea, Paraguay, Peru, Philippines, Poland, Portugal, Puerto Rico, Romania, Serbia, Singapore, Slovakia, Slovenia, South Africa, South Korea, Spain, Sri Lanka, Sweden, Switzerland, Taiwan, Thailand, Trinidad and Tobago, Turkey, Ukraine, United Arab Emirates, United Kingdom, United States, Uruguay, Uzbekistan, Venezuela, Vietnam
2024-04-18T11:20:45-06:00 INFO Shutdown successful

Share your configuration

gluetun:
    image: qmcgaw/gluetun:v3.38
    container_name: gluetun
    restart: always
    cap_add:
      - NET_ADMIN
    devices:
      - /dev/net/tun:/dev/net/tun
    ports:
      - "8888:8888/tcp"                         # Gluetun Local Network HTTP proxy
      - "8388:8388/tcp"                         # Gluetun Local Network Shadowsocks
      - "8388:8388/udp"                         # Gluetun Local Network Shadowsocks
      - "8000:8000/tcp"                         #HTTP Status /v1/publicip/ip  /v1/openvpn/status  /v1/dns/status /v1/updater/status

      - "${WEBUI_PORT_LIDARR:?err}:8686"        # WebUI Portal: Lidarr
      - "${WEBUI_PORT_PROWLARR:?err}:9696"      # WebUI Portal: Prowlarr
      - "${WEBUI_PORT_RADARR:?err}:7878"        # WebUI Portal: Radarr
      - "${WEBUI_PORT_SONARR:?err}:8989"        # WebUI Portal: Sonarr
      - "${WEBUI_PORT_QBITTORRENT:?err}:${WEBUI_PORT_QBITTORRENT:?err}"   # WebUI Portal: qBittorrent

      - "${QBIT_PORT_TCP:?err}:6881/tcp"        # Transmission Torrent Port TCP
      - "${QBIT_PORT_UDP:?err}:6881/udp"        # Transmission Torrent Port UDP
      - "${FLARESOLVERR_PORT:?err}:8191"        # Service Port: FlareSolverr

    volumes:
      - ${FOLDER_FOR_CONFIGS:?err}/gluetun:/gluetun
    environment:
      - PUID=${PUID:?err}
      - PGID=${PGID:?err}
      - TZ=${TIMEZONE:?err}
      - VPN_SERVICE_PROVIDER=${VPN_SERVICE_PROVIDER:?err}
      - OPENVPN_USER=${OPENVPN_USER:?err}
      - OPENVPN_PASSWORD=${OPENVPN_PASSWORD:?err}
      - SERVER_COUNTRIES=${SERVER_COUNTRIES:?err}
      - FIREWALL_OUTBOUND_SUBNETS=${LOCAL_SUBNET:?err}
      - HTTPPROXY=on
      - SHADOWSOCKS=on
    networks:
      - media-network
github-actions[bot] commented 7 months ago

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

qdm12 commented 7 months ago

Thanks for the detailed issue report, I'm traveling right now so I cannot test much really, but can you try to see if the latest image (docker pull qmcgaw/gluetun) has the bug still? Settings parsing was changed, and spaces may be trimmed. Otherwise, I'll code it up to trim prefix and suffix spaces for all filter values. Better codify it than documenting it :wink:

backcountrymountains commented 6 months ago

I was also traveling.

Running version latest built on 2024-05-02T16:57:20.083Z (commit fb145d6)

========================================
========================================
=============== gluetun ================
========================================
=========== Made with ❀️ by ============
======= https://github.com/qdm12 =======
========================================
========================================
Running version latest built on 2024-05-02T16:57:20.083Z (commit fb145d6)
πŸ”§ 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-05-02T15:34:06-06:00 INFO [routing] default route found: interface eth0, gateway 172.28.10.1, assigned IP 172.28.10.2 and family v4
2024-05-02T15:34:06-06:00 INFO [routing] local ethernet link found: eth0
2024-05-02T15:34:06-06:00 INFO [routing] local ipnet found: 172.28.10.0/24
2024-05-02T15:34:06-06:00 INFO [firewall] enabling...
2024-05-02T15:34:06-06:00 INFO [firewall] enabled successfully
2024-05-02T15:34:07-06:00 INFO [storage] merging by most recent 19425 hardcoded servers and 19425 servers read from /gluetun/servers.json
2024-05-02T15:34:07-06:00 ERROR VPN settings: provider settings: server selection: for VPN service provider nordvpn: the country specified is not valid: value is not one of the possible choices: value  Mexico, choices available are Albania, Algeria, Andorra, Argentina, Armenia, Australia, Austria, Azerbaijan, Bahamas, Bangladesh, Belgium, Belize, Bermuda, Bhutan, Bolivia, Bosnia and Herzegovina, Brazil, Brunei Darussalam, Bulgaria, Cambodia, Canada, Cayman Islands, Chile, Colombia, Costa Rica, Croatia, Cyprus, Czech Republic, Denmark, Dominican Republic, Ecuador, Egypt, El Salvador, Estonia, Finland, France, Georgia, Germany, Ghana, Greece, Greenland, Guam, Guatemala, Honduras, Hong Kong, Hungary, Iceland, India, Indonesia, Ireland, Isle of Man, Israel, Italy, Jamaica, Japan, Jersey, Kazakhstan, Kenya, Lao People's Democratic Republic, Latvia, Lebanon, Liechtenstein, Lithuania, Luxembourg, Malaysia, Malta, Mexico, Moldova, Monaco, Mongolia, Montenegro, Morocco, Myanmar, Nepal, Netherlands, New Zealand, Nigeria, North Macedonia, Norway, Pakistan, Panama, Papua New Guinea, Paraguay, Peru, Philippines, Poland, Portugal, Puerto Rico, Romania, Serbia, Singapore, Slovakia, Slovenia, South Africa, South Korea, Spain, Sri Lanka, Sweden, Switzerland, Taiwan, Thailand, Trinidad and Tobago, Turkey, Ukraine, United Arab Emirates, United Kingdom, United States, Uruguay, Uzbekistan, Venezuela, Vietnam
2024-05-02T15:34:07-06:00 INFO Shutdown successful

I think it's the same: Canada, Mexico, Germany Doesn't work but Canada,Mexico,Germany does work

Thanks for looking into this!