Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ ENV MW_VERSION=REL1_39 \
MW_VOLUME=/mediawiki \
WWW_USER=www-data \
WWW_GROUP=www-data \
PHP_LOG_DIR=/var/log/php-fpm \
APACHE_LOG_DIR=/var/log/apache2

# System setup
Expand Down Expand Up @@ -84,6 +85,7 @@ RUN set -x; \
&& a2enmod proxy_fcgi \
# Create directories
&& mkdir -p $MW_HOME \
&& mkdir -p $PHP_LOG_DIR \
&& mkdir -p $MW_ORIGIN_FILES \
&& mkdir -p $MW_VOLUME

Expand Down Expand Up @@ -201,7 +203,7 @@ ENV MW_ENABLE_JOB_RUNNER=true \
COPY _sources/configs/msmtprc /etc/
COPY _sources/configs/mediawiki.conf /etc/apache2/sites-enabled/
COPY _sources/configs/status.conf /etc/apache2/mods-available/
COPY _sources/configs/php_error_reporting.ini _sources/configs/php_upload_max_filesize.ini /etc/php/8.1/cli/conf.d/
COPY _sources/configs/php_cli_error_reporting.ini _sources/configs/php_upload_max_filesize.ini /etc/php/8.1/cli/conf.d/
COPY _sources/configs/php_error_reporting.ini _sources/configs/php_upload_max_filesize.ini /etc/php/8.1/fpm/conf.d/
COPY _sources/configs/php_max_input_vars.ini _sources/configs/php_max_input_vars.ini /etc/php/8.1/fpm/conf.d/
COPY _sources/configs/php_timeouts.ini /etc/php/8.1/fpm/conf.d/
Expand Down
10 changes: 10 additions & 0 deletions _sources/configs/mediawiki.conf
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,16 @@ RewriteRule ^/?w/img_auth.php/ - [L]
RedirectMatch 404 /\.git
# Disable directory indexing
Options -Indexes

######## Overwrite log format to include X-Forwarded-For if it is provided ########
RemoteIPHeader X-Forwarded-For
RemoteIPInternalProxy 10.0.0.0/8
RemoteIPInternalProxy 172.16.0.0/12
RemoteIPInternalProxy 192.168.0.0/16

LogFormat "%a %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" docker

CustomLog "|/usr/bin/rotatelogs -c -f -l -p /rotatelogs-compress.sh -L /var/log/apache2/access_log.current /var/log/apache2/access_log_%Y%m%d 86400" docker
# Disable directory indexing
ErrorLog "|/usr/bin/rotatelogs -c -f -l -p /rotatelogs-compress.sh -L /var/log/apache2/error_log.current /var/log/apache2/error_log_%Y%m%d 86400"
# Overwrite log format to include X-Forwarded-For if it is provided
Expand Down
5 changes: 5 additions & 0 deletions _sources/configs/php_cli_error_reporting.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
log_errors=stderr
; must be an integer, see
; https://www.php.net/manual/en/function.error-reporting
; https://www.php.net/manual/en/errorfunc.constants.php
error_reporting = E_ALL & ~E_DEPRECATED & ~E_STRICT
1 change: 1 addition & 0 deletions _sources/configs/php_error_reporting.ini
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
log_errors=On
error_log = "${PHP_LOG_DIR}/php_error.log"
; must be an integer, see
; https://www.php.net/manual/en/function.error-reporting
; https://www.php.net/manual/en/errorfunc.constants.php
Expand Down