66 Commits

Author SHA1 Message Date
GitHub Actions
044ea2b034 Bump version to v3.21.2 2025-07-23 00:21:43 +00:00
GitHub Actions
b643ecf9b6 Bump version to v3.21.1 2025-06-19 00:20:36 +00:00
GitHub Actions
e788a0098e Bump version to v3.20.0 2025-05-16 00:20:00 +00:00
Simon Ungar Felding
4c7b9b9a8c fix version 2025-04-25 09:47:00 +02:00
Simon Ungar Felding
6b4a3e23a8 fix based on https://stackoverflow.com/questions/75521775/buildx-docker-image-claims-to-be-a-manifest-list 2025-04-25 00:20:40 +02:00
Simon Ungar Felding
e67c6cb97a fix push by digest 2025-04-24 23:36:08 +02:00
Simon Ungar Felding
84b7a76320 fix tags 2025-04-24 23:29:50 +02:00
Simon Ungar Felding
7e1b2d7104 fix build tags 2025-04-24 23:26:11 +02:00
Simon Ungar Felding
89d488b2fb fix build password 2025-04-24 23:11:47 +02:00
simonfelding
4ccd39856a improve build readability and speed (by parallelization) (#117) 2025-04-24 23:03:50 +02:00
GitHub Actions
540ba69528 Bump deb version to 3.19.0-1 2025-04-02 00:18:53 +00:00
GitHub Actions
546f813ea4 Bump build version to 3.19.0 2025-03-19 00:18:37 +00:00
GitHub Actions
794e58400a Bump deb version to 3.18.0-1 2025-03-07 00:17:55 +00:00
GitHub Actions
2bd42d97ca Bump build version to 3.18.0 2025-02-28 00:17:35 +00:00
GitHub Actions
c87479ac51 Bump deb version to 3.17.0-1 2025-02-20 00:17:27 +00:00
schklom
8ffef34853 Build when deb/* changes (#97)
The build calls to Protonmail's repo and builds from it. When that repo
changes (i.e. when deb/* changes), the image should be built again.

---------

Co-authored-by: Simon Ungar Felding <45149055+simonfelding@users.noreply.github.com>
2025-02-17 13:03:56 +01:00
simonfelding
2745c6eb57 deb build: make sure it has the necessary tools (#116) 2025-02-17 10:15:22 +01:00
simonfelding
d00645ffcc add vaulteditor and fix build on arm (#114)
first working build for a long time
2025-02-15 19:38:15 +01:00
simonfelding
a19458f703 fix builds by switching base layer to debian:sid-slim
tested locally, works fine.
debian has supported riscv64 in the sid image for some time.

this is the same thing the carlosedp/golang image did.

this also fixes the bug with the wrong glibc version, as the build
container now uses the same glibc version as the final container.
2025-02-15 17:07:15 +01:00
GitHub Actions
d2828adae6 Bump build version to 3.17.0 2025-02-14 00:17:18 +00:00
GitHub Actions
3d628a35e3 Bump deb version to 3.16.0-1 2025-02-14 00:17:17 +00:00
GitHub Actions
718ccfacc2 Bump build version to 3.20.12 2025-02-13 00:17:18 +00:00
GitHub Actions
6d4c8eee6c Bump deb version to 3.17.0-1 2025-02-11 00:17:05 +00:00
GitHub Actions
1cd0a1e01a Bump build version to 3.17.0 2025-01-30 00:16:31 +00:00
GitHub Actions
a92c7d34d6 Bump deb version to 3.16.0-1 2025-01-15 00:16:57 +00:00
GitHub Actions
c7cef79482 Bump build version to 3.16.0 2024-12-18 00:18:00 +00:00
GitHub Actions
7090760703 Bump deb version to 3.15.1-1 2024-12-12 00:18:23 +00:00
GitHub Actions
11cf98c1f4 Bump build version to 3.15.1 2024-12-06 00:18:35 +00:00
GitHub Actions
69fd67721a Bump deb version to 3.15.0-1 2024-11-26 00:18:12 +00:00
GitHub Actions
abf6dd9055 Bump build version to 3.15.0 2024-11-14 00:16:51 +00:00
GitHub Actions
363cef56c2 Bump deb version to 3.14.0-1 2024-10-23 00:16:59 +00:00
GitHub Actions
63e7e3098e Bump build version to 3.14.0 2024-10-01 00:18:58 +00:00
GitHub Actions
64b50d7e24 Bump build version to 3.13.0 2024-09-11 00:15:41 +00:00
GitHub Actions
f3da872c45 Bump deb version to 3.12.0-1 2024-07-03 00:14:31 +00:00
GitHub Actions
48717095db Bump build version to 3.12.0 2024-06-20 00:13:45 +00:00
GitHub Actions
8d820748ee Bump deb version to 3.11.1-1 2024-05-24 00:14:19 +00:00
GitHub Actions
471a00b96b Bump build version to 3.11.1 2024-05-22 00:13:26 +00:00
GitHub Actions
9b21cf69f1 Bump deb version to 3.11.0-1 2024-05-14 00:13:49 +00:00
GitHub Actions
3aee9f2e4a Bump build version to 3.11.0 2024-04-30 00:12:59 +00:00
GitHub Actions
3be7e930d9 Bump deb version to 3.10.0-1 2024-03-22 00:12:48 +00:00
GitHub Actions
47e204b047 Bump build version to 3.10.0 2024-03-13 00:12:46 +00:00
GitHub Actions
5b52d7c9aa Bump deb version to 3.9.1-1 2024-02-22 00:12:28 +00:00
GitHub Actions
bc9f21fa87 Bump build version to 3.9.1 2024-02-13 00:13:22 +00:00
Mark Monteiro
9d2bf07c78 Improve Docker Compose documentation and example (#95)
- Clean up the example `docker-compose.yml` file by removing unnecessary
configuration/comments and add missing volume declaration
- Update the project README.md with instructions on how to use the
project with Docker Compose
2024-02-08 11:06:43 +08:00
GitHub Actions
2ac707c0c3 Bump deb version to 3.8.2-1 2024-02-03 00:12:59 +00:00
GitHub Actions
64495cd318 Bump build version to 3.9.0 2024-02-01 00:13:28 +00:00
GitHub Actions
1a8b879f90 Bump deb version to 3.8.1-1 2024-01-13 00:13:25 +00:00
GitHub Actions
ca1fd017f0 Bump build version to 3.8.1 2023-12-13 00:13:09 +00:00
GitHub Actions
a1afacb63a Bump build version to 3.8.0 2023-12-12 00:13:22 +00:00
GitHub Actions
47e04a9690 Bump deb version to 3.7.1-1 2023-12-07 00:13:08 +00:00
GitHub Actions
5d94313662 Bump build version to 3.7.1 2023-11-23 00:13:20 +00:00
GitHub Actions
5fd66d65ef Bump build version to 3.7.0 2023-11-15 00:13:09 +00:00
GitHub Actions
43f5b98e9d Bump deb version to 3.6.1-2 2023-11-02 00:12:21 +00:00
GitHub Actions
0d0808a6cd Bump build version to 3.6.1 2023-10-21 00:12:01 +00:00
GitHub Actions
ad930ab89f Bump deb version to 3.5.4-1 2023-10-20 00:12:26 +00:00
GitHub Actions
1fe6a19bd5 Bump build version to 3.6.0 2023-10-18 00:12:28 +00:00
GitHub Actions
fc7540d86f Bump build version to 3.5.3 2023-10-13 00:12:40 +00:00
GitHub Actions
9fb8bc7aae Bump deb version to 3.5.3-1 2023-10-13 00:12:39 +00:00
GitHub Actions
e782f3fca6 Bump build version to 3.5.2 2023-10-11 00:12:13 +00:00
GitHub Actions
28068b7451 Bump deb version to 3.4.2-1 2023-10-07 00:12:24 +00:00
GitHub Actions
a262d3381a Bump deb version to 3.5.1-1 2023-10-05 00:12:20 +00:00
GitHub Actions
33196176b6 Bump build version to 3.5.1 2023-09-29 00:12:21 +00:00
GitHub Actions
7358ead1c0 Bump deb version to 3.4.2-1 2023-09-26 00:12:28 +00:00
GitHub Actions
b764f02f7a Bump build version to 3.5.0 2023-09-15 00:12:17 +00:00
GitHub Actions
3b069e5899 Bump build version to 3.4.2 2023-09-05 00:11:36 +00:00
GitHub Actions
1423a659e1 Bump build version to 3.4.1 2023-08-15 00:11:45 +00:00
17 changed files with 292 additions and 274 deletions

View File

@@ -1,57 +0,0 @@
kind: pipeline
type: docker
name: docker-build
steps:
- name: build
image: plugins/docker
settings:
registry: git.jvalver.de
username:
from_secret: username
password:
from_secret: password
repo: git.jvalver.de/thilawyn/protonmail-bridge-docker
dockerfile: build/Dockerfile
dry_run: true
context: build
autotag: true
compress: true
platform: linux/amd64
trigger:
event:
exclude:
- tag
branch:
exclude:
- master
---
kind: pipeline
type: docker
name: docker-build-and-publish
steps:
- name: build-and-publish
image: plugins/docker
settings:
registry: git.jvalver.de
username:
from_secret: username
password:
from_secret: password
repo: git.jvalver.de/thilawyn/protonmail-bridge-docker
dockerfile: build/Dockerfile
context: build
autotag: true
compress: true
platform: linux/amd64
trigger:
event:
exclude:
- pull_request
branch:
- master

View File

@@ -2,91 +2,231 @@ name: build from source
on:
push:
branches:
- master
- dev
paths:
- .github/workflows/build.yaml
- build/*
- VERSION
pull_request:
paths:
- .github/workflows/build.yaml
- build/*
workflow_dispatch:
env:
DOCKER_REPO: shenxn/protonmail-bridge
DOCKER_REPO_DEV: ghcr.io/shenxn/protonmail-bridge-dev
GHCR_REPO: shenxn/protonmail-bridge-docker
DOCKERHUB_REPO: shenxn/protonmail-bridge
DOCKER_REPO_DEV: ghcr.io/shenxn/protonmail-bridge
PLATFORMS: linux/amd64,linux/arm64/v8,linux/arm/v7,linux/riscv64
jobs:
build:
test:
runs-on: ubuntu-latest
services:
registry:
image: registry:2
ports:
- 5000:5000
if: github.ref != 'refs/heads/master'
steps:
- name: Checkout
uses: actions/checkout@master
- name: Set version
id: version
run: echo "::set-output name=version::`cat build/VERSION`"
- name: Set repo
id: repo
run: if [[ $GITHUB_REF == "refs/heads/master" ]]; then echo "::set-output name=repo::${DOCKER_REPO}"; else echo "::set-output name=repo::${DOCKER_REPO_DEV}"; fi
run: echo "version=`cat VERSION`" >> $GITHUB_ENV
- name: Docker meta
id: docker_meta
uses: crazy-max/ghaction-docker-meta@v1
id: meta
uses: docker/metadata-action@v5
with:
images: ${{ steps.repo.outputs.repo }}
- name: Set up QEMU
uses: docker/setup-qemu-action@v1
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
with:
driver-opts: network=host
- name: Build image without push to registry
uses: docker/build-push-action@v2
with:
context: ./build
file: ./build/Dockerfile
platforms: ${{ env.PLATFORMS }}
push: true
tags: localhost:5000/protonmail-bridge:latest
- name: Scan image
id: scan
uses: anchore/scan-action@v2
with:
image: localhost:5000/protonmail-bridge:latest
fail-build: true
severity-cutoff: critical
acs-report-enable: true
- name: Upload Anchore scan SARIF report
uses: github/codeql-action/upload-sarif@v1
with:
sarif_file: ${{ steps.scan.outputs.sarif }}
- name: Login to DockerHub
uses: docker/login-action@v1
if: ${{ github.event_name != 'pull_request' && github.ref == 'refs/heads/master' }}
with:
username: ${{ secrets.REGISTRY_USERNAME }}
password: ${{ secrets.REGISTRY_PASSWORD }}
- name: Login to GitHub Container Registry
uses: docker/login-action@v1
if: ${{ github.event_name != 'pull_request' && github.ref == 'refs/heads/dev' }}
images: |
${{ env.DOCKER_REPO_DEV }}
- name: Login to GHCR
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.CR_PAT }}
- name: Push image
uses: docker/build-push-action@v2
password: ${{ secrets.GITHUB_TOKEN }}
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
with:
driver-opts: network=host
- name: Build and push by digest
id: build
uses: docker/build-push-action@v6
with:
labels: ${{ steps.meta.outputs.labels }}
outputs: type=image,"name=${{ env.DOCKER_REPO_DEV }}",push-by-digest=false,name-canonical=true,push=true
context: ./build
file: ./build/Dockerfile
tags: "${{ env.DOCKER_REPO_DEV }}:dev-${{ github.ref_name }}"
build-args: |
version=${{ env.version }}
- name: Run Trivy vulnerability scan
uses: aquasecurity/trivy-action@0.30.0
with:
image-ref: "${{ env.DOCKER_REPO_DEV }}:dev-${{ github.ref_name }}"
format: 'sarif'
exit-code: 0
severity: 'CRITICAL,HIGH'
output: 'trivy-results.sarif'
- name: Upload Trivy scan SARIF report
uses: github/codeql-action/upload-sarif@v3
with:
sarif_file: 'trivy-results.sarif'
build:
runs-on: ubuntu-latest
if: github.event_name == 'push' && github.ref == 'refs/heads/master'
strategy:
fail-fast: false
matrix:
platform:
- linux/amd64
- linux/arm64/v8
- linux/arm/v7
- linux/riscv64
steps:
- name: Checkout
uses: actions/checkout@master
- name: Prepare
run: |
platform=${{ matrix.platform }}
echo "PLATFORM_PAIR=${platform//\//-}" >> $GITHUB_ENV
- name: Set version
id: version
run: echo "version=`cat VERSION`" >> $GITHUB_ENV
- name: Docker meta
id: meta
uses: docker/metadata-action@v5
with:
images: |
${{ env.DOCKERHUB_REPO }}
${{ env.GHCR_REPO }}
- name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.REGISTRY_USERNAME }}
password: ${{ secrets.REGISTRY_PASSWORD }}
- name: Login to GHCR
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Build and push by digest
id: build
uses: docker/build-push-action@v6
with:
platforms: ${{ matrix.platform }}
labels: ${{ steps.meta.outputs.labels }}
outputs: type=image,"name=name=${{ env.DOCKERHUB_REPO }},${{ env.GHCR_REPO }}",push-by-digest=true,name-canonical=true,push=false
context: ./build
file: ./build/Dockerfile
platforms: ${{ env.PLATFORMS }}
tags: |
${{ steps.repo.outputs.repo }}:build
${{ steps.repo.outputs.repo }}:${{ steps.version.outputs.version }}-build
labels: ${{ steps.docker_meta.outputs.labels }}
push: ${{ github.event_name != 'pull_request' }}
"${{ env.DOCKERHUB_REPO }}:build"
"${{ env.DOCKERHUB_REPO }}:${{ env.version }}-build"
"${{ env.GHCR_REPO }}:build"
"${{ env.GHCR_REPO }}:${{ env.version }}-build"
provenance: false
sbom: false
build-args: |
version=${{ env.version }}
- name: Export digest
run: |
mkdir -p ${{ runner.temp }}/digests
digest="${{ steps.build.outputs.digest }}"
touch "${{ runner.temp }}/digests/${digest#sha256:}"
- name: Upload digest
uses: actions/upload-artifact@v4
with:
name: digests-${{ env.PLATFORM_PAIR }}
path: ${{ runner.temp }}/digests/*
if-no-files-found: error
retention-days: 1
merge:
runs-on: ubuntu-latest
needs:
- build
steps:
- name: Download digests
uses: actions/download-artifact@v4
with:
path: ${{ runner.temp }}/digests
pattern: digests-*
merge-multiple: true
- name: Set version
id: version
run: echo "version=`cat VERSION`" >> $GITHUB_ENV
- name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.REGISTRY_USERNAME }}
password: ${{ secrets.REGISTRY_PASSWORD }}
- name: Login to GHCR
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
with:
driver-opts: network=host
- name: Docker meta
id: meta
uses: docker/metadata-action@v5
with:
images: |
${{ env.DOCKERHUB_REPO }}
${{ env.GHCR_REPO }}
tags: |
type=raw,enable=true,value=${{ env.version }}-build
type=raw,enable=true,suffix=,value=build
- name: Create manifest list and push
working-directory: ${{ runner.temp }}/digests
run: |
docker buildx imagetools create $(jq -cr '.tags | map("-t " + .) | join(" ")' <<< "$DOCKER_METADATA_OUTPUT_JSON") \
$(printf '${{ env.DOCKERHUB_REPO }}@sha256:%s ' *)
docker buildx imagetools create $(jq -cr '.tags | map("-t " + .) | join(" ")' <<< "$DOCKER_METADATA_OUTPUT_JSON") \
$(printf '${{ env.GHCR_REPO }}@sha256:%s ' *)
- name: Run Trivy vulnerability scan
uses: aquasecurity/trivy-action@0.30.0
with:
image-ref: "${{ env.DOCKERHUB_REPO }}:${{ env.version }}-build"
format: 'sarif'
exit-code: 0
severity: 'CRITICAL,HIGH'
output: 'trivy-results.sarif'
- name: Upload Trivy scan SARIF report
uses: github/codeql-action/upload-sarif@v3
with:
sarif_file: 'trivy-results.sarif'
- name: Inspect image
run: |
docker buildx imagetools inspect ${{ env.DOCKERHUB_REPO }}:${{ steps.meta.outputs.version }}
docker buildx imagetools inspect ${{ env.GHCR_REPO }}:${{ steps.meta.outputs.version }}

View File

@@ -2,16 +2,15 @@ name: pack from deb
on:
push:
branches:
- master
- dev
paths:
- .github/workflows/deb.yaml
- deb/*
- VERSION
pull_request:
paths:
- .github/workflows/deb.yaml
- deb/*
workflow_dispatch:
env:
DOCKER_REPO: shenxn/protonmail-bridge
@@ -25,7 +24,7 @@ jobs:
uses: actions/checkout@master
- name: Set version
id: version
run: echo "::set-output name=version::`cat deb/VERSION`"
run: echo "version=`cat VERSION`" >> $GITHUB_ENV
- name: Set repo
id: repo
run: if [[ $GITHUB_REF == "refs/heads/master" ]]; then echo "::set-output name=repo::${DOCKER_REPO}"; else echo "::set-output name=repo::${DOCKER_REPO_DEV}"; fi
@@ -52,18 +51,18 @@ jobs:
severity-cutoff: critical
acs-report-enable: true
- name: Upload Anchore scan SARIF report
uses: github/codeql-action/upload-sarif@v1
uses: github/codeql-action/upload-sarif@v3
with:
sarif_file: ${{ steps.scan.outputs.sarif }}
- name: Login to DockerHub
uses: docker/login-action@v1
if: ${{ github.event_name != 'pull_request' && github.ref == 'refs/heads/master' }}
if: ${{ github.event_name != 'pull_request' }}
with:
username: ${{ secrets.REGISTRY_USERNAME }}
password: ${{ secrets.REGISTRY_PASSWORD }}
- name: Login to GitHub Container Registry
uses: docker/login-action@v1
if: ${{ github.event_name != 'pull_request' && github.ref == 'refs/heads/dev' }}
if: ${{ github.event_name != 'pull_request' }}
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
@@ -75,6 +74,6 @@ jobs:
file: ./deb/Dockerfile
tags: |
${{ steps.repo.outputs.repo }}:latest
${{ steps.repo.outputs.repo }}:${{ steps.version.outputs.version }}
${{ steps.repo.outputs.repo }}:${{ env.version }}
labels: ${{ steps.docker_meta.outputs.labels }}
push: ${{ github.event_name != 'pull_request' }}

View File

@@ -2,9 +2,6 @@ name: update check
on:
push:
branches:
- master
- dev
paths:
- .github/workflows/update-check.yaml
- update-check.py

View File

@@ -37,7 +37,13 @@ To initialize and add account to the bridge, run the following command.
docker run --rm -it -v protonmail:/root 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.
If you want to use Docker Compose instead, you can create a copy of the provided example [docker-compose.yml](docker-compose.yml) file, modify it to suit your needs, and then run the following command:
```
docker compose run protonmail-bridge init
```
Wait for the bridge to startup, then you will see a prompt appear for [Proton Mail Bridge interactive shell](https://proton.me/support/bridge-cli-guide). Use the `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.
## Run
@@ -47,6 +53,12 @@ To run the container, use the following command.
docker run -d --name=protonmail-bridge -v protonmail:/root -p 1025:25/tcp -p 1143:143/tcp --restart=unless-stopped shenxn/protonmail-bridge
```
Or, if using Docker Compose, use the following command.
```
docker compose up -d
```
## Kubernetes
If you want to run this image in a Kubernetes environment. You can use the [Helm](https://helm.sh/) chart (https://github.com/k8s-at-home/charts/tree/master/charts/stable/protonmail-bridge) created by [@Eagleman7](https://github.com/Eagleman7). More details can be found in [#23](https://github.com/shenxn/protonmail-bridge-docker/issues/23).

1
VERSION Normal file
View File

@@ -0,0 +1 @@
v3.21.2

View File

@@ -1,8 +0,0 @@
*
!.dockerignore
!VERSION
!entrypoint.sh
!gpgparams
!Dockerfile
!build.sh

View File

@@ -1,15 +1,18 @@
FROM golang:1.20-bookworm AS build
# The build image could be golang, but it currently does not support riscv64. Only debian:sid does, at the time of writing.
FROM debian:sid-slim AS build
ARG version
# Install dependencies
RUN apt-get update && apt-get install -y git build-essential libsecret-1-dev
RUN apt-get update && apt-get install -y golang build-essential libsecret-1-dev
# Build
ADD https://github.com/ProtonMail/proton-bridge.git#${version} /build/
WORKDIR /build/
COPY build.sh VERSION /build/
RUN bash build.sh
RUN make build-nogui vault-editor
FROM ubuntu:jammy
LABEL maintainer="Xiaonan Shen <s@sxn.dev>"
FROM debian:sid-slim
LABEL maintainer="Simon Felding <sife@adm.ku.dk>"
EXPOSE 25/tcp
EXPOSE 143/tcp
@@ -23,7 +26,8 @@ RUN apt-get update \
COPY gpgparams entrypoint.sh /protonmail/
# Copy protonmail
COPY --from=build /build/proton-bridge/bridge /protonmail/
COPY --from=build /build/proton-bridge/proton-bridge /protonmail/
COPY --from=build /build/bridge /protonmail/
COPY --from=build /build/proton-bridge /protonmail/
COPY --from=build /build/vault-editor /protonmail/
ENTRYPOINT ["bash", "/protonmail/entrypoint.sh"]

View File

@@ -1 +0,0 @@
3.4.0

View File

@@ -1,23 +0,0 @@
#!/bin/bash
set -ex
VERSION=`cat VERSION`
# Clone new code
git clone https://github.com/ProtonMail/proton-bridge.git
cd proton-bridge
git checkout v$VERSION
ARCH=$(uname -m)
if [[ $ARCH == "armv7l" ]] ; then
# This is expected to fail, and we use the following patch to fix
make build-nogui || true
# For 32bit architectures, there was a overflow error on the parser
# This is a workaround for this problem found at:
# https://github.com/antlr/antlr4/issues/2433#issuecomment-774514106
find $(go env GOPATH)/pkg/mod/github.com/\!proton\!mail/go-rfc5322*/ -type f -exec sed -i.bak 's/(1<</(int64(1)<</g' {} +
fi
# Build
make build-nogui

View File

@@ -1,8 +0,0 @@
*
!.dockerignore
!VERSION
!entrypoint.sh
!install.sh
!gpgparams
!Dockerfile

View File

@@ -1,5 +1,16 @@
FROM ubuntu:jammy
LABEL maintainer="Xiaonan Shen <s@sxn.dev>"
### The Deb install is just a repack of the official ProtonMail Bridge deb package with less dependencies.
### I recommend you don't use this. It's here for legacy reasons.
FROM debian:sid-slim AS build
COPY install.sh PACKAGE /
RUN apt-get update && apt-get install -y wget binutils
# Repack deb (removes unnecessary dependencies and produces /protonmail.deb)
RUN bash /install.sh
FROM debian:sid-slim
LABEL maintainer="Simon Felding <sife@adm.ku.dk>"
EXPOSE 25/tcp
EXPOSE 143/tcp
@@ -7,9 +18,11 @@ EXPOSE 143/tcp
WORKDIR /protonmail
# Copy bash scripts
COPY gpgparams install.sh entrypoint.sh VERSION /protonmail/
COPY gpgparams entrypoint.sh PACKAGE /protonmail/
COPY --from=build /protonmail.deb /tmp/protonmail.deb
# Install dependencies and protonmail bridge
RUN bash install.sh
RUN apt-get update \
&& apt-get install -y --no-install-recommends /tmp/protonmail.deb socat pass libsecret-1-0 ca-certificates procps \
&& rm -rf /var/lib/apt/lists/*
ENTRYPOINT ["bash", "/protonmail/entrypoint.sh"]
CMD ["bash", "/protonmail/entrypoint.sh"]

1
deb/PACKAGE Normal file
View File

@@ -0,0 +1 @@
https://github.com/ProtonMail/proton-bridge/releases/download/v3.21.2/protonmail-bridge_3.21.2-1_amd64.deb

View File

@@ -1 +0,0 @@
3.3.2-1

View File

@@ -1,36 +1,16 @@
#!/bin/bash
set -ex
VERSION=`cat VERSION`
DEB_FILE=protonmail-bridge_${VERSION}_amd64.deb
# Install dependents
apt-get update
apt-get install -y --no-install-recommends socat pass ca-certificates
# Build time dependencies
apt-get install -y wget binutils xz-utils
# Repack deb (remove unnecessary dependencies)
mkdir deb
wget -i /PACKAGE -O /deb/protonmail.deb
cd deb
wget -q https://protonmail.com/download/bridge/${DEB_FILE}
ar x -v ${DEB_FILE}
ar x -v protonmail.deb
mkdir control
tar zxvf control.tar.gz -C control
sed -i "s/^Depends: .*$/Depends: libgl1, libc6, libsecret-1-0, libstdc++6, libgcc1/" control/control
cd control
tar zcvf ../control.tar.gz .
cd ../
ar rcs -v ${DEB_FILE} debian-binary control.tar.gz data.tar.gz
cd ../
# Install protonmail bridge
apt-get install -y --no-install-recommends ./deb/${DEB_FILE}
# Cleanup
apt-get purge -y wget binutils xz-utils
apt-get autoremove -y
rm -rf /var/lib/apt/lists/*
rm -rf deb
ar rcs -v /protonmail.deb debian-binary control.tar.gz data.tar.gz

View File

@@ -3,16 +3,12 @@ version: '2.1'
services:
protonmail-bridge:
image: shenxn/protonmail-bridge
# build:
# context: ./build
# dockerfile: Dockerfile
container_name: pm_bridge
ports:
- 1025:25/tcp
- 1143:143/tcp
restart: unless-stopped
stdin_open: true
tty: true
volumes:
- protonmail:/root
volumes:
protonmail:
name: protonmail

View File

@@ -1,64 +1,37 @@
import sys
import os
import requests
import json
import re
import requests, os, sys
def git(command):
return os.system(f"git {command}")
release = requests.get("https://api.github.com/repos/protonmail/proton-bridge/releases/latest").json()
version = release['tag_name']
deb = [asset for asset in release ['assets'] if asset['name'].endswith('.deb')][0]['browser_download_url']
print(f"Latest release is: {version}")
with open("VERSION", 'w') as f:
f.write(version)
with open("deb/PACKAGE", 'w') as f:
f.write(deb)
git("config --local user.name 'GitHub Actions'")
git("config --local user.email 'actions@github.com'")
git("add -A")
if git("diff --cached --quiet") == 0: # Returns 0 if there are no changes
print("Version didn't change")
exit(0)
git(f"commit -m 'Bump version to {version}'")
is_pull_request = sys.argv[1] == "true"
print(f"is_pull_request={is_pull_request}")
if is_pull_request:
print("This is a pull request, skipping push step.")
exit(0)
def check_version(directory, new_version):
print(f"Checking version for {directory}")
if not new_version:
print("Failed to get new version. Exiting.")
if git("push") != 0:
print("Git push failed!")
exit(1)
with open(f"{directory}/VERSION", "r") as f:
old_version = f.read().rstrip()
print(f"Up-to-date version {new_version}")
print(f"Current version: {old_version}")
if old_version != new_version:
print(f"New release found: {new_version}")
# bump up to new release
with open(f"{directory}/VERSION", "w") as f:
f.write(new_version)
# commit
result = os.system(f"git config --local user.email 'actions@github.com' \
&& git config --local user.name 'GitHub Actions' \
&& git add {directory}/VERSION \
&& git commit -m 'Bump {directory} version to {new_version}'")
if result != 0:
print("Failed to commit the bump. Exiting")
exit(1)
if is_pull_request:
print("Action triggered by pull request. Do not push.")
else:
result = os.system("git push")
if result != 0:
print("Failed to push. Exiting")
exit(1)
else:
print(f"Already newest version {old_version}")
# check deb version
response = requests.get("https://protonmail.com/download/current_version_linux.json")
content = json.loads(response.content)
version = re.match(".*_([0-9.-]+)_amd64\.deb", content["DebFile"]).group(1)
check_version("deb", version)
# check build version
response = requests.get(
"https://api.github.com/repos/ProtonMail/proton-bridge/tags",
headers={"Accept": "application/vnd.github.v3+json"},
)
tags = json.loads(response.content)
version_re = re.compile("v\d+\.\d+\.\d+")
releases = [tag["name"][1:] for tag in tags if version_re.match(tag["name"])]
check_version("build", releases[0])