Joentje / nordvpn-proxy

Use NordVPN in your Docker stack
141 stars 53 forks source link

Filter recommended servers to only include vpn-capable servers #50

Closed SijmenHuizenga closed 3 years ago

SijmenHuizenga commented 3 years ago

Apparently, not all vpn servers support openvpn. Servers that do not support vpn are not included in the ovpn.zip folder.

At the moment, if you are unlucky and openvpn recommends a server that does not support openvpn, the problem described in #49 will happen because openvpn can't find the server file.

From what I can find, the https://api.nordvpn.com/v1/servers/recommendations does not support filtering recommended servers based on technology support.

I think the solution should be to use the https://nordvpn.com/wp-admin/admin-ajax.php endpoind as described here. That endpoint does support tech-filtering. It is also the same endpoint used by https://nordvpn.com/servers/tools/ when you select 'show advanced options.

gerwim commented 3 years ago

Ah, this is the same exact issue I actually had. My openvpn would not start because of it being unable to parse the configuration file.

The API does support filtering though, e.g.: https://api.nordvpn.com/v1/servers/recommendations?filters[servers_technologies][identifier]=openvpn_udp&limit=1.

I'll create a PR later this week.

gerwim commented 3 years ago

@SijmenHuizenga I've made the (small) PR, and I just noticed you submitted a PR too. Ah well :-)

Joentje commented 3 years ago

@SijmenHuizenga thank you for reporting. This is indeed crucial to make it work if somehow a server does not support a certain protocol. Just merged @gerwim PR that will solve this.