From e725d75cd9651726dd89e625ab09e8222de20ad5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan-Otto=20Kr=C3=B6pke?= Date: Mon, 29 Jan 2024 09:50:18 +0100 Subject: [PATCH 1/7] Support custom web.xml --- startup.sh | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/startup.sh b/startup.sh index 9195d26..8c3317c 100755 --- a/startup.sh +++ b/startup.sh @@ -109,6 +109,12 @@ if [ "${POSTGRES_JNDI_ENABLED}" = "true" ]; then echo "Installing default context.xml with substituted environment variables" envsubst < "${CONFIG_DIR}"/context.xml > "${CATALINA_HOME}/conf/context.xml" fi + + # Use a custom "web.xml" if the user mounted one into the container + if [ -d "${CONFIG_OVERRIDES_DIR}" ] && [ -f "${CONFIG_OVERRIDES_DIR}/web.xml" ]; then + echo "Installing configuration override for web.xml with substituted environment variables" + envsubst < "${CONFIG_OVERRIDES_DIR}"/web.xml > "$CATALINA_HOME/webapps/geoserver/WEB-INF/web.xml" + fi fi # start the tomcat From c691b3578beee1e927f599cadfa2ad95ae090810 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan-Otto=20Kr=C3=B6pke?= Date: Mon, 29 Jan 2024 11:12:25 +0100 Subject: [PATCH 2/7] Update startup.sh Co-authored-by: Reinout van Rees --- startup.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/startup.sh b/startup.sh index 8c3317c..7de7444 100755 --- a/startup.sh +++ b/startup.sh @@ -113,7 +113,7 @@ if [ "${POSTGRES_JNDI_ENABLED}" = "true" ]; then # Use a custom "web.xml" if the user mounted one into the container if [ -d "${CONFIG_OVERRIDES_DIR}" ] && [ -f "${CONFIG_OVERRIDES_DIR}/web.xml" ]; then echo "Installing configuration override for web.xml with substituted environment variables" - envsubst < "${CONFIG_OVERRIDES_DIR}"/web.xml > "$CATALINA_HOME/webapps/geoserver/WEB-INF/web.xml" + envsubst < "${CONFIG_OVERRIDES_DIR}"/web.xml > "${CATALINA_HOME}/webapps/geoserver/WEB-INF/web.xml" fi fi From d744517e76f720936f79e9cd0c4a0eedc8323970 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan-Otto=20Kr=C3=B6pke?= Date: Mon, 29 Jan 2024 11:14:05 +0100 Subject: [PATCH 3/7] Update startup.sh --- startup.sh | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/startup.sh b/startup.sh index 7de7444..d3f6351 100755 --- a/startup.sh +++ b/startup.sh @@ -113,6 +113,11 @@ if [ "${POSTGRES_JNDI_ENABLED}" = "true" ]; then # Use a custom "web.xml" if the user mounted one into the container if [ -d "${CONFIG_OVERRIDES_DIR}" ] && [ -f "${CONFIG_OVERRIDES_DIR}/web.xml" ]; then echo "Installing configuration override for web.xml with substituted environment variables" + + if [ "${CORS_ENABLED}" = "true" ]; then + echo "Warning: the CORS_ENABLED's changes will be overwritten!" + fi + envsubst < "${CONFIG_OVERRIDES_DIR}"/web.xml > "${CATALINA_HOME}/webapps/geoserver/WEB-INF/web.xml" fi fi From 906cab1267ec926f2647fafb42388611be67f222 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan-Otto=20Kr=C3=B6pke?= Date: Mon, 29 Jan 2024 23:20:17 +0100 Subject: [PATCH 4/7] Update README.md --- README.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/README.md b/README.md index 8c17d2c..6dd7494 100644 --- a/README.md +++ b/README.md @@ -84,6 +84,10 @@ The ``startup.sh`` script allows some customization on startup: * ``CORS_ALLOW_CREDENTIALS`` (default ``false``) **Setting this to ``true`` will only have the desired effect if ``CORS_ALLOWED_ORIGINS`` defines explicit origins (not ``*``)** * ``PROXY_BASE_URL`` to the base URL of the GeoServer web app if GeoServer is behind a proxy. Example: ``https://example.com/geoserver``. +The CORS variables customize tomcat's `web.xml` file. If you need more customization, +you can provide your own customized `web.xml` file to tomcat by mounting it into the container +at `/opt/config_overrides/server.xml`. + Example installing wps and ysld extensions: ```shell From 16fe5727d1c38120d935875fe556b005e8e09d61 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan-Otto=20Kr=C3=B6pke?= Date: Sat, 10 Feb 2024 01:04:48 +0100 Subject: [PATCH 5/7] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 7703d3a..b236764 100644 --- a/README.md +++ b/README.md @@ -86,7 +86,7 @@ The ``startup.sh`` script allows some customization on startup: The CORS variables customize tomcat's `web.xml` file. If you need more customization, you can provide your own customized `web.xml` file to tomcat by mounting it into the container -at `/opt/config_overrides/server.xml`. +at `/opt/config_overrides/web.xml`. Example installing wps and ysld extensions: From 5e9b7ea122724fff92c3973b57b4d50d905c5f2d Mon Sep 17 00:00:00 2001 From: Mark Prins <1165786+mprins@users.noreply.github.com> Date: Tue, 20 Feb 2024 11:19:43 +0100 Subject: [PATCH 6/7] Update TOMCAT_VERSION to 9.0.86 see https://tomcat.apache.org/tomcat-9.0-doc/changelog.html#Tomcat_9.0.86_(remm) --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index f465b0d..78a3cd9 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,6 +1,6 @@ FROM ubuntu:22.04 as tomcat -ARG TOMCAT_VERSION=9.0.84 +ARG TOMCAT_VERSION=9.0.86 ARG CORS_ENABLED=false ARG CORS_ALLOWED_ORIGINS=* ARG CORS_ALLOWED_METHODS=GET,POST,PUT,DELETE,HEAD,OPTIONS From a3f89c5797862b67210072c5b41c30259da768a9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nils=20B=C3=BChner?= Date: Tue, 20 Feb 2024 14:13:30 +0100 Subject: [PATCH 7/7] fix: set tomcat version as environment variable --- Dockerfile | 1 + 1 file changed, 1 insertion(+) diff --git a/Dockerfile b/Dockerfile index f465b0d..bdede97 100644 --- a/Dockerfile +++ b/Dockerfile @@ -8,6 +8,7 @@ ARG CORS_ALLOWED_HEADERS=* ARG CORS_ALLOW_CREDENTIALS=false # Environment variables +ENV TOMCAT_VERSION=$TOMCAT_VERSION ENV CATALINA_HOME=/opt/apache-tomcat-${TOMCAT_VERSION} ENV EXTRA_JAVA_OPTS="-Xms256m -Xmx1g" ENV CORS_ENABLED=$CORS_ENABLED