0
0
Fork 0
mirror of https://github.com/nextcloud/docker.git synced 2025-03-15 19:05:09 +01:00

Allow Referrer-Policy header to be configured

This commit is contained in:
Louis Matthijssen 2018-09-07 22:09:02 +02:00
parent 4549fd56a9
commit 6bcc8c6770
No known key found for this signature in database
GPG key ID: 188D1103419E4C20
5 changed files with 23 additions and 7 deletions

View file

@ -95,14 +95,18 @@ RUN { \
VOLUME /var/www/html VOLUME /var/www/html
RUN a2enmod rewrite remoteip ;\ RUN a2enmod rewrite remoteip env headers ;\
{\ {\
echo RemoteIPHeader X-Real-IP ;\ echo RemoteIPHeader X-Real-IP ;\
echo RemoteIPTrustedProxy 10.0.0.0/8 ;\ echo RemoteIPTrustedProxy 10.0.0.0/8 ;\
echo RemoteIPTrustedProxy 172.16.0.0/12 ;\ echo RemoteIPTrustedProxy 172.16.0.0/12 ;\
echo RemoteIPTrustedProxy 192.168.0.0/16 ;\ echo RemoteIPTrustedProxy 192.168.0.0/16 ;\
} > /etc/apache2/conf-available/remoteip.conf;\ } > /etc/apache2/conf-available/remoteip.conf;\
a2enconf remoteip {\
echo PassEnv APACHE_REFERRER_POLICY ;\
echo Header set Referrer-Policy "%{APACHE_REFERRER_POLICY}e" "env=APACHE_REFERRER_POLICY" ;\
} > /etc/apache2/conf-available/referrerpolicy.conf;\
a2enconf remoteip referrerpolicy
ENV NEXTCLOUD_VERSION 12.0.11 ENV NEXTCLOUD_VERSION 12.0.11

View file

@ -95,14 +95,18 @@ RUN { \
VOLUME /var/www/html VOLUME /var/www/html
RUN a2enmod rewrite remoteip ;\ RUN a2enmod rewrite remoteip env headers ;\
{\ {\
echo RemoteIPHeader X-Real-IP ;\ echo RemoteIPHeader X-Real-IP ;\
echo RemoteIPTrustedProxy 10.0.0.0/8 ;\ echo RemoteIPTrustedProxy 10.0.0.0/8 ;\
echo RemoteIPTrustedProxy 172.16.0.0/12 ;\ echo RemoteIPTrustedProxy 172.16.0.0/12 ;\
echo RemoteIPTrustedProxy 192.168.0.0/16 ;\ echo RemoteIPTrustedProxy 192.168.0.0/16 ;\
} > /etc/apache2/conf-available/remoteip.conf;\ } > /etc/apache2/conf-available/remoteip.conf;\
a2enconf remoteip {\
echo PassEnv APACHE_REFERRER_POLICY ;\
echo Header set Referrer-Policy "%{APACHE_REFERRER_POLICY}e" "env=APACHE_REFERRER_POLICY" ;\
} > /etc/apache2/conf-available/referrerpolicy.conf;\
a2enconf remoteip referrerpolicy
ENV NEXTCLOUD_VERSION 13.0.6 ENV NEXTCLOUD_VERSION 13.0.6

View file

@ -95,14 +95,18 @@ RUN { \
VOLUME /var/www/html VOLUME /var/www/html
RUN a2enmod rewrite remoteip ;\ RUN a2enmod rewrite remoteip env headers ;\
{\ {\
echo RemoteIPHeader X-Real-IP ;\ echo RemoteIPHeader X-Real-IP ;\
echo RemoteIPTrustedProxy 10.0.0.0/8 ;\ echo RemoteIPTrustedProxy 10.0.0.0/8 ;\
echo RemoteIPTrustedProxy 172.16.0.0/12 ;\ echo RemoteIPTrustedProxy 172.16.0.0/12 ;\
echo RemoteIPTrustedProxy 192.168.0.0/16 ;\ echo RemoteIPTrustedProxy 192.168.0.0/16 ;\
} > /etc/apache2/conf-available/remoteip.conf;\ } > /etc/apache2/conf-available/remoteip.conf;\
a2enconf remoteip {\
echo PassEnv APACHE_REFERRER_POLICY ;\
echo Header set Referrer-Policy "%{APACHE_REFERRER_POLICY}e" "env=APACHE_REFERRER_POLICY" ;\
} > /etc/apache2/conf-available/referrerpolicy.conf;\
a2enconf remoteip referrerpolicy
ENV NEXTCLOUD_VERSION 14.0.0 ENV NEXTCLOUD_VERSION 14.0.0

View file

@ -122,6 +122,10 @@ If you want you can set the data directory and table prefix, otherwise default v
- `NEXTCLOUD_DATA_DIR` (default: _/var/www/html/data_) Configures the data directory where nextcloud stores all files from the users. - `NEXTCLOUD_DATA_DIR` (default: _/var/www/html/data_) Configures the data directory where nextcloud stores all files from the users.
- `NEXTCLOUD_TABLE_PREFIX` (default: _""_) Optional prefix for the tables. Used to be `oc_` in the past - `NEXTCLOUD_TABLE_PREFIX` (default: _""_) Optional prefix for the tables. Used to be `oc_` in the past
If you want you can set the `Referrer-Policy` header, otherwise the header won't be added to the response.
- `APACHE_REFERRER_POLICY` Sets the value of the `Referrer-Policy` header (`apache` variant only).
# Running this image with docker-compose # Running this image with docker-compose
The easiest way to get a fully featured and functional setup is using a `docker-compose` file. There are too many different possibilities to setup your system, so here are only some examples what you have to look for. The easiest way to get a fully featured and functional setup is using a `docker-compose` file. There are too many different possibilities to setup your system, so here are only some examples what you have to look for.

View file

@ -19,7 +19,7 @@ declare -A base=(
) )
declare -A extras=( declare -A extras=(
[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' [apache]='\nRUN a2enmod rewrite remoteip env headers ;\\\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 {\\\n echo PassEnv APACHE_REFERRER_POLICY ;\\\n echo Header set Referrer-Policy "%{APACHE_REFERRER_POLICY}e" "env=APACHE_REFERRER_POLICY" ;\\\n } > /etc/apache2/conf-available/referrerpolicy.conf;\\\n a2enconf remoteip referrerpolicy'
[fpm]='' [fpm]=''
[fpm-alpine]='' [fpm-alpine]=''
) )