diff --git a/README.md b/README.md index 41a824e..2bb21ed 100644 --- a/README.md +++ b/README.md @@ -52,6 +52,7 @@ If you're running `Docker Toolbox` then start a web browser session to ` +* **TOMCAT_REQUEST_HEADER_LIMIT**: Request header limit for the Tomcat Server ## HTTPS SSL Certificate via Let's Encrypt diff --git a/main/docker-entrypoint.sh b/main/docker-entrypoint.sh index f9ee367..a3804a6 100755 --- a/main/docker-entrypoint.sh +++ b/main/docker-entrypoint.sh @@ -58,6 +58,14 @@ if [ -n "$DRAWIO_SERVER_URL" ] && [ "$CONTEXT_PATH" != "/" ]; then else echo "Tomcat context remains at root '/'" fi + +# Update the maxHTTPHeaderSize in Tomcat for the HTTP endpoint +echo "Updating Tomcat max header size to '${TOMCAT_REQUEST_HEADER_LIMIT:-8192}'" + xmlstarlet ed -P -S -L \ + -i '/Server/Service/Connector[@port="8080"]' -t attr -n 'maxHttpHeaderSize' -v "${TOMCAT_REQUEST_HEADER_LIMIT:-8192}" \ + conf/server.xml + + #DRAWIO_VIEWER_URL is path to the viewer js, e.g. https://www.example.com/js/viewer.min.js echo "window.DRAWIO_VIEWER_URL = '${DRAWIO_VIEWER_URL}';" >> $CATALINA_HOME/webapps/draw/js/PreConfig.js #DRAWIO_LIGHTBOX_URL Replace with your lightbox URL, eg. https://www.example.com @@ -189,6 +197,7 @@ if [ -f $CATALINA_HOME/.keystore ] && [ -z $VAR ]; then -i "/Server/Service/${UUID}" -t 'attr' -n 'KeystoreFile' -v "$CATALINA_HOME/.keystore" \ -i "/Server/Service/${UUID}" -t 'attr' -n 'KeystorePass' -v "${KEY_PASS}" \ -i "/Server/Service/${UUID}" -t 'attr' -n 'defaultSSLHostConfigName' -v "${PUBLIC_DNS:-'draw.example.com'}" \ + -i "/Server/Service/${UUID}" -t 'attr' -n 'maxHttpHeaderSize' -v "${TOMCAT_REQUEST_HEADER_LIMIT:-8192}" \ -s "/Server/Service/${UUID}" -t 'elem' -n 'SSLHostConfig' \ -i "/Server/Service/${UUID}/SSLHostConfig" -t 'attr' -n 'hostName' -v "${PUBLIC_DNS:-'draw.example.com'}" \ -i "/Server/Service/${UUID}/SSLHostConfig" -t 'attr' -n 'protocols' -v 'TLSv1.2' \