Variables not handled correctly
Closed this issue · 4 comments
Hi, something is not working right with the variables between the .env and the yaml:
If I hardcode the value in the yaml it works.
Whats the status of this project, is it supposed to work or are there known issues?
Thanks for your efforts!
Markus
2024-07-21T19:44:17+08:00 INFO [firewall] enabling...
2024-07-21T19:44:17+08:00 INFO [firewall] enabled successfully
2024-07-21T19:44:17+08:00 INFO [storage] merging by most recent 19425 hardcoded servers and 19425 servers read from /gluetun/servers.json
2024-07-21T19:44:17+08:00 ERROR VPN settings: provider settings: server selection: for VPN service provider protonvpn: the country specified is not valid: value is not one of the possible choices: value $(SERVER_COUNTRIES), choices available are Argentina, Australia, Austria, Belgium, Brazil, Bulgaria, Cambodia, Canada, Chile, Colombia, Costa Rica, Cyprus, Czech Republic, Denmark, Ecuador, Egypt, Estonia, Finland, France, Germany, Greece, Hong Kong, Hungary, Iceland, India, Ireland, Israel, Italy, Japan, Korea, Latvia, Lithuania, Luxembourg, Malaysia, Mexico, Moldova, Netherlands, New Zealand, Nigeria, Norway, Peru, Philippines, Poland, Portugal, Puerto Rico, Romania, Russian Federation, Serbia, Singapore, Slovakia, Slovenia, South Africa, Spain, Sweden, Switzerland, Taiwan, Thailand, Turkey, Ukraine, United Arab Emirates, United Kingdom, United States, Vietnam
2024-07-21T19:44:17+08:00 INFO Shutdown successful
got it working after removing the gluetun variables and just putting the content in the yaml
This seems to be an upstream issue with the Gluetun container, which I logged the following bug a few days ago:
As per bug report, this is the only way we could get it working with the variables:
- OPENVPN_USER=${VPN_USERNAME:?err}
- OPENVPN_PASSWORD=${VPN_PASSWORD:?err}
# - SERVER_COUNTRIES=$(SERVER_COUNTRIES)
- SERVER_REGIONS=$(SERVER_REGIONS)
# - SERVER_CITIES=$(SERVER_CITIES)
# - SERVER_HOSTNAMES=$(SERVER_HOSTNAMES)
# - SERVER_CATEGORIES=$(SERVER_CATEGORIES)
I expect this to be resolved in time, and the variables should all eventually work, we just dependant on bug fix, or use above example to remove some of the variables as a temporary workaround.
Glad you got it working in the mean time.
I believe this is just due to Gluetun reading settings 'raw' without dealing with the shell. So $(SERVER_COUNTRIES)
is read as it is, without searching for the other environment variable SERVER_COUNTRIES
. Other containers might work with this if they use a shell to read settings, but in this case Gluetun is a custom Go program so it's not aware of the shell syntax. And I would ideally like to keep it that way so it's more shell/OS-independent (the end goal is a cross platform binary).
Is there a particular reason to use i.e. SERVER_CITIES=$(SERVER_CITIES)
instead of having the cities directly in there?
This issue has been discussed in qdm12/gluetun#2367 and qdm12/gluetun#2358
Have pushed 3acad52 update in our repo to address this, so using the ENV file works correctly now.