main
parent
dbd558350a
commit
4164524906
@ -0,0 +1,8 @@
|
|||||||
|
*
|
||||||
|
|
||||||
|
!.dockerignore
|
||||||
|
!VERSION
|
||||||
|
!entrypoint.sh
|
||||||
|
!install.sh
|
||||||
|
!gpgparams
|
||||||
|
!Dockerfile
|
||||||
@ -0,0 +1,14 @@
|
|||||||
|
FROM ubuntu:jammy
|
||||||
|
|
||||||
|
EXPOSE 25/tcp
|
||||||
|
EXPOSE 143/tcp
|
||||||
|
|
||||||
|
WORKDIR /protonmail
|
||||||
|
|
||||||
|
# Copy bash scripts
|
||||||
|
COPY gpgparams install.sh entrypoint.sh VERSION /protonmail/
|
||||||
|
|
||||||
|
# Install dependencies and protonmail bridge
|
||||||
|
RUN bash install.sh
|
||||||
|
|
||||||
|
ENTRYPOINT ["bash", "/protonmail/entrypoint.sh"]
|
||||||
@ -0,0 +1,17 @@
|
|||||||
|
services:
|
||||||
|
protonmail-bridge:
|
||||||
|
container_name: protonmail-bridge-v2
|
||||||
|
build: .
|
||||||
|
ports:
|
||||||
|
- 1025:25/tcp
|
||||||
|
- 1143:143/tcp
|
||||||
|
restart: unless-stopped
|
||||||
|
volumes:
|
||||||
|
- ${APP_DIR:?err}/app:/root
|
||||||
|
networks:
|
||||||
|
- main
|
||||||
|
|
||||||
|
networks:
|
||||||
|
main:
|
||||||
|
driver: bridge
|
||||||
|
external: true
|
||||||
@ -0,0 +1,49 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
set -ex
|
||||||
|
|
||||||
|
# Initialize
|
||||||
|
if [[ $1 == init ]]; then
|
||||||
|
|
||||||
|
# # Parse parameters
|
||||||
|
# TFP="" # Default empty two factor passcode
|
||||||
|
# shift # skip `init`
|
||||||
|
# while [[ $# -gt 0 ]]; do
|
||||||
|
# key="$1"
|
||||||
|
# case $key in
|
||||||
|
# -u|--username)
|
||||||
|
# USERNAME="$2"
|
||||||
|
# ;;
|
||||||
|
# -p|--password)
|
||||||
|
# PASSWORD="$2"
|
||||||
|
# ;;
|
||||||
|
# -t|--twofactor)
|
||||||
|
# TWOFACTOR="$2"
|
||||||
|
# ;;
|
||||||
|
# esac
|
||||||
|
# shift
|
||||||
|
# shift
|
||||||
|
# done
|
||||||
|
|
||||||
|
# Initialize pass
|
||||||
|
gpg --generate-key --batch /protonmail/gpgparams
|
||||||
|
pass init pass-key
|
||||||
|
|
||||||
|
# Login
|
||||||
|
protonmail-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 :)
|
||||||
|
socat TCP-LISTEN:25,fork TCP:127.0.0.1:1025 &
|
||||||
|
socat TCP-LISTEN:143,fork TCP:127.0.0.1:1143 &
|
||||||
|
|
||||||
|
# Start protonmail
|
||||||
|
# Fake a terminal, so it does not quit because of EOF...
|
||||||
|
rm -f faketty
|
||||||
|
mkfifo faketty
|
||||||
|
cat faketty | protonmail-bridge --cli
|
||||||
|
|
||||||
|
fi
|
||||||
@ -0,0 +1,8 @@
|
|||||||
|
%no-protection
|
||||||
|
%echo Generating a basic OpenPGP key
|
||||||
|
Key-Type: RSA
|
||||||
|
Key-Length: 2048
|
||||||
|
Name-Real: pass-key
|
||||||
|
Expire-Date: 0
|
||||||
|
%commit
|
||||||
|
%echo done
|
||||||
@ -0,0 +1,36 @@
|
|||||||
|
#!/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
|
||||||
|
cd deb
|
||||||
|
wget -q https://git.lanubya.de/Lanubya/protonmail-bridge-v2/raw/branch/main/${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
|
||||||
|
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
|
||||||
Loading…
Reference in new issue