Skip to content

Commit

Permalink
disable ubuntu1804 workaround, add warning
Browse files Browse the repository at this point in the history
  • Loading branch information
gijzelaerr committed Oct 29, 2018
1 parent 5c682c7 commit d2b2227
Show file tree
Hide file tree
Showing 6 changed files with 52 additions and 28 deletions.
13 changes: 13 additions & 0 deletions eduvpn/actions/select.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@

logger = logging.getLogger(__name__)

from eduvpn.util import are_we_running_ubuntu1804


# ui thread
def select_profile(builder, verifier, lets_connect):
Expand All @@ -24,6 +26,10 @@ def select_profile(builder, verifier, lets_connect):
switch = builder.get_object('connect-switch')
ipv4_label = builder.get_object('ipv4-label')
ipv6_label = builder.get_object('ipv6-label')

note_label = builder.get_object('note-label')
note_label_label = builder.get_object('note-label-label')

twofa_label = builder.get_object('2fa-label')
twofa_label_label = builder.get_object('2fa-label-label')
name_label = builder.get_object('name-label')
Expand Down Expand Up @@ -65,6 +71,13 @@ def select_profile(builder, verifier, lets_connect):
twofa_label.set_text("")
twofa_label_label.set_text("")

if are_we_running_ubuntu1804():
note_label.set_markup('<a href="https://bugs.launchpad.net/ubuntu/+source/network-manager/+bug/1754671">Ubuntu 18.04 Leaks DNS info</a>')
note_label_label.set_markup('<span foreground="red">WARNING</span>:')
else:
note_label.set_text("")
note_label_label.set_text("")

notebook.show_all()
notebook.set_current_page(1)

Expand Down
19 changes: 0 additions & 19 deletions eduvpn/actions/vpn_status.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,24 +10,9 @@
from eduvpn.notify import notify, init_notify
from eduvpn.manager import list_active
from eduvpn.util import metadata_of_selected
from eduvpn.exceptions import EduvpnException

logger = logging.getLogger(__name__)

from eduvpn.util import detect_distro


def post_check():
"""This should be called after VPN connection setup to make sure we don't leak DNS info on Ubuntu 18.04"""
try:
distro, version = detect_distro()
except EduvpnException as e:
logger.error("can't determine distribution and version: {}".format(e))
return

if distro == 'ubuntu' and version == '18.04':
logger.critical("You are running Ubuntu 18.04, which leaks DNS information")


def vpn_change(builder, lets_connect, state=0, reason=0):
logger.info("VPN status change")
Expand All @@ -44,10 +29,6 @@ def vpn_change(builder, lets_connect, state=0, reason=0):

notification = init_notify(lets_connect)

# check if we need to secure the DNS for Ubuntu 18.04 on connect
if state == 5:
post_check()

selected_uuid_active = False
for active in list_active():
try:
Expand Down
7 changes: 0 additions & 7 deletions eduvpn/steps/start.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,18 +8,11 @@
from eduvpn.manager import list_providers
from eduvpn.util import bytes2pixbuf, get_pixbuf
from eduvpn.brand import get_brand
from eduvpn.util import detect_distro


logger = logging.getLogger(__name__)


def support_check():
distro, version = detect_distro()
if distro == "debian" and version < 10:
error_helper(parent, msg_big, msg_small)


# ui thread
def refresh_start(builder, lets_connect):
logger.info("composing list of current eduVPN configurations")
Expand Down
16 changes: 15 additions & 1 deletion eduvpn/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -166,4 +166,18 @@ def detect_distro(release_file='/etc/os-release'):
raise EduvpnException("Can't detect distribution version, '/etc/os-release' doesn't "
"contain ID and VERSION_ID fields")

return params['ID'], params['VERSION_ID']
return params['ID'], params['VERSION_ID']


def are_we_running_ubuntu1804():
try:
distro, version = detect_distro()
except EduvpnException as e:
logger.error("can't determine distribution and version: {}".format(e))
return False
else:
if distro == 'ubuntu' and version == '18.04':
logger.critical("You are running Ubuntu 18.04, which leaks DNS information")
return True
else:
return False
3 changes: 2 additions & 1 deletion eduvpn/util.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,5 @@ def get_prefix(): ...
def have_dbus(): ...
def get_pixbuf(logo: str): ...
def metadata_of_selected(builder): ...
def detect_distro() -> Tuple[str, str]: ...
def detect_distro() -> Tuple[str, str]: ...
def are_we_running_ubuntu1804() -> bool: ...
22 changes: 22 additions & 0 deletions share/eduvpn/builder/window.ui
Original file line number Diff line number Diff line change
Expand Up @@ -418,6 +418,28 @@
<property name="top_attach">3</property>
</packing>
</child>
<child>
<object class="GtkLabel" id="note-label-label">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="label" translatable="yes">Note:</property>
<property name="xalign">1</property>
</object>
<packing>
<property name="left_attach">0</property>
<property name="top_attach">7</property>
</packing>
</child>
<child>
<object class="GtkLabel" id="note-label">
<property name="visible">True</property>
<property name="can_focus">False</property>
</object>
<packing>
<property name="left_attach">1</property>
<property name="top_attach">7</property>
</packing>
</child>
</object>
<packing>
<property name="expand">False</property>
Expand Down

0 comments on commit d2b2227

Please sign in to comment.