diff --git a/entrypoint.sh b/entrypoint.sh index 7719cae..419144e 100755 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -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 $! diff --git a/isolated-protonmail-bridge.sh b/isolated-protonmail-bridge.sh index f455707..19913d4 100755 --- a/isolated-protonmail-bridge.sh +++ b/isolated-protonmail-bridge.sh @@ -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}