Secure gpg entrypoint

- enable gpg protection
- remove set -x to prevent logging password
- add checks to prevent re-initing pass and gpg
- present passphrase unlock via docker env variable
  - Note: gpg-agent will not expire gpg-present-passphrases
- fix deb CMD to ENTRYPOINT
This commit is contained in:
Echo Nar 2025-12-21 14:31:18 -06:00
parent 044ea2b034
commit c2e8b88188
No known key found for this signature in database
GPG key ID: 06D33D3795EB43AA
7 changed files with 75 additions and 39 deletions

View file

@ -34,10 +34,10 @@ tag | description
To initialize and add account to the bridge, run the following command.
```
docker run --rm -it -v protonmail:/root shenxn/protonmail-bridge init
docker run --rm -it -e KEYRING_PASSPHRASE='<your_passphrase>' -v protonmail:/root shenxn/protonmail-bridge init
```
If you want to use Docker Compose instead, you can create a copy of the provided example [docker-compose.yml](docker-compose.yml) file, modify it to suit your needs, and then run the following command:
If you want to use Docker Compose instead, you can create a copy of the provided example [docker-compose.yml](docker-compose.yml) file, modify it to suit your needs (making sure KEYRING_PASSPHRASE matches what was used during intitialization), and then run the following command:
```
docker compose run protonmail-bridge init
@ -50,7 +50,7 @@ Wait for the bridge to startup, then you will see a prompt appear for [Proton Ma
To run the container, use the following command.
```
docker run -d --name=protonmail-bridge -v protonmail:/root -p 1025:25/tcp -p 1143:143/tcp --restart=unless-stopped shenxn/protonmail-bridge
docker run -d --name=protonmail-bridge -e KEYRING_PASSPHRASE='<your_passphrase>' -v protonmail:/root -p 1025:25/tcp -p 1143:143/tcp --restart=unless-stopped shenxn/protonmail-bridge
```
Or, if using Docker Compose, use the following command.
@ -70,7 +70,7 @@ If you don't want to use Helm, you can also reference to the guide ([#6](https:/
Please be aware that running the command above will expose your bridge to the network. Remember to use firewall if you are going to run this in an untrusted network or on a machine that has public IP address. You can also use the following command to publish the port to only localhost, which is the same behavior as the official bridge package.
```
docker run -d --name=protonmail-bridge -v protonmail:/root -p 127.0.0.1:1025:25/tcp -p 127.0.0.1:1143:143/tcp --restart=unless-stopped shenxn/protonmail-bridge
docker run -d --name=protonmail-bridge -e KEYRING_PASSPHRASE='<your_passphrase>' -v protonmail:/root -p 127.0.0.1:1025:25/tcp -p 127.0.0.1:1143:143/tcp --restart=unless-stopped shenxn/protonmail-bridge
```
Besides, you can publish only port 25 (SMTP) if you don't need to receive any email (e.g. as a email notification service).