diff --git a/Dockerfile b/Dockerfile index 13c78ab..159bbbc 100644 --- a/Dockerfile +++ b/Dockerfile @@ -56,15 +56,16 @@ COPY virtual.sympa.template /etc/sympa/virtual.sympa.template COPY robot.conf.template /etc/sympa/robot.conf.template COPY nginx.conf.template /etc/nginx/site.conf.template +RUN mkdir /etc/sympa/transport && \ + touch /etc/sympa/transport/sympa_transport && \ + ln -s /etc/sympa/transport/sympa_transport /etc/sympa/sympa_transport + COPY wwsympa /etc/init.d/wwsympa RUN chmod +x /etc/init.d/wwsympa RUN touch /etc/sympa/transport.sympa \ - /etc/sympa/virtual.sympa \ - /etc/sympa/sympa_transport && \ - chmod 0640 /etc/sympa/sympa_transport && \ - chown sympa:sympa /etc/sympa/sympa_transport \ - /etc/sympa/*.sympa + /etc/sympa/virtual.sympa && \ + chown sympa:sympa /etc/sympa/*.sympa RUN postmap hash:/etc/sympa/transport.sympa && \ postmap hash:/etc/sympa/virtual.sympa @@ -79,6 +80,7 @@ EXPOSE 25 80 465 VOLUME /var/lib/sympa \ /var/spool/sympa \ - /etc/sympa/robots + /etc/sympa/robots \ + /etc/sympa/transport ENV DOMAINS="localhost" diff --git a/entrypoint.sh b/entrypoint.sh index 8949810..a793c59 100755 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -4,10 +4,8 @@ cat /etc/sympa/sympa/sympa.conf.template | sed "s/{{MAIN_LIST_DOMAIN}}/$MAIN_LIS rm /etc/postfix/main.cf && cat /etc/postfix/main.cf.template | sed "s/{{MAIN_LIST_DOMAIN}}/$MAIN_LIST_DOMAIN/g" > /etc/postfix/main.cf [[ -d /var/lib/sympa/bounce ]] || mkdir -p /var/lib/sympa/bounce - -chown -R sympa:sympa /etc/sympa/sympa_transport \ - /var/spool/sympa \ - /var/lib/sympa +[[ -d /etc/sympa/transport ]] || mkdir -p /etc/sympa/transport +touch /etc/sympa/transport/sympa_transport LIST_DOMAINS=$(echo $DOMAINS | tr ";" "\n") [[ ! -f /etc/sympa/transport.sympa ]] || rm /etc/sympa/transport.sympa @@ -32,6 +30,10 @@ do echo "Domain $domain added!" done +chown -R sympa:sympa /etc/sympa/transport \ + /var/spool/sympa \ + /var/lib/sympa + chown -R www-data:www-data /etc/nginx/sites-available /etc/nginx/sites-enabled service rsyslog restart