diff --git a/.github/actions/build-postfix-exporter/action.yaml b/.github/actions/build-postfix-exporter/action.yaml index 5b246f5..80513c7 100644 --- a/.github/actions/build-postfix-exporter/action.yaml +++ b/.github/actions/build-postfix-exporter/action.yaml @@ -9,6 +9,10 @@ inputs: description: 'Docker image tags' required: true +env: + DOCKERHUB_REPO: boky/postfix-exporter + #GHCR_REPO: ghcr.io/bokysan/postfix-exporter + runs: using: "composite" steps: @@ -33,6 +37,22 @@ runs: with: DOCKER_ACCESS_TOKEN: '${{ inputs.DOCKER_ACCESS_TOKEN }}' + # GitHub container registry login + #- name: Login to GHCR + # uses: docker/login-action@v3 + # with: + # registry: ghcr.io + # username: ${{ github.repository_owner }} + # password: ${{ secrets.GITHUB_TOKEN }} + + - name: Docker meta + id: meta + uses: docker/metadata-action@v5 + with: + images: | + ${{ env.DOCKERHUB_REPO }} +# ${{ env.GHCR_REPO }} + - name: Cache Docker layers uses: actions/cache@v4 with: @@ -42,11 +62,12 @@ runs: ${{ runner.os }}-postfix-exporter- - name: Build and push - uses: docker/build-push-action@v5 + uses: docker/build-push-action@v6 with: context: postfix_exporter push: true tags: '${{ inputs.tags }}' + labels: ${{ steps.meta.outputs.labels }} platforms: "linux/amd64,linux/arm/v5,linux/arm/v7,linux/arm64/v8,linux/mips64le,linux/ppc64le,linux/s390x" # linux/386,linux/arm/v6,linux/arm64,linux/riscv64" cache-from: type=local,src=/tmp/.buildx-cache/postfix-exporter,mode=max,compression=estargz diff --git a/.github/actions/buildx-setup/action.yaml b/.github/actions/buildx-setup/action.yaml index 11b8c90..62a9968 100644 --- a/.github/actions/buildx-setup/action.yaml +++ b/.github/actions/buildx-setup/action.yaml @@ -9,7 +9,7 @@ runs: - name: Set up Docker Buildx id: buildx - uses: docker/setup-buildx-action@master + uses: docker/setup-buildx-action@v3 with: install: true diff --git a/.github/workflows/tags.yml b/.github/workflows/tags.yml index aa71cb4..a500763 100644 --- a/.github/workflows/tags.yml +++ b/.github/workflows/tags.yml @@ -51,8 +51,6 @@ jobs: tags: | boky/postfix-exporter:latest boky/postfix-exporter:edge - # boky/postfix-exporter:${{ env.RELEASE_VERSION }} - # boky/postfix-exporter:${{ env.RELEASE_VERSION_NO_v }} Build_Alpine: runs-on: ubuntu-latest diff --git a/README.md b/README.md index d2f081c..dce43a8 100644 --- a/README.md +++ b/README.md @@ -131,7 +131,7 @@ Several potentially "surprising" changes went into this issue and hence warrant - **[`master`](https://github.com/bokysan/docker-postfix/tree/master/) branch now builds images called [`edge`](https://hub.docker.com/r/boky/postfix/tags?page=1&name=edge)**. `latest` images are built from the last tag. We've had several issues with people using the `latest` tag and reporting problems. You can now rely on `latest` being the latest stable release. -- Image now builds its own version of [postfix-exporter](https://github.com/kumina/postfix_exporter) and relies on this +- Image now builds its own version of [postfix-exporter](https://github.com/hsn723/postfix_exporter) and relies on this third-party project. Checkout is from master branch, based on specific SHA commit id. The same hash is used for master and tags. - **Architecture galore!** With the addition of debian images, we now support support more architectures than ever. The list includes: diff --git a/scripts/healthcheck.sh b/scripts/healthcheck.sh index f967342..1b3ec42 100644 --- a/scripts/healthcheck.sh +++ b/scripts/healthcheck.sh @@ -5,7 +5,20 @@ if [ -f /tmp/container_is_terminating ]; then fi check_postfix() { - printf "EHLO healthcheck\nquit\n" | \ + local proxy_protocol="$(postconf postscreen_upstream_proxy_protocol | cut -f2- -d= | tr -d '[:blank:]')" + + check_string="EHLO healthcheck\nquit\n" + + if [ -n "$proxy_protocol" ]; then + check_string="PROXY TCP4 127.0.0.1 127.0.0.1 587 587\n${check_string}" + # ^--- proxied internet protocol and family + # ^--- source address + # ^--- destination address + # ^--- source port + # ^--- destination port + fi + + printf "${check_string}" | \ { while read l ; do sleep 1; echo $l; done } | \ nc -w 2 127.0.0.1 587 | \ grep -qE "^220.*ESMTP Postfix"