From ca6f399c045d5caa21835f762cde877bf2b80ad6 Mon Sep 17 00:00:00 2001 From: "Kali Kaneko (leap communications)" Date: Tue, 16 May 2017 22:54:21 +0200 Subject: [pkg] install and use static openvpn from bundle --- pkg/pyinst/build.mk | 7 ++++++- src/leap/bitmask/vpn/_config.py | 6 ++++++ src/leap/bitmask/vpn/helpers/__init__.py | 7 +++++++ 3 files changed, 19 insertions(+), 1 deletion(-) diff --git a/pkg/pyinst/build.mk b/pkg/pyinst/build.mk index 25a7ef38..e8772058 100644 --- a/pkg/pyinst/build.mk +++ b/pkg/pyinst/build.mk @@ -29,12 +29,17 @@ bundle_gpg: patchelf --set-rpath '.' $(DIST_VERSION)/apps/mail/gpg cp /lib/x86_64-linux-gnu/libusb-0.1.so.4 $(DIST_VERSION)/lib +bundle_vpn: + mkdir -p $(DIST_VERSION)/apps/vpn + # TODO verify signature + wget https://downloads.leap.se/thirdparty/linux/openvpn/openvpn -O $(DIST_VERSION)/apps/vpn/openvpn.leap + bundle_linux_helpers: mkdir -p $(DIST_VERSION)/apps/helpers cp src/leap/bitmask/vpn/helpers/linux/bitmask-root $(DIST_VERSION)/apps/helpers/ cp src/leap/bitmask/vpn/helpers/linux/se.leap.bitmask.bundle.policy $(DIST_VERSION)/apps/helpers/ -bundle_apps: bundle_gpg bundle_linux_helpers +bundle_apps: bundle_gpg bundle_vpn bundle_linux_helpers bundle_tar: cd dist/ && tar cvzf Bitmask.$(NEXT_VERSION).tar.gz bitmask-$(NEXT_VERSION) diff --git a/src/leap/bitmask/vpn/_config.py b/src/leap/bitmask/vpn/_config.py index 421d15a6..5bb61e78 100644 --- a/src/leap/bitmask/vpn/_config.py +++ b/src/leap/bitmask/vpn/_config.py @@ -22,6 +22,12 @@ if IS_LINUX: return pkg_resources.resource_filename( 'leap.bitmask.vpn.helpers.linux', 'se.leap.bitmask.bundle.policy') + def get_bitmask_openvpn_path(): + if STANDALONE: + return os.path.join(here(), "..", "apps", "vpn", + "openvpn.leap") + # else nothing, we're only shipping the openvpn binary with bundles + class _TempVPNConfig(object): """Current VPN code on bitmask depends on VPNConfig object, this temporary diff --git a/src/leap/bitmask/vpn/helpers/__init__.py b/src/leap/bitmask/vpn/helpers/__init__.py index 69a9a5fb..3b7e1176 100644 --- a/src/leap/bitmask/vpn/helpers/__init__.py +++ b/src/leap/bitmask/vpn/helpers/__init__.py @@ -10,14 +10,21 @@ if IS_LINUX: helper_to = '/usr/local/sbin/bitmask-root' polkit_to = '/usr/share/polkit-1/actions/se.bitmask.bundle.policy' + openvpn_to = '/usr/local/sbin/leap-openvpn' def install(): helper_from = _config.get_bitmask_helper_path() polkit_from = _config.get_bitmask_polkit_policy_path() + openvpn_from = _config.get_bitmask_openvpn_path() + copyfile(helper_from, helper_to) chmod(helper_to, 0744) + copyfile(polkit_from, polkit_to) + copyfile(openvpn_from, openvpn_to) + chmod(openvpn_to, 0700) + def uninstall(): remove(helper_to) remove(polkit_to) -- cgit v1.2.3