Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add exodus #17

Closed
wants to merge 8 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions conf.d/electrum
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 5 additions & 1 deletion overlay/usr/lib/bitkey.d/wbar-config
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,13 @@ CONFIG=/home/user/.wbar

cat >$CONFIG<<EOF
i: /usr/share/pixmaps/wbar/dock.png
c: wbar --bpress --pos bottom --zoomf 1.3 --isize 72 --idist 4 --jumpf 1 --nanim 3 --balfa 25
c: wbar --bpress --pos bottom --zoomf 1.3 --isize 36 --idist 4 --jumpf 1 --nanim 3 --balfa 25
t: /usr/share/fonts/truetype/dejavu/DejaVuSans-Bold.ttf/10

i: /usr/local/share/icons/exodus.png
c: exodus-wrapper >/dev/null
t: Exodus

i: /usr/local/share/icons/electrum.png
c: electrum-wrapper $mode >/dev/null
t: Electrum ($mode)
Expand Down
Empty file modified overlay/usr/local/bin/electron-cash-wrapper
100644 → 100755
Empty file.
Empty file modified overlay/usr/local/bin/electrum-ltc-wrapper
100644 → 100755
Empty file.
145 changes: 145 additions & 0 deletions overlay/usr/local/bin/exodus-wrapper
Original file line number Diff line number Diff line change
@@ -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

Empty file modified overlay/usr/local/bin/firefox-app
100644 → 100755
Empty file.
Empty file modified overlay/usr/local/bin/firefox-wrapper
100644 → 100755
Empty file.
Binary file added overlay/usr/local/share/icons/exodus.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
5 changes: 4 additions & 1 deletion plan/main
Original file line number Diff line number Diff line change
Expand Up @@ -45,4 +45,7 @@ printer-driver-pxljr
printer-driver-sag-gdi
printer-driver-splix
cups-browsed
avahi-daemon
avahi-daemon

libgconf-2-4