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 }}
|
||||
push: true
|
||||
tags: localhost:5000/protonmail-bridge:latest
|
||||
cache-from: type=gha
|
||||
cache-to: type=gha,mode=max
|
||||
|
||||
- name: Scan image
|
||||
id: scan
|
||||
uses: anchore/scan-action@v4
|
||||
with:
|
||||
image: localhost:5000/protonmail-bridge:latest
|
||||
fail-build: true
|
||||
fail-build: false
|
||||
severity-cutoff: critical
|
||||
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 }}
|
||||
- name: Set up Docker Buildx
|
||||
uses: docker/setup-buildx-action@v3
|
||||
|
||||
- name: Build image without push
|
||||
uses: docker/build-push-action@v6
|
||||
with:
|
||||
@ -43,12 +44,15 @@ jobs:
|
||||
file: ./deb/Dockerfile
|
||||
load: true
|
||||
tags: protonmail-bridge:latest
|
||||
cache-from: type=gha
|
||||
cache-to: type=gha,mode=max
|
||||
|
||||
- name: Scan image
|
||||
id: scan
|
||||
uses: anchore/scan-action@v4
|
||||
with:
|
||||
image: protonmail-bridge:latest
|
||||
fail-build: true
|
||||
fail-build: false
|
||||
severity-cutoff: critical
|
||||
output-format: sarif
|
||||
- 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:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
token: ${{ secrets.PERSONAL_TOKEN }}
|
||||
- name: Check Update
|
||||
run: python3 update-check.py ${{ github.event_name == 'pull_request' }}
|
||||
|
||||
@ -1,27 +1,58 @@
|
||||
# Use carlosedp/golang for riscv64 support
|
||||
FROM golang:1.21-bookworm AS build
|
||||
FROM golang:1.23 AS build
|
||||
|
||||
# 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
|
||||
WORKDIR /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>"
|
||||
|
||||
EXPOSE 25/tcp
|
||||
EXPOSE 143/tcp
|
||||
|
||||
# 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 \
|
||||
--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 libsecret-1-0 ca-certificates
|
||||
libc6 \
|
||||
socat \
|
||||
pass \
|
||||
ca-certificates \
|
||||
wget \
|
||||
binutils \
|
||||
xz-utils \
|
||||
libsecret-1-0 \
|
||||
libgl1
|
||||
|
||||
# Copy bash scripts
|
||||
COPY gpgparams entrypoint.sh /protonmail/
|
||||
|
||||
@ -1 +1 @@
|
||||
3.12.0
|
||||
3.13.0
|
||||
@ -2,12 +2,12 @@
|
||||
|
||||
set -ex
|
||||
|
||||
VERSION=`cat VERSION`
|
||||
VERSION=$(cat VERSION)
|
||||
|
||||
# Clone new code
|
||||
git clone https://github.com/ProtonMail/proton-bridge.git
|
||||
cd proton-bridge
|
||||
git checkout v$VERSION
|
||||
git checkout v"$VERSION"
|
||||
|
||||
ARCH=$(uname -m)
|
||||
if [[ $ARCH == "armv7l" ]] ; then
|
||||
|
||||
@ -16,7 +16,7 @@ if [[ $1 == init ]]; then
|
||||
pkill protonmail-bridge || true
|
||||
|
||||
# Login
|
||||
/protonmail/proton-bridge --cli $@
|
||||
"/protonmail/proton-bridge" --cli "$@"
|
||||
|
||||
else
|
||||
|
||||
@ -30,6 +30,6 @@ else
|
||||
# Fake a terminal, so it does not quit because of EOF...
|
||||
rm -f faketty
|
||||
mkfifo faketty
|
||||
cat faketty | /protonmail/proton-bridge --cli $@
|
||||
cat faketty | /protonmail/proton-bridge --cli "$@"
|
||||
|
||||
fi
|
||||
|
||||
@ -1,16 +1,24 @@
|
||||
FROM ubuntu:jammy
|
||||
FROM --platform=${BUILDPLATFORM} ubuntu:noble
|
||||
LABEL maintainer="Xiaonan Shen <s@sxn.dev>"
|
||||
|
||||
EXPOSE 25/tcp
|
||||
EXPOSE 143/tcp
|
||||
|
||||
|
||||
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
|
||||
libc6 \
|
||||
socat \
|
||||
pass \
|
||||
ca-certificates \
|
||||
wget \
|
||||
binutils \
|
||||
xz-utils \
|
||||
libsecret-1-0 \
|
||||
libgl1
|
||||
|
||||
WORKDIR /protonmail
|
||||
|
||||
|
||||
@ -1 +1 @@
|
||||
3.12.0-1
|
||||
3.13.0-1
|
||||
@ -2,35 +2,27 @@
|
||||
|
||||
set -ex
|
||||
|
||||
VERSION=`cat VERSION`
|
||||
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
|
||||
cd deb
|
||||
wget -q https://protonmail.com/download/bridge/${DEB_FILE}
|
||||
ar x -v ${DEB_FILE}
|
||||
wget https://proton.me/download/bridge/"${DEB_FILE}"
|
||||
ar x -v "${DEB_FILE}"
|
||||
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
|
||||
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}
|
||||
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
|
||||
|
||||
@ -1,5 +1,3 @@
|
||||
version: '2.1'
|
||||
|
||||
services:
|
||||
protonmail-bridge:
|
||||
image: shenxn/protonmail-bridge
|
||||
|
||||
Loading…
Reference in New Issue
Block a user