Merge branch 'master' into amavis-sa

This commit is contained in:
Casper 2024-03-20 20:15:30 +01:00 committed by GitHub
commit 2141bdb66b
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
8 changed files with 35 additions and 31 deletions

View File

@ -79,11 +79,11 @@ jobs:
platforms: arm64 platforms: arm64
- name: 'Set up Docker Buildx' - name: 'Set up Docker Buildx'
uses: docker/setup-buildx-action@v3.1.0 uses: docker/setup-buildx-action@v3.2.0
# NOTE: AMD64 can build within 2 minutes # NOTE: AMD64 can build within 2 minutes
- name: 'Build images' - name: 'Build images'
uses: docker/build-push-action@v5.2.0 uses: docker/build-push-action@v5.3.0
with: with:
context: . context: .
# Build at least the AMD64 image (which runs against the test suite). # Build at least the AMD64 image (which runs against the test suite).

View File

@ -40,7 +40,7 @@ jobs:
platforms: arm64 platforms: arm64
- name: 'Set up Docker Buildx' - name: 'Set up Docker Buildx'
uses: docker/setup-buildx-action@v3.1.0 uses: docker/setup-buildx-action@v3.2.0
# Try get the cached build layers from a prior `generic_build.yml` job. # Try get the cached build layers from a prior `generic_build.yml` job.
# NOTE: Until adopting `type=gha` scoped cache exporter (in `docker/build-push-action`), # NOTE: Until adopting `type=gha` scoped cache exporter (in `docker/build-push-action`),
@ -67,7 +67,7 @@ jobs:
password: ${{ secrets.GITHUB_TOKEN }} password: ${{ secrets.GITHUB_TOKEN }}
- name: 'Build and publish images' - name: 'Build and publish images'
uses: docker/build-push-action@v5.2.0 uses: docker/build-push-action@v5.3.0
with: with:
context: . context: .
build-args: | build-args: |

View File

@ -38,12 +38,12 @@ jobs:
# Ensures consistent BuildKit version (not coupled to Docker Engine), # Ensures consistent BuildKit version (not coupled to Docker Engine),
# and increased compatibility of the build cache vs mixing buildx drivers. # and increased compatibility of the build cache vs mixing buildx drivers.
- name: 'Set up Docker Buildx' - name: 'Set up Docker Buildx'
uses: docker/setup-buildx-action@v3.1.0 uses: docker/setup-buildx-action@v3.2.0
# Importing from the cache should create the image within approx 30 seconds: # Importing from the cache should create the image within approx 30 seconds:
# NOTE: `qemu` step is not needed as we only test for AMD64. # NOTE: `qemu` step is not needed as we only test for AMD64.
- name: 'Build AMD64 image from cache' - name: 'Build AMD64 image from cache'
uses: docker/build-push-action@v5.2.0 uses: docker/build-push-action@v5.3.0
with: with:
context: . context: .
tags: mailserver-testing:ci tags: mailserver-testing:ci

View File

@ -37,12 +37,12 @@ jobs:
# Ensures consistent BuildKit version (not coupled to Docker Engine), # Ensures consistent BuildKit version (not coupled to Docker Engine),
# and increased compatibility of the build cache vs mixing buildx drivers. # and increased compatibility of the build cache vs mixing buildx drivers.
- name: 'Set up Docker Buildx' - name: 'Set up Docker Buildx'
uses: docker/setup-buildx-action@v3.1.0 uses: docker/setup-buildx-action@v3.2.0
# Importing from the cache should create the image within approx 30 seconds: # Importing from the cache should create the image within approx 30 seconds:
# NOTE: `qemu` step is not needed as we only test for AMD64. # NOTE: `qemu` step is not needed as we only test for AMD64.
- name: 'Build AMD64 image from cache' - name: 'Build AMD64 image from cache'
uses: docker/build-push-action@v5.2.0 uses: docker/build-push-action@v5.3.0
with: with:
context: . context: .
tags: mailserver-testing:ci tags: mailserver-testing:ci

View File

@ -74,6 +74,9 @@ The most noteworthy change of this release is the update of the container's base
- `LOGROTATE_COUNT` defines the number of files kept by logrotate ([#3907](https://github.com/docker-mailserver/docker-mailserver/pull/3907)) - `LOGROTATE_COUNT` defines the number of files kept by logrotate ([#3907](https://github.com/docker-mailserver/docker-mailserver/pull/3907))
- The fail2ban log file is now also taken into account by `LOGROTATE_COUNT` and `LOGROTATE_INTERVAL` ([#3915](https://github.com/docker-mailserver/docker-mailserver/pull/3915), [#3919](https://github.com/docker-mailserver/docker-mailserver/pull/3919)) - The fail2ban log file is now also taken into account by `LOGROTATE_COUNT` and `LOGROTATE_INTERVAL` ([#3915](https://github.com/docker-mailserver/docker-mailserver/pull/3915), [#3919](https://github.com/docker-mailserver/docker-mailserver/pull/3919))
- **Internal:**
- Regular container restarts are now better supported. Setup scripts that ran previously will now be skipped ([#3929](https://github.com/docker-mailserver/docker-mailserver/pull/3929))
### Updates ### Updates
- **Environment Variables:** - **Environment Variables:**

View File

@ -33,7 +33,6 @@ function _register_functions() {
# ? >> Checks # ? >> Checks
_register_check_function '_check_improper_restart'
_register_check_function '_check_hostname' _register_check_function '_check_hostname'
_register_check_function '_check_log_level' _register_check_function '_check_log_level'
_register_check_function '_check_spam_prefix' _register_check_function '_check_spam_prefix'
@ -170,6 +169,9 @@ function _register_functions() {
# ? >> Executing all stacks / actual start of DMS # ? >> Executing all stacks / actual start of DMS
# ------------------------------------------------------------ # ------------------------------------------------------------
# Ensure DMS only adjusts config files for a new container.
# Container restarts should skip as they retain the modified config.
if [[ ! -f /CONTAINER_START ]]; then
_early_supervisor_setup _early_supervisor_setup
_early_variables_setup _early_variables_setup
@ -178,16 +180,24 @@ _log 'info' "Welcome to docker-mailserver ${DMS_RELEASE}"
_register_functions _register_functions
_check _check
_setup _setup
[[ ${LOG_LEVEL} =~ (debug|trace) ]] && print-environment
_run_user_patches _run_user_patches
_start_daemons else
# container was restarted
_early_variables_setup
_log 'info' 'Container was restarted. Skipping setup routines.'
_log 'info' "Welcome to docker-mailserver ${DMS_RELEASE}"
_register_functions
fi
# marker to check if container was restarted # marker to check if container was restarted
date >/CONTAINER_START date >/CONTAINER_START
[[ ${LOG_LEVEL} =~ (debug|trace) ]] && print-environment
_start_daemons
_log 'info' "${HOSTNAME} is up and running" _log 'info' "${HOSTNAME} is up and running"
touch /var/log/mail/mail.log touch /var/log/mail/mail.log
tail -Fn 0 /var/log/mail/mail.log exec tail -Fn 0 /var/log/mail/mail.log
exit 0

View File

@ -14,15 +14,6 @@ function _check() {
done done
} }
function _check_improper_restart() {
_log 'debug' 'Checking for improper restart'
if [[ -f /CONTAINER_START ]]; then
_log 'warn' 'This container was (likely) improperly restarted which can result in undefined behavior'
_log 'warn' "Please use 'docker compose up --force-recreate' or equivalent (view our troubleshooting docs)"
fi
}
function _check_hostname() { function _check_hostname() {
_log 'debug' 'Checking that hostname/domainname is provided or overridden' _log 'debug' 'Checking that hostname/domainname is provided or overridden'

View File

@ -40,7 +40,7 @@ function _early_supervisor_setup() {
if ! grep -q "loglevel = ${SUPERVISOR_LOGLEVEL}" /etc/supervisor/supervisord.conf; then if ! grep -q "loglevel = ${SUPERVISOR_LOGLEVEL}" /etc/supervisor/supervisord.conf; then
case "${SUPERVISOR_LOGLEVEL}" in case "${SUPERVISOR_LOGLEVEL}" in
( 'critical' | 'error' | 'info' | 'debug' ) ( 'critical' | 'error' | 'info' | 'debug' )
sed -i -E \ sedfile -i -E \
"s|(loglevel).*|\1 = ${SUPERVISOR_LOGLEVEL}|g" \ "s|(loglevel).*|\1 = ${SUPERVISOR_LOGLEVEL}|g" \
/etc/supervisor/supervisord.conf /etc/supervisor/supervisord.conf