vpnmgr vpnmgr - Manage and update VPN Client configurations for NordVPN and PIA

  • ATTENTION! You'll notice a Prefix dropdown when you create a thread. If your post applies to one of the topics listed, please use that Prefix for your post. When browsing the thread list you can use the Prefix to filter the view.
  • ATTENTION! As of November 1, 2020, you are not able to reply to threads 6 months after the thread is opened if there are more than 500 posts in the thread.
    Threads will not be locked, so posts may still be edited by their authors.
    Just start a new thread on the topic to post if you get an error message when trying to reply to a thread.

Which VPN provider do you use?


  • Total voters
    179

Teymur

Regular Contributor
They shouldn't interact, can you check for browser errors in the f12 console please? It looks like something is failing to load
Hey Jack, thanks for the hint. Please see the attached screenshot. Would this be the reason it's failing to load? I'm not using PIA, I'm on NordVPN.
 

Attachments

  • Capture.PNG
    Capture.PNG
    422.6 KB · Views: 42

Teymur

Regular Contributor
@Jack Yaz So my problem was that there was no pia_countrydata file in /tmp/var/wwwext/vpnmgr/. I don't know why it wasn't downloaded. But since I don't use PIA I just copied wevpn and renamed to pia and now the page loads properly. Thanks again. I'd also suggest if possible of course to have an option to enable a graph to see the server load throught the day/week/month etc... That parametr is getting checked on every scheduled update/reload anyway. Question here about update/reload: what's the criteria when the script decides to change the server? Is it load based? If yes what's the load value it will switch the server to a new one with least load?
 

Jack Yaz

Part of the Furniture
@Jack Yaz So my problem was that there was no pia_countrydata file in /tmp/var/wwwext/vpnmgr/. I don't know why it wasn't downloaded. But since I don't use PIA I just copied wevpn and renamed to pia and now the page loads properly. Thanks again. I'd also suggest if possible of course to have an option to enable a graph to see the server load throught the day/week/month etc... That parametr is getting checked on every scheduled update/reload anyway. Question here about update/reload: what's the criteria when the script decides to change the server? Is it load based? If yes what's the load value it will switch the server to a new one with least load?
NordVPN simply recommends a server through their API it doesn't show the load with the way it's done now. The script will change the server if the API reports a different server to the one currently in use
 

Jack Yaz

Part of the Furniture
Hey Jack, thanks for the hint. Please see the attached screenshot. Would this be the reason it's failing to load? I'm not using PIA, I'm on NordVPN.
What happens if you use option r at the command line? The PIA archives shouldn't be failing to download, unless they've changed something their side
 

Teymur

Regular Contributor
NordVPN simply recommends a server through their API it doesn't show the load with the way it's done now. The script will change the server if the API reports a different server to the one currently in use
Ok I see what you mean. I have been using NordVPN for at least 3 years now. I had written a script to monitor the load and switch the server if the load was above specified percentage. That was no where near what you've done here with all that fancy gui and stuff. From what I can tell from my experience with nordvpn is that their server load changes quite quick. You may connect to a server with 10 percent load and in 10 minutes it can be at 90 %. I used this command to check the server load and it still works:
Code:
curl --silent https://api.nordvpn.com/server/stats/nl732.nordvpn.com | jq .percent
 

Teymur

Regular Contributor
What happens if you use option r at the command line? The PIA archives shouldn't be failing to download, unless they've changed something their side
here is the output. once the vpnmgr command entered it takes approx a minute or so to refresh openvpn packages. I think it's the same thing if I used "r" option.
Code:
[email protected]:/tmp/home/root# vpnmgr
vpnmgr: Refreshing OpenVPN file archives...

vpnmgr: No changes in PIA OpenVPN file archives

vpnmgr: No changes in WeVPN OpenVPN file archives

###################################################
##                                               ##
## __   __ _ __   _ __   _ __ ___    __ _  _ __  ##
## \ \ / /| '_ \ | '_ \ | '_   _ \  / _  || '__| ##
##  \ V / | |_) || | | || | | | | || (_| || |    ##
##   \_/  | .__/ |_| |_||_| |_| |_| \__, ||_|    ##
##        | |                        __/ |       ##
##        |_|                       |___/        ##
##                                               ##
##               v2.1.1 on RT-AC3200             ##
##                                               ##
##       https://github.com/jackyaz/vpnmgr       ##
##                                               ##
###################################################

1.    List VPN client configurations

2.    Update configuration for a managed VPN client

3.    Enable management for a VPN client
4.    Disable management for a VPN client

5.    Search for new recommended server/reload server
6.    Update schedule for a VPN client
7.    Enable a scheduled VPN client update/reload
8.    Delete a scheduled VPN client update/reload

r.    Refresh cached data from VPN providers

u.    Check for updates
uf.   Update vpnmgr with latest version (force)

e.    Exit vpnmgr

z.    Uninstall vpnmgr

###################################################

Choose an option:    r

vpnmgr: Refreshing NordVPN country data...

vpnmgr: No changes in NordVPN country data

vpnmgr: Refreshing OpenVPN file archives...
 

Jack Yaz

Part of the Furniture
Ok I see what you mean. I have been using NordVPN for at least 3 years now. I had written a script to monitor the load and switch the server if the load was above specified percentage. That was no where near what you've done here with all that fancy gui and stuff. From what I can tell from my experience with nordvpn is that their server load changes quite quick. You may connect to a server with 10 percent load and in 10 minutes it can be at 90 %. I used this command to check the server load and it still works:
Code:
curl --silent https://api.nordvpn.com/server/stats/nl732.nordvpn.com | jq .percent
We could display the load for the connected server and have a trigger action if load exceeds a threshold - checked every X minutes.

Initially i wanted to parse the server list to make our own selection algorithm but parsing the list on the router with jq just took far too long.
 

Teymur

Regular Contributor
We could display the load for the connected server and have a trigger action if load exceeds a threshold - checked every X minutes.

Initially i wanted to parse the server list to make our own selection algorithm but parsing the list on the router with jq just took far too long.
That’d be awesome if we could specify the percentage value at what I’d like to change the server to a recommended one from the same country or automatic... and that check to run every so often. As far as I’m aware right now the gui scheduler doesn’t accept “*/5” every 5 min check. Only once a day at certain time. Please correct if I’m wrong. I know that it could be modified with cru, but then I’ll have a server change every 5 min say.
 

Jack Yaz

Part of the Furniture
That’d be awesome if we could specify the percentage value at what I’d like to change the server to a recommended one from the same country or automatic... and that check to run every so often. As far as I’m aware right now the gui scheduler doesn’t accept “*/5” every 5 min check. Only once a day at certain time. Please correct if I’m wrong. I know that it could be modified with cru, but then I’ll have a server change every 5 min say.
I'll add it as a feature request on my to-do list
 

JT Strickland

Senior Member
It may be too late to vote, but the poll is still up, so I voted for Other. I use Surfshark, don't have a clue how many others do.
I think they have a free trial. I felt like they had the most to offer for the money at the time.
 

Teymur

Regular Contributor
It may be too late to vote, but the poll is still up, so I voted for Other. I use Surfshark, don't have a clue how many others do.
I think they have a free trial. I felt like they had the most to offer for the money at the time.
I have no idea about Surfsharks API, but if @Jack Yaz wants to implement it, I have an account with Surfshark which I can provide for the time being.
 

JT Strickland

Senior Member
I have no idea about Surfsharks API, but if @Jack Yaz wants to implement it, I have an account with Surfshark which I can provide for the time being.
Me too. It's about all I can do, not much help with troubleshooting.
 

Teymur

Regular Contributor
Should be easy enough to run surfshark's app through a mitm proxy and see what it does to find suitable server.
 

Expose11

New Around Here
Surfshark please. I've been using them with no problem for almost a year. This was my first use of a VPN. Had to contact support early on and they were very responsive. All the servers I've tried have been fast.
 
Last edited:

h0me5k1n

Occasional Visitor
SurfShark has an api but it appears that most functions are restricted to authenticated users... you probably need a log in ("bearer" token) to access these endpoints (guessed from the surfshark chrome extension and linux binary app):

https://api.surfshark.com/v1/auth/login # for auth?
https://api.surfshark.com/v1/auth/activate # for auth?
https://api.surfshark.com/v1/auth/renew # for auth?
https://api.surfshark.com/v1/server/suggest # possibly recommended servers once authenticated?
https://api.surfshark.com/v1/server/suggest/unrestricted # possibly recommended servers once authenticated?

These ones are accessible without authentication (found from searching the web):

https://api.surfshark.com/v1/server/clusters # lists clusters
https://api.surfshark.com/v3/server/clusters # lists clusters - this one better matches the files downloaded in the below link but there is no v3 equivalent of the below.
(there is mention of "load" in the above outputs per cluster... this may be OK if you are able to pick a country and vpnmgr can choose the cluster with the least load?!)
https://api.surfshark.com/v1/server/configurations # download zip file of vpn config files

I think a configuration like PIA might be best where the zip is downloaded and locations offered (possibly based on locations in the cluster api endpoint) but there are no recommendations available based on load!
 

Jack Yaz

Part of the Furniture
SurfShark has an api but it appears that most functions are restricted to authenticated users... you probably need a log in ("bearer" token) to access these endpoints (guessed from the surfshark chrome extension and linux binary app):

https://api.surfshark.com/v1/auth/login # for auth?
https://api.surfshark.com/v1/auth/activate # for auth?
https://api.surfshark.com/v1/auth/renew # for auth?
https://api.surfshark.com/v1/server/suggest # possibly recommended servers once authenticated?
https://api.surfshark.com/v1/server/suggest/unrestricted # possibly recommended servers once authenticated?

These ones are accessible without authentication (found from searching the web):

https://api.surfshark.com/v1/server/clusters # lists clusters
https://api.surfshark.com/v3/server/clusters # lists clusters - this one better matches the files downloaded in the below link but there is no v3 equivalent of the below.
(there is mention of "load" in the above outputs per cluster... this may be OK if you are able to pick a country and vpnmgr can choose the cluster with the least load?!)
https://api.surfshark.com/v1/server/configurations # download zip file of vpn config files

I think a configuration like PIA might be best where the zip is downloaded and locations offered (possibly based on locations in the cluster api endpoint) but there are no recommendations available based on load!
This snippet seems to have an example of retrieving a token from surfshark https://github.com/TimLChan/surfshark-smartdns-updater/blob/master/surfshark.sh
 

dazedandlost

Occasional Visitor
A thank you to Jack Yaz: vpnmgr install was effortless and operation has been flawless, afaict. In fact, the script setup seems to have avoided error(s) which I did not. AC86U, 384.19, Nordvpn. I would support the idea of vpnmgr being added to amtm if the question ever came up.
 

Jack Yaz

Part of the Furniture
Does anyone know if PIA publish a download of OpenVPN files for their next gen servers? I looked briefly but didn't find them
 

h0me5k1n

Occasional Visitor
I found a reddit reply from pia support from just over a month ago where they gave this link. Not sure which option is "next gen"... It seems to suggest some are and some aren't - maybe they're in the process of moving servers over! I also found posts where linux users have experienced issues although (unspecified) "routers" may be ok.
 

Similar threads

Top