From ac55256b612a53b02afdeff5340266b6a6df0324 Mon Sep 17 00:00:00 2001 From: Simon Ungar Felding Date: Fri, 6 Dec 2024 13:45:31 +0100 Subject: [PATCH] fix restarts --- build/Dockerfile | 4 ++-- build/entrypoint.sh | 11 +++++------ 2 files changed, 7 insertions(+), 8 deletions(-) diff --git a/build/Dockerfile b/build/Dockerfile index d995d47..2253a17 100644 --- a/build/Dockerfile +++ b/build/Dockerfile @@ -15,8 +15,8 @@ LABEL maintainer="Xiaonan Shen " EXPOSE 25/tcp EXPOSE 143/tcp -EXPOSE 1025/tcp -EXPOSE 1143/tcp +EXPOSE 2025/tcp +EXPOSE 2143/tcp # Install dependencies and protonmail bridge RUN apt-get update \ diff --git a/build/entrypoint.sh b/build/entrypoint.sh index 330c9e2..403ace6 100644 --- a/build/entrypoint.sh +++ b/build/entrypoint.sh @@ -19,6 +19,8 @@ if [[ $1 == init ]]; then /protonmail/proton-bridge --cli $@ else + # delete lock files if they exist - this can happen if the container is restarted forcefully + find $HOME -name "*.lock" -delete # socat will make the conn appear to come from 127.0.0.1 # ProtonMail Bridge currently expects that. @@ -28,13 +30,10 @@ else socat TCP-LISTEN:143,fork TCP:127.0.0.1:1143 & fi - socat TCP-LISTEN:1025,fork TCP:127.0.0.1:1025 & - socat TCP-LISTEN:1143,fork TCP:127.0.0.1:1143 & + socat TCP-LISTEN:2025,fork TCP:127.0.0.1:1025 & + socat TCP-LISTEN:2143,fork TCP:127.0.0.1:1143 & # Start protonmail - # Fake a terminal, so it does not quit because of EOF... - rm -f faketty - mkfifo faketty - cat faketty | /protonmail/proton-bridge --cli $@ + /protonmail/proton-bridge --noninteractive $@ fi