This commit is contained in:
d3vnu1l 2025-01-03 16:47:52 -08:00
parent c7cef79482
commit a0e993c0cc
4 changed files with 23 additions and 22 deletions

View File

@ -1,29 +1,28 @@
# Use carlosedp/golang for riscv64 support
FROM carlosedp/golang:1.18 AS build
FROM golang:1.23 AS build
# Install dependencies
RUN apt-get update && apt-get install -y git build-essential libsecret-1-dev
# Install build dependencies
RUN apt-get update \
&& apt-get install -y --no-install-recommends git build-essential libsecret-1-dev
# Build
WORKDIR /build/
COPY build.sh VERSION /build/
RUN bash build.sh
FROM ubuntu:jammy
LABEL maintainer="Xiaonan Shen <s@sxn.dev>"
FROM debian:bookworm
LABEL maintainer="Ryan Deushane <radeushane@gmail.com>"
EXPOSE 25/tcp
EXPOSE 143/tcp
EXPOSE 25/tcp 143/tcp
# Install dependencies and protonmail bridge
# Install dependencies
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/*
# Copy bash scripts
COPY gpgparams entrypoint.sh /protonmail/
# Copy protonmail
# Install protonmail
COPY --from=build /build/proton-bridge/bridge /protonmail/
COPY --from=build /build/proton-bridge/proton-bridge /protonmail/

View File

@ -1 +1 @@
3.16.0
3.15.1

View File

@ -1,13 +1,11 @@
#!/bin/bash
set -ex
set -eoux pipefail
VERSION=`cat VERSION`
# 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
git checkout v$VERSION
ARCH=$(uname -m)
if [[ $ARCH == "armv7l" ]] ; then

View File

@ -1,10 +1,8 @@
#!/bin/bash
set -ex
set -eoux pipefail
# Initialize
if [[ $1 == init ]]; then
if [[ "${1:-}" == "init" ]]; then
# Initialize pass
gpg --generate-key --batch /protonmail/gpgparams
pass init pass-key
@ -17,9 +15,16 @@ if [[ $1 == init ]]; then
# Login
/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
# socat will make the conn appear to come from 127.0.0.1
# ProtonMail Bridge currently expects that.
# It also allows us to bind to the real ports :)
@ -31,5 +36,4 @@ else
rm -f faketty
mkfifo faketty
cat faketty | /protonmail/proton-bridge --cli $@
fi