47 Commits

Author SHA1 Message Date
Xiaonan Shen 5c7c5c50c6 temp x 2023-02-24 23:23:56 +08:00
Xiaonan Shen bea37a8aa9 Multi arch build 2023-01-14 17:11:58 +08:00
Xiaonan Shen 5284ee3425 Build locally 2023-01-14 16:55:13 +08:00
Daniel Nathan Gray 89b3ef69f4 Rebase on Jammy (#71)
If you're going to build v3 you need to have Jammy, or you will get
glibc errors
2023-01-14 14:56:03 +08:00
GitHub Actions 04a2fae963 Bump build version to 3.0.9 2022-12-21 00:12:33 +00:00
GitHub Actions bd9addf4f4 Bump build version to 3.0.7 2022-12-17 00:12:20 +00:00
GitHub Actions c3140a3fa0 Bump build version to 3.0.6 2022-12-08 00:13:17 +00:00
GitHub Actions 51015361c5 Bump build version to 3.0.5 2022-12-06 00:12:45 +00:00
GitHub Actions 0e92386a93 Bump build version to 3.0.4 2022-12-03 00:12:21 +00:00
GitHub Actions 2e3bcdef1f Bump build version to 3.0.2 2022-11-30 00:15:14 +00:00
GitHub Actions cf1e025209 Bump deb version to 2.3.0-1 2022-11-26 00:13:33 +00:00
GitHub Actions 4dbf2f806e Bump deb version to 2.4.8-1 2022-11-23 00:14:33 +00:00
Xiaonan Shen 712de23988 Add riscv64 support to CI docker builds (#54) 2022-11-21 00:14:03 +08:00
Olof Nord 0541f29d98 Add riscv64 support to docker builds
* Adjust GitHub CI to also build for riscv64
* Update base Ubuntu base for build from 18.04 LTS to 20.04 LTS as to support riscv64
* Minor: Exclude idea IDE files from git
2022-11-20 23:32:58 +08:00
Xiaonan Shen 252397a86d Switch to carlosedp/golang for riscv64 support 2022-11-20 23:12:46 +08:00
GitHub Actions 6a2a413d0a Bump build version to 2.4.8 2022-11-17 00:15:47 +00:00
GitHub Actions 60c8a9ecc4 Bump build version to 2.4.5 2022-11-09 00:16:36 +00:00
Xiaonan Shen 535c80379d Copy bridge executable to the image (fixes #66) 2022-11-05 14:30:33 +08:00
GitHub Actions acefed1b95 Bump build version to 2.4.3 2022-10-26 00:16:54 +00:00
Xiaonan Shen 6decf657c2 Bump golang to 1.18 2022-10-16 15:04:58 +08:00
Xiaonan Shen 0fa5f9fc13 Fix entrypoint init fail issue 2022-10-16 14:49:38 +08:00
Xiaonan Shen e0b0ce653c Add .vscode to .gitignore 2022-10-16 14:47:32 +08:00
GitHub Actions fa4ddf7126 Bump build version to 2.4.0 2022-09-29 00:23:38 +00:00
GitHub Actions 07d3779fc6 Bump deb version to 2.3.0-1 2022-09-09 00:17:44 +00:00
GitHub Actions 2e9d95d90b Bump build version to 2.3.0 2022-09-02 00:15:28 +00:00
GitHub Actions a8f5c0a096 Bump build version to 2.2.2 2022-07-28 00:15:49 +00:00
GitHub Actions 14cac1052d Bump deb version to 2.2.2-1 2022-07-28 00:15:47 +00:00
GitHub Actions 92b0c5bd5f Bump build version to 2.2.1 2022-07-22 00:16:20 +00:00
Xiaonan Shen 812646acb9 Fix entrypoint so it works correctly on init #57 2022-05-28 12:40:24 +08:00
GitHub Actions 664b5e924d Bump build version to 2.2.0 2022-05-26 00:14:14 +00:00
Nilesh 680e82076e Fix entrypoint so it works correctly on init
Ran into this issue when trying to use in kubernetes via k8s-at-home/protonmail-bridge. Took a bit of figuring out before I realized I had to manually kill the other instance. The only output from the failed load is a dbus issue, and an immediate exit.
2022-05-12 11:31:03 -07:00
GitHub Actions 86e10823e0 Bump deb version to 2.1.3-1 2022-04-28 00:15:49 +00:00
GitHub Actions 22b04d941d Bump build version to 2.1.3 2022-04-12 00:12:24 +00:00
GitHub Actions 4e11382bdb Bump build version to 2.1.2 2022-03-31 00:11:19 +00:00
Rafael Blumberg ba5d5297dc Add linux/arm/v7 to automate builds
After working around 32bits issues, this PR automate arm/v7 builds
2022-02-26 11:30:47 +08:00
GitHub Actions 758406337f Bump build version to 2.1.1 2022-02-10 00:08:25 +00:00
GitHub Actions db7f0eb889 Bump deb version to 2.1.1-1 2022-02-10 00:08:25 +00:00
GitHub Actions d73f3f4a63 Bump deb version to 2.1.0-1 2022-02-04 00:07:28 +00:00
GitHub Actions 683dd16a80 Bump build version to 2.1.0 2022-01-19 00:08:03 +00:00
Rafael Blumberg 75bee435f5 Workaround to compile for 32bit (#40)
* Workaround to compile for 32bit

This is a workaround based on [this
comment](https://github.com/antlr/antlr4/issues/2433#issuecomment-774514106).
It is not a pretty solution but it worked well on my test file.

It runs once to compile, if make fails, then it apply the fix and try
again, this is done so builds that don't need workaround don't use it
and also because the workaround is done on top of downloaded files
during ethe first compilation.

* Update README to remove ARMv7 error comment
2022-01-02 02:41:44 +08:00
GitHub Actions e7020854f2 Bump build version to 2.0.1 2021-12-16 00:48:19 +00:00
GitHub Actions 1ebd048bf8 Bump deb version to 1.8.12-1 2021-12-07 00:50:09 +00:00
GitHub Actions a76b7f2725 Bump build version to 1.8.12 2021-12-01 00:49:54 +00:00
GitHub Actions 616e4562a9 Bump build version to 1.8.11 2021-11-19 00:46:26 +00:00
GitHub Actions 0372093a19 Bump deb version to 1.8.10-1 2021-10-14 00:44:23 +00:00
GitHub Actions a147e41001 Bump build version to 1.8.10 2021-10-07 00:48:28 +00:00
GitHub Actions c45548e768 Bump deb version to 1.8.9-1 2021-09-14 00:47:48 +00:00
9 changed files with 150 additions and 76 deletions
+112 -66
View File
@@ -16,77 +16,123 @@ on:
env: env:
DOCKER_REPO: shenxn/protonmail-bridge DOCKER_REPO: shenxn/protonmail-bridge
DOCKER_REPO_DEV: ghcr.io/shenxn/protonmail-bridge-dev DOCKER_REPO_DEV: ghcr.io/shenxn/protonmail-bridge-dev
PLATFORMS: linux/amd64,linux/arm64/v8 PLATFORMS: linux/amd64,linux/arm64/v8,linux/arm/v7,linux/riscv64
jobs: jobs:
build: build-binary:
runs-on: ubuntu-latest runs-on: ubuntu-22.04
services: strategy:
registry: matrix:
image: registry:2 arch: ["amd64", "arm64", "arm", "riscv64"]
ports: fail-fast: true
- 5000:5000
steps: steps:
- name: Checkout - name: Checkout
uses: actions/checkout@master uses: actions/checkout@v3
with:
path: main
- name: Set version - name: Set version
id: version id: version
run: echo "::set-output name=version::`cat build/VERSION`" run: echo "version=`cat main/build/VERSION`" >> $GITHUB_OUTPUT
- name: Set repo - name: Checkout proton bridge repo
id: repo uses: actions/checkout@v3
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
- name: Docker meta
id: docker_meta
uses: crazy-max/ghaction-docker-meta@v1
with: with:
images: ${{ steps.repo.outputs.repo }} repository: ProtonMail/proton-bridge
- name: Set up QEMU ref: v${{ steps.version.outputs.version }}
uses: docker/setup-qemu-action@v1 path: proton-bridge
- name: Set up Docker Buildx - name: Set up golang
uses: docker/setup-buildx-action@v1 uses: actions/setup-go@v3
with: with:
driver-opts: network=host go-version: 1.18
- name: Build image without push to registry check-latest: true
uses: docker/build-push-action@v2 - name: Install dependencies
with: run: sudo apt-get install -y --no-install-recommends build-essential libsecret-1-dev
context: ./build - name: Download go dep
file: ./build/Dockerfile if: ${{ matrix.arch == 'arm' }}
platforms: ${{ env.PLATFORMS }} working-directory: proton-bridge
push: true # Build once to download deps.
tags: localhost:5000/protonmail-bridge:latest # This step is expected to fail.
- name: Scan image run: make build-nogui || true
id: scan env:
uses: anchore/scan-action@v2 GOARCH: ${{ matrix.arch }}
with: - name: Patch for 32 bit arch
image: localhost:5000/protonmail-bridge:latest if: ${{ matrix.arch == 'arm' }}
fail-build: true # For 32bit architectures, there was a overflow error on the parser
severity-cutoff: critical # This is a workaround for this problem found at:
acs-report-enable: true # https://github.com/antlr/antlr4/issues/2433#issuecomment-774514106
- name: Upload Anchore scan SARIF report run: find $(go env GOPATH)/pkg/mod/github.com/\!proton\!mail/go-rfc5322*/ -type f -exec sed -i.bak 's/(1<</(int64(1)<</g' {} +
uses: github/codeql-action/upload-sarif@v1 - name: Build binary
with: working-directory: proton-bridge
sarif_file: ${{ steps.scan.outputs.sarif }} run: make build-nogui
- name: Login to DockerHub env:
uses: docker/login-action@v1 GOARCH: ${{ matrix.arch }}
if: ${{ github.event_name != 'pull_request' && github.ref == 'refs/heads/master' }} # build:
with: # runs-on: ubuntu-latest
username: ${{ secrets.REGISTRY_USERNAME }} # services:
password: ${{ secrets.REGISTRY_PASSWORD }} # registry:
- name: Login to GitHub Container Registry # image: registry:2
uses: docker/login-action@v1 # ports:
if: ${{ github.event_name != 'pull_request' && github.ref == 'refs/heads/dev' }} # - 5000:5000
with: # steps:
registry: ghcr.io # - name: Checkout
username: ${{ github.repository_owner }} # uses: actions/checkout@master
password: ${{ secrets.CR_PAT }} # - name: Set version
- name: Push image # id: version
uses: docker/build-push-action@v2 # run: echo "::set-output name=version::`cat build/VERSION`"
with: # - name: Set repo
context: ./build # id: repo
file: ./build/Dockerfile # 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
platforms: ${{ env.PLATFORMS }} # - name: Docker meta
tags: | # id: docker_meta
${{ steps.repo.outputs.repo }}:build # uses: crazy-max/ghaction-docker-meta@v1
${{ steps.repo.outputs.repo }}:${{ steps.version.outputs.version }}-build # with:
labels: ${{ steps.docker_meta.outputs.labels }} # images: ${{ steps.repo.outputs.repo }}
push: ${{ github.event_name != 'pull_request' }} # - 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' }}
# with:
# registry: ghcr.io
# username: ${{ github.repository_owner }}
# password: ${{ secrets.CR_PAT }}
# - name: Push image
# uses: docker/build-push-action@v2
# with:
# 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' }}
+3
View File
@@ -0,0 +1,3 @@
# Ignoring IDE-specific files
.idea/*
.vscode
+1 -5
View File
@@ -12,10 +12,6 @@ Docker Hub: [https://hub.docker.com/r/shenxn/protonmail-bridge](https://hub.dock
GitHub: [https://github.com/shenxn/protonmail-bridge-docker](https://github.com/shenxn/protonmail-bridge-docker) GitHub: [https://github.com/shenxn/protonmail-bridge-docker](https://github.com/shenxn/protonmail-bridge-docker)
## ARMv7 Builds
Currently there is a problem building the new parser targeting 32-bit architectures (i.e. `arm/v7`). The latest working build is `1.4.5-build`. Therefore, if you are using an `arm/v7` device like Raspberry Pi, do not upgrade to newer version. More information about the problem can be found [here](https://www.reddit.com/r/ProtonMail/comments/jvzm12/issue_building_bridge_150/). If you have any idea on how to fix this, a PR is welcome.
## ARM Support ## ARM Support
We now support ARM devices (`arm64` and `arm/v7`)! Use the images tagged with `build`. See next section for details. We now support ARM devices (`arm64` and `arm/v7`)! Use the images tagged with `build`. See next section for details.
@@ -24,7 +20,7 @@ We now support ARM devices (`arm64` and `arm/v7`)! Use the images tagged with `b
There are two types of images. There are two types of images.
- `deb`: Images based on the official [.deb release](https://protonmail.com/bridge/install). It only supports the `amd64` architecture. - `deb`: Images based on the official [.deb release](https://protonmail.com/bridge/install). It only supports the `amd64` architecture.
- `build`: Images based on the [source code](https://github.com/ProtonMail/proton-bridge). It supports `amd64`, `arm64`, and `arm/v7`. Supporting to more architectures is possible. PRs are welcome. - `build`: Images based on the [source code](https://github.com/ProtonMail/proton-bridge). It supports `amd64`, `arm64`, `arm/v7` and `riscv64`. Supporting to more architectures is possible. PRs are welcome.
tag | description tag | description
-- | -- -- | --
+5 -3
View File
@@ -1,14 +1,15 @@
FROM golang:1.15 AS build # Use carlosedp/golang for riscv64 support
FROM carlosedp/golang:1.18 AS build
# Install dependencies # Install dependencies
RUN apt-get update && apt-get install -y libsecret-1-dev RUN apt-get update && apt-get install -y 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:bionic FROM ubuntu:jammy
LABEL maintainer="Xiaonan Shen <s@sxn.dev>" LABEL maintainer="Xiaonan Shen <s@sxn.dev>"
EXPOSE 25/tcp EXPOSE 25/tcp
@@ -23,6 +24,7 @@ RUN apt-get update \
COPY gpgparams entrypoint.sh /protonmail/ COPY gpgparams entrypoint.sh /protonmail/
# Copy protonmail # Copy 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/
ENTRYPOINT ["bash", "/protonmail/entrypoint.sh"] ENTRYPOINT ["bash", "/protonmail/entrypoint.sh"]
+1 -1
View File
@@ -1 +1 @@
1.8.9 3.0.9
+10
View File
@@ -9,5 +9,15 @@ git clone https://github.com/ProtonMail/proton-bridge.git
cd proton-bridge cd proton-bridge
git checkout v$VERSION 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 # Build
make build-nogui make build-nogui
+6
View File
@@ -9,6 +9,12 @@ if [[ $1 == init ]]; then
gpg --generate-key --batch /protonmail/gpgparams gpg --generate-key --batch /protonmail/gpgparams
pass init pass-key pass init pass-key
# 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 # Login
/protonmail/proton-bridge --cli $@ /protonmail/proton-bridge --cli $@
+11
View File
@@ -0,0 +1,11 @@
#!/bin/bash
set -ex
GOLANG_VERSION=1.18.7
ARCH=$(uname -m)
if [[ $ARCH == "riscv64" ]]; then
# There is no official riscv64 release. Use carlosedp/riscv-bringup instead.
wget
+1 -1
View File
@@ -1 +1 @@
1.8.7-1 2.3.0-1