diff --git a/.gitignore b/.gitignore index 6530e93..0a9346a 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ __pycache__/ Pipfile Pipfile.lock +.idea \ No newline at end of file diff --git a/README.md b/README.md index 01dbb05..76b287e 100644 --- a/README.md +++ b/README.md @@ -161,6 +161,10 @@ Example: The directory where [Lucene](https://lucene.apache.org/) search indexes should be stored. Defaults to `index` under the Confluence home directory. +* `ATL_LICENSE_KEY` (from Confluence 7.8 onwards) + + The Confluence license string. Providing this will remove the need to supply it through the web startup screen. + ## Database configuration It is optionally possible to configure the database from the environment, diff --git a/config/confluence.cfg.xml.j2 b/config/confluence.cfg.xml.j2 index c235f12..24b2887 100644 --- a/config/confluence.cfg.xml.j2 +++ b/config/confluence.cfg.xml.j2 @@ -66,5 +66,9 @@ {% endif %} + {% if atl_license_key is defined %} + {{ atl_license_key }} + {% endif %} + diff --git a/tests/test_image.py b/tests/test_image.py index 52b0abe..2333b3e 100644 --- a/tests/test_image.py +++ b/tests/test_image.py @@ -305,6 +305,17 @@ def test_confluence_xml_cluster_tcp(docker_cli, image, run_user): assert xml.findall('.//property[@name="confluence.cluster.name"]')[0].text == "atl_cluster_name" assert xml.findall('.//property[@name="confluence.cluster.peers"]')[0].text == "1.1.1.1,99.99.99.99" +def test_confluence_xml_license(docker_cli, image, run_user): + environment = { + 'ATL_LICENSE_KEY': 'mylicense', + } + 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="atlassian.license.message"]')[0].text == "mylicense" + def test_java_in_run_user_path(docker_cli, image): RUN_USER = 'confluence' container = run_image(docker_cli, image)