diff --git a/debian/changelog b/debian/changelog index 6e24020..9663db9 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,4 +1,4 @@ -protonvpn-cli (3.1.0-11) UNRELEASED; urgency=low +protonvpn-cli (3.1.0-12) UNRELEASED; urgency=low * Add support for protonvpn-nm-lib v0.2.0-1 * Cache servers after connecting to vpn if previous cache failed @@ -10,7 +10,7 @@ protonvpn-cli (3.1.0-11) UNRELEASED; urgency=low * Bugfix: Catch KeyringError * Bugfix: Cache prior displays connection status; incorrect cache when using dialog - -- Proton Technologies AG Mond, 14 Dec 2020 11:25:18 +0000 + -- Proton Technologies AG Mon, 14 Dec 2020 12:55:37 +0000 protonvpn-cli (3.0.0-10) UNRELEASED; urgency=low diff --git a/protonvpn_cli/cli.py b/protonvpn_cli/cli.py index d8e255b..4632c80 100644 --- a/protonvpn_cli/cli.py +++ b/protonvpn_cli/cli.py @@ -7,8 +7,8 @@ from protonvpn_nm_lib.logger import logger from .cli_wrapper import CLIWrapper -from .constants import (APP_VERSION, CONFIG_HELP, CONNECT_HELP, LOGIN_HELP, - MAIN_CLI_HELP, KS_HELP) +from .constants import (APP_VERSION, CONFIG_HELP, CONNECT_HELP, KS_HELP, + LOGIN_HELP, MAIN_CLI_HELP) class ProtonVPNCLI(): diff --git a/protonvpn_cli/main.py b/protonvpn_cli/main.py new file mode 100644 index 0000000..6d0fcb4 --- /dev/null +++ b/protonvpn_cli/main.py @@ -0,0 +1,21 @@ + +import os +import sys + + +def main(): + if "SUDO_UID" in os.environ: + print( + "\nRunning ProtonVPN as root is not supported and " + "is highly discouraged, as it might introduce " + "undesirable side-effects." + ) + user_input = input("Are you sure that you want to proceed (y/N): ") + user_input = user_input.lower() + if not user_input == "y": + sys.exit(1) + + # Import has to be made here due to dbus delay on ubuntu 18.04, + # when running with sudo + from .cli import ProtonVPNCLI + ProtonVPNCLI() diff --git a/setup.py b/setup.py index 660e025..d2f713e 100644 --- a/setup.py +++ b/setup.py @@ -13,7 +13,7 @@ packages=find_packages(), entry_points={ "console_scripts": [ - "protonvpn-cli = protonvpn_cli.cli:ProtonVPNCLI" + "protonvpn-cli = protonvpn_cli.main:main" ] }, description="Official ProtonVPN CLI for Linux",