diff --git a/Dockerfile b/Dockerfile index 3611fbd..672988b 100644 --- a/Dockerfile +++ b/Dockerfile @@ -165,7 +165,7 @@ ADD ./build/etc/default/pure-ftpd-common /etc/default/pure-ftpd-common # --- 15 Install BIND DNS Server, haveged, unbound, rspamd RUN apt-get -y --no-install-recommends install haveged unbound lsb-release; \ - echo "do-ip6: no" >> /etc/unbound/unbound.conf; \ + echo "do-ip6: no" > /etc/unbound/unbound.conf.d/no-ip6v.conf; \ if [ "$BUILD_REDIS" = "yes" ]; then \ apt-get -y --no-install-recommends install redis-server; \ sed -i "s|daemonize yes|daemonize no|" /etc/redis/redis.conf; \ diff --git a/build/supervisor/init.d/rspamd b/build/supervisor/init.d/rspamd index 89a3ea4..0f26871 100755 --- a/build/supervisor/init.d/rspamd +++ b/build/supervisor/init.d/rspamd @@ -9,4 +9,5 @@ chown -R _rspamd:_rspamd /run/rspamd if [ -n "$REDIS_HOST" ]; then echo " - configure redis host as $REDIS_HOST" sed -i "s|servers = \".*\";|servers = \"$REDIS_HOST\";|" /etc/rspamd/local.d/redis.conf + grep -lR ":6379" /etc/rspamd | while read -r F; do sed -i'' 's|servers = .*:6379.*;|servers = "redis:6379";|' $F; done fi diff --git a/build/supervisor/services.d/rspamd b/build/supervisor/services.d/rspamd index 38abe71..9c330e2 100755 --- a/build/supervisor/services.d/rspamd +++ b/build/supervisor/services.d/rspamd @@ -1,5 +1,5 @@ [program:rspamd] -command=/usr/bin/rspamd -f -u _rspamd -c /etc/rspamd/rspamd.conf +command=/usr/bin/rspamd -f -u _rspamd -g _rspamd -c /etc/rspamd/rspamd.conf stdout_logfile=/var/log/rspamd/rspamd.log stderr_logfile=/var/log/rspamd/rspamd.log priority=20 diff --git a/docker-compose.template.yml b/docker-compose.template.yml index c272710..63bf1f0 100644 --- a/docker-compose.template.yml +++ b/docker-compose.template.yml @@ -41,7 +41,7 @@ services: - HOSTNAME_EMAIL=mail.myhost.test.com # Hostname for email - LANGUAGE=en # see ./build/autoinstall.ini # disable services (apache2 clamav-daemon cron dovecot fail2ban mailman mysql postfix postfix pure-ftpd-mysql redis rspamd rsyslog spamassassin ssh unbound) - - DISABLED_SERVICES=mailman + - DISABLED_SERVICES=mailman unbound - POSTGREY_DELAY=300 - POSTGREY_MAX_AGE=35 - POSTGREY_TEXT="Delayed by postgrey" diff --git a/test/bats/tests.sh b/test/bats/tests.sh index f64df0e..0fee66c 100755 --- a/test/bats/tests.sh +++ b/test/bats/tests.sh @@ -14,14 +14,14 @@ setup() { @test "expected supervisor services running" { run docker exec $CONTAINER supervisorctl status - for SERVICE in apache2 clamav-daemon cron dovecot fail2ban mysql php-fpm postfix postgrey pure-ftpd-mysql redis rspamd rsyslog spamassassin ssh unbound; do + for SERVICE in apache2 clamav-daemon cron dovecot fail2ban mysql php-fpm postfix postgrey pure-ftpd-mysql redis rspamd rsyslog spamassassin ssh; do echo "$output" | grep "RUNNING" | grep "$SERVICE" done } @test "expected supervisor services are disabled" { run docker exec $CONTAINER supervisorctl status - for SERVICE in mailman; do + for SERVICE in mailman unbound; do echo "$output" | grep "STOPPED" | grep "$SERVICE" done }