diff --git a/README.md b/README.md index c86ca87..e176e7a 100644 --- a/README.md +++ b/README.md @@ -125,15 +125,18 @@ of the setup. They can be controlled via the below environment variables. external tools. The following Tomcat/Catalina options are also supported. For more information, -see https://tomcat.apache.org/tomcat-7.0-doc/config/index.html. +see https://tomcat.apache.org/tomcat-7.0-doc/config/index.html * `ATL_TOMCAT_MGMT_PORT` (default: 8000) -* `ATL_TOMCAT_MAXTHREADS` (default: 100) +* `ATL_TOMCAT_MAXTHREADS` (default: 48) * `ATL_TOMCAT_MINSPARETHREADS` (default: 10) * `ATL_TOMCAT_CONNECTIONTIMEOUT` (default: 20000) * `ATL_TOMCAT_ENABLELOOKUPS` (default: false) -* `ATL_TOMCAT_PROTOCOL` (default: HTTP/1.1) +* `ATL_TOMCAT_PROTOCOL` (default: org.apache.coyote.http11.Http11NioProtocol) +* `ATL_TOMCAT_REDIRECTPORT` (default: 8443) * `ATL_TOMCAT_ACCEPTCOUNT` (default: 10) +* `ATL_TOMCAT_DEBUG` (default: 0) +* `ATL_TOMCAT_URIENCODING` (default: UTF-8) * `ATL_TOMCAT_MAXHTTPHEADERSIZE` (default: 8192) ## JVM configuration diff --git a/config/server.xml.j2 b/config/server.xml.j2 index cf7d07e..4218ef7 100644 --- a/config/server.xml.j2 +++ b/config/server.xml.j2 @@ -3,34 +3,25 @@ - - - - - - + - relaxedPathChars="[]|" - relaxedQueryChars="[]|{}^\`"<>" - bindOnInit="false" - maxHttpHeaderSize="{{ atl_tomcat_maxhttpheadersize | default('8192') }}" - useBodyEncodingForURI="true" - disableUploadTimeout="true" /> + diff --git a/tests/test_image.py b/tests/test_image.py index 5ca1862..d87bf53 100644 --- a/tests/test_image.py +++ b/tests/test_image.py @@ -65,18 +65,23 @@ def test_server_xml_defaults(docker_cli, image): context = xml.find('.//Context') assert connector.get('port') == '8090' - assert connector.get('maxThreads') == '100' + assert connector.get('maxThreads') == '48' assert connector.get('minSpareThreads') == '10' assert connector.get('connectionTimeout') == '20000' assert connector.get('enableLookups') == 'false' - assert connector.get('protocol') == 'HTTP/1.1' + assert connector.get('protocol') == 'org.apache.coyote.http11.Http11NioProtocol' + assert connector.get('redirectPort') == '8443' assert connector.get('acceptCount') == '10' + assert connector.get('debug') == '0' + assert connector.get('URIEncoding') == 'UTF-8' assert connector.get('secure') == 'false' assert connector.get('scheme') == 'http' assert connector.get('proxyName') == '' assert connector.get('proxyPort') == '' assert connector.get('maxHttpHeaderSize') == '8192' + assert context.get('path') == '' + def test_server_xml_catalina_fallback(docker_cli, image): environment = { 'CATALINA_CONNECTOR_PROXYNAME': 'PROXYNAME', @@ -108,7 +113,10 @@ def test_server_xml_params(docker_cli, image): 'ATL_TOMCAT_CONNECTIONTIMEOUT': '20001', 'ATL_TOMCAT_ENABLELOOKUPS': 'true', 'ATL_TOMCAT_PROTOCOL': 'HTTP/2', + 'ATL_TOMCAT_REDIRECTPORT': '8444', 'ATL_TOMCAT_ACCEPTCOUNT': '11', + 'ATL_TOMCAT_DEBUG': '1', + 'ATL_TOMCAT_URIENCODING':'ISO-8859-1', 'ATL_TOMCAT_SECURE': 'true', 'ATL_TOMCAT_SCHEME': 'https', 'ATL_PROXY_NAME': 'conf.atlassian.com', @@ -131,7 +139,10 @@ def test_server_xml_params(docker_cli, image): assert connector.get('connectionTimeout') == environment.get('ATL_TOMCAT_CONNECTIONTIMEOUT') assert connector.get('enableLookups') == environment.get('ATL_TOMCAT_ENABLELOOKUPS') assert connector.get('protocol') == environment.get('ATL_TOMCAT_PROTOCOL') + assert connector.get('redirectPort') == environment.get('ATL_TOMCAT_REDIRECTPORT') assert connector.get('acceptCount') == environment.get('ATL_TOMCAT_ACCEPTCOUNT') + assert connector.get('debug') == environment.get('ATL_TOMCAT_DEBUG') + assert connector.get('URIEncoding') == environment.get('ATL_TOMCAT_URIENCODING') assert connector.get('secure') == environment.get('ATL_TOMCAT_SECURE') assert connector.get('scheme') == environment.get('ATL_TOMCAT_SCHEME') assert connector.get('proxyName') == environment.get('ATL_PROXY_NAME') @@ -350,3 +361,4 @@ def test_jvm_fallback_fonts(docker_cli, image): font = container.file("/opt/java/openjdk/lib/fonts/fallback/NotoSansGujarati-Regular.ttf") assert font.exists assert font.is_symlink +