mirror of
https://github.com/chatmail/relay.git
synced 2026-05-14 18:04:38 +00:00
docker: drop env to ini translation, use chatmail.ini directly
Remove update_ini.sh and the env-var-to-ini pipeline. The container now has two config modes: - Simple: set MAIL_DOMAIN in .env, container generates chatmail.ini with defaults via `cmdeploy init` on first start. - Advanced: mount a custom chatmail.ini into the container; the init step is skipped when the file already exists. This eliminates the fragile FORCE_REINIT_INI_FILE / INI_CMD_ARGS machinery and the env vars that duplicated chatmail.ini settings Also add *.ini and .env to .dockerignore so local config files don't leak into the image.
This commit is contained in:
@@ -5,7 +5,6 @@ export CHATMAIL_INI="${CHATMAIL_INI:-/etc/chatmail/chatmail.ini}"
|
||||
export ENABLE_CERTS_MONITORING="${ENABLE_CERTS_MONITORING:-true}"
|
||||
export CERTS_MONITORING_TIMEOUT="${CERTS_MONITORING_TIMEOUT:-60}"
|
||||
export PATH_TO_SSL="${PATH_TO_SSL:-/var/lib/acme/live/${MAIL_DOMAIN}}"
|
||||
export CHANGE_KERNEL_SETTINGS=${CHANGE_KERNEL_SETTINGS:-"False"}
|
||||
|
||||
CMDEPLOY=/opt/cmdeploy/bin/cmdeploy
|
||||
|
||||
@@ -43,20 +42,15 @@ monitor_certificates() {
|
||||
|
||||
### MAIN
|
||||
|
||||
if [ "$FORCE_REINIT_INI_FILE" = true ]; then
|
||||
INI_CMD_ARGS=--force
|
||||
fi
|
||||
|
||||
if [ ! -f /etc/dkimkeys/opendkim.private ]; then
|
||||
/usr/sbin/opendkim-genkey -D /etc/dkimkeys -d $MAIL_DOMAIN -s opendkim
|
||||
fi
|
||||
chown opendkim:opendkim /etc/dkimkeys/opendkim.private
|
||||
chown opendkim:opendkim /etc/dkimkeys/opendkim.txt
|
||||
|
||||
# Create chatmail.ini from env vars (skips if file already exists, e.g. volume-mounted)
|
||||
# Create chatmail.ini (skips if file already exists, e.g. volume-mounted)
|
||||
mkdir -p "$(dirname "$CHATMAIL_INI")"
|
||||
$CMDEPLOY init --config "$CHATMAIL_INI" $INI_CMD_ARGS $MAIL_DOMAIN || true
|
||||
INI_FILE="$CHATMAIL_INI" bash /update_ini.sh
|
||||
$CMDEPLOY init --config "$CHATMAIL_INI" $MAIL_DOMAIN || true
|
||||
|
||||
export CMDEPLOY_STAGES="${CMDEPLOY_STAGES:-configure,activate}"
|
||||
$CMDEPLOY run --ssh-host @docker
|
||||
|
||||
Reference in New Issue
Block a user