diff --git a/config/confluence.cfg.cluster.xml.j2 b/config/confluence.cfg.cluster.xml.j2
deleted file mode 100644
index c0b0132..0000000
--- a/config/confluence.cfg.cluster.xml.j2
+++ /dev/null
@@ -1,16 +0,0 @@
-
-
-
- true
- {{ atl_product_home_shared }}
- {{ atl_product_home_shared }}
- {{ atl_hazelcast_network_aws_iam_role }}
- {{ atl_hazelcast_network_aws_iam_region }}
- {{ atl_hazelcast_network_aws_host_header }}
- {{ atl_hazelcast_network_aws_tag_key }}
- {{ atl_hazelcast_network_aws_tag_value }}
- aws
- {{ atl_aws_stack_name }}
- 1
-
-
diff --git a/config/confluence.cfg.db.xml.j2 b/config/confluence.cfg.db.xml.j2
deleted file mode 100644
index c72b39f..0000000
--- a/config/confluence.cfg.db.xml.j2
+++ /dev/null
@@ -1,19 +0,0 @@
-
-
-
- {{ atl_db_choice }}
- {{ atl_db_dialect }}
- {{ atl_db_driver }}
- {{ atl_jdbc_url }}
- {{ atl_jdbc_user }}
- {{ atl_jdbc_password }}
- {{ atl_db_poolminsize }}
- {{ atl_db_poolmaxsize }}
- {{ atl_db_timeout }}
- {{ atl_db_idletestperiod }}
- {{ atl_db_maxstatements }}
- {{ atl_db_validate }}
- {{ atl_db_acquireincrement }}
- {{ atl_db_validationquery }}
-
-
diff --git a/config/confluence.cfg.head.xml.j2 b/config/confluence.cfg.head.xml.j2
deleted file mode 100644
index 521bfb8..0000000
--- a/config/confluence.cfg.head.xml.j2
+++ /dev/null
@@ -1,17 +0,0 @@
-
-
-
-
-
-
- setupstart
- custom
- 0
-
-
- database-type-standard
- ${localHome}/temp
- ${confluenceHome}/attachments
-
-
-
diff --git a/config/confluence.cfg.tail.xml.j2 b/config/confluence.cfg.tail.xml.j2
deleted file mode 100644
index 225be14..0000000
--- a/config/confluence.cfg.tail.xml.j2
+++ /dev/null
@@ -1,7 +0,0 @@
-
-
-
-
-
-
-
diff --git a/config/confluence.cfg.xml.j2 b/config/confluence.cfg.xml.j2
new file mode 100644
index 0000000..b51e4f9
--- /dev/null
+++ b/config/confluence.cfg.xml.j2
@@ -0,0 +1,52 @@
+
+
+
+
+ setupstart
+ custom
+ 0
+
+
+ database-type-standard
+ ${localHome}/temp
+ ${confluenceHome}/attachments
+
+ {% if atl_jdbc_url is defined %}
+ {% set databases = {
+ "mysql": ["com.mysql.jdbc.Driver", "MySQLDialect"],
+ "postgresql": ["org.postgresql.Driver", "PostgreSQLDialect"],
+ "mssql": ["com.microsoft.sqlserver.jdbc.SQLServerDriver", "SQLServerDialect"],
+ "oracle12c": ["oracle.jdbc.driver.OracleDriver", "OracleDialect"]
+ } %}
+ {{ atl_db_type }}
+
+ {{ atl_jdbc_url }}
+ {{ atl_jdbc_user }}
+ {{ atl_jdbc_password }}
+ {{ databases[atl_db_type][0] }}
+ com.atlassian.confluence.impl.hibernate.dialect.{{ databases[atl_db_type][1] }}
+
+ {{ atl_db_poolminsize | default('20') }}
+ {{ atl_db_poolmaxsize | default('100') }}
+ {{ atl_db_timeout | default('30') }}
+ {{ atl_db_idletestperiod | default('100') }}
+ {{ atl_db_maxstatements | default('0') }}
+ {{ atl_db_validate | default('false') }}
+ {{ atl_db_acquireincrement | default('1') }}
+ {{ atl_db_validationquery | default('select 1') }}
+ {% endif %}
+
+ {# {{ atl_product_home_shared | default('') }} #}
+ {# true #}
+ {# {{ atl_product_home_shared | default('') }} #}
+ {# {{ atl_hazelcast_network_aws_iam_role | default('') }} #}
+ {# {{ atl_hazelcast_network_aws_iam_region | default('') }} #}
+ {# {{ atl_hazelcast_network_aws_host_header | default('') }} #}
+ {# {{ atl_hazelcast_network_aws_tag_key | default('') }} #}
+ {# {{ atl_hazelcast_network_aws_tag_value | default('') }} #}
+ {# aws #}
+ {# {{ atl_aws_stack_name | default('') }} #}
+ {# 1 #}
+
+
+
diff --git a/entrypoint.py b/entrypoint.py
index 174c069..6ad62cd 100755
--- a/entrypoint.py
+++ b/entrypoint.py
@@ -94,6 +94,12 @@ env['atl_product_home'] = confluence_home
gen_cfg('confluence-init.properties.j2', confluence_install_dir+'/confluence/WEB-INF/classes/confluence-init.properties', env)
+######################################################################
+# Configure confluence.cfg.xml
+
+gen_cfg('confluence.cfg.xml.j2', confluence_home+'/confluence.cfg.xml', env,
+ user=user, group=group, mode=0o640)
+
######################################################################
# Start Confluence as the correct user
diff --git a/tests/test_image.py b/tests/test_image.py
index cfe3623..ffba70a 100644
--- a/tests/test_image.py
+++ b/tests/test_image.py
@@ -226,10 +226,9 @@ def test_confluence_xml_postgres_all_set(docker_cli, image):
'ATL_DB_VALIDATIONQUERY': 'xselect 1'
}
container = run_image(docker_cli, image, environment=environment)
- wait_for_file(container, "/opt/atlassian/confluence/confluence/WEB-INF/classes/confluence-init.properties")
+ wait_for_file(container, "/var/atlassian/application-data/confluence/confluence.cfg.xml")
xml = etree.fromstring(container.file('/var/atlassian/application-data/confluence/confluence.cfg.xml').content)
-
assert xml.xpath('//property[@name="hibernate.c3p0.min_size"]')[0].text == "x20"
assert xml.xpath('//property[@name="hibernate.c3p0.max_size"]')[0].text == "x100"
assert xml.xpath('//property[@name="hibernate.c3p0.timeout"]')[0].text == "x30"