From 2f092ea9dbe46d1bebe1576cd7626bf325fe82e5 Mon Sep 17 00:00:00 2001 From: Kali Kaneko Date: Tue, 10 Jun 2014 15:22:56 -0500 Subject: Install missing stuff into /usr/local/sbin. Closes: #$741 --- pkg/linux/polkit/se.leap.bitmask.bundle.policy | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 pkg/linux/polkit/se.leap.bitmask.bundle.policy (limited to 'pkg') diff --git a/pkg/linux/polkit/se.leap.bitmask.bundle.policy b/pkg/linux/polkit/se.leap.bitmask.bundle.policy new file mode 100644 index 00000000..58fcaaa8 --- /dev/null +++ b/pkg/linux/polkit/se.leap.bitmask.bundle.policy @@ -0,0 +1,23 @@ + + + + + LEAP Project + http://leap.se/ + + + Runs bitmask helper to launch firewall and openvpn (bundle version) + Ejecuta el asistente de bitmask para lanzar el firewall y openvpn (version bundle) + Bitmask needs that you authenticate to start + Bitmask necesita autorizacion para comenzar + package-x-generic + + yes + yes + yes + + /usr/local/sbin/bitmask-root + + -- cgit v1.2.3 From d2fc367cc284a87d60bfdc96fcd87e257296ee02 Mon Sep 17 00:00:00 2001 From: Kali Kaneko Date: Thu, 12 Jun 2014 10:32:17 -0500 Subject: Update README with the latest changes to paths, and hashing info. --- pkg/linux/README.rst | 31 ++++++++++++++++++++++++++++--- 1 file changed, 28 insertions(+), 3 deletions(-) (limited to 'pkg') diff --git a/pkg/linux/README.rst b/pkg/linux/README.rst index 220565ff..249c721f 100644 --- a/pkg/linux/README.rst +++ b/pkg/linux/README.rst @@ -3,8 +3,33 @@ Files In GNU/Linux, we expect these files to be in place:: - update-resolv-conf -> /etc/leap/update-resolv-conf - resolv-update -> /etc/leap/resolv-update - bitmask-root -> /usr/sbin/bitmask-root polkit/se.leap.bitmask.policy -> /usr/share/polkit-1/actions/se.leap.bitmask.policy + +Bundle +====== + +The bundle will ask for permission to install to a different path. This search +path will be used if the flag ``--standalone`` is set:: + + bitmask-root -> /usr/local/sbin/bitmask-root + polkit/se.leap.bitmask.bundle.policy -> /usr/share/polkit-1/actions/se.leap.bitmask.bundle.policy + +You will also have to place an openvpn binary in the following path:: + + leap-openvpn -> /usr/local/sbin/leap-openvpn + + +Binary hashing +============== + +To be able to update the binaries when needed, the bundles distribute with the +sha256 hash of the packaged binaries for each release. This info can be found +in:: + + src/leap/bitmask/_binaries.py + +That file is generated during the bundling process, by issuing the following +command from the root folder:: + + python setup.py hash_binaries -- cgit v1.2.3 From a1ed7ee69fc76a978c2ed9a85593492e596689bd Mon Sep 17 00:00:00 2001 From: Kali Kaneko Date: Mon, 16 Jun 2014 17:51:44 -0500 Subject: Add bash script to help copy files from within the bundle. --- pkg/linux/leap-install-helper.sh | 172 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 172 insertions(+) create mode 100755 pkg/linux/leap-install-helper.sh (limited to 'pkg') diff --git a/pkg/linux/leap-install-helper.sh b/pkg/linux/leap-install-helper.sh new file mode 100755 index 00000000..bed48255 --- /dev/null +++ b/pkg/linux/leap-install-helper.sh @@ -0,0 +1,172 @@ +#!/bin/bash + +# File: leap-install-helper.sh +# Copy the needed binaries and helper files to their destination. +# Copyright (C) 2014 LEAP Encryption Access Project. +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . + +LOCAL_SBIN_FOLDER=/usr/local/sbin + +POLKIT_FILE="se.leap.bitmask.bundle.policy" +POLKIT_PATH="/usr/share/polkit-1/actions" + +BITMASK_ROOT_FILE="bitmask-root" +BITMASK_ROOT_PATH="${LOCAL_SBIN_FOLDER}/${BITMASK_ROOT_FILE}" + +OPENVPN_FILE="leap-openvpn" +OPENVPN_PATH="${LOCAL_SBIN_FOLDER}/${OPENVPN_FILE}" + +# The following array stores global files that have been deprecated and we want +# to remove from the system path, after having dropped them there in the past. + +DEPRECATED_FILES=( + '/usr/share/polkit-1/actions/net.openvpn.gui.leap.policy' +) + + +# Variables for parsing and storing the script options. + +FROM_PATH=NONE +REMOVE_OLD_FILES=NO +INSTALL_BITMASK_ROOT=NO +INSTALL_POLKIT_FILE=NO +INSTALL_OPENVPN=NO + + +# Process the options + +while [[ $# > 1 ]] +do +key="$1" +shift + +case $key in + -f|--from-path) + FROM_PATH="$1" + shift + ;; + -r|--remove-old-files) + REMOVE_OLD_FILES="$1" + shift + ;; + --install-bitmask-root) + INSTALL_BITMASK_ROOT="$1" + shift + ;; + --install-polkit-file) + INSTALL_POLKIT_FILE="$1" + shift + ;; + --install-openvpn) + INSTALL_OPENVPN="$1" + shift + ;; + *) + # unknown option + ;; +esac +done +echo "LEAP_INSTALL_HELPER" +echo "-------------------" +echo FROM_PATH = "${FROM_PATH}" +echo REMOVE_OLD_FILES = "${REMOVE_OLD_FILES}" +echo INSTALL_BITMASK_ROOT = "${INSTALL_BITMASK_ROOT}" +echo INSTALL_POLKIT_FILE = "${INSTALL_POLKIT_FILE}" +echo INSTALL_OPENVPN = "${INSTALL_OPENVPN}" +echo + + +# +# helper functions +# + +function check_current_uid() { + current_uid=`id | sed 's/^uid=//;s/(.*$//'` + if [ $current_uid != 0 ] + then + echo "[ERROR] NEED TO BE RUN AS ROOT" + exit 1 + fi +} + +function check_from_path() { + if [ $FROM_PATH == NONE ] + then + echo "[ERROR] YOU NEED TO GIVE --from-path VALUE..." + exit 1 + fi +} + +function remove_old_files() { + for file in "${DEPRECATED_FILES[@]}" + do + rm $file + done +} + +function copy_bitmask_root() { + mkdir -p "${LOCAL_SBIN_FOLDER}" + cp "${FROM_PATH}/${BITMASK_ROOT_FILE}" "${BITMASK_ROOT_PATH}" + chmod 744 "${BITMASK_ROOT_PATH}" + +} + +function copy_polkit_file() { + cp "${FROM_PATH}/${POLKIT_FILE}" "${POLKIT_PATH}" + chmod 644 "${POLKIT_PATH}" +} + +function copy_openvpn_file() { + mkdir -p "${LOCAL_SBIN_FOLDER}" + cp "${FROM_PATH}/${OPENVPN_FILE}" "${OPENVPN_PATH}" + chmod 744 "${OPENVPN_PATH}" + +} + + +# +# Process options and run functions. +# + +check_current_uid + +if [ $INSTALL_BITMASK_ROOT == YES ] || [ $INSTALL_POLKIT_FILE == YES ] || [ $INSTALL_OPENVPN == YES ] +then + check_from_path +fi + +if [ $REMOVE_OLD_FILES == YES ] +then + echo "REMOVING OLD FILES..." + remove_old_files +fi + +if [ $INSTALL_BITMASK_ROOT == YES ] +then + echo "INSTALLING bitmask-root..." + copy_bitmask_root +fi + +if [ $INSTALL_POLKIT_FILE == YES ] +then + echo "INSTALLING policykit file..." + copy_polkit_file +fi + +if [ $INSTALL_OPENVPN == YES ] +then + echo "INSTALLING openvpn..." + copy_openvpn_file +fi -- cgit v1.2.3 From 89d126e96b1ed3ac1076b3c45129f8bc78a09700 Mon Sep 17 00:00:00 2001 From: Kali Kaneko Date: Tue, 17 Jun 2014 11:25:11 -0500 Subject: use bash installer instead of the temporal script --- pkg/linux/README.rst | 7 ++++++- pkg/linux/leap-install-helper.sh | 3 ++- 2 files changed, 8 insertions(+), 2 deletions(-) (limited to 'pkg') diff --git a/pkg/linux/README.rst b/pkg/linux/README.rst index 249c721f..f89842d3 100644 --- a/pkg/linux/README.rst +++ b/pkg/linux/README.rst @@ -15,10 +15,15 @@ path will be used if the flag ``--standalone`` is set:: bitmask-root -> /usr/local/sbin/bitmask-root polkit/se.leap.bitmask.bundle.policy -> /usr/share/polkit-1/actions/se.leap.bitmask.bundle.policy -You will also have to place an openvpn binary in the following path:: +When running with ``--standalone`` flag, the openvpn binary is expected in the following path:: leap-openvpn -> /usr/local/sbin/leap-openvpn +The bundle will use the script ``leap-install-helper.sh`` to copy the needed +files. If you ever want to use it manually to update the helpers or bins, it +needs a ``--from-path`` parameter to be passed to it. This points to a folder +from where all the needed binaries and scripts can be found. + Binary hashing ============== diff --git a/pkg/linux/leap-install-helper.sh b/pkg/linux/leap-install-helper.sh index bed48255..566dd3d9 100755 --- a/pkg/linux/leap-install-helper.sh +++ b/pkg/linux/leap-install-helper.sh @@ -19,8 +19,9 @@ LOCAL_SBIN_FOLDER=/usr/local/sbin +POLKIT_FOLDER="/usr/share/polkit-1/actions" POLKIT_FILE="se.leap.bitmask.bundle.policy" -POLKIT_PATH="/usr/share/polkit-1/actions" +POLKIT_PATH="${POLKIT_FOLDER}/${POLKIT_FILE}" BITMASK_ROOT_FILE="bitmask-root" BITMASK_ROOT_PATH="${LOCAL_SBIN_FOLDER}/${BITMASK_ROOT_FILE}" -- cgit v1.2.3 From b7b00f724b5ce1dc9382ec6c44e6b23faadacbb4 Mon Sep 17 00:00:00 2001 From: Kali Kaneko Date: Fri, 20 Jun 2014 11:05:54 -0500 Subject: fix bundle path for openvpn --- pkg/linux/bitmask-root | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'pkg') diff --git a/pkg/linux/bitmask-root b/pkg/linux/bitmask-root index 1929b51b..5367a31c 100755 --- a/pkg/linux/bitmask-root +++ b/pkg/linux/bitmask-root @@ -67,7 +67,7 @@ OPENVPN_USER = "nobody" OPENVPN_GROUP = "nogroup" LEAPOPENVPN = "LEAPOPENVPN" OPENVPN_SYSTEM_BIN = "/usr/sbin/openvpn" # Debian location -OPENVPN_LEAP_BIN = "/usr/sbin/leap-openvpn" # installed by bundle +OPENVPN_LEAP_BIN = "/usr/local/sbin/leap-openvpn" # installed by bundle """ -- cgit v1.2.3