Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NordVPN sync not working #62

Closed
mobad opened this issue Feb 16, 2021 · 4 comments · Fixed by #63
Closed

NordVPN sync not working #62

mobad opened this issue Feb 16, 2021 · 4 comments · Fixed by #63

Comments

@mobad
Copy link
Contributor

mobad commented Feb 16, 2021

2021-02-16T19:04:10.987Z INFO  vopono::util > Calling sudo for elevated privileges, current user will be used as default user
 2021-02-16T19:04:10.987Z DEBUG vopono::util > Args: ["target/debug/vopono", "-v", "sync"]
Which VPN providers do you wish to synchronise? Press Space to select and Enter to continue: NordVPN
 2021-02-16T19:04:12.727Z INFO  vopono::sync > Starting OpenVPN configuration...
Please choose the set of OpenVPN configuration files you wish to install: UDP: These files connect over UDP.
 2021-02-16T19:04:14.076Z DEBUG reqwest::connect > starting new connection: https://downloads.nordcdn.com/
 2021-02-16T19:04:14.086Z DEBUG rustls::client::hs > No cached session for DNSNameRef("downloads.nordcdn.com")
 2021-02-16T19:04:14.086Z DEBUG rustls::client::hs > Not resuming any session
 2021-02-16T19:04:14.094Z DEBUG rustls::client::hs > Using ciphersuite TLS13_CHACHA20_POLY1305_SHA256
 2021-02-16T19:04:14.095Z DEBUG rustls::client::tls13 > Not resuming
 2021-02-16T19:04:14.095Z DEBUG rustls::client::tls13 > TLS1.3 encrypted extensions: [ServerNameAck, Protocols([PayloadU8([104, 50])])]
 2021-02-16T19:04:14.096Z DEBUG rustls::client::hs    > ALPN protocol is Some(b"h2")
 2021-02-16T19:04:14.100Z DEBUG rustls::client::tls13 > Ticket saved
 2021-02-16T19:04:14.101Z DEBUG rustls::client::tls13 > Ticket saved
 2021-02-16T19:04:14.144Z DEBUG reqwest::async_impl::client > response '200 OK' for https://downloads.nordcdn.com/configs/archives/servers/ovpn.zip
 2021-02-16T19:04:16.359Z DEBUG vopono::providers::nordvpn::openvpn > Reading file: ovpn_udp/al18.nordvpn.com.udp.ovpn
 2021-02-16T19:04:16.359Z DEBUG vopono::providers::nordvpn::openvpn > Reading filename: **albania-ovpn_udp/al18.ovpn**
Error: No such file or directory (os error 2)

This is on 7a9402a and no .config/vopono
I added that last print.
It seems like it should be stripping off the ovpn_udp part at some point.

@jeff-hughes

@jamesmcm
Copy link
Owner

jamesmcm commented Feb 16, 2021

Hi,

I think the issue is that line 73 keeps the directory:

let fname = file.name();

I think it can use enclosed_name() instead to get a Path:

let fname = file.enclosed_name()?.file_name().ok_or_else(anyhow!("No valid filename for file: {:?}", fname.name()))?;

I won't be on my home computer to test this until tomorrow but I think something like that will work.

@jeff-hughes
Copy link
Contributor

Ahh yes, I'm getting the same issue. I think I may have accidentally tested an earlier version after I made a change to the filename that gets stored. Not sure exactly what happened, but my apologies.

@jamesmcm, that's essentially it, though there's a bit more work to get the resulting OsStr into a str. I can work on a quick PR, I just need to tidy up the error handling -- probably better just to skip over an invalid file rather than return an error.

@jamesmcm
Copy link
Owner

Thanks! Yeah, that makes sense, you could use map to get a Result<Option<&OsStr>> and then match it to warn in the failed cases (we might actually need one extra layer to convert the &OsStr to Option<&Str> too.

But it'd be best to either write debug messages in that case (if we know there are some files that will trigger this case) or warnings (if there currently are not), in case the zip file changes in the future.

@jamesmcm
Copy link
Owner

Thanks to both of you 🙂 The fix is released in release 0.6.7.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants