jotyGill / openpyn-nordvpn

Easily connect to and switch between, OpenVPN servers hosted by NordVPN on Linux (+patch leakes)
GNU General Public License v3.0
628 stars 114 forks source link

Not working on macos #244

Closed ickam closed 4 years ago

ickam commented 4 years ago

Hi, I tried to homebrew openpyn on my wife's mac. The brewing works (but I had to manually install pip3 - it doesn't install automatically with python3) When I try to execute openpyn uk, however, this is what I get:

caterina@caterinas-imac ~> sudo openpyn uk

According to NordVPN, Least Busy 10 Servers in UK With 'Load' Less Than 70 Which Support OPENVPN-UDP Are: [['uk1175', 5], ['uk1483', 5], ['uk805', 6], ['uk829', 6], ['uk1009', 6], ['uk1037', 6], ['uk1054', 6], ['uk1213', 6], ['uk1217', 6], ['uk1292', 6]]

Pinging Server uk1175 min/avg/max/mdev = [20, 21, 21, 0]

Pinging Server uk1483 min/avg/max/mdev = [20, 21, 22, 0]

Pinging Server uk805 min/avg/max/mdev = [22, 24, 26, 1]

Pinging Server uk829 min/avg/max/mdev = [20, 21, 22, 0]

Pinging Server uk1009 min/avg/max/mdev = [20, 21, 21, 0]

Pinging Server uk1037 min/avg/max/mdev = [21, 22, 23, 0]

Pinging Server uk1054 min/avg/max/mdev = [20, 21, 22, 0]

Pinging Server uk1213 min/avg/max/mdev = [20, 22, 23, 1]

Pinging Server uk1217 min/avg/max/mdev = [21, 22, 22, 0]

Pinging Server uk1292 min/avg/max/mdev = [20, 20, 21, 0]

Top 10 Servers with Best Ping Are: ['uk1292', 'uk1175', 'uk1483', 'uk829', 'uk1009', 'uk1054', 'uk1037', 'uk1217', 'uk1213', 'uk805']

Out of the Best Available Servers, Chose uk1292

2019-09-24 11:42:32 [SUCCESS] CONNECTING TO SERVER uk1292 ON PORT udp 2019-09-24 11:42:32 [WARNING] Not modifying '/etc/resolv.conf', DNS traffic likely won't go through the encrypted tunnel sudo: openvpn: command not found caterina@caterinas-imac ~> brew install openvpn Warning: openvpn 2.4.7_1 is already installed and up-to-date To reinstall 2.4.7_1, run brew reinstall openvpn caterina@caterinas-imac ~> brew link openvpn Warning: Already linked: /usr/local/Cellar/openvpn/2.4.7_1 To relink: brew unlink openvpn && brew link openvpn

As you can see, I also checked whether openvpn was both installed and linked. It was, so I'm not to sure what causes the error.

jotyGill commented 4 years ago

Hi, Looks like a path issue. It can't find openvpn when you run it as sudo. sudo openvpn I created a workaround to manually add these paths in this script's env, to get around such issues on some OSs. Just added "/usr/local/Cellar" as well. uninstall it sudo python3 -m pip uninstall openpyn install it from the test branch. git clone --branch test https://github.com/jotyGill/openpyn-nordvpn.git cd openpyn-nordvpn && sudo python3 -m pip install --upgrade -e .

jotyGill commented 4 years ago

Could you please test this and report back if this works ok. Cheers

ickam commented 4 years ago

It is working indeed. Thank you