diff --git a/build/Dockerfile b/build/Dockerfile index 1635773..4ce186e 100644 --- a/build/Dockerfile +++ b/build/Dockerfile @@ -29,7 +29,9 @@ RUN apk add --no-cache \ pass \ ca-certificates \ dbus \ - dbus-x11 + dbus-x11 \ + gnome-keyring \ + haveged # Copy bash scripts COPY gpgparams entrypoint.sh /protonmail/ diff --git a/build/entrypoint.sh b/build/entrypoint.sh index d64eb2a..160b7ca 100644 --- a/build/entrypoint.sh +++ b/build/entrypoint.sh @@ -1,18 +1,20 @@ #!/bin/bash set -ex -# Start DBus session for libsecret +# start entropy +haveged -w 1024 & + +# start dbus eval $(dbus-launch --sh-syntax) +# start secret service +export $(gnome-keyring-daemon --start --components=secrets) + +chmod 700 /root/.gnupg || true + # Initialize if [[ $1 == init ]]; then - - # Initialize pass gpg --generate-key --batch /protonmail/gpgparams - # Change Permission when Folder Exists - if [ -d "/root/.gnupg" ]; then - chmod 700 /root/.gnupg - fi KEY=$(gpg --list-secret-keys --with-colons | awk -F: '/^sec:/ {print $5; exit}') pass init "$KEY" @@ -23,19 +25,12 @@ if [[ $1 == init ]]; then # || true to make sure this would not fail in case there is no running instance. pkill protonmail-bridge || true - # Login + # Run any ProtonMail Bridge Command - Login proton-bridge --cli $@ - else - # Change Permission when Folder Exists - if [ -d "/root/.gnupg" ]; then - chmod 700 /root/.gnupg - fi - - # Start protonmail + # Start ProtonMail Bridge # Fake a terminal, so it does not quit because of EOF... rm -f faketty mkfifo faketty cat faketty | proton-bridge --cli $@ - fi