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/5] 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/5] 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/5] 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/5] 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/5] 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: