Get rid of hard coded IPs (#441)
Replace them with: * containers' hostnames * gateway's IP address for default SMTP_HOST * Core: when SMTP_HOST undef, echo the default value * docker-compose: add port mapping * docker-compose: drop network driver conf * Exim macro: use localhost as LMTP host * Update README.md * docker-compose: Limit port mapping to loopback * Update other docker-compose example files
This commit is contained in:
@@ -27,14 +27,16 @@ function wait_for_mysql () {
|
||||
echo "# This file is autogenerated at container startup." > /etc/mailman.cfg
|
||||
|
||||
# Check if $MM_HOSTNAME is set, if not, set it to the value returned by
|
||||
# `hostname -i` command to set it to whatever IP address is assigned to the
|
||||
# `hostname` command to set it to whatever hostname is assigned to the
|
||||
# container.
|
||||
if [[ ! -v MM_HOSTNAME ]]; then
|
||||
export MM_HOSTNAME=`hostname -i`
|
||||
export MM_HOSTNAME=`hostname`
|
||||
fi
|
||||
|
||||
# SMTP_HOST defaults to the gateway
|
||||
if [[ ! -v SMTP_HOST ]]; then
|
||||
export SMTP_HOST='172.19.199.1'
|
||||
export SMTP_HOST=$(/sbin/ip route | awk '/default/ { print $3 }')
|
||||
echo "SMPT_HOST not specified, using the gateway ($SMTP_HOST) as default"
|
||||
fi
|
||||
|
||||
if [[ ! -v SMTP_PORT ]]; then
|
||||
|
||||
Reference in New Issue
Block a user