diff --git a/Dockerfile b/Dockerfile index bde0fb5..466edb5 100644 --- a/Dockerfile +++ b/Dockerfile @@ -6,7 +6,7 @@ WORKDIR /build/ RUN git clone --depth 1 --branch v3.9.1 https://github.com/ProtonMail/proton-bridge.git WORKDIR /build/proton-bridge -RUN sed -i 's/127.0.0.1/0.0.0.0/g' internal/constants/constants.go +RUN find . -type f -exec sed -i 's/127.0.0.1/0.0.0.0/g' {} + RUN make build-nogui @@ -16,7 +16,7 @@ EXPOSE 25/tcp EXPOSE 143/tcp RUN apt-get update \ - && apt-get install -y --no-install-recommends pass libsecret-1-0 ca-certificates \ + && apt-get install -y --no-install-recommends pass socat libsecret-1-0 ca-certificates \ && rm -rf /var/lib/apt/lists/* COPY gpgparams entrypoint.sh /protonmail/ diff --git a/entrypoint.sh b/entrypoint.sh index e3ac6ef..f4c1a81 100644 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -6,7 +6,11 @@ if [[ $1 == init ]]; then gpg --generate-key --batch /protonmail/gpgparams pass init pass-key pkill protonmail-bridge || true + /protonmail/proton-bridge --cli "$@" else - /protonmail/proton-bridge -n "$@" + socat TCP-LISTEN:25,fork TCP:127.0.0.1:1025 & + socat TCP-LISTEN:143,fork TCP:127.0.0.1:1143 & + + /protonmail/proton-bridge --cli "$@" fi