edgd1er / nordvpn-proxy

NordVPN openVPN socks
24 stars 8 forks source link

Verified correct credentials parsed from ENV, container fails to AUTH. Logs show an error ./run: line 73: }: too many arguments #35

Closed xanderphillips closed 10 months ago

xanderphillips commented 10 months ago

Steps to reproduce: set up nordvpn with password containing spaces. (Similar password with no spaces does not throw the error in the run script from line 73)

ALSO: Even without spaces in password getting AUTH error using same username and password as works in official nordvpn client.

INFO: OVPN: Creating tun interface /dev/net/tun INFO: OVPN: Checking curl installation INFO: OVPN: DNS resolution ok INFO: OVPN: ok, configurations download site reachable INFO: OVPN: Removing existing configs in /etc/service/openvpn/nordvpn INFO: Checking NORDPVN API responses INFO: OVPN:Selecting the best server... INFO: WARNING: OVPN: empty or invalid NORDVPN_COUNTRY (value=). Ignoring this parameter. Possible values are:AL,AR,AU,AT,BE,BA,BR,BG,CA,CL,CO,CR,HR,CY,CZ,DK,EE,FI,FR,GE,DE,GR,HK,HU,IS,ID,IE,IL,IT,JP,LV,LT,LU,MY,MX,MD,NL,NZ,MK,NO,PL,PT,RO,RS,SG,SK,SI,ZA,KR,ES,SE,CH,TW,TH,TR,UA,AE,GB,US,VN, or Albania,Argentina,Australia,Austria,Belgium,Bosnia and Herzegovina,Brazil,Bulgaria,Canada,Chile,Colombia,Costa Rica,Croatia,Cyprus,Czech Republic,Denmark,Estonia,Finland,France,Georgia,Germany,Greece,Hong Kong,Hungary,Iceland,Indonesia,Ireland,Israel,Italy,Japan,Latvia,Lithuania,Luxembourg,Malaysia,Mexico,Moldova,Netherlands,New Zealand,North Macedonia,Norway,Poland,Portugal,Romania,Serbia,Singapore,Slovakia,Slovenia,South Africa,South Korea,Spain,Sweden,Switzerland,Taiwan,Thailand,Turkey,Ukraine,United Arab Emirates,United Kingdom,United States,Vietnam,. Please check https://haugene.github.io/docker-transmission-openvpn/provider-specific/#nordvpn INFO: OVPN: Searching for group: legacy_p2p INFO: OVPN:Searching for technology: openvpn_tcp INFO: OVPN: Best server : us6308.nordvpn.com, load: 17 INFO: OVPN: Downloading config: us6308.nordvpn.com.ovpn INFO: OVPN: Downloading from: https://downloads.nordcdn.com/configs/files/ovpn_udp/servers/us6308.nordvpn.com.udp.ovpn selected: us6308.nordvpn.com, VPN_PROVIDER_HOME: /etc/service/openvpn/nordvpn INFO: OVPN: ######################################################## INFO: OVPN: Files found: 1 INFO: OVPN: config: /etc/service/openvpn/nordvpn/us6308.nordvpn.com.ovpn INFO: OVPN: openvpn log level: 0 INFO: OVPN: ######################################################## ./run: line 73: [: too many arguments INFO: OVPN: Found existing OPENVPN credentials at /config/openvpn-credentials.txt INFO: OVPN: Setting OpenVPN credentials... 2023-11-17 04:11:29 NOTE: the current --script-security setting may allow this configuration to call user-defined scripts 2023-11-17 04:11:29 WARNING: this configuration may cache passwords in memory -- use the auth-nocache option to prevent this 2023-11-17 04:11:36 AUTH: Received control message: AUTH_FAILED INFO: OVPN: VPN connection lost, stopping unbound INFO: OVPN: Waiting 30 seconds before restarting

edgd1er commented 10 months ago

Thanks for your interest in the project. I'll be looking into the problem. I'm revisiting the code, as It hasn't evolved for a while.

edgd1er commented 10 months ago

@xanderphillips , The last image should fix the problem, Could you confirm it has been fixed ?

xanderphillips commented 10 months ago

Oddly now my logs show it not finding ./run now. "runsv openvpn: fatal: unable to start ./run: file does not exist" Console to the container and search and it appears that there should be a /etc/service/openvpn/run script from the github repo, but there's not one in my container.

edgd1er commented 10 months ago

The Dockerfile at build time copy /app to /etc/services/. I fixed glitches (dockerignore being to restrictive, scripts not looking in the moved config directory.) Should be ok now. I cannot test at the moment the container as windows, docker and vpn do not mix very well. As soon as the vpn is up, the container loose its internet access due to incompatibilities in docker/windows/wsl networks Please keep me informed if it's fixed or not.

xanderphillips commented 10 months ago

I recreated that run script in /etc/service/openvpn/ (copied from github) logs indicated it picked up the run script once I set it to executable but then the run script was moved/removed (not sure which) logs showing run script missing again

edgd1er commented 10 months ago

here are my logs with the latest image, no problem so far. Could you pull the latest image to test ?

nordvpn-proxy-proxy-1  | 2023-11-21 10:26:07: INFO: NORDVPN: Using cached values for json_countries
nordvpn-proxy-proxy-1  | 2023-11-21 10:26:07: INFO: NORDVPN: Using cached values for json_groups
nordvpn-proxy-proxy-1  | 2023-11-21 10:26:07: INFO: NORDVPN: Using cached values for json_technologies
nordvpn-proxy-proxy-1  | 2023-11-21 10:26:08: INFO: Checking curl installation
nordvpn-proxy-proxy-1  | 2023-11-21 10:26:08: INFO: DNS: resolution ok
nordvpn-proxy-proxy-1  | 2023-11-21 10:26:09: INFO: OVPN: ok, configurations download site reachable
nordvpn-proxy-proxy-1  | 2023-11-21 10:26:09: INFO: NORDVPN: Removing existing configs in /etc/service/openvpn
nordvpn-proxy-proxy-1  | 2023-11-21 10:26:09: INFO: Checking NORDPVN API responses
nordvpn-proxy-proxy-1  | 2023-11-21 10:26:09: INFO: Selecting the best server...
nordvpn-proxy-proxy-1  | 2023-11-21 10:26:10: INFO: NORDVPN: Searching for country : GE (80)
nordvpn-proxy-proxy-1  | 2023-11-21 10:26:10: INFO: NORDVPN, searching for group: legacy_p2p
nordvpn-proxy-proxy-1  | 2023-11-21 10:26:10: INFO: NORDVPN: searching for technology: openvpn_udp
nordvpn-proxy-proxy-1  | 2023-11-21 10:26:18: INFO: OVPN: Best server : ge14.nordvpn.com, load: 6
nordvpn-proxy-proxy-1  | 2023-11-21 10:26:18: INFO: NORDVPN: selected: ge14.nordvpn.com, VPN_PROVIDER_HOME: /etc/service/openvpn
nordvpn-proxy-proxy-1  | 2023-11-21 10:26:18: INFO: OVPN: Downloading config: ge14.nordvpn.com.ovpn
nordvpn-proxy-proxy-1  | 2023-11-21 10:26:18: INFO: OVPN: Downloading from: https://downloads.nordcdn.com/configs/files/ovpn_udp/servers/ge14.nordvpn.com.udp.ovpn
nordvpn-proxy-proxy-1  | 2023-11-21 10:26:19: OVPN: ########################################################:
nordvpn-proxy-proxy-1  | 2023-11-21 10:26:19: OVPN: FILES FOUND: 1:
nordvpn-proxy-proxy-1  | 2023-11-21 10:26:19: OVPN: CONFIG: /ETC/SERVICE/OPENVPN/GE14.NORDVPN.COM.OVPN:
nordvpn-proxy-proxy-1  | 2023-11-21 10:26:19: OVPN: OPENVPN LOG LEVEL: 0:
nordvpn-proxy-proxy-1  | 2023-11-21 10:26:19: OVPN: ########################################################:
nordvpn-proxy-proxy-1  | 2023-11-21 10:26:19: OVPN: FOUND EXISTING OPENVPN CREDENTIALS AT /CONFIG/OPENVPN-CREDENTIALS.TXT:
nordvpn-proxy-proxy-1  | 2023-11-21 10:26:19: OVPN: SETTING OPENVPN CREDENTIALS...:
nordvpn-proxy-proxy-1  | 2023-11-21 10:26:19 NOTE: the current --script-security setting may allow this configuration to call user-defined scripts
nordvpn-proxy-proxy-1  | 2023-11-21 10:26:19 WARNING: this configuration may cache passwords in memory -- use the auth-nocache option to prevent this
nordvpn-proxy-proxy-1  | 2023-11-21 09:26:21: INFO: OPENVPN: UP: STARTING UNBOUND:
nordvpn-proxy-proxy-1  | 2023-11-21 10:26:21: INFO: UNBOUND: SET CONFIGURATION DNS UNBOUND:
nordvpn-proxy-proxy-1  | 2023-11-21 10:26:21: INFO: UNBOUND : COPY ORIGINAL RESOLV CONF:
nordvpn-proxy-proxy-1  | 2023-11-21 10:26:21: INFO: UNBOUND : CHECK UNBOUND CONF:
nordvpn-proxy-proxy-1  | unbound-checkconf: no errors in /config/unbound.conf
nordvpn-proxy-proxy-1  | 2023-11-21 10:26:21: INFO: UNBOUND : START UNBOUND:
nordvpn-proxy-proxy-1  | [1700558781] unbound[160:0] notice: Start of unbound 1.17.1.
nordvpn-proxy-proxy-1  | ok: run: unbound: (pid 148) 0s, normally down
nordvpn-proxy-proxy-1  | 2023-11-21 09:26:21: INFO: OPENVPN: UP: STARTING DANTE:
nordvpn-proxy-proxy-1  | 2023-11-21 10:26:21: ########################################################:
nordvpn-proxy-proxy-1  | 2023-11-21 10:26:21: INFO: DANTE: WAITING FOR TUN0 TO BE UP:
nordvpn-proxy-proxy-1  | 2023-11-21 10:26:21: INFO: DANTE: CHECK CONFIGURATION SOCKS PROXY:
nordvpn-proxy-proxy-1  | 2023-11-21 10:26:21: INFO: DANTE: SET CONFIGURATION SOCKS PROXY:
nordvpn-proxy-proxy-1  | ok: run: dante: (pid 167) 0s, normally down
nordvpn-proxy-proxy-1  | 2023-11-21 09:26:21: INFO: OPENVPN: UP: STARTING TINYPROXY:
nordvpn-proxy-proxy-1  | 2023-11-21 10:26:22: INFO: TINYPROXY: SET CONFIGURATION INT_IP: 172.28.0.2/ EXT_IP: 10.8.1.2 / LOG LEVEL: ERROR / LOCAL NETWORK: :
nordvpn-proxy-proxy-1  | 2023-11-21 10:26:22: INFO: TINYPROXY: STARTING:
nordvpn-proxy-proxy-1  | ok: run: tinyproxy: (pid 195) 1s, normally down
nordvpn-proxy-proxy-1  | Initialization Sequence Completed
nordvpn-proxy-proxy-1  | Nov 21 10:26:25 (1700558785.254233) sockd[190]: info: Dante/server[1/2] v1.4.3 running
nordvpn-proxy-proxy-1  | Nov 21 10:26:25 (1700558785.255694) sockd[228]: info: Dante/server[2/2] v1.4.3 running
xanderphillips commented 10 months ago

I tested without spaces in password, and after a failure to AUTH (with verified credentials in ENV for NORDVPN_USER and NORDVPN_PASS I get a failure to AUTH, then after the failure it's still apparently wiping out the run script, as when it tried to spin back up it is missing.


2023-11-21 11:12:05: INFO: NORDVPN: Using cached values for json_countries 2023-11-21 11:12:05: INFO: NORDVPN: Using cached values for json_groups 2023-11-21 11:12:05: INFO: NORDVPN: Using cached values for json_technologies 2023-11-21 11:12:06: INFO: Checking curl installation 2023-11-21 11:12:21: INFO: DNS: resolution ok 2023-11-21 11:12:22: INFO: OVPN: ok, configurations download site reachable 2023-11-21 11:12:22: INFO: NORDVPN: Removing existing configs in /etc/service/openvpn 2023-11-21 11:12:22: INFO: Checking NORDPVN API responses 2023-11-21 11:12:22: INFO: Selecting the best server... 2023-11-21 11:12:22: INFO: NORDVPN: Searching for country : US (228) 2023-11-21 11:12:22: INFO: NORDVPN, searching for group: legacy_p2p 2023-11-21 11:12:22: INFO: NORDVPN: searching for technology: openvpn_tcp 2023-11-21 11:12:31: INFO: OVPN: Best server : us9306.nordvpn.com, load: 6 2023-11-21 11:12:31: INFO: NORDVPN: selected: us9306.nordvpn.com, VPN_PROVIDER_HOME: /etc/service/openvpn 2023-11-21 11:12:31: INFO: OVPN: Downloading config: us9306.nordvpn.com.ovpn 2023-11-21 11:12:31: INFO: OVPN: Downloading from: https://downloads.nordcdn.com/configs/files/ovpn_tcp/servers/us9306.nordvpn.com.tcp.ovpn 2023-11-21 11:12:31: INFO: OVPN: ######################################################## 2023-11-21 11:12:31: INFO: OVPN: Files found: 1 2023-11-21 11:12:31: INFO: OVPN: config: /etc/service/openvpn/us9306.nordvpn.com.ovpn 2023-11-21 11:12:31: INFO: OVPN: openvpn log level: 0 2023-11-21 11:12:31: INFO: OVPN: ######################################################## 2023-11-21 11:12:31: OVPN: FOUND EXISTING OPENVPN CREDENTIALS AT /CONFIG/OPENVPN-CREDENTIALS.TXT: 2023-11-21 11:12:31: OVPN: SETTING OPENVPN CREDENTIALS...: 2023-11-21 11:12:31 NOTE: the current --script-security setting may allow this configuration to call user-defined scripts 2023-11-21 11:12:31 WARNING: this configuration may cache passwords in memory -- use the auth-nocache option to prevent this 2023-11-21 11:12:38 AUTH: Received control message: AUTH_FAILED 2023-11-21 11:12:38: OVPN: VPN CONNECTION LOST, STOPPING UNBOUND: 2023-11-21 11:12:38: OVPN: WAITING 30 SECONDS BEFORE RESTARTING: runsv openvpn: fatal: unable to start ./run: file does not exist runsv openvpn: fatal: unable to start ./run: file does not exist runsv openvpn: fatal: unable to start ./run: file does not exist runsv openvpn: fatal: unable to start ./run: file does not exist runsv openvpn: fatal: unable to start ./run: file does not exist

edgd1er commented 10 months ago

@xanderphillips , I pushed few fixes not directly related to this issue but it should help. a new env var, WAITSEC define the time to wait between to connection attempt, too many calls to the api and failed connection attempts may trigger throttle rules, then the container would be enable to connect whatever are the credentials. Feel free to reopen the issue if the problem is still there.