cleanup entrypoint.sh and add haveged for getentropy
Build and Push Docker Container / build-and-push (push) Successful in 5m50s
Build and Push Docker Container / build-and-push (push) Successful in 5m50s
This commit is contained in:
+3
-1
@@ -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/
|
||||
|
||||
+11
-16
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user