Add README entry about new setting and misc. formatting cleanups.

This commit is contained in:
Steve Smith 2020-02-28 14:30:20 +11:00
parent 6aea6a1cb4
commit ec4b4bcc45
3 changed files with 36 additions and 15 deletions

View File

@ -110,6 +110,15 @@ of the setup. They can be controlled via the below environment variables.
The context path the application is served over. `CATALINA_CONTEXT_PATH` is
also supported for backwards compatability.
* `ATL_TOMCAT_ACCESS_LOG` (default: false)
Whether to enable Tomcat access logging; set to `true` to enable. *NOTE*:
These logs are written to the Container internal volume by default (under
`/opt/atlassian/confluence/logs/`); these are rotated but not removed, and
will grow indefinitely. If you enable this functionality it is recommended
that you map the directory to a volume and perform log ingestion/cleanup with
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.

View File

@ -51,8 +51,20 @@
<Valve className="org.apache.catalina.valves.StuckThreadDetectionValve"
threshold="60"/>
{% if atl_tomcat_access_log == 'true' %}
<Valve className="org.apache.catalina.valves.AccessLogValve" requestAttributesEnabled="true" directory="logs" prefix="confluence_access" suffix=".log" rotatable="true" pattern="%h %{X-AUSERNAME}o %t &quot;%r&quot; %s %b %D %U %I &quot;%{User-Agent}i&quot;" />
<Valve className="org.apache.catalina.valves.RemoteIpValve" proxiesHeader="x-forwarded-by" internalProxies="{{ atl_tomcat_proxy_internal_ips | default('') }}" remoteIpHeader="x-forwarded-for" protocolHeader="x-forwarded-proto" requestAttributesEnabled="true" resolveHosts="false" />
<Valve className="org.apache.catalina.valves.AccessLogValve"
requestAttributesEnabled="true"
directory="logs"
prefix="confluence_access"
suffix=".log"
rotatable="true"
pattern="%h %{X-AUSERNAME}o %t &quot;%r&quot; %s %b %D %U %I &quot;%{User-Agent}i&quot;" />
<Valve className="org.apache.catalina.valves.RemoteIpValve"
proxiesHeader="x-forwarded-by"
internalProxies="{{ atl_tomcat_proxy_internal_ips | default('') }}"
remoteIpHeader="x-forwarded-for"
protocolHeader="x-forwarded-proto"
requestAttributesEnabled="true"
resolveHosts="false" />
{% endif %}
</Context>

View File

@ -14,10 +14,10 @@ def test_jvm_args(docker_cli, image, run_user):
}
container = run_image(docker_cli, image, user=run_user, environment=environment)
_jvm = wait_for_proc(container, get_bootstrap_proc(container))
procs_list = get_procs(container)
jvm = [proc for proc in procs_list if get_bootstrap_proc(container) in proc][0]
assert f'-Xms{environment.get("JVM_MINIMUM_MEMORY")}' in jvm
assert f'-Xmx{environment.get("JVM_MAXIMUM_MEMORY")}' in jvm
assert f'-XX:ReservedCodeCacheSize={environment.get("JVM_RESERVED_CODE_CACHE_SIZE")}' in jvm
@ -37,9 +37,9 @@ def test_install_permissions(docker_cli, image):
def test_first_run_state(docker_cli, image, run_user):
PORT = 8090
URL = f'http://localhost:{PORT}/status'
container = run_image(docker_cli, image, user=run_user, ports={PORT: PORT})
wait_for_http_response(URL, expected_status=200, expected_state=('STARTING', 'FIRST_RUN'))
@ -50,7 +50,7 @@ def test_server_xml_defaults(docker_cli, image):
xml = parse_xml(container, f'{get_app_install_dir(container)}/conf/server.xml')
connector = xml.find('.//Connector')
context = xml.find('.//Context')
assert connector.get('port') == '8090'
assert connector.get('maxThreads') == '100'
assert connector.get('minSpareThreads') == '10'
@ -62,7 +62,7 @@ def test_server_xml_defaults(docker_cli, image):
assert connector.get('scheme') == 'http'
assert connector.get('proxyName') == ''
assert connector.get('proxyPort') == ''
def test_server_xml_catalina_fallback(docker_cli, image):
environment = {
'CATALINA_CONNECTOR_PROXYNAME': 'PROXYNAME',
@ -107,7 +107,7 @@ def test_server_xml_params(docker_cli, image):
xml = parse_xml(container, f'{get_app_install_dir(container)}/conf/server.xml')
connector = xml.find('.//Connector')
context = xml.find('.//Context')
assert xml.get('port') == environment.get('ATL_TOMCAT_MGMT_PORT')
assert connector.get('port') == environment.get('ATL_TOMCAT_PORT')
@ -168,7 +168,7 @@ def test_confluence_xml_postgres(docker_cli, image, run_user):
}
container = run_image(docker_cli, image, user=run_user, environment=environment)
_jvm = wait_for_proc(container, get_bootstrap_proc(container))
xml = parse_xml(container, f'{get_app_home(container)}/confluence.cfg.xml')
assert xml.findall('.//property[@name="hibernate.connection.url"]')[0].text == "atl_jdbc_url"
assert xml.findall('.//property[@name="hibernate.connection.username"]')[0].text == "atl_jdbc_user"
@ -231,7 +231,7 @@ def test_confluence_xml_cluster_aws(docker_cli, image, run_user):
}
container = run_image(docker_cli, image, user=run_user, environment=environment)
_jvm = wait_for_proc(container, get_bootstrap_proc(container))
xml = parse_xml(container, f'{get_app_home(container)}/confluence.cfg.xml')
assert xml.findall('.//property[@name="confluence.cluster"]')[0].text == "true"
@ -255,7 +255,7 @@ def test_confluence_xml_cluster_multicast(docker_cli, image, run_user):
}
container = run_image(docker_cli, image, user=run_user, environment=environment)
_jvm = wait_for_proc(container, get_bootstrap_proc(container))
xml = parse_xml(container, f'{get_app_home(container)}/confluence.cfg.xml')
assert xml.findall('.//property[@name="confluence.cluster"]')[0].text == "true"
@ -273,7 +273,7 @@ def test_confluence_xml_cluster_tcp(docker_cli, image, run_user):
}
container = run_image(docker_cli, image, user=run_user, environment=environment)
_jvm = wait_for_proc(container, get_bootstrap_proc(container))
xml = parse_xml(container, f'{get_app_home(container)}/confluence.cfg.xml')
assert xml.findall('.//property[@name="confluence.cluster"]')[0].text == "true"
@ -288,7 +288,7 @@ def test_confluence_xml_access_log(docker_cli, image, run_user):
}
container = run_image(docker_cli, image, user=run_user, environment=environment)
_jvm = wait_for_proc(container, get_bootstrap_proc(container))
xml = parse_xml(container, f'{get_app_home(container)}/server.cfg.xml')
valve = xml.find(".//Context/Valve[@className='org.apache.catalina.valves.RemoteIpValve']")
@ -305,4 +305,4 @@ def test_non_root_user(docker_cli, image):
RUN_UID = 2002
RUN_GID = 2002
container = run_image(docker_cli, image, user=f'{RUN_UID}:{RUN_GID}')
jvm = wait_for_proc(container, "org.apache.catalina.startup.Bootstrap")
jvm = wait_for_proc(container, "org.apache.catalina.startup.Bootstrap")