mirror of
https://github.com/Mailu/Mailu.git
synced 2025-01-30 04:30:49 +02:00
e50f6c58c0
2360: roundcube: disable apache2 access log r=mergify[bot] a=pommi ## What type of PR? bug-fix ## What does this PR do? It disables the access log of apache2 in the roundcube webmail container. Requests are already logged by the front container. The requests logged in the roundcube container contained contained the wrong client IP: the IP address of the front container. ---- Original PR: ~~Roundcube webmail is accessed through the nginx reverse proxy in the front container. Each access logline logged by apache2 in the roundcube container did not contain the actual client IP address, but the IP address of the front container, for example:~~ ``` 192.168.203.3 - - [28/May/2022:12:33:52 +0000] "POST /?_task=mail&_action=refresh HTTP/1.1" 200 677 "https://[REDACTED]/roundcube/?_task=mail&_mbox=INBOX" "Mozilla/5.0 (X11; Linux x86_64; rv:100.0) Gecko/20100101 Firefox/100.0" ^ IP address of the front container ``` ~~By enabling the apache2 remoteip module and configuring it to get the actual client IP address from the X-Forwarded-For header, it logs the correct client IP address to the access log.~~ ### Related issue(s) - None ## Prerequisites Before we can consider review and merge, please make sure the following list is done and checked. If an entry in not applicable, you can check it or remove it from the list. **No changelog or documentation necessary for this minor change.** Co-authored-by: Pim van den Berg <pim@nethuis.nl>
80 lines
3.2 KiB
Docker
80 lines
3.2 KiB
Docker
# NOTE: only add qemu-arm-static if building for arm
|
|
ARG ARCH=""
|
|
ARG QEMU=other
|
|
FROM ${ARCH}php:8.0-apache as build_arm
|
|
ONBUILD COPY --from=balenalib/rpi-alpine:3.14 /usr/bin/qemu-arm-static /usr/bin/qemu-arm-static
|
|
FROM ${ARCH}php:8.0-apache as build_other
|
|
|
|
|
|
FROM build_${QEMU}
|
|
ARG VERSION
|
|
ENV TZ Etc/UTC
|
|
|
|
LABEL version=$VERSION
|
|
|
|
RUN set -eu \
|
|
&& apt-get update \
|
|
&& echo 'debconf debconf/frontend select Noninteractive' | debconf-set-selections \
|
|
&& apt-get install -y --no-install-recommends \
|
|
python3 curl python3-pip git python3-multidict \
|
|
python3-jinja2 gpg gpg-agent tzdata \
|
|
&& pip3 install socrate \
|
|
&& echo date.timezone=UTC > /usr/local/etc/php/conf.d/timezone.ini \
|
|
&& echo "ServerSignature Off\nServerName roundcube" >> /etc/apache2/apache2.conf \
|
|
&& sed -i '/CustomLog.*combined$/d' /etc/apache2/sites-available/000-default.conf \
|
|
\
|
|
&& mark="$(apt-mark showmanual)" \
|
|
&& apt-get install -y --no-install-recommends \
|
|
libfreetype6-dev libicu-dev libjpeg62-turbo-dev libldap2-dev libmagickwand-dev \
|
|
libpng-dev libpq-dev libsqlite3-dev libzip-dev libpspell-dev libonig-dev \
|
|
&& ln -s php.ini-production /usr/local/etc/php/php.ini \
|
|
&& docker-php-ext-configure gd --with-jpeg --with-freetype \
|
|
&& docker-php-ext-install exif gd intl zip pspell pdo_mysql pdo_pgsql pdo_sqlite \
|
|
&& pecl install imagick \
|
|
&& docker-php-ext-enable imagick opcache \
|
|
&& apt-mark auto '.*' >/dev/null \
|
|
&& apt-mark manual ${mark} >/dev/null \
|
|
&& ldd "$(php -r 'echo ini_get("extension_dir");')"/*.so | awk '/=>/ { print $3 }' | sort -u | \
|
|
xargs -r dpkg-query -S | cut -d: -f1 | sort -u | xargs -r apt-mark manual >/dev/null \
|
|
&& apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false \
|
|
&& rm -rf /var/lib/apt/lists
|
|
|
|
ENV ROUNDCUBE_URL https://github.com/roundcube/roundcubemail/releases/download/1.5.2/roundcubemail-1.5.2-complete.tar.gz
|
|
ENV CARDDAV_URL https://github.com/mstilkerich/rcmcarddav/releases/download/v4.3.0/carddav-v4.3.0.tar.gz
|
|
|
|
RUN set -eu \
|
|
&& rm -rf /var/www/html/ \
|
|
&& cd /var/www \
|
|
&& curl -sL ${ROUNDCUBE_URL} | tar xz \
|
|
&& curl -sL ${CARDDAV_URL} | tar xz \
|
|
&& mv roundcubemail-* html \
|
|
&& mv carddav html/plugins/ \
|
|
&& cd html \
|
|
&& rm -rf CHANGELOG.md SECURITY.md INSTALL LICENSE README.md UPGRADING composer.json-dist installer composer.* \
|
|
&& ln -sf index.php /var/www/html/sso.php \
|
|
&& ln -sf /dev/stderr /var/www/html/logs/errors.log \
|
|
&& chown -R root:root . \
|
|
&& chown www-data:www-data logs temp \
|
|
&& chmod -R a+rX . \
|
|
&& a2enmod rewrite deflate expires headers \
|
|
&& 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}
|
|
|
|
# enable database_attachments (and memcache?)
|
|
|
|
COPY mailu.php /var/www/html/plugins/mailu/mailu.php
|
|
COPY php.ini /
|
|
COPY config.inc.php /
|
|
COPY start.py /
|
|
COPY config.inc.carddav.php /var/www/html/plugins/carddav/config.inc.php
|
|
|
|
EXPOSE 80/tcp
|
|
VOLUME /data
|
|
VOLUME /overrides
|
|
|
|
CMD /start.py
|
|
|
|
HEALTHCHECK CMD curl -f -L -H 'User-Agent: health' http://localhost/ || exit 1
|
|
|
|
RUN echo $VERSION >> /version
|