protonmail-bridge-docker
protonmail-bridge-docker copied to clipboard
Running `bash /protonmail/entrypoint.sh init` does not work with 1.6.3-1 on kubernetes
I'v had to remove my persistent storage a while ago. However with brand new storage with version 1.6.3-1 I cannot seem to get to the login option.
Once I am inside the pod/container and run this command:
bash /protonmail/entrypoint.sh init
This happens:
root@protonmail-bridge-7bf6f88599-tcmzq:/protonmail# bash /protonmail/entrypoint.sh init
+ [[ init == init ]]
+ gpg --generate-key --batch /protonmail/gpgparams
gpg: directory '/root/.gnupg' created
gpg: keybox '/root/.gnupg/pubring.kbx' created
gpg: Generating a basic OpenPGP key
gpg: /root/.gnupg/trustdb.gpg: trustdb created
gpg: key 3C8BADCA153A6FE2 marked as ultimately trusted
gpg: directory '/root/.gnupg/openpgp-revocs.d' created
gpg: revocation certificate stored as '/root/.gnupg/openpgp-revocs.d/D840F8CA6EBEA3A7E09402FD3C8BADCA153A6FE2.rev'
gpg: done
+ pass init pass-key
mkdir: created directory '/root/.password-store/'
Password store initialized for pass-key
+ protonmail-bridge --cli
root@protonmail-bridge-7bf6f88599-tcmzq:/protonmail#
Try running protonmail-bridge --cli
directly.
I found the problem. In earlier versions (I've tested 1.5.4-1), starting the container without initializing pass will cause the bridge failed to start. Therefore, you can then get a bash environment, do the initialization, and start a bridge to set up. However, in more recent versions, the bridge does not check at boot so there will be a bridge running and thus you cannot start another one. I have almost zero experience in kubernetes but I think you need to somehow change the entrypoint during initialization and setup. You can also add account use an older version and then update.
I had this exact same error. You should never call protonmail-bridge --cli
by itself, it relies on the socat port mappings to pretend the connection is coming from 127.0.0.1 and the fake terminal, which are created in entrypoint.sh before executing protonmail-bridge.
The solution: (On a new container)
-
Call
./entrypoint.sh init
(make it executable before withchmod +x entrypoint.sh
) -
Go in
top
and look up the process id's of the two protonmail processes.(Here 11 and 17)
-
Kill them. (In my case
kill 11 17
) -
Execute
./entrypoint.sh
(without init). -
Now you can use the protonmail-bridge CLI like normal. For example to
login
andinfo
to get your password. -
Restart the container just to make sure it works every time now.