diff --git a/README.md b/README.md index 8648f52..ea13d9f 100644 --- a/README.md +++ b/README.md @@ -47,7 +47,7 @@ There are two types of images. To initialize and add account to the bridge, run the following command. ```bash -docker run --rm -it -v protonmail:/root shenxn/protonmail-bridge init +docker run --rm -it -v protonmail:/home/protonmail shenxn/protonmail-bridge init ``` Wait for the bridge to startup, use `login` command and follow the instructions to add your account into the bridge. Then use `info` to see the configuration information (username and password). After that, use `exit` to exit the bridge. You may need `CTRL+C` to exit the docker entirely. @@ -59,7 +59,7 @@ __NOTE:__ If you have `PROTONMAIL_USERNAME` and `PROTONMAIL_PASSWORD` set for `d To run the container, use the following command. ```bash -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 -v protonmail:/home/protonmail -p 1025:25/tcp -p 1143:143/tcp --restart=unless-stopped shenxn/protonmail-bridge ``` ## Kubernetes @@ -73,7 +73,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. ```bash -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 -v protonmail:/home/protonmail -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). diff --git a/build/Dockerfile b/build/Dockerfile index 995751c..77926fb 100644 --- a/build/Dockerfile +++ b/build/Dockerfile @@ -28,4 +28,11 @@ COPY gpgparams entrypoint.sh login.exp /protonmail/ RUN chmod +x /protonmail/login.exp +# Add a user 'protonmail' with UID 8535 +RUN useradd -u 8535 -d /home/protonmail protonmail \ + && mkdir -p /home/protonmail \ + && chown protonmail: /home/protonmail +# change to non-privileged user for extra security +USER protonmail + ENTRYPOINT ["bash", "/protonmail/entrypoint.sh"] diff --git a/build/VERSION b/build/VERSION index fe4e75f..5af131d 100644 --- a/build/VERSION +++ b/build/VERSION @@ -1 +1 @@ -1.8.3 \ No newline at end of file +1.8.9 \ No newline at end of file diff --git a/build/entrypoint.sh b/build/entrypoint.sh index d767f77..3f4f653 100644 --- a/build/entrypoint.sh +++ b/build/entrypoint.sh @@ -2,6 +2,11 @@ set -ex +id +# Go to current user's homedir +cd +echo $PWD + # Initialize if [[ $1 == init ]]; then # set GNUPGHOME as a workaround for diff --git a/deb/VERSION b/deb/VERSION index 3a784b5..26ed364 100644 --- a/deb/VERSION +++ b/deb/VERSION @@ -1 +1 @@ -1.8.3-1 \ No newline at end of file +1.8.7-1 \ No newline at end of file