summaryrefslogtreecommitdiff
path: root/pkg/bundle_riseupvpn_from_docker
diff options
context:
space:
mode:
authorKali Kaneko <kali@leap.se>2018-02-15 17:30:23 +0100
committerKali Kaneko <kali@leap.se>2018-02-15 17:30:23 +0100
commit16e8c9179b15f10570670e6068f87357427fd12b (patch)
tree56b321a37f2bea9aec5d93c0ae76db15afb0a997 /pkg/bundle_riseupvpn_from_docker
parent8b474dbfcd3cc72f0ce94eea3d63dbd18184060c (diff)
[pkg] add branding image
Diffstat (limited to 'pkg/bundle_riseupvpn_from_docker')
-rw-r--r--pkg/bundle_riseupvpn_from_docker65
1 files changed, 65 insertions, 0 deletions
diff --git a/pkg/bundle_riseupvpn_from_docker b/pkg/bundle_riseupvpn_from_docker
new file mode 100644
index 00000000..006a788a
--- /dev/null
+++ b/pkg/bundle_riseupvpn_from_docker
@@ -0,0 +1,65 @@
+# This script gets executed inside the docker-bundler-apt image.
+# Produces a RiseupVPN bundle inside the volume exported as /dist
+# (no virtualenv, so all the dependencies must be already installed in the image).
+
+: ${REPO:="https://github.com/leapcode/bitmask-dev"}
+: ${BRANCH:="master"}
+
+# build bitmask-systray
+# (dependencies should already be in the base image)
+
+export GOPATH=/srv/go
+export CGO_CPPFLAGS="-I/usr/include"
+export CGO_LDFLAGS="-L/usr/lib -L/usr/lib/z86_64-linux-gnu -lzmq -lpthread -lsodium -lrt -lstdc++ -lm -lc -lgcc"
+
+# echo "[+] building systray deps"
+# go get -a 0xacab.org/leap/bitmask-systray
+cd /src/leap && git clone --depth 1 --single-branch --branch master https://0xacab.org/leap/bitmask-systray
+echo "[+] building systray"
+cd bitmask-systray && go build .
+
+cd $HOME
+echo "[+] CLONING REPO from $REPO [$BRANCH]"
+rm -rf bitmaskbuild
+git clone --depth 1 --single-branch --branch $BRANCH $REPO bitmaskbuild
+cd bitmaskbuild
+RELEASE=anonvpn-`cat pkg/next-version`
+echo "[+] RELEASE: $RELEASE"
+git fetch --tags
+# uninstall bitmask-dev from base image and install bitmask-vpn
+pip uninstall --yes leap.bitmask
+pip install -e '.[vpn]'
+mkdir -p dist/
+
+# nuke bitmask mail
+rm -rf src/leap/bitmask/mail
+
+# build anonvpn bundle
+VIRTUAL_ENV=/usr/local make bundle_anonvpn_linux
+
+# copy systray binary and libs
+echo "[+] Copy systray binary"
+cp /src/leap/bitmask-systray/bitmask-systray dist/${RELEASE}/lib/
+cp /usr/lib/x86_64-linux-gnu/libsodium.so.18 dist/${RELEASE}/lib/
+cp /usr/lib/x86_64-linux-gnu/libzmq.so.5.1.1 dist/${RELEASE}/lib/libzmq.so.5
+cp /usr/lib/x86_64-linux-gnu/libappindicator3.so.1 dist/${RELEASE}/lib/
+cp /usr/lib/x86_64-linux-gnu/libpng16.so.16 dist/${RELEASE}/lib/libpng.so.16
+cp /usr/lib/x86_64-linux-gnu/libz.so dist/${RELEASE}/lib/libz.so
+
+# copy assets
+cp /src/leap/bitmask-systray/riseupvpn.svg dist/${RELEASE}/lib/riseupvpn.svg
+
+# trim some bytes
+rm dist/${RELEASE}/lib/pysqlcipher._sqlite.so
+rm dist/${RELEASE}/lib/libzmq-0576c57a.so.5.0.2
+rm dist/${RELEASE}/lib/libsqlite3.so.0
+
+# rename entrypoint
+echo "[+] Build and copy wrapper binary"
+cd $HOME/bitmaskbuild/pkg/launcher && make
+cd $HOME/bitmaskbuild
+cp pkg/launcher/bitmask dist/${RELEASE}/RiseupVPN
+mv dist/${RELEASE}/lib/anonvpn dist/${RELEASE}/lib/bitmask
+
+cp -r dist/* /dist
+echo "[+] DONE"