Skip to content

Commit

Permalink
Update sudo dbus fix for ubuntu 18.04
Browse files Browse the repository at this point in the history
  • Loading branch information
Alexandru Cheltuitor committed Dec 14, 2020
1 parent 3db683a commit c706884
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 5 deletions.
4 changes: 2 additions & 2 deletions debian/changelog
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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 <[email protected]> Mond, 14 Dec 2020 11:25:18 +0000
-- Proton Technologies AG <[email protected]> Mon, 14 Dec 2020 12:55:37 +0000

protonvpn-cli (3.0.0-10) UNRELEASED; urgency=low

Expand Down
4 changes: 2 additions & 2 deletions protonvpn_cli/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -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():
Expand Down
21 changes: 21 additions & 0 deletions protonvpn_cli/main.py
Original file line number Diff line number Diff line change
@@ -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()
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down

0 comments on commit c706884

Please sign in to comment.