diff --git a/farmos3/Dockerfile b/farmos3/Dockerfile index 321ee18..b07228c 100644 --- a/farmos3/Dockerfile +++ b/farmos3/Dockerfile @@ -1,5 +1,5 @@ # Use the official Drupal 10 image to build GEOS PHP extension. -FROM drupal:10.1 as php-dependencies +FROM drupal:10.1 AS php-dependencies # Build and install the GEOS PHP extension. # See https://git.osgeo.org/gitea/geos/php-geos @@ -67,7 +67,7 @@ COPY services.yml /opt/drupal/web/sites/default/ # Copy the settings.php file into the container so that the # default database connection information is set. -copy settings.php /opt/drupal/web/sites/default/ +COPY settings.php /opt/drupal/web/sites/default/ RUN chown www-data:www-data /opt/drupal/web/sites/default/settings.php # Generate the API keys that are needed by FarmData2 diff --git a/farmos3/repo.txt b/farmos3/repo.txt index 6dce392..4b73be9 100644 --- a/farmos3/repo.txt +++ b/farmos3/repo.txt @@ -1 +1 @@ -farmos3:fd2.1 \ No newline at end of file +farmos3:fd2.2 \ No newline at end of file diff --git a/farmos3/settings.php b/farmos3/settings.php index 767e6aa..816dc8a 100644 --- a/farmos3/settings.php +++ b/farmos3/settings.php @@ -355,7 +355,7 @@ * Be aware, however, that it is likely that this would allow IP * address spoofing unless more advanced precautions are taken. */ -# $settings['reverse_proxy'] = TRUE; +$settings['reverse_proxy'] = TRUE; /** * Reverse proxy addresses. @@ -365,6 +365,7 @@ * $settings['reverse_proxy'] is TRUE. */ # $settings['reverse_proxy_addresses'] = ['a.b.c.d', 'e.f.g.h/24', ...]; +$settings['reverse_proxy_addresses'] = [$_SERVER['REMOTE_ADDR']]; /** * Reverse proxy trusted headers. @@ -400,8 +401,7 @@ * @see \Symfony\Component\HttpFoundation\Request::HEADER_FORWARDED * @see \Symfony\Component\HttpFoundation\Request::setTrustedProxies */ -# $settings['reverse_proxy_trusted_headers'] = \Symfony\Component\HttpFoundation\Request::HEADER_X_FORWARDED_FOR | \Symfony\Component\HttpFoundation\Request::HEADER_X_FORWARDED_HOST | \Symfony\Component\HttpFoundation\Request::HEADER_X_FORWARDED_PORT | \Symfony\Component\HttpFoundation\Request::HEADER_X_FORWARDED_PROTO | \Symfony\Component\HttpFoundation\Request::HEADER_FORWARDED; - +$settings['reverse_proxy_trusted_headers'] = \Symfony\Component\HttpFoundation\Request::HEADER_X_FORWARDED_FOR | \Symfony\Component\HttpFoundation\Request::HEADER_X_FORWARDED_HOST | \Symfony\Component\HttpFoundation\Request::HEADER_X_FORWARDED_PORT | \Symfony\Component\HttpFoundation\Request::HEADER_X_FORWARDED_PROTO | \Symfony\Component\HttpFoundation\Request::HEADER_FORWARDED; /** * Page caching: diff --git a/nginx/Dockerfile b/nginx/Dockerfile new file mode 100644 index 0000000..e6b9720 --- /dev/null +++ b/nginx/Dockerfile @@ -0,0 +1,7 @@ +# All we want to do here is get the base image +# and push it to the farmdata2 repo on DockerHub. +# +# We build and store our own images so that we can +# upgrade / update in a fully controlled way. + +FROM nginx:stable-alpine3.23 diff --git a/nginx/repo.txt b/nginx/repo.txt new file mode 100644 index 0000000..4155361 --- /dev/null +++ b/nginx/repo.txt @@ -0,0 +1 @@ +nginx:fd2.1 \ No newline at end of file