Skip to content

Commit

Permalink
apache: set the remote ip from X-Real-IP by default (nextcloud#297)
Browse files Browse the repository at this point in the history
  • Loading branch information
Loic Dachary authored and pierreozoux committed Apr 1, 2018
1 parent e49cfb4 commit e01caa9
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 5 deletions.
9 changes: 8 additions & 1 deletion 11.0/apache/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,14 @@ RUN { \

VOLUME /var/www/html

RUN a2enmod rewrite
RUN a2enmod rewrite remoteip ;\
{\
echo RemoteIPHeader X-Real-IP ;\
echo RemoteIPTrustedProxy 10.0.0.0/8 ;\
echo RemoteIPTrustedProxy 172.16.0.0/12 ;\
echo RemoteIPTrustedProxy 192.168.0.0/16 ;\
} > /etc/apache2/conf-available/remoteip.conf;\
a2enconf remoteip

ENV NEXTCLOUD_VERSION 11.0.8

Expand Down
9 changes: 8 additions & 1 deletion 12.0/apache/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,14 @@ RUN { \

VOLUME /var/www/html

RUN a2enmod rewrite
RUN a2enmod rewrite remoteip ;\
{\
echo RemoteIPHeader X-Real-IP ;\
echo RemoteIPTrustedProxy 10.0.0.0/8 ;\
echo RemoteIPTrustedProxy 172.16.0.0/12 ;\
echo RemoteIPTrustedProxy 192.168.0.0/16 ;\
} > /etc/apache2/conf-available/remoteip.conf;\
a2enconf remoteip

ENV NEXTCLOUD_VERSION 12.0.6

Expand Down
9 changes: 8 additions & 1 deletion 13.0/apache/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,14 @@ RUN { \

VOLUME /var/www/html

RUN a2enmod rewrite
RUN a2enmod rewrite remoteip ;\
{\
echo RemoteIPHeader X-Real-IP ;\
echo RemoteIPTrustedProxy 10.0.0.0/8 ;\
echo RemoteIPTrustedProxy 172.16.0.0/12 ;\
echo RemoteIPTrustedProxy 192.168.0.0/16 ;\
} > /etc/apache2/conf-available/remoteip.conf;\
a2enconf remoteip

ENV NEXTCLOUD_VERSION 13.0.1

Expand Down
4 changes: 2 additions & 2 deletions update.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ declare -A base=(
)

declare -A extras=(
[apache]='\nRUN a2enmod rewrite'
[apache]='\nRUN 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]=''
)
Expand Down Expand Up @@ -68,7 +68,7 @@ function create_variant() {
s/%%VERSION%%/'"$fullversion"'/g;
s/%%BASE_DOWNLOAD_URL%%/'"$2"'/g;
s/%%CMD%%/'"${cmd[$variant]}"'/g;
s/%%VARIANT_EXTRAS%%/'"${extras[$variant]}"'/g;
s|%%VARIANT_EXTRAS%%|'"${extras[$variant]}"'|g;
s/%%APCU_VERSION%%/'"${pecl_versions[APCu]}"'/g;
s/%%MEMCACHED_VERSION%%/'"${pecl_versions[memcached]}"'/g;
s/%%REDIS_VERSION%%/'"${pecl_versions[redis]}"'/g;
Expand Down

0 comments on commit e01caa9

Please sign in to comment.