mirror of
https://github.com/shenxn/protonmail-bridge-docker.git
synced 2025-12-06 08:27:08 +00:00
build pr images too
This commit is contained in:
parent
3e0cc0ff8d
commit
a7fcf0fd88
10
.github/workflows/build.yaml
vendored
10
.github/workflows/build.yaml
vendored
@ -93,3 +93,13 @@ jobs:
|
|||||||
${{ steps.repo.outputs.repo }}:${{ steps.version.outputs.version }}-build
|
${{ steps.repo.outputs.repo }}:${{ steps.version.outputs.version }}-build
|
||||||
labels: ${{ steps.docker_meta.outputs.labels }}
|
labels: ${{ steps.docker_meta.outputs.labels }}
|
||||||
push: ${{ github.event_name != 'pull_request' }}
|
push: ${{ github.event_name != 'pull_request' }}
|
||||||
|
- name: Push test-image
|
||||||
|
uses: docker/build-push-action@v2
|
||||||
|
with:
|
||||||
|
context: ./build
|
||||||
|
file: ./build/Dockerfile
|
||||||
|
platforms: ${{ env.PLATFORMS }}
|
||||||
|
tags: |
|
||||||
|
${{ steps.repo.outputs.repo }}:pr-${{ github.head_ref }}
|
||||||
|
labels: ${{ steps.docker_meta.outputs.labels }}
|
||||||
|
push: ${{ github.event_name == 'pull_request' }}
|
||||||
|
|||||||
@ -8,7 +8,7 @@ if [[ $1 == init ]]; then
|
|||||||
# Initialize pass
|
# Initialize pass
|
||||||
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.
|
# Kill the other instance as only one can be running at a time.
|
||||||
# This allows users to run entrypoint init inside a running conainter
|
# This allows users to run entrypoint init inside a running conainter
|
||||||
# which is useful in a k8s environment.
|
# which is useful in a k8s environment.
|
||||||
@ -30,7 +30,7 @@ else
|
|||||||
sleep 300
|
sleep 300
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# give friendly error if the user doesn't own the data
|
# give friendly error if the user doesn't own the data
|
||||||
if [[ $(id -u) != 0 ]]; then
|
if [[ $(id -u) != 0 ]]; then
|
||||||
if [[ `find $HOME/.* -not -user $(id -u) | wc -l` != 0 ]]; then
|
if [[ `find $HOME/.* -not -user $(id -u) | wc -l` != 0 ]]; then
|
||||||
@ -49,26 +49,11 @@ else
|
|||||||
if [[ $(id -u) == 0 ]]; then
|
if [[ $(id -u) == 0 ]]; then
|
||||||
socat TCP-LISTEN:25,fork TCP:127.0.0.1:1025 &
|
socat TCP-LISTEN:25,fork TCP:127.0.0.1:1025 &
|
||||||
socat TCP-LISTEN:143,fork TCP:127.0.0.1:1143 &
|
socat TCP-LISTEN:143,fork TCP:127.0.0.1:1143 &
|
||||||
|
else
|
||||||
|
socat TCP-LISTEN:2025,fork TCP:127.0.0.1:1025 &
|
||||||
|
socat TCP-LISTEN:2143,fork TCP:127.0.0.1:1143 &
|
||||||
fi
|
fi
|
||||||
|
|
||||||
socat TCP-LISTEN:2025,fork TCP:127.0.0.1:1025 &
|
|
||||||
socat TCP-LISTEN:2143,fork TCP:127.0.0.1:1143 &
|
|
||||||
|
|
||||||
# Broken until https://github.com/ProtonMail/proton-bridge/issues/512 is resolved.
|
|
||||||
# check if the vault-editor can read the config
|
|
||||||
/protonmail/vault-editor read 2>&1 1>/dev/null
|
|
||||||
# Modify the protonmail config with env variables and expected values. Env variables must be converted from string to boolean.
|
|
||||||
/protonmail/vault-editor read | \
|
|
||||||
jq '.Settings.AutoUpdate = (env.PROTONMAIL_AutoUpdate | if . == "true" then true else false end)
|
|
||||||
| .Settings.TelemetryDisabled = (env.PROTONMAIL_TelemetryDisabled | if . == "true" then true else false end)
|
|
||||||
| .Settings.GluonDir |= "\(env.HOME)/.local/share/protonmail/bridge-v3/gluon"
|
|
||||||
| .Settings.Autostart = false
|
|
||||||
| .Settings.SMTPPort = 1025
|
|
||||||
| .Settings.IMAPPort = 1143 ' > /tmp/protonmail-conf.json
|
|
||||||
|
|
||||||
cat /tmp/protonmail-conf.json | /protonmail/vault-editor write
|
|
||||||
rm /tmp/protonmail-conf.json
|
|
||||||
|
|
||||||
# Start protonmail
|
# Start protonmail
|
||||||
/protonmail/proton-bridge --noninteractive $@
|
/protonmail/proton-bridge --noninteractive $@
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user