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

Update VPN credentials from CLI #184

Closed mrahmadt closed 6 years ago

mrahmadt commented 6 years ago

Hello

I'm working in building a basic web interface to control openpyn (plus other apps), what is the best way to pass new VPN credentials to openpyn?

PS: My credentials are located at /usr/local/lib/python3.6/dist-packages/openpyn/credentials, but I want to know if I have a better way to update it that can work with all users.

jotyGill commented 6 years ago

The /usr/local/lib/python3.6/dist-packages/openpyn/ path is OS dependent. openpyn --init finds this using relative path to it. If you were using python, I guess you could import openpyn then get it's __basefilepath__ or directly use credentials.save_credentials().

jotyGill commented 6 years ago

I suppose we could add an options like --show-installation-path to get the installation path of openpyn in any system. From there on, it's just a matter of putting the credentials in the file. ok, another issue is credentials file is root only read/editable.

jotyGill commented 6 years ago

As this has been resolved using the "expect" script. I'll reference it here and close this.

https://github.com/mrahmadt/SmartGW/tree/master/web/openpyn-setup.sh

openpyn-setup.zip