1
0
mirror of https://github.com/mailcow/mailcow-dockerized.git synced 2025-12-12 17:36:01 +00:00

Update Redis connection setup in postfix-tlspol.sh

Refactor Redis connection handling and configuration.
This commit is contained in:
Dmitriy Alekseev
2025-11-13 22:15:01 +01:00
committed by GitHub
parent 0413d26855
commit 156cfbeb4d

View File

@@ -18,11 +18,15 @@ done
# Do not attempt to write to slave
if [[ ! -z ${REDIS_SLAVEOF_IP} ]]; then
export REDIS_CMDLINE="redis-cli -h ${REDIS_SLAVEOF_IP} -p ${REDIS_SLAVEOF_PORT} -a ${REDISPASS} --no-auth-warning"
export REDIS_SERVER="${REDIS_SLAVEOF_IP}"
export REDIS_PORT="${REDIS_SLAVEOF_PORT}"
else
export REDIS_CMDLINE="redis-cli -h redis -p 6379 -a ${REDISPASS} --no-auth-warning"
export REDIS_SERVER="redis"
export REDIS_PORT="6379"
fi
export REDIS_CMDLINE="redis-cli -h ${REDIS_SERVER} -p ${REDIS_PORT} -a ${REDISPASS} --no-auth-warning"
until [[ $(${REDIS_CMDLINE} PING) == "PONG" ]]; do
echo "Waiting for Redis..."
sleep 2
@@ -37,16 +41,13 @@ echo "Postfix OK"
cat <<EOF > /etc/postfix-tlspol/config.yaml
server:
address: 0.0.0.0:8642
log-level: ${LOGLVL}
prefetch: true
cache-file: /var/lib/postfix-tlspol/cache.db
dns:
# must support DNSSEC
address: 127.0.0.11:53
redis:
address: ${REDIS_SERVER}:${REDIS_PORT}
db: 2
EOF
/usr/local/bin/postfix-tlspol -config /etc/postfix-tlspol/config.yaml