From 9ee4859558b868f01012c39dd98bf292d64e09f0 Mon Sep 17 00:00:00 2001 From: Kali Kaneko Date: Mon, 5 Mar 2018 17:55:29 +0100 Subject: [pkg] minor adjustments for riseupvpn osx bundle - duplicate the scripts folder for riseupvpn - fix renaming of helper - set openvpn path for riseupvpn --- pkg/build_osx_bundle_riseupvpn_with_venv.sh | 3 +-- pkg/bundles/build.mk | 12 +++++----- pkg/osx/scripts-riseupvpn/postinstall | 13 +++++++++++ pkg/osx/scripts-riseupvpn/preinstall | 12 ++++++++++ .../scripts-riseupvpn/se.leap.bitmask-helper.plist | 26 ++++++++++++++++++++++ 5 files changed, 58 insertions(+), 8 deletions(-) create mode 100755 pkg/osx/scripts-riseupvpn/postinstall create mode 100755 pkg/osx/scripts-riseupvpn/preinstall create mode 100644 pkg/osx/scripts-riseupvpn/se.leap.bitmask-helper.plist (limited to 'pkg') diff --git a/pkg/build_osx_bundle_riseupvpn_with_venv.sh b/pkg/build_osx_bundle_riseupvpn_with_venv.sh index 7f819849..2e7ec759 100755 --- a/pkg/build_osx_bundle_riseupvpn_with_venv.sh +++ b/pkg/build_osx_bundle_riseupvpn_with_venv.sh @@ -20,8 +20,7 @@ echo "[+] Using venv in" $VIRTUAL_ENV $VIRTUAL_ENV/bin/pip install -U pyinstaller $VIRTUAL_ENV/bin/pip install zope.interface zope.proxy - -$VIRTUAL_ENV/bin/pip install -r pkg/requirements-osx.pip +$VIRTUAL_ENV/bin/pip install -r pkg/requirements-vpn.pip # Get the bundled libzmq $VIRTUAL_ENV/bin/pip install -I pyzmq --install-option="--zmq=bundled" diff --git a/pkg/bundles/build.mk b/pkg/bundles/build.mk index e93199db..aa411239 100644 --- a/pkg/bundles/build.mk +++ b/pkg/bundles/build.mk @@ -169,16 +169,16 @@ bundle_anonvpn_osx_missing: mv $(OSX_ANON_CON)/anonvpn $(OSX_ANON_CON)/bitmask-app cp pkg/osx/bitmask-wrapper $(OSX_ANON_CON)/anonvpn mkdir -p $(OSX_ANON_RES)/bitmask-helper - cp -r pkg/osx/daemon $(OSX_ANON_RES)/bitmask-helper/ - cp -r pkg/osx/openvpn $(OSX_ANON_RES)/bitmask-helper/ + cp -r pkg/osx/openvpn/* $(OSX_ANON_RES)/ + cp -r pkg/osx/daemon/* $(OSX_ANON_RES)/bitmask-helper/ mkdir -p $(OSX_ANON_RES)/../apps/providers cp -r src/leap/bitmask/bonafide/providers/* $(OSX_ANON_RES)/../apps/providers/ cp -r $(ANONVPN_DIST_VERSION)/apps/providers/* $(OSX_ANON_RES)/../apps/providers cp src/leap/bitmask/vpn/helpers/osx/bitmask-helper $(OSX_ANON_RES)/bitmask-helper/ - sed "s/.*Bitmask.app.*/APP_PATH='\/Applications\/RiseupVPN\.app\/'/" $(OSX_ANON_RES)/bitmask-helper/bitmask-helper2 - mv $(OSX_ANON_RES)/bitmask-helper/bitmask-helper2 $(OSX_ANON_RES)/bitmask-helper/bitmask-helper + chmod +x $(OSX_ANON_RES)/bitmask-helper/bitmask-helper + sed "s/.*Bitmask.app.*/APP_PATH='\/Applications\/RiseupVPN\.app\/'/" $(OSX_ANON_RES)/bitmask-helper/bitmask-helper > $(OSX_ANON_RES)/bitmask-helper/bitmask-helper2 && mv $(OSX_ANON_RES)/bitmask-helper/bitmask-helper2 $(OSX_ANON_RES)/bitmask-helper/bitmask-helper cp src/leap/bitmask/vpn/helpers/osx/bitmask.pf.conf $(OSX_ANON_RES)/bitmask-helper/ - cp pkg/osx/scripts/se.leap.bitmask-helper.plist $(OSX_ANON_RES)/bitmask-helper/ + cp pkg/osx/scripts-riseupvpn/se.leap.bitmask-helper.plist $(OSX_ANON_RES)/bitmask-helper/ wget https://downloads.leap.se/thirdparty/osx/openvpn/openvpn -O $(OSX_ANON_RES)/openvpn.leap chmod +x $(OSX_ANON_RES)/openvpn.leap @@ -187,7 +187,7 @@ bundle_anonvpn_osx_pkg: cp ../bitmask-systray/bitmask-systray $(OSX_ANON_CON)/bitmask-systray cp /usr/local/opt/zeromq/lib/libzmq.5.dylib $(OSX_ANON_CON)/libzmq.5.dylib install_name_tool -change /usr/local/opt/zeromq/lib/libzmq.5.dylib "@loader_path/libzmq.5.dylib" $(OSX_ANON_CON)/bitmask-systray - pkg/osx/quickpkg --output dist/RiseupVPN-$(NEXT_VERSION)_pre.pkg --scripts pkg/osx/scripts/ dist/RiseupVPN.app/ + pkg/osx/quickpkg --output dist/RiseupVPN-$(NEXT_VERSION)_pre.pkg --scripts pkg/osx/scripts-riseupvpn/ dist/RiseupVPN.app/ @if [ $(BUILD_RELEASE) = no ]; then\ echo "[!] BUILD_RELEASE=no, skipping signature";\ else\ diff --git a/pkg/osx/scripts-riseupvpn/postinstall b/pkg/osx/scripts-riseupvpn/postinstall new file mode 100755 index 00000000..93430390 --- /dev/null +++ b/pkg/osx/scripts-riseupvpn/postinstall @@ -0,0 +1,13 @@ +#!/bin/sh +# Bitmask Post-Instalation script +# (c) LEAP Encryption access Project +# We copy the bitmask-helper plist to the LaunchDaemons folder, and load the bitmask-helper that runs as root. + +LOG=/tmp/bitmask-install.log + +chmod +x /Applications/RiseupVPN.app/Contents/Resources/bitmask-helper/bitmask-helper +cp se.leap.bitmask-helper.plist /Library/LaunchDaemons/ \ + && echo `date` ":: Bitmask post-install: copied bitmask-helper Plist." >> $LOG +launchctl load /Library/LaunchDaemons/se.leap.bitmask-helper.plist && echo `date` ":: Bitmask post-install: loaded bitmask-helper." >> $LOG +echo `date` ":: Bitmask post-install: ok." >> $LOG +exit 0 diff --git a/pkg/osx/scripts-riseupvpn/preinstall b/pkg/osx/scripts-riseupvpn/preinstall new file mode 100755 index 00000000..1ae68f9c --- /dev/null +++ b/pkg/osx/scripts-riseupvpn/preinstall @@ -0,0 +1,12 @@ +#!/bin/sh +# Bitmask Pre-Instalation script +# (c) LEAP Encryption access Project +# We unload the bitmask-helper if it is running, because we can be installing an upgrade. + +LOG=/tmp/bitmask-install.log + +ps aux | grep [b]itmask-helper \ + && launchctl unload /Library/LaunchDaemons/se.leap.bitmask-helper.plist \ + && echo `date` ":: Bitmask pre-install: unloaded bitmask-helper." >> $LOG +echo `date` ":: Bitmask pre-install: ok." >> $LOG +exit 0 diff --git a/pkg/osx/scripts-riseupvpn/se.leap.bitmask-helper.plist b/pkg/osx/scripts-riseupvpn/se.leap.bitmask-helper.plist new file mode 100644 index 00000000..8ebfb947 --- /dev/null +++ b/pkg/osx/scripts-riseupvpn/se.leap.bitmask-helper.plist @@ -0,0 +1,26 @@ + + + + + WorkingDirectory + /Applications/RiseupVPN.app/Contents/Resources/bitmask-helper/ + StandardOutPath + bitmask-helper.log + StandardErrorPath + bitmask-helper-err.log + GroupName + daemon + RunAtLoad + + SessionCreate + + KeepAlive + + ThrottleInterval + 5 + Label + se.leap.BitmaskHelper + Program + /Applications/RiseupVPN.app/Contents/Resources/bitmask-helper/bitmask-helper + + -- cgit v1.2.3