Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
release 2.0.1
  • Loading branch information
jotyGill committed Dec 3, 2017
1 parent 0d196e4 commit 0e6dfa0
Show file tree
Hide file tree
Showing 8 changed files with 35 additions and 147 deletions.
2 changes: 1 addition & 1 deletion MANIFEST.in
@@ -1,2 +1,2 @@
recursive-include openpyn *.*
include LICENSE.md README
include LICENSE.md README.md
41 changes: 24 additions & 17 deletions README.md
@@ -1,8 +1,9 @@
# openpyn
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. Find servers in a specific country or even a city. 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 third party) and completely compromises Privacy!
A python3 script/systemd service, 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. Find servers in a specific country or even a city. 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 third party) and completely compromises Privacy!

## Features
* Automatically connect to least busy, low latency servers in a given country.
* Systemd inegration, easy to check VPN status, autostart at startup.
* Find and connect to servers in a specific city or state.
* Uses NordVPN's DNS servers and tunnels DNS queries through the VPN Tunnel.
* Use Iptables rules to prevent IP leakage if tunnel breaks (Experimental).
Expand All @@ -28,18 +29,18 @@ A python3 script to easily connect to and switch between, OpenVPN servers hosted
sudo apt install openvpn python-gobject unzip wget
```
### Installation Methods
1. For Ubuntu / Kali / Debian / based OS's with Python=>3.4
1. For Ubuntu / Kali / Debian / based OS's with Python=>3.5
```bash
sudo apt install python3-colorama python3-requests python3-setuptools #dependencies
wget https://github.com/jotyGill/openpyn-nordvpn/releases/download/1.7.4/python3-openpyn_1.7.4-1_all.deb
sudo dpkg -i python3-openpyn_1.7.4-1_all.deb
wget https://github.com/jotyGill/openpyn-nordvpn/releases/download/2.0.1/python3-openpyn_2.0.1-1_all.deb
sudo dpkg -i python3-openpyn_2.0.1-1_all.deb
```
2. For Fedora 26, all dependencies should be auto installed.
2. For Fedora, all dependencies should be auto installed.
```bash
wget https://github.com/jotyGill/openpyn-nordvpn/releases/download/1.7.4/openpyn-1.7.4-1.noarch.rpm
sudo dnf install ./openpyn-1.7.4-1.noarch.rpm
wget https://github.com/jotyGill/openpyn-nordvpn/releases/download/2.0.1/openpyn-2.0.1-1.noarch.rpm
sudo dnf install ./openpyn-2.0.1-1.noarch.rpm
```
3. Install openpyn with pip3. (Python=>3.4, Don't use on Debian, causes issues):
3. Install openpyn with pip3. (Python=>3.5, Don't use on Debian, causes issues):
``` bash
sudo apt install python3-pip
sudo pip3 install openpyn --upgrade # DO NOT USE "sudo -H"
Expand All @@ -51,17 +52,17 @@ cd openpyn-nordvpn
sudo python3 setup.py install
```
### Setup
Initialise the script with "--init" (store credentials and update/install vpn config files)
Initialise the script with "--init" (store credentials, install Systemd service, update/install vpn config files)
``` bash
sudo openpyn --init
```
That's it, run the script! when done with it, press "Ctr + C" to exit.

## Basic Usage
* At minimum, you only need to specify the country-code, default port is TCP-443, If you want to use
UDP-1194 instead, use "-u" switch.
* At minimum, you only need to specify the country-code, default port is UDP-1194, If you want to use
TCP-443 instead, use "--tcp" switch.
``` bash
openpyn us -u
openpyn us
```
* Now, you can also specify a city or state, useful when companies (like Google) lock your
account if you try to login from an IP that resides in a different physical location.
Expand Down Expand Up @@ -102,10 +103,14 @@ openpyn -l --tor # tor over vpn in all countries
``` bash
openpyn us -t 10 -T 2 --p2p
```
* To run the script in background.
* To update and run the systemd openpyn.service, use "-d" or "--daemon"
``` bash
openpyn us -d
```
* To check the status of the systemd openpyn.service.
``` bash
systemctl status openpyn
```
* To kill a running openvpn connection.
``` bash
sudo openpyn -k
Expand Down Expand Up @@ -149,15 +154,17 @@ optional arguments:
-s SERVER, --server SERVER
server name, i.e. ca64 or au10

-u, --udp use port UDP-1194 instead of the default TCP-443
--tcp use port TCP-443 instead of the default UDP-1194

-c COUNTRY_CODE, --country-code COUNTRY_CODE
Specify Country Code with 2 letters, i.e au,

-a AREA, --area AREA Specify area: city name or state e.g "openpyn au -a victoria"
or "openpyn au -a 'sydney'"

-d, --daemon Run script in the background as openvpn daemon
-d, --daemon Update and start Systemd service openpyn.service,
running it as a background process, to check status
"systemctl status openpyn",

-m MAX_LOAD, --max-load MAX_LOAD
Specify load threshold, rejects servers with more
Expand Down Expand Up @@ -212,12 +219,12 @@ optional arguments:
- [x] clean exit, handle exceptions
- [x] store credentials from user input, if "credentials" file exists use that instead.
- [x] sane command-line options following the POSIX guidelines
- [ ] ability to store profiles
- [ ] ability to store profiles (sort of works as the systemd service file stores last state)
- [x] find and display server's locations (cities)
- [x] accept full country names
- [x] colourise output
- [x] modularize
- [x] create a combined config of multiple servers (on the fly) for auto failover
- [x] uninstall.sh #sudo pip3 uninstall openpyn
- [ ] view status of the connection after launching in --daemon mode.
- [x] view status of the connection after launching in --daemon mode.
- [x] desktop notifications.
120 changes: 0 additions & 120 deletions README.rst

This file was deleted.

2 changes: 1 addition & 1 deletion openpyn/__init__.py
@@ -1,2 +1,2 @@
__version__ = "2.0.0"
__version__ = "2.0.1"
__license__ = "GNU General Public License v3 or later (GPLv3+)"
5 changes: 3 additions & 2 deletions openpyn/openpyn.py
Expand Up @@ -23,7 +23,7 @@

def main():
parser = argparse.ArgumentParser(
description="A python3 script (GPLv3+) to easily connect to and switch between, OpenVPN \
description="A python3 script/systemd service (GPLv3+) 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. Find Nordvpn servers in a given \
country or city. Tunnels DNS traffic through the VPN which normally (when using OpenVPN \
Expand All @@ -49,7 +49,8 @@ def main():
'-a', '--area', type=str, help='Specify area, city name or state e.g \
"openpyn au -a victoria" or "openpyn au -a \'sydney\'"')
parser.add_argument(
'-d', '--daemon', help='Run script in the background as openvpn daemon',
'-d', '--daemon', help='Update and start Systemd service openpyn.service,\
running it as a background process, to check status "systemctl status openpyn"',
action='store_true')
parser.add_argument(
'-m', '--max-load', type=int, default=70, help='Specify load threashold, \
Expand Down
3 changes: 2 additions & 1 deletion openpyn/systemd.py
Expand Up @@ -27,5 +27,6 @@ def update_service(openpyn_options, run=False):

subprocess.run("systemctl daemon-reload".split())
if run:
print("Started Openpyn by running 'systemctl start openpyn'")
print("Started Openpyn by running 'systemctl start openpyn'\n\
To check VPN status, run 'systemctl status openpyn'")
subprocess.run("systemctl start openpyn".split())
2 changes: 1 addition & 1 deletion setup.cfg
@@ -1,5 +1,5 @@
[bdist_wheel]

[metadata]
description-file = README.rst
description-file = README.md
license_file = LICENSE.md
7 changes: 3 additions & 4 deletions setup.py
Expand Up @@ -2,12 +2,12 @@
from openpyn import __version__
import sys

if sys.version_info < (3, 4):
sys.stderr.write("ERROR: openpyn requires Python 3.4 or above." +
if sys.version_info < (3, 5):
sys.stderr.write("ERROR: openpyn requires Python 3.5 or above." +
"Install using 'pip3' instead of just 'pip' \n")
sys.exit(1)

with open('README.rst', encoding='utf-8') as readme_file:
with open('README.md', encoding='utf-8') as readme_file:
full_description = readme_file.read()
readme_file.close()

Expand Down Expand Up @@ -44,7 +44,6 @@
'Natural Language :: English',
'Operating System :: POSIX :: Linux',
'Programming Language :: Python :: 3 :: Only',
'Programming Language :: Python :: 3.4',
'Programming Language :: Python :: 3.5',
'Programming Language :: Python :: 3.6',
],
Expand Down

0 comments on commit 0e6dfa0

Please sign in to comment.