Skip to content

Commit

Permalink
Merge pull request #8 from jotyGill/test
Browse files Browse the repository at this point in the history
short discription and "-h" if no argument given
  • Loading branch information
jotyGill authored May 1, 2017
2 parents 1383faf + 3793700 commit f3c5449
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 16 deletions.
28 changes: 13 additions & 15 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# openpyn
A python3 script to easily connect to and switch between, OpenVPN servers hosted by NordVPN. Quickly connect to the least busy servers (by grabbing current data from Nordvpn's website) and the ones that have the lowest latency from you. It Tunnels DNS traffic through the VPN which normally (when using OpenVPN with NordVPN) goes through your ISP's DNS (still unencrypted, even if you use a thirdparty) and completely compromises Privacy!
A python3 script to easily connect to and switch between, OpenVPN servers hosted by NordVPN. Quickly Connect to the least busy servers (using current data from Nordvpn's website) with lowest latency from you. It Tunnels DNS traffic through the VPN which normally (when using OpenVPN with NordVPN) goes through your ISP's DNS (still unencrypted, even if you use a thirdparty) and completely compromises Privacy!

## Features
* Automatically connect to least busy, low latency servers in a given country.
Expand All @@ -21,17 +21,17 @@ cd openpyn-nordvpn
```
2. Create a "pass.txt" in the current folder, with openvpn compatible "auth-user-pass" file format.
``` bash
youruser@name.com #first line
yourpass #second line
youruser@name.com #first line
yourpass #second line
```
3. Install the script, and dependencies if they are not already present.
``` bash
sudo ./install.sh
sudo ./install.sh

# dependencies
sudo apt install openvpn
sudo pip install requests
sudo pip install beautifulsoup4 #Completely optional Only needed with '--updateCountries'
sudo apt install openvpn
sudo pip install requests
sudo pip install beautifulsoup4 #Completely optional Only needed with '--updateCountries'
```
4. Download/Update the latest vpn config files from NordVPN by:
``` bash
Expand Down Expand Up @@ -68,26 +68,24 @@ have the lowest latency from you.
```
* To run the script in background.
``` bash
sudo openpyn us -b #needs sudo to use openvpn
sudo openpyn us -b #needs sudo to use openvpn
```
* To kill a running openvpn connection.
``` bash
sudo openpyn -k
sudo openpyn -k
```
* To Flush the iptables and kill any running openvpn connections.
``` bash
sudo openpyn -kf
sudo openpyn -kf
```

## Usage Options
``` bash
usage: openpyn [-h] [-s SERVER] [-u] [-c COUNTRYCODE] [-b] [-l LOADTHRESHOLD] [-t TOPSERVERS]
[-p PINGS] [-tt TOPPESTSERVERS] [-k] [-kf] [--updateCountries] [-ls] [--update] [country]

A python3 script to easily connect to and switch between, OpenVPN servers hosted by NordVPN. Quickly connect to the least busy servers (by grabbing current data from Nordvpn's website) and the ones that have the lowest latency from you. It Tunnels DNS traffic through the VPN which otherwise would go through your ISP!
positional arguments:
country Country Code can also be speficied without "-c," i.em"openpyn au"
country Country Code can also be speficied without "-c," i.e "openpyn au"

optional arguments:
-h, --help show this help message and exit
Expand Down Expand Up @@ -128,13 +126,13 @@ optional arguments:
-kf, --killFW Flush iptables And Kill any running Openvnp process, needed
when using "-f"

--updateCountries Fetch the latest countries from nord's site and update
--updateCountries Fetch the latest countries from nords site and update
the country code mappings

-ls, --listCountries List all the countries, with Country Codes to Use

-f, ----forceFW Enfore Firewall rules to drop traffic when tunnel breaks
Force disable DNS traffic going to any other interface

--update Fetch the latest config files from nord\'s site
--update Fetch the latest config files from nord''s site
```
9 changes: 8 additions & 1 deletion openpyn.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,9 @@ def main(
vpnServerIp = findVpnServerIP(server, port)
applyFirewallRules(networkInterfaces, vpnServerIp)
connection = connect(server, port, background)
else:
parser.print_help()
exit()


def getData(countryCode=None, countryName=None):
Expand Down Expand Up @@ -410,7 +413,11 @@ def connect(server, port, background):

if __name__ == '__main__':
parser = argparse.ArgumentParser(
description='Script to Connect to OpenVPN')
description="A python3 script to easily connect to and switch between, OpenVPN \
servers hosted by NordVPN. Quickly Connect to the least busy servers (using current \
data from Nordvpn website) with lowest latency from you. Tunnels DNS traffic through \
the VPN which normally (when using OpenVPN with NordVPN) goes through your ISP's DNS \
(still unencrypted, even if you use a thirdparty) and completely compromises Privacy!")
parser.add_argument(
'-s', '--server', help='server name, i.e. ca64 or au10',)
parser.add_argument(
Expand Down

0 comments on commit f3c5449

Please sign in to comment.