Skip to content

Commit

Permalink
adding RemoteIPHeader config
Browse files Browse the repository at this point in the history
  • Loading branch information
ctot-nondef committed Oct 9, 2023
1 parent 849130f commit 9a051a5
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
3 changes: 2 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ RUN apt update &&\
git clone --depth 1 --recurse-submodules https://github.com/acdh-oeaw/aksearch.git /usr/local/vufind &&\
### Apache \
a2enmod rewrite &&\
a2enmod remoteip &&\
ln -s /var/www/local/config/vufind/httpd-vufind.conf /etc/apache2/conf-enabled/vufind.conf &&\
sed -i '/^<\/Location>/i #SetEnv APPLICATION_ENV ""' /etc/apache2/conf-enabled/vufind.conf &&\
# environment variables are set by the start.sh script (which allows setting them by `docker run`) \
Expand All @@ -33,7 +34,7 @@ COPY harvest_degruyter.sh /var/www/vufind/harvest/harvest_degruyter.sh
COPY health_check_and_harvest.sh /var/www/vufind/harvest/health_check_and_harvest.sh
### AkSearch config tuning which can be done as a www-data user
USER www-data
RUN cd /usr/local/vufind &&\
RUN cd /usr/local/vufind &&\
# remove automatic installation of solr and swaggerui \
sed -i -e '/phing-install-dependencies/d' composer.json &&\
# for composer v2 compatibility \
Expand Down
3 changes: 3 additions & 0 deletions local/config/vufind/httpd-vufind.conf
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,9 @@ AliasMatch ^/resources/cache/(.*)$ /usr/local/vufind/local/cache/public/$1
# Configuration for general VuFind base:
Alias /resources /usr/local/vufind/public
<Directory /usr/local/vufind/public/>
<IfModule mod_remoteip.c>
RemoteIPHeader X-Forwarded-For
</IfModule>
<If "%{HTTP_USER_AGENT} =~ /bytedance/">
Require all denied
</If>
Expand Down

0 comments on commit 9a051a5

Please sign in to comment.