Move Mailcow copy hook into image behind MAILCOW_ENABLED #3
Loading…
Reference in a new issue
No description provided.
Delete branch "evaluate-dockerfile-version-variables"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
What changed
/usr/local/bin/mailcow-hook.shinstead of being mounted at runtime viaPOST_HOOK. ThePOST_HOOKvariable is removed.MAILCOW_ENABLED(true/false, defaultfalse) controls whether the hook runs. Any other value exits before the poll loop.false, the container only dumps PEM files and becomes ready after the first successful dump. SSH keys and the DNS token are not read.true, after a changed dump the hook copies the SMTP certificate to Mailcow over pinned SSH, updates the existing_25._tcp.TLSA record (Cloudflare or deSEC, DNSSEC-checked), and restartspostfix-mailcow,dovecot-mailcow, andnginx-mailcow. Remote certificates are backed up and rolled back on failure..dockerignoreallowsmailcow-hook.sh; the Dockerfile copies and marks it executable.MAILCOW_ENABLED: "false")..openso/memory/mailcow-hook.mdrecording the image-specific decision.Why
The Mailcow hook previously lived in
docker-templatesand was mounted at runtime, which meant each deployment had to ship and keep in sync its own copy. Baking it into the image makes behaviour versioned with the image, and the explicitMAILCOW_ENABLEDswitch keeps dump-only deployments free of SSH and DNS secrets by default.