mirror of
https://github.com/shenxn/protonmail-bridge-docker.git
synced 2025-12-06 08:27:08 +00:00
fixes
This commit is contained in:
parent
c7cef79482
commit
a0e993c0cc
@ -1,29 +1,28 @@
|
|||||||
# Use carlosedp/golang for riscv64 support
|
FROM golang:1.23 AS build
|
||||||
FROM carlosedp/golang:1.18 AS build
|
|
||||||
|
|
||||||
# Install dependencies
|
# Install build dependencies
|
||||||
RUN apt-get update && apt-get install -y git build-essential libsecret-1-dev
|
RUN apt-get update \
|
||||||
|
&& apt-get install -y --no-install-recommends git build-essential libsecret-1-dev
|
||||||
|
|
||||||
# Build
|
# Build
|
||||||
WORKDIR /build/
|
WORKDIR /build/
|
||||||
COPY build.sh VERSION /build/
|
COPY build.sh VERSION /build/
|
||||||
RUN bash build.sh
|
RUN bash build.sh
|
||||||
|
|
||||||
FROM ubuntu:jammy
|
FROM debian:bookworm
|
||||||
LABEL maintainer="Xiaonan Shen <s@sxn.dev>"
|
LABEL maintainer="Ryan Deushane <radeushane@gmail.com>"
|
||||||
|
|
||||||
EXPOSE 25/tcp
|
EXPOSE 25/tcp 143/tcp
|
||||||
EXPOSE 143/tcp
|
|
||||||
|
|
||||||
# Install dependencies and protonmail bridge
|
# Install dependencies
|
||||||
RUN apt-get update \
|
RUN apt-get update \
|
||||||
&& apt-get install -y --no-install-recommends socat pass libsecret-1-0 ca-certificates \
|
&& apt-get install -y --no-install-recommends socat pass procps libsecret-1-0 ca-certificates \
|
||||||
&& rm -rf /var/lib/apt/lists/*
|
&& rm -rf /var/lib/apt/lists/*
|
||||||
|
|
||||||
# Copy bash scripts
|
# Copy bash scripts
|
||||||
COPY gpgparams entrypoint.sh /protonmail/
|
COPY gpgparams entrypoint.sh /protonmail/
|
||||||
|
|
||||||
# Copy protonmail
|
# Install protonmail
|
||||||
COPY --from=build /build/proton-bridge/bridge /protonmail/
|
COPY --from=build /build/proton-bridge/bridge /protonmail/
|
||||||
COPY --from=build /build/proton-bridge/proton-bridge /protonmail/
|
COPY --from=build /build/proton-bridge/proton-bridge /protonmail/
|
||||||
|
|
||||||
|
|||||||
@ -1 +1 @@
|
|||||||
3.16.0
|
3.15.1
|
||||||
@ -1,13 +1,11 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
set -eoux pipefail
|
||||||
set -ex
|
|
||||||
|
|
||||||
VERSION=`cat VERSION`
|
VERSION=`cat VERSION`
|
||||||
|
|
||||||
# Clone new code
|
# Clone new code
|
||||||
git clone https://github.com/ProtonMail/proton-bridge.git
|
git clone https://github.com/ProtonMail/proton-bridge.git --depth 1 --branch v$VERSION
|
||||||
cd proton-bridge
|
cd proton-bridge
|
||||||
git checkout v$VERSION
|
|
||||||
|
|
||||||
ARCH=$(uname -m)
|
ARCH=$(uname -m)
|
||||||
if [[ $ARCH == "armv7l" ]] ; then
|
if [[ $ARCH == "armv7l" ]] ; then
|
||||||
|
|||||||
@ -1,10 +1,8 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
set -eoux pipefail
|
||||||
set -ex
|
|
||||||
|
|
||||||
# Initialize
|
# Initialize
|
||||||
if [[ $1 == init ]]; then
|
if [[ "${1:-}" == "init" ]]; then
|
||||||
|
|
||||||
# Initialize pass
|
# Initialize pass
|
||||||
gpg --generate-key --batch /protonmail/gpgparams
|
gpg --generate-key --batch /protonmail/gpgparams
|
||||||
pass init pass-key
|
pass init pass-key
|
||||||
@ -17,9 +15,16 @@ if [[ $1 == init ]]; then
|
|||||||
|
|
||||||
# Login
|
# Login
|
||||||
/protonmail/proton-bridge --cli $@
|
/protonmail/proton-bridge --cli $@
|
||||||
|
elif [[ "${1:-}" == "cli" ]]; then
|
||||||
|
# Kill the other instance as only one can be running at a time.
|
||||||
|
# This allows users to run entrypoint init inside a running conainter
|
||||||
|
# which is useful in a k8s environment.
|
||||||
|
# || true to make sure this would not fail in case there is no running instance.
|
||||||
|
pkill protonmail-bridge || true
|
||||||
|
|
||||||
|
# Login
|
||||||
|
/protonmail/proton-bridge --cli $@
|
||||||
else
|
else
|
||||||
|
|
||||||
# socat will make the conn appear to come from 127.0.0.1
|
# socat will make the conn appear to come from 127.0.0.1
|
||||||
# ProtonMail Bridge currently expects that.
|
# ProtonMail Bridge currently expects that.
|
||||||
# It also allows us to bind to the real ports :)
|
# It also allows us to bind to the real ports :)
|
||||||
@ -31,5 +36,4 @@ else
|
|||||||
rm -f faketty
|
rm -f faketty
|
||||||
mkfifo faketty
|
mkfifo faketty
|
||||||
cat faketty | /protonmail/proton-bridge --cli $@
|
cat faketty | /protonmail/proton-bridge --cli $@
|
||||||
|
|
||||||
fi
|
fi
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user