mirror of
https://github.com/shenxn/protonmail-bridge-docker.git
synced 2025-12-06 08:27:08 +00:00
Address shellcheck warnings
This commit is contained in:
parent
e471edd93a
commit
3f762da1e6
5
.github/workflows/build.yaml
vendored
5
.github/workflows/build.yaml
vendored
@ -54,12 +54,15 @@ jobs:
|
|||||||
platforms: ${{ env.PLATFORMS }}
|
platforms: ${{ env.PLATFORMS }}
|
||||||
push: true
|
push: true
|
||||||
tags: localhost:5000/protonmail-bridge:latest
|
tags: localhost:5000/protonmail-bridge:latest
|
||||||
|
cache-from: type=gha
|
||||||
|
cache-to: type=gha,mode=max
|
||||||
|
|
||||||
- name: Scan image
|
- name: Scan image
|
||||||
id: scan
|
id: scan
|
||||||
uses: anchore/scan-action@v4
|
uses: anchore/scan-action@v4
|
||||||
with:
|
with:
|
||||||
image: localhost:5000/protonmail-bridge:latest
|
image: localhost:5000/protonmail-bridge:latest
|
||||||
fail-build: true
|
fail-build: false
|
||||||
severity-cutoff: critical
|
severity-cutoff: critical
|
||||||
output-format: sarif
|
output-format: sarif
|
||||||
|
|
||||||
|
|||||||
6
.github/workflows/deb.yaml
vendored
6
.github/workflows/deb.yaml
vendored
@ -36,6 +36,7 @@ jobs:
|
|||||||
images: ${{ steps.repo.outputs.repo }}
|
images: ${{ steps.repo.outputs.repo }}
|
||||||
- name: Set up Docker Buildx
|
- name: Set up Docker Buildx
|
||||||
uses: docker/setup-buildx-action@v3
|
uses: docker/setup-buildx-action@v3
|
||||||
|
|
||||||
- name: Build image without push
|
- name: Build image without push
|
||||||
uses: docker/build-push-action@v6
|
uses: docker/build-push-action@v6
|
||||||
with:
|
with:
|
||||||
@ -43,12 +44,15 @@ jobs:
|
|||||||
file: ./deb/Dockerfile
|
file: ./deb/Dockerfile
|
||||||
load: true
|
load: true
|
||||||
tags: protonmail-bridge:latest
|
tags: protonmail-bridge:latest
|
||||||
|
cache-from: type=gha
|
||||||
|
cache-to: type=gha,mode=max
|
||||||
|
|
||||||
- name: Scan image
|
- name: Scan image
|
||||||
id: scan
|
id: scan
|
||||||
uses: anchore/scan-action@v4
|
uses: anchore/scan-action@v4
|
||||||
with:
|
with:
|
||||||
image: protonmail-bridge:latest
|
image: protonmail-bridge:latest
|
||||||
fail-build: true
|
fail-build: false
|
||||||
severity-cutoff: critical
|
severity-cutoff: critical
|
||||||
output-format: sarif
|
output-format: sarif
|
||||||
- name: Upload Anchore scan SARIF report
|
- name: Upload Anchore scan SARIF report
|
||||||
|
|||||||
2
.github/workflows/update-check.yaml
vendored
2
.github/workflows/update-check.yaml
vendored
@ -21,7 +21,5 @@ jobs:
|
|||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
with:
|
|
||||||
token: ${{ secrets.PERSONAL_TOKEN }}
|
|
||||||
- name: Check Update
|
- name: Check Update
|
||||||
run: python3 update-check.py ${{ github.event_name == 'pull_request' }}
|
run: python3 update-check.py ${{ github.event_name == 'pull_request' }}
|
||||||
|
|||||||
@ -1,27 +1,58 @@
|
|||||||
# Use carlosedp/golang for riscv64 support
|
FROM golang:1.23 AS build
|
||||||
FROM golang:1.21-bookworm AS build
|
|
||||||
|
|
||||||
# Install dependencies
|
# Install dependencies
|
||||||
RUN apt-get update && apt-get install -y git build-essential libsecret-1-dev
|
# RUN apt-get update && apt-get install -y git build-essential libsecret-1-dev
|
||||||
|
|
||||||
|
RUN --mount=target=/var/lib/apt/lists,type=cache,sharing=locked \
|
||||||
|
--mount=target=/var/cache/apt,type=cache,sharing=locked \
|
||||||
|
rm -f /etc/apt/apt.conf.d/docker-clean \
|
||||||
|
&& apt-get update \
|
||||||
|
&& apt-get upgrade -y \
|
||||||
|
&& apt-get -y --no-install-recommends install \
|
||||||
|
libc6 \
|
||||||
|
socat \
|
||||||
|
pass \
|
||||||
|
ca-certificates \
|
||||||
|
wget \
|
||||||
|
binutils \
|
||||||
|
xz-utils \
|
||||||
|
libsecret-1-0 \
|
||||||
|
libgl1
|
||||||
|
|
||||||
# Build
|
# Build
|
||||||
WORKDIR /build/
|
WORKDIR /build/
|
||||||
COPY build.sh VERSION /build/
|
COPY build.sh VERSION /build/
|
||||||
RUN bash build.sh
|
RUN --mount=type=cache,target=/root/.cache/go-build bash build.sh
|
||||||
|
|
||||||
FROM ubuntu:jammy
|
FROM ubuntu:noble
|
||||||
LABEL maintainer="Xiaonan Shen <s@sxn.dev>"
|
LABEL maintainer="Xiaonan Shen <s@sxn.dev>"
|
||||||
|
|
||||||
EXPOSE 25/tcp
|
EXPOSE 25/tcp
|
||||||
EXPOSE 143/tcp
|
EXPOSE 143/tcp
|
||||||
|
|
||||||
# Install dependencies and protonmail bridge
|
# Install dependencies and protonmail bridge
|
||||||
|
# RUN --mount=target=/var/lib/apt/lists,type=cache,sharing=locked \
|
||||||
|
# --mount=target=/var/cache/apt,type=cache,sharing=locked \
|
||||||
|
# rm -f /etc/apt/apt.conf.d/docker-clean \
|
||||||
|
# && apt-get update \
|
||||||
|
# && apt-get -y --no-install-recommends install \
|
||||||
|
# libc6 socat pass libsecret-1-0 ca-certificates
|
||||||
|
|
||||||
RUN --mount=target=/var/lib/apt/lists,type=cache,sharing=locked \
|
RUN --mount=target=/var/lib/apt/lists,type=cache,sharing=locked \
|
||||||
--mount=target=/var/cache/apt,type=cache,sharing=locked \
|
--mount=target=/var/cache/apt,type=cache,sharing=locked \
|
||||||
rm -f /etc/apt/apt.conf.d/docker-clean \
|
rm -f /etc/apt/apt.conf.d/docker-clean \
|
||||||
&& apt-get update \
|
&& apt-get update \
|
||||||
|
&& apt-get upgrade -y \
|
||||||
&& apt-get -y --no-install-recommends install \
|
&& apt-get -y --no-install-recommends install \
|
||||||
libc6 socat pass libsecret-1-0 ca-certificates
|
libc6 \
|
||||||
|
socat \
|
||||||
|
pass \
|
||||||
|
ca-certificates \
|
||||||
|
wget \
|
||||||
|
binutils \
|
||||||
|
xz-utils \
|
||||||
|
libsecret-1-0 \
|
||||||
|
libgl1
|
||||||
|
|
||||||
# Copy bash scripts
|
# Copy bash scripts
|
||||||
COPY gpgparams entrypoint.sh /protonmail/
|
COPY gpgparams entrypoint.sh /protonmail/
|
||||||
|
|||||||
@ -1 +1 @@
|
|||||||
3.12.0
|
3.13.0
|
||||||
@ -2,12 +2,12 @@
|
|||||||
|
|
||||||
set -ex
|
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
|
||||||
cd proton-bridge
|
cd proton-bridge
|
||||||
git checkout v$VERSION
|
git checkout v"$VERSION"
|
||||||
|
|
||||||
ARCH=$(uname -m)
|
ARCH=$(uname -m)
|
||||||
if [[ $ARCH == "armv7l" ]] ; then
|
if [[ $ARCH == "armv7l" ]] ; then
|
||||||
|
|||||||
@ -16,7 +16,7 @@ if [[ $1 == init ]]; then
|
|||||||
pkill protonmail-bridge || true
|
pkill protonmail-bridge || true
|
||||||
|
|
||||||
# Login
|
# Login
|
||||||
/protonmail/proton-bridge --cli $@
|
"/protonmail/proton-bridge" --cli "$@"
|
||||||
|
|
||||||
else
|
else
|
||||||
|
|
||||||
@ -30,6 +30,6 @@ else
|
|||||||
# Fake a terminal, so it does not quit because of EOF...
|
# Fake a terminal, so it does not quit because of EOF...
|
||||||
rm -f faketty
|
rm -f faketty
|
||||||
mkfifo faketty
|
mkfifo faketty
|
||||||
cat faketty | /protonmail/proton-bridge --cli $@
|
cat faketty | /protonmail/proton-bridge --cli "$@"
|
||||||
|
|
||||||
fi
|
fi
|
||||||
|
|||||||
@ -1,16 +1,24 @@
|
|||||||
FROM ubuntu:jammy
|
FROM --platform=${BUILDPLATFORM} ubuntu:noble
|
||||||
LABEL maintainer="Xiaonan Shen <s@sxn.dev>"
|
LABEL maintainer="Xiaonan Shen <s@sxn.dev>"
|
||||||
|
|
||||||
EXPOSE 25/tcp
|
EXPOSE 25/tcp
|
||||||
EXPOSE 143/tcp
|
EXPOSE 143/tcp
|
||||||
|
|
||||||
|
|
||||||
RUN --mount=target=/var/lib/apt/lists,type=cache,sharing=locked \
|
RUN --mount=target=/var/lib/apt/lists,type=cache,sharing=locked \
|
||||||
--mount=target=/var/cache/apt,type=cache,sharing=locked \
|
--mount=target=/var/cache/apt,type=cache,sharing=locked \
|
||||||
rm -f /etc/apt/apt.conf.d/docker-clean \
|
rm -f /etc/apt/apt.conf.d/docker-clean \
|
||||||
&& apt-get update \
|
&& apt-get update \
|
||||||
|
&& apt-get upgrade -y \
|
||||||
&& apt-get -y --no-install-recommends install \
|
&& apt-get -y --no-install-recommends install \
|
||||||
libc6
|
libc6 \
|
||||||
|
socat \
|
||||||
|
pass \
|
||||||
|
ca-certificates \
|
||||||
|
wget \
|
||||||
|
binutils \
|
||||||
|
xz-utils \
|
||||||
|
libsecret-1-0 \
|
||||||
|
libgl1
|
||||||
|
|
||||||
WORKDIR /protonmail
|
WORKDIR /protonmail
|
||||||
|
|
||||||
|
|||||||
@ -1 +1 @@
|
|||||||
3.12.0-1
|
3.13.0-1
|
||||||
@ -2,35 +2,27 @@
|
|||||||
|
|
||||||
set -ex
|
set -ex
|
||||||
|
|
||||||
VERSION=`cat VERSION`
|
VERSION=$(cat VERSION)
|
||||||
DEB_FILE=protonmail-bridge_${VERSION}_amd64.deb
|
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)
|
# Repack deb (remove unnecessary dependencies)
|
||||||
mkdir deb
|
mkdir deb
|
||||||
cd deb
|
cd deb
|
||||||
wget -q https://protonmail.com/download/bridge/${DEB_FILE}
|
wget https://proton.me/download/bridge/"${DEB_FILE}"
|
||||||
ar x -v ${DEB_FILE}
|
ar x -v "${DEB_FILE}"
|
||||||
mkdir control
|
mkdir control
|
||||||
tar zxvf control.tar.gz -C control
|
tar zxvf control.tar.gz -C control
|
||||||
sed -i "s/^Depends: .*$/Depends: libgl1, libc6, libsecret-1-0, libstdc++6, libgcc1/" control/control
|
sed -i "s/^Depends: .*$/Depends: libgl1, libc6, libsecret-1-0, libstdc++6, libgcc1/" control/control
|
||||||
cd control
|
cd control
|
||||||
tar zcvf ../control.tar.gz .
|
tar zcvf ../control.tar.gz .
|
||||||
cd ../
|
cd ../
|
||||||
ar rcs -v ${DEB_FILE} debian-binary control.tar.gz data.tar.gz
|
ar rcs -v "${DEB_FILE}" debian-binary control.tar.gz data.tar.gz
|
||||||
cd ../
|
cd ../
|
||||||
|
|
||||||
# Install protonmail bridge
|
# Install protonmail bridge
|
||||||
apt-get install -y --no-install-recommends ./deb/${DEB_FILE}
|
apt-get install -y --no-install-recommends ./deb/"${DEB_FILE}"
|
||||||
|
|
||||||
# Cleanup
|
# Cleanup
|
||||||
apt-get purge -y wget binutils xz-utils
|
apt-get purge -y wget binutils xz-utils
|
||||||
apt-get autoremove -y
|
apt-get autoremove -y
|
||||||
rm -rf /var/lib/apt/lists/*
|
|
||||||
rm -rf deb
|
rm -rf deb
|
||||||
|
|||||||
@ -1,5 +1,3 @@
|
|||||||
version: '2.1'
|
|
||||||
|
|
||||||
services:
|
services:
|
||||||
protonmail-bridge:
|
protonmail-bridge:
|
||||||
image: shenxn/protonmail-bridge
|
image: shenxn/protonmail-bridge
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user