roundcube: disable access log

As per discussion in #2360: The front container (nginx reverse proxy) is
already logging all requests, disable the access logs for apache2 in the
roundcube container completely.
master
Pim van den Berg 2 years ago
parent e8b7d6afed
commit 6f884c6c93

@ -1 +0,0 @@
roundcube: log actual client ip by using apache2 remoteip

@ -21,8 +21,7 @@ RUN set -eu \
&& pip3 install socrate \ && pip3 install socrate \
&& echo date.timezone=UTC > /usr/local/etc/php/conf.d/timezone.ini \ && echo date.timezone=UTC > /usr/local/etc/php/conf.d/timezone.ini \
&& echo "ServerSignature Off\nServerName roundcube" >> /etc/apache2/apache2.conf \ && echo "ServerSignature Off\nServerName roundcube" >> /etc/apache2/apache2.conf \
&& sed -i 's,LogFormat "%h \(.*\) combined,Logformat "%a \1 combined,' /etc/apache2/apache2.conf \ && sed -i '/CustomLog.*combined$/d' /etc/apache2/sites-available/000-default.conf \
&& sed -i 's,CustomLog.*combined$,\0 "'"expr=!(%{HTTP_USER_AGENT}=='health'\&\&(-R '127.0.0.1/8' || -R '::1'))"'",' /etc/apache2/sites-available/000-default.conf \
\ \
&& mark="$(apt-mark showmanual)" \ && mark="$(apt-mark showmanual)" \
&& apt install -y --no-install-recommends \ && apt install -y --no-install-recommends \
@ -57,7 +56,7 @@ RUN set -eu \
&& chown -R root:root . \ && chown -R root:root . \
&& chown www-data:www-data logs temp \ && chown www-data:www-data logs temp \
&& chmod -R a+rX . \ && chmod -R a+rX . \
&& a2enmod rewrite deflate expires headers remoteip \ && a2enmod rewrite deflate expires headers \
&& echo date.timezone=${TZ} > /usr/local/etc/php/conf.d/timezone.ini \ && echo date.timezone=${TZ} > /usr/local/etc/php/conf.d/timezone.ini \
&& rm -rf plugins/{autologon,example_addressbook,http_authentication,krb_authentication,new_user_identity,password,redundant_attachments,squirrelmail_usercopy,userinfo,virtuser_file,virtuser_query} && rm -rf plugins/{autologon,example_addressbook,http_authentication,krb_authentication,new_user_identity,password,redundant_attachments,squirrelmail_usercopy,userinfo,virtuser_file,virtuser_query}
@ -66,7 +65,6 @@ RUN set -eu \
COPY mailu.php /var/www/html/plugins/mailu/mailu.php COPY mailu.php /var/www/html/plugins/mailu/mailu.php
COPY php.ini / COPY php.ini /
COPY config.inc.php / COPY config.inc.php /
COPY remoteip.conf /
COPY start.py / COPY start.py /
COPY config.inc.carddav.php /var/www/html/plugins/carddav/config.inc.php COPY config.inc.carddav.php /var/www/html/plugins/carddav/config.inc.php

@ -1,2 +0,0 @@
RemoteIPHeader X-Forwarded-For
RemoteIPTrustedProxy {{ FRONT_ADDRESS }}

@ -72,9 +72,8 @@ conf.jinja("/config.inc.php", context, "/var/www/html/config/config.inc.php")
# create dirs # create dirs
os.system("mkdir -p /data/gpg") os.system("mkdir -p /data/gpg")
# configure apache2 # disable access log for VirtualHosts that don't define their own logfile
conf.jinja("/remoteip.conf", context, "/etc/apache2/conf-available/remoteip.conf") os.system("a2disconf other-vhosts-access-log")
os.system("a2enconf remoteip")
print("Initializing database") print("Initializing database")
try: try:

Loading…
Cancel
Save