mirror of
https://github.com/chatmail/relay.git
synced 2026-05-20 12:58:04 +00:00
docker: trim chatmail init comments
This commit is contained in:
@@ -11,8 +11,6 @@ if [ -z "$MAIL_DOMAIN" ]; then
|
|||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
### MAIN
|
|
||||||
|
|
||||||
if [ ! -f /etc/dkimkeys/opendkim.private ]; then
|
if [ ! -f /etc/dkimkeys/opendkim.private ]; then
|
||||||
/usr/sbin/opendkim-genkey -D /etc/dkimkeys -d "$MAIL_DOMAIN" -s opendkim
|
/usr/sbin/opendkim-genkey -D /etc/dkimkeys -d "$MAIL_DOMAIN" -s opendkim
|
||||||
fi
|
fi
|
||||||
@@ -34,9 +32,7 @@ fi
|
|||||||
|
|
||||||
# --- Deploy fingerprint: skip cmdeploy run if nothing changed ---
|
# --- Deploy fingerprint: skip cmdeploy run if nothing changed ---
|
||||||
# On restart with identical image+config, systemd already brings up all
|
# On restart with identical image+config, systemd already brings up all
|
||||||
# enabled services — the full cmdeploy run is redundant (~30s saved).
|
# enabled services only configure+activate are needed here.
|
||||||
# The install stage runs at image build time (Dockerfile), so only
|
|
||||||
# configure+activate are needed here.
|
|
||||||
IMAGE_VERSION_FILE="/etc/chatmail-image-version"
|
IMAGE_VERSION_FILE="/etc/chatmail-image-version"
|
||||||
FINGERPRINT_FILE="/etc/chatmail/.deploy-fingerprint"
|
FINGERPRINT_FILE="/etc/chatmail/.deploy-fingerprint"
|
||||||
image_ver="none"
|
image_ver="none"
|
||||||
@@ -44,16 +40,16 @@ image_ver="none"
|
|||||||
config_hash=$(sha256sum "$CHATMAIL_INI" | cut -c1-16)
|
config_hash=$(sha256sum "$CHATMAIL_INI" | cut -c1-16)
|
||||||
current_fp="${image_ver}:${config_hash}"
|
current_fp="${image_ver}:${config_hash}"
|
||||||
|
|
||||||
# CMDEPLOY_STAGES non-empty in env = operator override → always run.
|
# CMDEPLOY_STAGES non-empty in env = operator override -> always run.
|
||||||
# Otherwise, if fingerprint matches the last successful deploy, skip.
|
# Otherwise, if fingerprint matches the last successful deploy, skip.
|
||||||
if [ -z "${CMDEPLOY_STAGES:-}" ] \
|
if [ -z "${CMDEPLOY_STAGES:-}" ] \
|
||||||
&& [ -f "$FINGERPRINT_FILE" ] \
|
&& [ -f "$FINGERPRINT_FILE" ] \
|
||||||
&& [ "$(cat "$FINGERPRINT_FILE")" = "$current_fp" ]; then
|
&& [ "$(cat "$FINGERPRINT_FILE")" = "$current_fp" ]; then
|
||||||
echo "[INFO] No changes detected ($current_fp), skipping deploy."
|
echo "[INFO] No changes detected ($current_fp), skipping deploy."
|
||||||
else
|
else
|
||||||
# Stop chatmail services so the port check sees a clean state.
|
# Stop chatmail services so the port check sees a clean state as
|
||||||
# (ss -p inside Docker can't always identify processes, causing false
|
# ss -p inside Docker can't identify processes, causing false
|
||||||
# "port occupied" failures.) The activate stage will restart them.
|
# "port occupied" failures
|
||||||
echo "[INFO] Stopping services for clean port check..."
|
echo "[INFO] Stopping services for clean port check..."
|
||||||
systemctl stop postfix dovecot nginx opendkim unbound \
|
systemctl stop postfix dovecot nginx opendkim unbound \
|
||||||
filtermail doveauth chatmail-metadata iroh-relay mtail fcgiwrap 2>/dev/null || true
|
filtermail doveauth chatmail-metadata iroh-relay mtail fcgiwrap 2>/dev/null || true
|
||||||
|
|||||||
Reference in New Issue
Block a user