Implement login workflow

This commit is contained in:
Kristóf Tóth 2020-05-22 23:26:34 +02:00
parent e0e0107e13
commit 2debac35b2
2 changed files with 16 additions and 2 deletions

View File

@ -1,9 +1,21 @@
#!/usr/bin/env bash
set -euo pipefail
BRIDGE="${BRIDGE:-/usr/bin/protonmail-bridge}"
gpg --generate-key --batch gpg-keygen-params.txt
pass init proton
/usr/bin/protonmail-bridge --cli
# TODO: login on cli
mkfifo input
sleep infinity > input &
$BRIDGE --cli < input &
bridge_pid=$!
echo "login" > input
echo "$BRIDGE_USER" > input
echo "$BRIDGE_PASS" > input
echo "info" > input
wait $!

View File

@ -20,5 +20,7 @@ nsjail -Mo
--bindmount_ro /etc/resolv.conf \
--env HOME=/home/proton \
--env PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin \
--env BRIDGE_USER \
--env BRIDGE_PASS \
-- ${BIN}