Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Version 2.7.5 #194

Merged
merged 7 commits into from
Sep 13, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion openpyn/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import subprocess


__version__ = "2.7.4"
__version__ = "2.7.5"
__license__ = "GNU General Public License v3 or later (GPLv3+)"
__data_files__ = []
__basefilepath__ = os.path.dirname(os.path.abspath(__file__)) + "/"
Expand Down
27 changes: 20 additions & 7 deletions openpyn/openpyn.py
Original file line number Diff line number Diff line change
Expand Up @@ -240,8 +240,18 @@ def run(init: bool, server: str, country_code: str, country: str, area: str, tcp

# check if dependencies are installed
if shutil.which("openvpn") is None or shutil.which("wget") is None or shutil.which("unzip") is None:
logger.error("Please Install 'openvpn' 'wget' 'unzip' first")
return 1
# In case of Debian Sid where "openvpn" is only in root's PATH, don't error out
try:
root_access = root.verify_root_access(
"Sudo credentials required to check if 'openvpn' is available in root's PATH")
if root_access is False:
root.obtain_root_access()
subprocess.check_output(["sudo", "which", "wget"])
subprocess.check_output(["sudo", "which", "unzip"])
# subprocess.check_output(["sudo", "which", "openvpn"])
except subprocess.CalledProcessError:
logger.error("Please Install 'openvpn' 'wget' 'unzip' first")
return 1

elif daemon:
if detected_os != "linux":
Expand Down Expand Up @@ -788,11 +798,14 @@ def get_vpn_server_ip(server: str, port: str) -> str:
def uses_systemd_resolved() -> bool:
# see https://www.freedesktop.org/software/systemd/man/systemd-resolved.service.html

systemd_resolved_running = subprocess.call(
["systemctl", "is-active", "systemd-resolved"],
stdout=subprocess.DEVNULL,
stderr=subprocess.DEVNULL,
) == 0
try:
systemd_resolved_running = subprocess.call(
["systemctl", "is-active", "systemd-resolved"],
stdout=subprocess.DEVNULL,
stderr=subprocess.DEVNULL,
) == 0
except FileNotFoundError: # When OS doesn't find systemctl
return False

if not systemd_resolved_running:
return False
Expand Down
4 changes: 2 additions & 2 deletions openpyn/scripts/manual-dns-patch.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/usr/bin/env sh

nordDNS1="162.242.211.137"
nordDNS2="78.46.223.24"
nordDNS1="103.86.99.100"
nordDNS2="103.86.96.100"
openDNS3="208.67.222.220"

echo "Changing DNS servers to NordVPN's DNS Servers"
Expand Down
1 change: 1 addition & 0 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
'openvpn wrapper', 'nordvpn', 'nordvpn client', 'secure vpn',
'vpn wrapper', 'private vpn', 'privacy'],
install_requires=['requests', 'colorama', 'coloredlogs', 'verboselogs'],
tests_require=['pytest', 'mock'],
platforms=['GNU/Linux', 'Ubuntu', 'Debian', 'Kali', 'CentOS', 'Arch', 'Fedora'],
packages=setuptools.find_packages(),
entry_points={
Expand Down