2
0
Fork 0
mirror of https://github.com/friendica/docker synced 2025-12-07 22:07:09 +01:00

Move log settings code from dockerfile templates to update.sh script

This commit is contained in:
m33 2025-02-09 12:40:04 +01:00
commit 30184c792d
3 changed files with 3 additions and 13 deletions

View file

@ -128,8 +128,6 @@ RUN set -ex; \
echo 'post_max_size=${PHP_UPLOAD_LIMIT}'; \
} > /usr/local/etc/php/conf.d/friendica.ini; \
ln -s /usr/local/etc/php/php.ini-production /usr/local/etc/php/php.ini; \
\
echo 'access.format ="%{HTTP_X_FORWARDED_FOR}e - %u %t \"%m %r\" %s"' >> /usr/local/etc/php-fpm.d/docker.conf; \
\
mkdir /var/www/data; \
chown -R www-data:root /var/www; \

View file

@ -150,14 +150,6 @@ RUN set -ex; \
} > /usr/local/etc/php/conf.d/friendica.ini; \
ln -s /usr/local/etc/php/php.ini-production /usr/local/etc/php/php.ini; \
\
# Set remote client IP logging for apache and fpm image variants
if [ "%%VARIANT%%" != "apache" ]; then \
echo 'access.format = "%{HTTP_X_FORWARDED_FOR}e - %u %t \"%m %r\" %s"' 1>> /usr/local/etc/php-fpm.d/docker.conf; \
else \
cat /etc/apache2/apache2.conf | sed 's/LogFormat "%h/LogFormat "%{X-Forwarded-for}i/' > /tmp/apache2.conf; \
cat /tmp/apache2.conf > /etc/apache2/apache2.conf ; rm -f /tmp/apache2.conf; \
fi; \
\
mkdir /var/www/data; \
chown -R www-data:root /var/www; \
chmod -R g=u /var/www

View file

@ -18,9 +18,9 @@ declare -A base=(
)
declare -A extras=(
[apache]='\nRUN set -ex;\\\n a2enmod rewrite remoteip ;\\\n {\\\n echo RemoteIPHeader X-Real-IP ;\\\n echo RemoteIPTrustedProxy 10.0.0.0/8 ;\\\n echo RemoteIPTrustedProxy 172.16.0.0/12 ;\\\n echo RemoteIPTrustedProxy 192.168.0.0/16 ;\\\n } > /etc/apache2/conf-available/remoteip.conf;\\\n a2enconf remoteip'
[fpm]=''
[fpm-alpine]=''
[apache]='\nRUN set -ex; \\\n a2enmodw rewrite remoteip ;\\\n {\\\n echo RemoteIPHeader X-Real-IP ;\\\n echo RemoteIPTrustedProxy 10.0.0.0/8 ;\\\n echo RemoteIPTrustedProxy 172.16.0.0/12 ;\\\n echo RemoteIPTrustedProxy 192.168.0.0/16 ;\\\n } > /etc/apache2/conf-available/remoteip.conf;\\\n a2enconf remoteip'
[fpm]="\nRUN set -ex; \\\ \\n echo access.format = \\\'%{HTTP_X_FORWARDED_FOR}e - %u %t \\\\\"%m %r\\\\\" %s\\\' >> /usr/local/etc/php-fpm.d/docker.conf; \n"
[fpm-alpine]="\nRUN set -ex; \\\ \\n echo access.format = \\\'%{HTTP_X_FORWARDED_FOR}e - %u %t \\\\\"%m %r\\\\\" %s\\\' >> /usr/local/etc/php-fpm.d/docker.conf; \n"
)
declare -A entrypoints=(