1
0
mirror of https://blitiri.com.ar/repos/chasquid synced 2025-12-18 14:47:03 +00:00

docker: Fix duplicate "hostname" configuration entry

When the chasquid docker container is restarted, entrypoint.sh will add
the hostname again, even if it is present.

This causes chasquid to fail to start due to the duplicated option
(`non-repeated field "hostname" is repeated`).

Thanks to Jaywann@github for finding and reporting this problem, on
https://github.com/albertito/chasquid/issues/16.

This patch fixes the issue by only adding the option if it isn't already
present.
This commit is contained in:
Alberto Bertogli
2021-01-28 09:48:48 +00:00
parent 5c09138db8
commit 5305d58418
2 changed files with 4 additions and 2 deletions

View File

@@ -30,6 +30,7 @@ ENCPASS=$(doveadm pw -u "${EMAIL}" -p "${PASSWORD}")
# Edit dovecot users: remove user if it exits.
mkdir -p /data/dovecot
touch /data/dovecot/users
if grep -q "^${EMAIL}:" /data/dovecot/users; then
cp /data/dovecot/users /data/dovecot/users.old
cat /data/dovecot/users.old | grep -v "^${EMAIL}:" \

View File

@@ -95,8 +95,9 @@ done >> /etc/dovecot/auto-ssl.conf
# Pick the default domain as default hostname for chasquid. This is only used
# in plain text sessions and on very rare cases, and it's mostly for aesthetic
# purposes.
echo "hostname: '$ONE_DOMAIN'" >> /etc/chasquid/chasquid.conf
if ! grep -iq "hostname:" /etc/chasquid/chasquid.conf; then
echo "hostname: '$ONE_DOMAIN'" >> /etc/chasquid/chasquid.conf
fi
# Start the services: dovecot in background, chasquid in foreground.
start-stop-daemon --start --quiet --pidfile /run/dovecot.pid \