diff --git a/conf.d/electrum b/conf.d/electrum index 889f59c..b6e2295 100755 --- a/conf.d/electrum +++ b/conf.d/electrum @@ -31,6 +31,14 @@ mv Electrum-*/ electrum/ sudo ln -s $SRC/electrum/electrum /usr/local/bin/electrum sudo chmod +x /usr/local/bin/electrum +# unpack Exodus +unzip exodus-linux-x64-*.zip -d . +rm exodus-linux-x64-*.zip + +# install Exodus +sudo ln -s $SRC/Exodus-linux-x64/Exodus /usr/local/bin/Exodus +sudo chmod +x /usr/local/bin/Exodus + # copy dependencies from Electrum to Electron Cash mkdir electron-cash/packages/ cp electrum/packages/* electron-cash/packages/ -R diff --git a/overlay/usr/lib/bitkey.d/wbar-config b/overlay/usr/lib/bitkey.d/wbar-config index b29bfaa..7de0791 100755 --- a/overlay/usr/lib/bitkey.d/wbar-config +++ b/overlay/usr/lib/bitkey.d/wbar-config @@ -5,9 +5,13 @@ CONFIG=/home/user/.wbar cat >$CONFIG</dev/null +t: Exodus + i: /usr/local/share/icons/electrum.png c: electrum-wrapper $mode >/dev/null t: Electrum ($mode) diff --git a/overlay/usr/local/bin/electron-cash-wrapper b/overlay/usr/local/bin/electron-cash-wrapper old mode 100644 new mode 100755 diff --git a/overlay/usr/local/bin/electrum-ltc-wrapper b/overlay/usr/local/bin/electrum-ltc-wrapper old mode 100644 new mode 100755 diff --git a/overlay/usr/local/bin/exodus-wrapper b/overlay/usr/local/bin/exodus-wrapper new file mode 100755 index 0000000..55f4f11 --- /dev/null +++ b/overlay/usr/local/bin/exodus-wrapper @@ -0,0 +1,145 @@ +#!/bin/bash -e + +fatal() { + zenity --error --text "$@" + exit 1 +} + +usage() { + echo "syntax: $(basename $0)" + exit 1 +} + +info() { + echo -n "$@" > $infofile +} + +locate_storage_path() { + dirname=$1 + filename=$2 + for d in $(ls /media); do + storage_path="/media/$d/$dirname" + if [ -e $storage_path/$filename ] && [ -w $storage_path/$filename ]; then + echo $storage_path + return + fi + done + + for d in $(ls /media); do + storage_path="/media/$d/$dirname" + if [ -d $storage_path ] && [ -w $storage_path ]; then + echo $storage_path + return + fi + done + + for d in $(ls /media); do + storage_path="/media/$d/$dirname" + if mountpoint -q /media/$d && [ -w "/media/$d" ]; then + mkdir -p $storage_path + echo $storage_path + return + fi + done +} + +if [[ "$#" != "0" ]]; then + usage +fi + +storage_dirname="bitkey-data" +mount_path="/mnt/bitkey-data" + +mode="exodus" + +# verify electrum isn't running +if pidof -x Exodus >/dev/null; then + fatal "Exodus is already running..." +fi + +# verify (another) electrum-wrapper isn't running +if pidof -x exodus-wrapper -o %PPID >/dev/null; then + fatal "Exodus-wrapper is already running..." +fi + +# verify mount_path isn't in use +if mountpoint -q $mount_path; then + fatal "$mount_path is currently in use...\nTip: sudo luks-umount $mount_path" +fi + +# setup info dialog +infofile=$(tempfile) +info "loading..." +info-dialog --title="exodus-wrapper" $infofile & +trap "rm -f -- '$infofile'" INT TERM EXIT + +# locate and setup storage +info "searching for persistent storage..." +storage_path=$(locate_storage_path $storage_dirname $mode) +storage_file=$storage_path/$mode + +if [ -z $storage_path ]; then + error="Unable to locate USB device to use as persistent storage.\n" + error+="Please insert a USB device and try again." + fatal "$error" +fi + +# create and or mount encrypted storage (cold-offline / hot-online) +passwd_text="Enter passphrase for encrypted wallet storage:\n$storage_file" +if [ ! -e "$storage_file" ]; then + passwd=$(passphrase-zxcvbn --confirm --text="$passwd_text") + + info "creating $storage_file loopback..." + dd if=/dev/zero of=$storage_file bs=1M count=5 + + info "creating $storage_file filesystem..." + echo $passwd | sudo luks-mkfs -f --fs=ext2 $storage_file + + info "mounting $storage_file..." + echo $passwd | sudo luks-mount $storage_file $mount_path + +else + error="" + while true; do + passwd=$(passphrase-zxcvbn --hide --text="$passwd_text" --error="$error") + info "attempting to mount $storage_file ..." + if echo $passwd | sudo luks-mount $storage_file $mount_path; then + break + fi + error="Invalid passphrase, please try again" + done +fi + +# close info dialog +rm -f $infofile + +# start Exodus in foreground +sudo chown -R user:user $mount_path +wallet_path=$mount_path/$mode +Exodus --datadir=$wallet_path + +# setup info dialog +infofile=$(tempfile) +info-dialog --title="electrum-wrapper" $infofile & +trap "rm -f -- '$infofile'" INT TERM EXIT + +#echo seedless watch wallet is disabled for lack of the deseed function +# create seedless watch wallet (cold-online) +#if [ -e "$wallet_path" ] && [ ! -e "$storage_path/cold-online" ]; then + #info "creating $storage_path/cold-online..." + #echo y | electrum deseed -w $wallet_path + #mv $wallet_path.seedless $storage_path/cold-online +#fi + +# umount encrypted storage +info "syncing filesystem..." +sync && sleep 2 + +info "umounting encrypted storage..." +while true; do + if sudo luks-umount $mount_path; then + break + fi + zenity --error --text "unable to unmount encrypted storage. please close all programs that may be blocking." +done + diff --git a/overlay/usr/local/bin/firefox-app b/overlay/usr/local/bin/firefox-app old mode 100644 new mode 100755 diff --git a/overlay/usr/local/bin/firefox-wrapper b/overlay/usr/local/bin/firefox-wrapper old mode 100644 new mode 100755 diff --git a/overlay/usr/local/share/icons/exodus.png b/overlay/usr/local/share/icons/exodus.png new file mode 100644 index 0000000..c64fe4b Binary files /dev/null and b/overlay/usr/local/share/icons/exodus.png differ diff --git a/overlay/usr/local/src/exodus-linux-x64-1.40.0.zip b/overlay/usr/local/src/exodus-linux-x64-1.40.0.zip new file mode 100644 index 0000000..5d9ff10 Binary files /dev/null and b/overlay/usr/local/src/exodus-linux-x64-1.40.0.zip differ diff --git a/plan/main b/plan/main index c41abd8..c572479 100644 --- a/plan/main +++ b/plan/main @@ -45,4 +45,7 @@ printer-driver-pxljr printer-driver-sag-gdi printer-driver-splix cups-browsed -avahi-daemon \ No newline at end of file +avahi-daemon + +libgconf-2-4 +