diff options
author | Kali Kaneko <kali@leap.se> | 2016-04-27 15:33:51 -0400 |
---|---|---|
committer | Kali Kaneko <kali@leap.se> | 2016-04-27 20:32:42 -0400 |
commit | d2806583ead2712c9095b82f31b50924dfc80411 (patch) | |
tree | ecaff8b4342905a1eb0149809439d2c4566bfc04 | |
parent | c9066a10f3fb8c34b3db2ef9be55501ba91fdca5 (diff) |
split packages: debian-core, debian-cli
-rw-r--r-- | debian/bitmask-cli.install | 3 | ||||
-rw-r--r-- | debian/bitmask-core.install | 2 | ||||
-rw-r--r-- | debian/bitmask.install | 4 | ||||
-rw-r--r-- | debian/bitmask.pyremove | 2 | ||||
-rw-r--r-- | debian/control | 36 | ||||
-rw-r--r-- | debian/pydist-overrides | 2 | ||||
-rwxr-xr-x | debian/rules | 24 | ||||
-rw-r--r-- | debian/source/include-binaries | 1 | ||||
-rw-r--r-- | docker/Dockerfile | 32 | ||||
-rw-r--r-- | docker/README.rst | 47 | ||||
-rwxr-xr-x | docker/bitmask-docker.sh | 119 | ||||
-rw-r--r-- | docker/bitmask-nightly.json | 11 | ||||
-rwxr-xr-x | docker/debian/apt-bitmask.sh | 123 | ||||
-rwxr-xr-x | docker/debian/bitmask-on-docker.sh | 23 | ||||
-rw-r--r-- | docker/debian/leap-experimental.key | 52 | ||||
-rwxr-xr-x | docker/debian/run-docker-for-bitmask.sh | 22 | ||||
-rwxr-xr-x | docker/leap_bootstrap.sh | 324 |
17 files changed, 56 insertions, 771 deletions
diff --git a/debian/bitmask-cli.install b/debian/bitmask-cli.install new file mode 100644 index 00000000..69703ed7 --- /dev/null +++ b/debian/bitmask-cli.install @@ -0,0 +1,3 @@ +/usr/bin/bitmask_cli +src/leap/bitmask/cli usr/lib/python2.7/dist-packages/leap/bitmask/ + diff --git a/debian/bitmask-core.install b/debian/bitmask-core.install new file mode 100644 index 00000000..51161af3 --- /dev/null +++ b/debian/bitmask-core.install @@ -0,0 +1,2 @@ +/usr/bin/bitmaskd +src/leap/bitmask/core usr/lib/python2.7/dist-packages/leap/bitmask/ diff --git a/debian/bitmask.install b/debian/bitmask.install index 34943e9b..fb081d1e 100644 --- a/debian/bitmask.install +++ b/debian/bitmask.install @@ -1,8 +1,11 @@ +/usr/bin/bitmask +/usr/lib/python2.7/dist-packages/leap.bitmask-*.egg-info pkg/linux/bitmask-root usr/sbin/ pkg/linux/polkit/se.leap.bitmask.policy usr/share/polkit-1/actions/ debian/bitmask.xpm usr/share/pixmaps debian/bitmask.desktop usr/share/applications debian/icons/hicolor usr/share/icons +src/leap/bitmask usr/lib/python2.7/dist-packages/leap/ # pixelated hacks!!! src/pixelated usr/lib/python2.7/dist-packages/ @@ -11,3 +14,4 @@ src/leap/bitmask/auth/auth.py usr/lib/python2.7/dist-packages/leap/ src/leap/bitmask/auth/exceptions.py usr/lib/python2.7/dist-packages/leap/ src/leap/bitmask/auth/srp_session.py usr/lib/python2.7/dist-packages/leap/ + diff --git a/debian/bitmask.pyremove b/debian/bitmask.pyremove index 702c93f5..9d6e34d3 100644 --- a/debian/bitmask.pyremove +++ b/debian/bitmask.pyremove @@ -1 +1,3 @@ usr/etc/leap +usr/bin/bitmaskd +usr/bin/bitmask_cli diff --git a/debian/control b/debian/control index 52952943..4975fadd 100644 --- a/debian/control +++ b/debian/control @@ -7,19 +7,17 @@ Uploaders: Micah Anderson <micah@debian.org> Homepage: https://leap.se Build-Depends: debhelper (>= 8.0.0), dh-python, python (>=2.6), python-setuptools, pep8, - python-sphinx (>= 1.0.7+dfsg), docutils-common, python-nose, python-mock, - python-requests (>= 1.2.3), python-srp, python-crypto, python-keyring, python-xdg, + python-sphinx (>= 1.0.7+dfsg), docutils-common, python-nose, + python-requests (>= 1.2.3), python-srp, python-keyring, python-jsonschema (>= 0.7.0), python-psutil, python-openssl, - python-dateutil, python-argparse, pyside-tools, - xvfb, xauth -X-Python-Version: >= 2.6 + python-dateutil, python-argparse, pyside-tools, xvfb, xauth +X-Python-Version: >= 2.7 Package: bitmask Architecture: all Depends: ${misc:Depends}, ${python:Depends}, python-openssl, - python-crypto, python-keyring (>= 0.9.2), python-srp, python-dateutil, @@ -38,9 +36,10 @@ Depends: python-pyside.qtcore, python-pyside.qtgui, python-pyside.qtsvg, + python-pyside.qtwebkit, python-twisted-core (>= 14.0.2), python-leap-common, - leap-mail (>= 0.3.99), + leap-mail (>= 0.4.1), soledad-client, # This is a workaround to broken python-srp in wily. # We should remove libssl-dev when #7566 is solved @@ -65,4 +64,27 @@ Description: Provides the desktop client for LEAP encrypted when possible; and public keys are automatically discovered and validated. +Package: bitmask-core +Architecture: all +Depends: python-twisted-core, + python-zope.interface +Suggests: bitmask-cli +Provides: leap.bitmask.core, ${python:Provides} +# Replaces: ... +# Breaks: ... +Description: Desktop client to access LEAP Services. + The LEAP project aims to secure everyday communication. + . + This package provides the core daemon. + +Package: bitmask-cli +Architecture: all +Depends: bitmask-core +Provides: leap.bitmask.cli, ${python:Provides} +# Replaces: ... +# Breaks: ... +Description: Desktop client to access LEAP Services. + The LEAP project aims to secure everyday communication. + . + This package provides the command line client. diff --git a/debian/pydist-overrides b/debian/pydist-overrides index 8380915c..4c1c3c7e 100644 --- a/debian/pydist-overrides +++ b/debian/pydist-overrides @@ -2,3 +2,5 @@ leap.soledad.client soledad-client ; PEP386 leap.common python-leap-common ; PEP386 leap.mail leap-mail ; PEP386 leap.keymanager leap-keymanager +leap.bitmask bitmask +leap.bitmask-core bitmask-core diff --git a/debian/rules b/debian/rules index d82b9451..f762cb3c 100755 --- a/debian/rules +++ b/debian/rules @@ -7,7 +7,7 @@ # This special exception was added by Craig Small in version 0.37 of dh-make. # # Uncomment this to turn on verbose mode. -#DH_VERBOSE=1 +DH_VERBOSE=1 DEB_BUILD_OPTIONS=nocheck package=bitmask @@ -22,6 +22,8 @@ override_dh_prep: rst2man docs/man/bitmask-root.1.rst docs/man/bitmask-root.1 dh_prep + mv src/leap.bitmask.egg-info src/leap.bitmask.egg-info.orig + # this will re-generate the resource files and locales. make -f ./Makefile @@ -30,8 +32,8 @@ ifeq (,$(filter nocheck,$(DEB_BUILD_OPTIONS))) # run tests! # -test-python%: - xvfb-run ./run_tests.sh -x -N +#test-python%: +# xvfb-run ./run_tests.sh -x -N override_dh_auto_test: $(PYTHON2:%=test-python%) $(PYTHON3:%=test-python%) endif @@ -41,14 +43,13 @@ endif build-python%: python$* setup.py build -#override_dh_auto_build: $(PYTHON3:%=build-python%) -# dh_auto_build - -install-python%: - python$* setup.py install --root=$(CURDIR)/debian/tmp --install-layout=deb +override_dh_auto_build: $(PYTHON3:%=build-python%) + dh_auto_build -#override_dh_auto_install: $(PYTHON3:%=install-python%) -# dh_auto_install +override_dh_install: + dh_install -Xbitmask/core -Xbitmask/cli + rm -rf src/leap.bitmask.egg-info + mv src/leap.bitmask.egg-info.orig src/leap.bitmask.egg-info # build and install sphinx docs # @@ -68,9 +69,12 @@ override_dh_auto_clean: rm -rf .tox rm -rf bin rm -rf build + rm -rf dist rm -rf lib/ rm -rf docs/_build rm -rf *.egg-info + rm -rf .eggs/ rm -f docs/man/bitmask.1 rm -f docs/man/bitmask-root.1 rm -rf docs/covhtml + rm -rf docker diff --git a/debian/source/include-binaries b/debian/source/include-binaries deleted file mode 100644 index 9868b8e2..00000000 --- a/debian/source/include-binaries +++ /dev/null @@ -1 +0,0 @@ -dist/leap_client-0.1dev-py2.7.egg diff --git a/docker/Dockerfile b/docker/Dockerfile deleted file mode 100644 index d5a7b57e..00000000 --- a/docker/Dockerfile +++ /dev/null @@ -1,32 +0,0 @@ -FROM ubuntu:trusty - -MAINTAINER Ivan Alejandro <ivanalejandro0@gmail.com> - -RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \ - g++ \ - git \ - libffi-dev \ - libsqlite3-dev \ - libssl-dev \ - libzmq-dev \ - openvpn \ - pyside-tools \ - python-dev \ - python-openssl \ - python-pip \ - python-pyside \ - python-setuptools \ - python-virtualenv \ - make realpath lxpolkit policykit-1 iptables && \ - apt-get clean && rm -rf /var/lib/apt/lists/* - - -RUN mkdir -p /bitmask -WORKDIR /bitmask - -COPY leap_bootstrap.sh /bitmask/ - -VOLUME ["/data/"] - -EXPOSE 1984 2013 -ENTRYPOINT ["/bitmask/leap_bootstrap.sh"] diff --git a/docker/README.rst b/docker/README.rst deleted file mode 100644 index 4a2d08e7..00000000 --- a/docker/README.rst +++ /dev/null @@ -1,47 +0,0 @@ -Bitmask and Docker -================== - -Here we have several tools that leverages docker to ease Bitmask testing. - -``bitmask-docker.sh`` is a helper script to ``build`` and ``run`` the bitmask app, -here is an example usage:: - - $ ./bitmask-docker.sh build # build docker image - $ ./bitmask-docker.sh init bitmask-nightly.json # initialize (takes time) - $ ./bitmask-docker.sh run # run bitmask in docker - -``bitmask-nightly.json`` is the version specifier for each bitmask component that -will be used to run bitmask. - -``Dockerfile`` is the file used to build the docker image that will run bitmask. - -``leap_bootstrap.sh`` is the script that takes care of cloning repos, installing -python dependencies, running bitmask, etc. - - -Debian/ -------- - -``apt-bitmask.sh`` script that installs bitmask from the Debian packages. - -``bitmask-on-docker.sh`` installs bitmask and runs it in a dummy X server, -waits a little and takes a screenshot. - -``leap-experimental.key`` is needed by ``apt-bitmask.sh`` to ``apt-key add`` -and verify apt sources. - -``run-docker-for-bitmask.sh`` is a helper script that runs an Ubuntu/Debian -container ready to run the ``apt-bitmask.sh`` command, it does (among other -stuff) X11 forwarding to display Bitmask UI on the host linux. - -An example usage:: - - $ ./run-docker-for-bitmask.sh - non-network local connections being added to access control list - root@hostname:/# cd /host/ - root@hostname:/host# ./apt-bitmask.sh unstable - # [... not so relevant output ...] - root@hostname:/host# apt-get install -y lxpolkit # install a small polkit agent - # [... not so relevant output ...] - root@hostname:/host# lxpolkit & # run the polkit agent in the background, ignore the "No session for pid 6034" error. - root@hostname:/host# bitmask -d # tadaa, you have bitmask running in a container! diff --git a/docker/bitmask-docker.sh b/docker/bitmask-docker.sh deleted file mode 100755 index 329900f8..00000000 --- a/docker/bitmask-docker.sh +++ /dev/null @@ -1,119 +0,0 @@ -#!/bin/bash - -run(){ - # NOTE: you may need this line if you get an error using ip6tables - # (host needs ip6 kernel modules to use it in the container) - # sudo modprobe ip6_tables - - # NOTE: to get X11 socket forwarding to work we need this - xhost local:root - - CREDS_OPTS='' - if [[ -n $BITMASK_CREDENTIALS ]]; then - BITMASK_CREDENTIALS=`realpath $BITMASK_CREDENTIALS` - CREDS_OPTS="-e BITMASK_CREDENTIALS=/data/credentials.ini -v $BITMASK_CREDENTIALS:/data/credentials.ini" - fi - - # NOTE: to use containerized VPN from the host you need to add `--net host` - docker run --rm -it \ - --privileged \ - -v /tmp/.X11-unix:/tmp/.X11-unix \ - -e DISPLAY=unix$DISPLAY \ - $CREDS_OPTS \ - -v `pwd`/data/:/data/ -v `pwd`:/SHARED/ \ - -v `pwd`/data/config:/root/.config/leap \ - -p 1984:1984 -p 2013:2013 \ - -e LEAP_DOCKERIZED=1 \ - --name bitmask \ - test/bitmask run $@ - - # Services' related ports - # eip: ["80", "53", "443", "1194"] - # mail: ["1984", "2013"] - - # logs when no ip6_tables module is not loaded on host: - # root@bitmask-container:/bitmask# sudo ip6tables --new-chain bitmask - # modprobe: ERROR: ../libkmod/libkmod.c:556 kmod_search_moddep() could not open moddep file '/lib/modules/4.1.6-040106-generic/modules.dep.bin' - # ip6tables v1.4.21: can't initialize ip6tables table `filter': Table does not exist (do you need to insmod?) - # Perhaps ip6tables or your kernel needs to be upgraded. - - # logs when ip6_tables module is loaded on host: - # root@bitmask-container:/bitmask# sudo ip6tables --new-chain bitmask - # root@bitmask-container:/bitmask# # success! -} - -shell(){ - xhost local:root - - # NOTE: to use containerized VPN from the host you need to add `--net host` - docker run --rm -it \ - --privileged \ - -v /tmp/.X11-unix:/tmp/.X11-unix \ - -e DISPLAY=unix$DISPLAY \ - -v `pwd`/data/:/data/ -v `pwd`:/SHARED/ \ - -v `pwd`/data/config:/root/.config/leap \ - -p 1984:1984 -p 2013:2013 \ - -e LEAP_DOCKERIZED=1 \ - --name bitmask \ - --entrypoint=bash \ - test/bitmask -} - -init(){ - JSON=`realpath $1` - docker run --rm -it \ - -v `pwd`/data:/data \ - -v $JSON:/shared/bitmask.json \ - test/bitmask init ro /shared/bitmask.json -} - -update(){ - JSON=`realpath $1` - docker run --rm -it \ - -v `pwd`/data:/data \ - -v $JSON:/shared/bitmask.json \ - test/bitmask update /shared/bitmask.json -} - -build(){ - docker build -t test/bitmask . -} - -help() { - echo ">> Bitmask on docker" - echo "Run the bitmask app in a docker container." - echo - echo "Usage: $0 {init bitmask.json | update bitmask.json | build | shell | run | help}" - echo - echo " ?.json : The bitmask*.json file describes the version that will be used for each repo." - echo - echo " init : Clone repositories, install dependencies, and get bitmask ready to be used." - echo " update : Update the repositories and install new deps (if needed)." - echo " build : Build the docker image for bitmask." - echo " shell : Run a shell inside a bitmask docker container (useful to debug)." - echo " run : Run the client (any extra parameters will be sent to the app)." - echo " help : Show this help" - echo -} - - -case "$1" in - run) - run "$@" - ;; - init) - init $2 - ;; - update) - update $2 - ;; - build) - build - ;; - shell) - shell - ;; - *) - help - ;; -esac diff --git a/docker/bitmask-nightly.json b/docker/bitmask-nightly.json deleted file mode 100644 index 5b1c3cf0..00000000 --- a/docker/bitmask-nightly.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "version": "nightly", - "tuf_repo": "", - "bitmask_client": "develop", - "soledad": "develop", - "keymanager": "develop", - "leap_mail": "develop", - "leap_pycommon": "develop", - "bitmask_launcher": "develop", - "leap_assets": "master" -} diff --git a/docker/debian/apt-bitmask.sh b/docker/debian/apt-bitmask.sh deleted file mode 100755 index 99c5f07e..00000000 --- a/docker/debian/apt-bitmask.sh +++ /dev/null @@ -1,123 +0,0 @@ -#!/bin/bash -set -euo pipefail -IFS=$'\n\t' - -distro(){ - # for ubuntu/mint: - name=`lsb_release -a 2>&1 | grep Codename | cut -f2` - - # for debian: - [[ -z $name ]] && name=`grep -oP "VERSION=.*\(\K\w+" /etc/os-release` - - # for debian sid - [[ -z $name ]] && name=`grep -o sid /etc/debian_version` - - declare -A distros - distros=( - ['nadia']='quantal' - ['olivia']='raring' - ['petra']='saucy' - ['qiana']='trusty' - ['rebecca']='trusty' - ['rafaela']='trusty' - ['sana']='jessie' - ) - - # if name is in the above list -> replace - [ ${distros[$name]+abc} ] && name=${distros[$name]} - - echo $name | tr "[A-Z]" "[a-z]" -} - -is_supported(){ - distros=( - # 'wheezy' # Debian 7 - stable - 'jessie' # Debian 8 - testing - 'sid' # Debian unstable - # 'quantal' # Ubuntu 12.10 - # 'raring' # Ubuntu 13.04 - # 'saucy' # Ubuntu 13.10 - # 'trusty' # Ubuntu 14.04 - # 'utopic' # Ubuntu 14.10 - 'vivid' # Ubuntu 15.04 - 'wily' # Ubuntu 15.10 - ) - - my_distro=`distro` - - for p in "${distros[@]}"; do - if [[ $my_distro = ${p}* ]]; then - echo true - return - fi - done - echo false -} - -if [[ `is_supported` == "false" ]]; then - echo "ERROR: Sorry, your distro (`distro`) is currently not supported." - exit 1 -fi; - -help() { - echo ">> Bitmask .deb automatic installer helper" - echo "This script does all the needed stuff in order to get bitmask stable or unstable into your machine." - echo - echo "Usage: $0 ( stable | unstable | help )" - echo - echo " stable : Install the stable bitmask package." - echo " unstable : Install the unstable bitmask package." - echo " help : Show this help" - echo - echo "NOTE: you need to run this with root privileges." - echo -} - -case ${1:-} in - stable) - REPO='debian' - ;; - unstable) - REPO='experimental' - ;; - *) - help - exit 1 - ;; -esac - -if [[ $EUID -ne 0 ]]; then - echo "This script must be run as root" 1>&2 - exit 1 -fi - -# ------------------------------- -# instructions from http://deb.leap.se/experimental/ -# run this with admin privileges - -DISTRO=`distro` - -if [[ $REPO == 'debian' ]]; then - # stable - # wget -O- https://dl.bitmask.net/apt.key | apt-key add - - - # HACK: do this twice since the first one fails due to gpg not having a configuration - gpg --recv-key 0x1E34A1828E207901 &> /dev/null || true - gpg --recv-key 0x1E34A1828E207901 - - gpg --armor --export 0x1E34A1828E207901 | apt-key add - -else # $REPO == 'experimental' - if [[ ! -f "leap-experimental.key" ]]; then - echo "ERROR: you need to copy the leap-experimental.key file into this directory." - exit 1 - fi - - # sha256sum leap-experimental.key - echo "ed3f4f3e3e0835a044457451755ae743741d7bafa55bcd31cc464a54e8c5e7f9 leap-experimental.key" | sha256sum -c - - apt-key add leap-experimental.key -fi - -echo "deb http://deb.bitmask.net/$REPO $DISTRO main" > /etc/apt/sources.list.d/bitmask.list - -apt-get update -apt-get install -y bitmask diff --git a/docker/debian/bitmask-on-docker.sh b/docker/debian/bitmask-on-docker.sh deleted file mode 100755 index c3e42b22..00000000 --- a/docker/debian/bitmask-on-docker.sh +++ /dev/null @@ -1,23 +0,0 @@ -#!/bin/bash -# Helper script to install, run and do a screenshot of bitmask - -# You can use this as follows: -# $ docker run -t -i --rm -v `pwd`:/host/ ubuntu:14.04 /bin/bash -# $ cd /host/ -# $ ./bitmask-on-docker.sh stable - -[[ -z $1 ]] && exit 1 - -./apt-bitmask.sh $1 # this does an `apt-get update` -apt-get -y install xinit xvfb imagemagick lxpolkit - -startx -- `which Xvfb` :1 -screen 0 1024x768x24 & -sleep 1 - -DISPLAY=:1 lxpolkit & -sleep 0.5 # bitmask needs polkit to work - -DISPLAY=:1 bitmask & -sleep 2 # wait for bitmask to start - -DISPLAY=:1 import -window root bitmask.png diff --git a/docker/debian/leap-experimental.key b/docker/debian/leap-experimental.key deleted file mode 100644 index a07ec44c..00000000 --- a/docker/debian/leap-experimental.key +++ /dev/null @@ -1,52 +0,0 @@ ------BEGIN PGP PUBLIC KEY BLOCK----- -Version: GnuPG v1.4.12 (GNU/Linux) - -mQINBFRiYXMBEAC/96OXISCU9kndpa7zYedBd4NzXppk1hRPDgGH5Ccl7mFYRaaY -abKOJuilvMThBn2GelFRVXrhFT0K6TVCbrAaLHpb7KGpaxgKY/a+mYCA9BAtYkvR -ru4Xh6VhozI5hDlIDCD5og96d7ymYjVaxiN89ilh4j8TL5Bh4PoCaxIbmxHiVmtM -fIKw9LPAvpViC+8iS+x751plK8NFe4lAbSycWh3AdDfM5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gis2ba98Zx -Fkznh6+ugqfFJfA2b1yynxUxmKDJSctVYxYplpTAyvnH/nNJxCTnmMRYl+ZErSOK -jtoqJbH6bcMbDiWCJ0gjT05w63uN9php6VYVpgn45kUwN85C7+xF6k+Ntyw4UmOj -/VjwJLs1k0zeUhZGjJGRLfVB4RZnnmkX9HzGviHJETqKmoN9ES8+Tt4WlBdngsgT -yr8HXFOzc2OxzRmF7rg1FKhCeaP8EoOcvMyp/5ahnEeJotr+z2bcWlK07D8g0uo0 -tjU8r6fUiHwZD+3iQGFXW+MDMTj/CMOem+Phe22Pn9yjPWA3cmQmCFC+523Pckh9 -xHZgPtwq6F/9L3DQeSmwXey5Q2wBbEGLJ/IWHhiDXG6IDy2Go41M0WCojit0b7hm -70mLptA1rIDDs/T/u0MJ3QmkUxqj7+J3l4T3d0Fh2z/KKTdBJhGvx5h2QjxohIjp -b6JsAIBjl85rTqk6yiX8ct/i9LXqA4luEb47Sl1kc2WQyZv6VPmisBeazDXnnpc1 -5vuOdLqp0JhC+iaGPvkQs+ojQBSdIqnYpD0EmircvoW5yhtLflMZdPr3KeFJxmUp -I9i+ZSm7sc6kehlcGqzLr/p7WZvJBmH92AgEpicqDhJe -=10ZN ------END PGP PUBLIC KEY BLOCK----- diff --git a/docker/debian/run-docker-for-bitmask.sh b/docker/debian/run-docker-for-bitmask.sh deleted file mode 100755 index 9ffb400b..00000000 --- a/docker/debian/run-docker-for-bitmask.sh +++ /dev/null @@ -1,22 +0,0 @@ -#!/bin/sh -# NOTE: to get X11 socket forwarding to work we need this -xhost local:root - -docker run --rm -it \ - --net host \ - --privileged \ - -v /tmp/.X11-unix:/tmp/.X11-unix \ - -e DISPLAY=unix$DISPLAY \ - -v `pwd`:/host/ \ - -p 1984:1984 -p 2013:2013 \ - ubuntu:vivid bash - -# NOTE: what to do next? -# Install bitmask package: -# $ apt-bitmask.sh stable -# Install polkit agent (bitmask needs it): -# $ apt-get install lxpolkit -# Run polkit in background: -# $ lxpolkit & # this will show you a message like: 'No session for pid 5801', ignore it -# Run bitmask: -# $ bitmask -d diff --git a/docker/leap_bootstrap.sh b/docker/leap_bootstrap.sh deleted file mode 100755 index a717ab6d..00000000 --- a/docker/leap_bootstrap.sh +++ /dev/null @@ -1,324 +0,0 @@ -#!/bin/bash -###################################################################### -# repo-versions.sh -# Copyright (C) 2014, 2015 LEAP -# -# 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 <http://www.gnu.org/licenses/>. -###################################################################### -set -e # Exit immediately if a command exits with a non-zero status. -REPOSITORIES="bitmask_client leap_pycommon soledad keymanager leap_mail bitmask_launcher leap_assets" -PACKAGES="leap_pycommon keymanager soledad/common soledad/client leap_mail bitmask_client" - -_is_docker() { - grep -q docker /proc/1/cgroup -} - -SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" - -_is_docker && BASE_PATH="/data/" || BASE_PATH=$SCRIPT_DIR -REPOS_ROOT="$BASE_PATH/repositories" # Root path for all the needed repositories -VENV_DIR="$BASE_PATH/bitmask.venv" # Root path for all the needed repositories - -mkdir -p $REPOS_ROOT - -PS4=">> " # for debugging - -# Escape code -esc=`echo -en "\033"` - -# Set colors -cc_green="${esc}[0;32m" -cc_yellow="${esc}[0;33m" -cc_blue="${esc}[0;34m" -cc_red="${esc}[0;31m" -cc_normal=`echo -en "${esc}[m\017"` - -apt_install_dependencies() { - status="installing system dependencies" - echo "${cc_green}Status: $status...${cc_normal}" - set -x - sudo apt-get install -y git python-dev python-setuptools python-virtualenv python-pip libssl-dev python-openssl libsqlite3-dev g++ openvpn pyside-tools python-pyside libffi-dev libzmq-dev - set +x -} - -helpers() { - if [[ "$1" == "cleanup" ]]; then - status="removing helper files" - echo "${cc_green}Status: $status...${cc_normal}" - set -x - sudo rm -f /usr/sbin/bitmask-root - sudo rm -f /usr/share/polkit-1/actions/se.leap.bitmask.policy - set +x - else - status="installing helper files" - echo "${cc_green}Status: $status...${cc_normal}" - set -x - BASE=$REPOS_ROOT/bitmask_client/pkg/linux - sudo mkdir -p /usr/share/polkit-1/actions/ - sudo cp $BASE/bitmask-root /usr/sbin/ - sudo cp $BASE/polkit/se.leap.bitmask.policy /usr/share/polkit-1/actions/ - set +x - fi -} - -clone_repos() { - local status="clone repositories" - echo "${cc_green}Status: $status...${cc_normal}" - set -x # show commands - - if [[ "$1" == "rw" ]]; then - # read-write remotes: - src="ssh://gitolite@leap.se" - else - # read-only remotes: - src="https://leap.se/git" - fi - cd $REPOS_ROOT - - for repo in $REPOSITORIES; do - [ ! -d $repo ] && git clone $src/$repo - done - - cd - - - set +x - echo "${cc_green}Status: $status done!${cc_normal}" -} - -checkout_repos(){ - local status="checkout repositories" - echo "${cc_green}Status: $status...${cc_normal}" - set -x # show commands - - for repo in $REPOSITORIES; do - version=$(cat $1 | python -c "import json,sys;obj=json.load(sys.stdin);print obj['$repo'];") - cd $REPOS_ROOT/$repo - git fetch origin && git fetch --tags origin - - if [[ -n `git tag -l | grep $version` ]]; then - # if is a tag - git checkout -f $version - else - # if is a branch - git reset --hard origin/$version - fi - done - - set +x - echo "${cc_green}Status: $status done!${cc_normal}" -} - -create_venv() { - local status="creating virtualenv" - echo "${cc_green}Status: $status...${cc_normal}" - set -x # show commands - - virtualenv $VENV_DIR && source $VENV_DIR/bin/activate - pip install --upgrade pip # get the latest pip - - set +x - echo "${cc_green}Status: $status done.${cc_normal}" -} - -setup_develop() { - local status="installing packages" - echo "${cc_green}Status: $status...${cc_normal}" - set -x # show commands - cd $REPOS_ROOT - source $VENV_DIR/bin/activate - - # do a setup develop in every package - for package in $PACKAGES; do - cd $REPOS_ROOT/$package - python setup.py develop --always-unzip - done - - set +x - echo "${cc_green}Status: $status done.${cc_normal}" -} - -install_dependencies() { - local status="installing dependencies" - echo "${cc_green}Status: $status...${cc_normal}" - set -x # show commands - cd $REPOS_ROOT - source $VENV_DIR/bin/activate - - # install defined 3rd party dependencies for every package - for package in $PACKAGES; do - cd $REPOS_ROOT/$package - pkg/pip_install_requirements.sh --use-leap-wheels - done - - # symlink system's PySide inside the venv - $REPOS_ROOT/bitmask_client/pkg/postmkvenv.sh - - # hack to solve gnupg version problem - pip uninstall -y gnupg && pip install gnupg - - set +x - echo "${cc_green}Status: $status done.${cc_normal}" -} - -docker_stuff() { - local status="doing stuff needed to run bitmask on a docker container" - echo "${cc_green}Status: $status...${cc_normal}" - set -x # show commands - - helpers - lxpolkit & - sleep 0.5 - - # this is needed for pkexec - mkdir -p /var/run/dbus - dbus-daemon --system | true - - set +x - echo "${cc_green}Status: $status done.${cc_normal}" -} - -run() { - echo "${cc_green}Status: running client...${cc_normal}" - set -x - - shift # remove 'run' from arg list - passthrough_args=$@ - - _is_docker && docker_stuff - - source $VENV_DIR/bin/activate - python $REPOS_ROOT/bitmask_client/src/leap/bitmask/app.py -d $passthrough_args - - set +x -} - -initialize() { - shift # remove 'init' - echo $@ - if [[ "$1" == "ro" ]]; then - # echo "RO" - shift # remove 'ro' - clone_repos "ro" - else - # echo "RW" - clone_repos - fi - - if [[ -z $1 ]]; then - echo "You need to specify a bitmask.json parameter." - echo "for example:" - cat << EOF -{ - "bitmask_client": "0.7.0", - "soledad": "0.6.3", - "leap_pycommon": "0.3.9", - "keymanager": "0.3.8", - "leap_mail": "0.3.10", - "bitmask_launcher": "0.3.3", - "leap_assets": "master" -} -EOF - exit 1 - fi - - JSON=`realpath $1` - - checkout_repos $JSON - create_venv - install_dependencies - setup_develop - - cd $REPOS_ROOT/bitmask_client/ - make - cd - -} -update() { - local status="updating repositories" - echo "${cc_green}Status: $status...${cc_normal}" - set -x # show commands - - if [[ -z $1 ]]; then - echo "You need to specify a bitmask.json parameter." - echo "for example:" - cat << EOF -{ - "bitmask_client": "0.7.0", - "soledad": "0.6.3", - "leap_pycommon": "0.3.9", - "keymanager": "0.3.8", - "leap_mail": "0.3.10", - "bitmask_launcher": "0.3.3", - "leap_assets": "master" -} -EOF - exit 1 - fi - - JSON=`realpath $1` - - checkout_repos $JSON - install_dependencies - setup_develop - - cd $REPOS_ROOT/bitmask_client/ - make - cd - - - set +x - echo "${cc_green}Status: $status done!${cc_normal}" -} - - -help() { - echo ">> LEAP bootstrap - help" - echo "Bootstraps the environment to start developing the bitmask client" - echo "with all the needed repositories and dependencies." - echo - echo "Usage: $0 {init [ro] bitmask.json | update bitmask.json | run | help | deps | helpers}" - echo - echo " init : Initialize repositories, create virtualenv and \`python setup.py develop\` all." - echo " You can use \`init ro\` in order to use the https remotes if you don't have rw access." - echo " The bitmask.json file contains the version that will be used for each repo." - echo " update : Update the repositories and install new deps (if needed)." - echo " The bitmask.json file contains the version that will be used for each repo." - echo " run : Runs the client (any extra parameters will be sent to the app)." - echo " help : Show this help" - echo " -- system helpers --" - echo " deps : Install the system dependencies needed for bitmask dev (Debian based Linux ONLY)." - echo " helpers : Install the helper files needed to use bitmask (Linux only)." - echo " You can use \`helpers cleanup\` to remove those files." - echo -} - - -case "$1" in - init) - initialize "$@" - ;; - update) - update $2 - ;; - helpers) - helpers $2 - ;; - deps) - apt_install_dependencies - ;; - run) - run "$@" - ;; - *) - help - ;; -esac |