Merged in DCD-1299-server-xml-update (pull request #99)

DCD-1299 server xml update

Approved-by: Steve Smith
Approved-by: Minh Tran
Approved-by: Efim Pyshnohraiev
This commit is contained in:
Jun Jeong 2021-07-09 00:55:19 +00:00
commit 24be3a4c84
3 changed files with 27 additions and 20 deletions

View File

@ -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

View File

@ -3,34 +3,25 @@
<Server port="{{ atl_tomcat_mgmt_port | default('8000') }}"
shutdown="SHUTDOWN">
<Listener className="org.apache.catalina.startup.VersionLoggerListener"/>
<Listener className="org.apache.catalina.core.AprLifecycleListener"
SSLEngine="on"/>
<Listener className="org.apache.catalina.core.JreMemoryLeakPreventionListener"/>
<Listener className="org.apache.catalina.mbeans.GlobalResourcesLifecycleListener"/>
<Listener className="org.apache.catalina.core.ThreadLocalLeakPreventionListener"/>
<Service name="Catalina">
<Connector port="{{ atl_tomcat_port | default('8090') }}"
maxThreads="{{ atl_tomcat_maxthreads | default('100') }}"
maxThreads="{{ atl_tomcat_maxthreads | default('48') }}"
minSpareThreads="{{ atl_tomcat_minsparethreads | default('10') }}"
connectionTimeout="{{ atl_tomcat_connectiontimeout | default('20000') }}"
enableLookups="{{ atl_tomcat_enablelookups | default('false') }}"
protocol="{{ atl_tomcat_protocol | default('HTTP/1.1') }}"
protocol="{{ atl_tomcat_protocol | default('org.apache.coyote.http11.Http11NioProtocol') }}"
redirectPort="{{ atl_tomcat_redirectport | default('8443') }}"
acceptCount="{{ atl_tomcat_acceptcount | default('10') }}"
debug="{{ atl_tomcat_debug | default('0') }}"
URIEncoding="{{ atl_tomcat_uriencoding | default('UTF-8') }}"
secure="{{ atl_tomcat_secure | default(catalina_connector_secure) | default('false') }}"
scheme="{{ atl_tomcat_scheme | default(catalina_connector_scheme) | default('http') }}"
proxyName="{{ atl_proxy_name | default(catalina_connector_proxyname) | default('') }}"
proxyPort="{{ atl_proxy_port | default(catalina_connector_proxyport) | default('') }}"
maxHttpHeaderSize="{{ atl_tomcat_maxhttpheadersize | default('8192') }}" />
relaxedPathChars="[]|"
relaxedQueryChars="[]|{}^\`&quot;&lt;&gt;"
bindOnInit="false"
maxHttpHeaderSize="{{ atl_tomcat_maxhttpheadersize | default('8192') }}"
useBodyEncodingForURI="true"
disableUploadTimeout="true" />
<Engine name="Standalone"
defaultHost="localhost"
@ -84,3 +75,4 @@
</Server>

View File

@ -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