mirror of
https://bitbucket.org/atlassian-docker/docker-atlassian-confluence-server.git
synced 2024-08-30 18:22:16 +00:00
Merge branch 'DCD-558-python-spike' into DCD-545-confluence-dc-updates
This commit is contained in:
commit
063a249d18
12
Dockerfile
12
Dockerfile
@ -17,21 +17,17 @@ WORKDIR $CONFLUENCE_HOME
|
|||||||
EXPOSE 8090
|
EXPOSE 8090
|
||||||
EXPOSE 8091
|
EXPOSE 8091
|
||||||
|
|
||||||
CMD ["/entrypoint.sh", "-fg"]
|
CMD ["/entrypoint.py", "-fg"]
|
||||||
ENTRYPOINT ["/sbin/tini", "--"]
|
ENTRYPOINT ["/sbin/tini", "--"]
|
||||||
|
|
||||||
RUN apt-get update \
|
RUN apt-get update \
|
||||||
&& apt-get install -y --no-install-recommends fontconfig \
|
&& apt-get install -y --no-install-recommends fontconfig python3 python3-jinja2 \
|
||||||
&& apt-get clean autoclean && apt-get autoremove -y && rm -rf /var/lib/apt/lists/*
|
&& apt-get clean autoclean && apt-get autoremove -y && rm -rf /var/lib/apt/lists/*
|
||||||
|
|
||||||
ARG TINI_VERSION=v0.18.0
|
ARG TINI_VERSION=v0.18.0
|
||||||
ADD https://github.com/krallin/tini/releases/download/${TINI_VERSION}/tini /sbin/tini
|
ADD https://github.com/krallin/tini/releases/download/${TINI_VERSION}/tini /sbin/tini
|
||||||
RUN chmod +x /sbin/tini
|
RUN chmod +x /sbin/tini
|
||||||
|
|
||||||
COPY entrypoint.sh /entrypoint.sh
|
|
||||||
COPY scripts/* /opt/atlassian/bin/
|
|
||||||
COPY config/* /opt/atlassian/etc/
|
|
||||||
|
|
||||||
ARG CONFLUENCE_VERSION
|
ARG CONFLUENCE_VERSION
|
||||||
ARG DOWNLOAD_URL=https://product-downloads.atlassian.com/software/confluence/downloads/atlassian-confluence-${CONFLUENCE_VERSION}.tar.gz
|
ARG DOWNLOAD_URL=https://product-downloads.atlassian.com/software/confluence/downloads/atlassian-confluence-${CONFLUENCE_VERSION}.tar.gz
|
||||||
|
|
||||||
@ -47,3 +43,7 @@ RUN groupadd --gid ${RUN_GID} ${RUN_GROUP} \
|
|||||||
&& chown -R ${RUN_USER}:${RUN_GROUP} ${CONFLUENCE_INSTALL_DIR}/work \
|
&& chown -R ${RUN_USER}:${RUN_GROUP} ${CONFLUENCE_INSTALL_DIR}/work \
|
||||||
\
|
\
|
||||||
&& sed -i -e 's/-Xms\([0-9]\+[kmg]\) -Xmx\([0-9]\+[kmg]\)/-Xms\${JVM_MINIMUM_MEMORY:=\1} -Xmx\${JVM_MAXIMUM_MEMORY:=\2} \${JVM_SUPPORT_RECOMMENDED_ARGS} -Dconfluence.home=\${CONFLUENCE_HOME}/g' ${CONFLUENCE_INSTALL_DIR}/bin/setenv.sh
|
&& sed -i -e 's/-Xms\([0-9]\+[kmg]\) -Xmx\([0-9]\+[kmg]\)/-Xms\${JVM_MINIMUM_MEMORY:=\1} -Xmx\${JVM_MAXIMUM_MEMORY:=\2} \${JVM_SUPPORT_RECOMMENDED_ARGS} -Dconfluence.home=\${CONFLUENCE_HOME}/g' ${CONFLUENCE_INSTALL_DIR}/bin/setenv.sh
|
||||||
|
|
||||||
|
COPY entrypoint.py /entrypoint.py
|
||||||
|
COPY scripts/* /opt/atlassian/bin/
|
||||||
|
COPY config/* /opt/atlassian/etc/
|
||||||
|
@ -17,10 +17,10 @@ WORKDIR $CONFLUENCE_HOME
|
|||||||
EXPOSE 8090
|
EXPOSE 8090
|
||||||
EXPOSE 8091
|
EXPOSE 8091
|
||||||
|
|
||||||
CMD ["/entrypoint.sh", "-fg"]
|
CMD ["/entrypoint.py", "-fg"]
|
||||||
ENTRYPOINT ["/sbin/tini", "--"]
|
ENTRYPOINT ["/sbin/tini", "--"]
|
||||||
|
|
||||||
RUN apk add --no-cache ca-certificates wget curl openssh bash procps openssl perl ttf-dejavu tini
|
RUN apk add --no-cache ca-certificates wget curl openssh bash procps openssl perl ttf-dejavu tini python3 py3-jinja2
|
||||||
|
|
||||||
# Workaround for AdoptOpenJDK Alpine fontconfig bug
|
# Workaround for AdoptOpenJDK Alpine fontconfig bug
|
||||||
RUN ln -s /usr/lib/libfontconfig.so.1 /usr/lib/libfontconfig.so \
|
RUN ln -s /usr/lib/libfontconfig.so.1 /usr/lib/libfontconfig.so \
|
||||||
@ -28,10 +28,6 @@ RUN ln -s /usr/lib/libfontconfig.so.1 /usr/lib/libfontconfig.so \
|
|||||||
&& ln -s /lib/libc.musl-x86_64.so.1 /usr/lib/libc.musl-x86_64.so.1
|
&& ln -s /lib/libc.musl-x86_64.so.1 /usr/lib/libc.musl-x86_64.so.1
|
||||||
ENV LD_LIBRARY_PATH /usr/lib
|
ENV LD_LIBRARY_PATH /usr/lib
|
||||||
|
|
||||||
COPY entrypoint.sh /entrypoint.sh
|
|
||||||
COPY scripts/* /opt/atlassian/bin/
|
|
||||||
COPY config/* /opt/atlassian/etc/
|
|
||||||
|
|
||||||
ARG CONFLUENCE_VERSION
|
ARG CONFLUENCE_VERSION
|
||||||
ARG DOWNLOAD_URL=https://product-downloads.atlassian.com/software/confluence/downloads/atlassian-confluence-${CONFLUENCE_VERSION}.tar.gz
|
ARG DOWNLOAD_URL=https://product-downloads.atlassian.com/software/confluence/downloads/atlassian-confluence-${CONFLUENCE_VERSION}.tar.gz
|
||||||
|
|
||||||
@ -47,3 +43,7 @@ RUN addgroup -g ${RUN_GID} ${RUN_GROUP} \
|
|||||||
&& chown -R ${RUN_USER}:${RUN_GROUP} ${CONFLUENCE_INSTALL_DIR}/work \
|
&& chown -R ${RUN_USER}:${RUN_GROUP} ${CONFLUENCE_INSTALL_DIR}/work \
|
||||||
\
|
\
|
||||||
&& sed -i -e 's/-Xms\([0-9]\+[kmg]\) -Xmx\([0-9]\+[kmg]\)/-Xms\${JVM_MINIMUM_MEMORY:=\1} -Xmx\${JVM_MAXIMUM_MEMORY:=\2} \${JVM_SUPPORT_RECOMMENDED_ARGS} -Dconfluence.home=\${CONFLUENCE_HOME}/g' ${CONFLUENCE_INSTALL_DIR}/bin/setenv.sh
|
&& sed -i -e 's/-Xms\([0-9]\+[kmg]\) -Xmx\([0-9]\+[kmg]\)/-Xms\${JVM_MINIMUM_MEMORY:=\1} -Xmx\${JVM_MAXIMUM_MEMORY:=\2} \${JVM_SUPPORT_RECOMMENDED_ARGS} -Dconfluence.home=\${CONFLUENCE_HOME}/g' ${CONFLUENCE_INSTALL_DIR}/bin/setenv.sh
|
||||||
|
|
||||||
|
COPY entrypoint.py /entrypoint.py
|
||||||
|
COPY scripts/* /opt/atlassian/bin/
|
||||||
|
COPY config/* /opt/atlassian/etc/
|
||||||
|
@ -1,16 +0,0 @@
|
|||||||
|
|
||||||
<!-- Start confluence.cfg.cluster.xml.j2 -->
|
|
||||||
|
|
||||||
<property name="confluence.cluster">true</property>
|
|
||||||
<property name="shared-home">{{ atl_product_home_shared }}</property>
|
|
||||||
<property name="confluence.cluster.home">{{ atl_product_home_shared }}</property>
|
|
||||||
<property name="confluence.cluster.aws.iam.role">{{ atl_hazelcast_network_aws_iam_role }}</property>
|
|
||||||
<property name="confluence.cluster.aws.region">{{ atl_hazelcast_network_aws_iam_region }}</property>
|
|
||||||
<property name="confluence.cluster.aws.host.header">{{ atl_hazelcast_network_aws_host_header }}</property>
|
|
||||||
<property name="confluence.cluster.aws.tag.key">{{ atl_hazelcast_network_aws_tag_key }}</property>
|
|
||||||
<property name="confluence.cluster.aws.tag.value">{{ atl_hazelcast_network_aws_tag_value }}</property>
|
|
||||||
<property name="confluence.cluster.join.type">aws</property>
|
|
||||||
<property name="confluence.cluster.name">{{ atl_aws_stack_name }}</property>
|
|
||||||
<property name="confluence.cluster.ttl">1</property>
|
|
||||||
|
|
||||||
<!-- End confluence.cfg.cluster.xml.j2 -->
|
|
@ -1,19 +0,0 @@
|
|||||||
|
|
||||||
<!-- Start confluence.cfg.db.xml.j2 -->
|
|
||||||
|
|
||||||
<property name="confluence.database.choice">{{ atl_db_choice }}</property>
|
|
||||||
<property name="hibernate.dialect">{{ atl_db_dialect }}</property>
|
|
||||||
<property name="hibernate.connection.driver_class">{{ atl_db_driver }}</property>
|
|
||||||
<property name="hibernate.connection.url">{{ atl_jdbc_url }}</property>
|
|
||||||
<property name="hibernate.connection.username">{{ atl_jdbc_user }}</property>
|
|
||||||
<property name="hibernate.connection.password">{{ atl_jdbc_password }}</property>
|
|
||||||
<property name="hibernate.c3p0.min_size">{{ atl_db_poolminsize }}</property>
|
|
||||||
<property name="hibernate.c3p0.max_size">{{ atl_db_poolmaxsize }}</property>
|
|
||||||
<property name="hibernate.c3p0.timeout">{{ atl_db_timeout }}</property>
|
|
||||||
<property name="hibernate.c3p0.idle_test_period">{{ atl_db_idletestperiod }}</property>
|
|
||||||
<property name="hibernate.c3p0.max_statements">{{ atl_db_maxstatements }}</property>
|
|
||||||
<property name="hibernate.c3p0.validate">{{ atl_db_validate }}</property>
|
|
||||||
<property name="hibernate.c3p0.acquire_increment">{{ atl_db_acquireincrement }}</property>
|
|
||||||
<property name="hibernate.c3p0.preferredTestQuery">{{ atl_db_validationquery }}</property>
|
|
||||||
|
|
||||||
<!-- End confluence.cfg.db.xml.j2 -->
|
|
@ -1,17 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
|
|
||||||
<!-- Start confluence.cfg.head.xml.j2 -->
|
|
||||||
|
|
||||||
<confluence-configuration>
|
|
||||||
|
|
||||||
<setupStep>setupstart</setupStep>
|
|
||||||
<setupType>custom</setupType>
|
|
||||||
<buildNumber>0</buildNumber>
|
|
||||||
|
|
||||||
<properties>
|
|
||||||
<property name="confluence.database.connection.type">database-type-standard</property>
|
|
||||||
<property name="webwork.multipart.saveDir">${localHome}/temp</property>
|
|
||||||
<property name="attachments.dir">${confluenceHome}/attachments</property>
|
|
||||||
|
|
||||||
<!-- End confluence.cfg.head.xml.j2 -->
|
|
||||||
|
|
@ -1,7 +0,0 @@
|
|||||||
|
|
||||||
<!-- Start confluence.cfg.tail.xml.j2 -->
|
|
||||||
|
|
||||||
</properties>
|
|
||||||
</confluence-configuration>
|
|
||||||
|
|
||||||
<!-- End confluence.cfg.tail.xml.j2 -->
|
|
65
config/confluence.cfg.xml.j2
Normal file
65
config/confluence.cfg.xml.j2
Normal file
@ -0,0 +1,65 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
|
||||||
|
<confluence-configuration>
|
||||||
|
|
||||||
|
<setupStep>setupstart</setupStep>
|
||||||
|
<setupType>custom</setupType>
|
||||||
|
<buildNumber>0</buildNumber>
|
||||||
|
|
||||||
|
<properties>
|
||||||
|
<property name="confluence.database.connection.type">database-type-standard</property>
|
||||||
|
<property name="webwork.multipart.saveDir">${localHome}/temp</property>
|
||||||
|
<property name="attachments.dir">${confluenceHome}/attachments</property>
|
||||||
|
|
||||||
|
{% 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"]
|
||||||
|
} %}
|
||||||
|
<property name="confluence.database.choice">{{ atl_db_type }}</property>
|
||||||
|
|
||||||
|
<property name="hibernate.connection.url">{{ atl_jdbc_url }}</property>
|
||||||
|
<property name="hibernate.connection.username">{{ atl_jdbc_user }}</property>
|
||||||
|
<property name="hibernate.connection.password">{{ atl_jdbc_password }}</property>
|
||||||
|
<property name="hibernate.connection.driver_class">{{ databases[atl_db_type][0] }}</property>
|
||||||
|
<property name="hibernate.dialect">com.atlassian.confluence.impl.hibernate.dialect.{{ databases[atl_db_type][1] }}</property>
|
||||||
|
|
||||||
|
<property name="hibernate.c3p0.min_size">{{ atl_db_poolminsize | default('20') }}</property>
|
||||||
|
<property name="hibernate.c3p0.max_size">{{ atl_db_poolmaxsize | default('100') }}</property>
|
||||||
|
<property name="hibernate.c3p0.timeout">{{ atl_db_timeout | default('30') }}</property>
|
||||||
|
<property name="hibernate.c3p0.idle_test_period">{{ atl_db_idletestperiod | default('100') }}</property>
|
||||||
|
<property name="hibernate.c3p0.max_statements">{{ atl_db_maxstatements | default('0') }}</property>
|
||||||
|
<property name="hibernate.c3p0.validate">{{ atl_db_validate | default('false') }}</property>
|
||||||
|
<property name="hibernate.c3p0.acquire_increment">{{ atl_db_acquireincrement | default('1') }}</property>
|
||||||
|
<property name="hibernate.c3p0.preferredTestQuery">{{ atl_db_validationquery | default('select 1') }}</property>
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
|
{% if atl_cluster_type is defined %}
|
||||||
|
<property name="confluence.cluster">true</property>
|
||||||
|
<property name="confluence.cluster.name">{{ atl_cluster_name }}</property>
|
||||||
|
<property name="confluence.cluster.home">{{ atl_product_home_shared }}</property>
|
||||||
|
|
||||||
|
<property name="confluence.cluster.join.type">{{ atl_cluster_type }}</property>
|
||||||
|
{% if atl_cluster_type == 'aws' %}
|
||||||
|
<property name="confluence.cluster.aws.iam.role">{{ atl_hazelcast_network_aws_iam_role }}</property>
|
||||||
|
<property name="confluence.cluster.aws.region">{{ atl_hazelcast_network_aws_iam_region }}</property>
|
||||||
|
<property name="confluence.cluster.aws.host.header">{{ atl_hazelcast_network_aws_host_header }}</property>
|
||||||
|
<property name="confluence.cluster.aws.tag.key">{{ atl_hazelcast_network_aws_tag_key }}</property>
|
||||||
|
<property name="confluence.cluster.aws.tag.value">{{ atl_hazelcast_network_aws_tag_value }}</property>
|
||||||
|
<property name="confluence.cluster.ttl">{{ atl_cluster_ttl }}</property>
|
||||||
|
|
||||||
|
{% elif atl_cluster_type == 'tcp_ip' %}
|
||||||
|
<property name="confluence.cluster.peers">{{ atl_cluster_peers }}</property>
|
||||||
|
|
||||||
|
{% elif atl_cluster_type == 'multicast' %}
|
||||||
|
<property name="confluence.cluster.address">{{ atl_cluster_address }}</property>
|
||||||
|
<property name="confluence.cluster.ttl">{{ atl_cluster_ttl }}</property>
|
||||||
|
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
|
</properties>
|
||||||
|
</confluence-configuration>
|
@ -1,6 +1,6 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
|
||||||
<Server port="{{ atl_tomcat_mgmt_port }}"
|
<Server port="{{ atl_tomcat_mgmt_port | default('8000') }}"
|
||||||
shutdown="SHUTDOWN">
|
shutdown="SHUTDOWN">
|
||||||
|
|
||||||
<Listener className="org.apache.catalina.startup.VersionLoggerListener"/>
|
<Listener className="org.apache.catalina.startup.VersionLoggerListener"/>
|
||||||
@ -12,18 +12,18 @@
|
|||||||
|
|
||||||
<Service name="Catalina">
|
<Service name="Catalina">
|
||||||
|
|
||||||
<Connector port="{{ atl_tomcat_port }}"
|
<Connector port="{{ atl_tomcat_port | default('8090') }}"
|
||||||
maxThreads="{{ atl_tomcat_maxthreads }}"
|
maxThreads="{{ atl_tomcat_maxthreads | default('200') }}"
|
||||||
minSpareThreads="{{ atl_tomcat_minsparethreads }}"
|
minSpareThreads="{{ atl_tomcat_minsparethreads | default('10') }}"
|
||||||
connectionTimeout="{{ atl_tomcat_connectiontimeout }}"
|
connectionTimeout="{{ atl_tomcat_connectiontimeout | default('20000') }}"
|
||||||
enableLookups="{{ atl_tomcat_enablelookups }}"
|
enableLookups="{{ atl_tomcat_enablelookups | default('false') }}"
|
||||||
protocol="{{ atl_tomcat_protocol }}"
|
protocol="{{ atl_tomcat_protocol | default('HTTP/1.1') }}"
|
||||||
redirectPort="{{ atl_tomcat_redirectport }}"
|
redirectPort="{{ atl_tomcat_redirectport | default('8443') }}"
|
||||||
acceptCount="{{ atl_tomcat_acceptcount }}"
|
acceptCount="{{ atl_tomcat_acceptcount | default('10') }}"
|
||||||
secure="{{ atl_tomcat_secure }}"
|
secure="{{ atl_tomcat_secure | default(catalina_connector_secure) | default('false') }}"
|
||||||
scheme="{{ atl_tomcat_scheme }}"
|
scheme="{{ atl_tomcat_scheme | default(catalina_connector_scheme) | default('http') }}"
|
||||||
proxyName="{{ atl_proxy_name }}"
|
proxyName="{{ atl_proxy_name | default(catalina_connector_proxyname) | default('') }}"
|
||||||
proxyPort="{{ atl_proxy_port }}"
|
proxyPort="{{ atl_proxy_port | default(catalina_connector_proxyport) | default('') }}"
|
||||||
|
|
||||||
relaxedPathChars="[]|"
|
relaxedPathChars="[]|"
|
||||||
relaxedQueryChars="[]|{}^\`"<>"
|
relaxedQueryChars="[]|{}^\`"<>"
|
||||||
@ -41,7 +41,7 @@
|
|||||||
unpackWARs="true"
|
unpackWARs="true"
|
||||||
autoDeploy="false"
|
autoDeploy="false"
|
||||||
startStopThreads="4">
|
startStopThreads="4">
|
||||||
<Context path="{{ atl_tomcat_contextpath }}"
|
<Context path="{{ atl_tomcat_contextpath | default(catalina_context_path) | default('') }}"
|
||||||
docBase="../confluence"
|
docBase="../confluence"
|
||||||
debug="0"
|
debug="0"
|
||||||
reloadable="false"
|
reloadable="false"
|
||||||
|
92
entrypoint.py
Executable file
92
entrypoint.py
Executable file
@ -0,0 +1,92 @@
|
|||||||
|
#!/usr/bin/python3
|
||||||
|
|
||||||
|
import sys
|
||||||
|
import os
|
||||||
|
import shutil
|
||||||
|
import logging
|
||||||
|
import jinja2 as j2
|
||||||
|
|
||||||
|
|
||||||
|
######################################################################
|
||||||
|
# Utils
|
||||||
|
|
||||||
|
def set_perms(path, user, group, mode):
|
||||||
|
shutil.chown(path, user=user, group=group)
|
||||||
|
os.chmod(path, mode)
|
||||||
|
|
||||||
|
# Setup Jinja2 for templating
|
||||||
|
jenv = j2.Environment(
|
||||||
|
loader=j2.FileSystemLoader('/opt/atlassian/etc/'),
|
||||||
|
autoescape=j2.select_autoescape(['xml']))
|
||||||
|
|
||||||
|
def gen_cfg(tmpl, target, env, user='root', group='root', mode=0o644):
|
||||||
|
logging.info("Generating {} from template {}".format(target, tmpl))
|
||||||
|
cfg = jenv.get_template(tmpl).render(env)
|
||||||
|
with open(target, 'w') as fd:
|
||||||
|
fd.write(cfg)
|
||||||
|
set_perms(target, user, group, mode)
|
||||||
|
|
||||||
|
logging.basicConfig(level=logging.DEBUG)
|
||||||
|
|
||||||
|
|
||||||
|
######################################################################
|
||||||
|
# Setup inputs and outputs
|
||||||
|
|
||||||
|
# Import all ATL_* and Dockerfile environment variables. We lower-case
|
||||||
|
# these for compatability with Ansible template convention. We also
|
||||||
|
# support CATALINA variables from older versions of the Docker images
|
||||||
|
# for backwards compatability, if the new version is not set.
|
||||||
|
env = {k.lower(): v
|
||||||
|
for k, v in os.environ.items()
|
||||||
|
if k.startswith(('ATL_', 'CONFLUENCE_', 'RUN_', 'CATALINA_'))}
|
||||||
|
|
||||||
|
# For compatability with the Ansible templates.
|
||||||
|
env['atl_product_home'] = env['confluence_home']
|
||||||
|
env['atl_product_home_shared'] = env.get('confluence_shared_home')
|
||||||
|
|
||||||
|
|
||||||
|
######################################################################
|
||||||
|
# Generate server.xml for Tomcat.
|
||||||
|
|
||||||
|
gen_cfg('server.xml.j2', env['confluence_install_dir']+'/conf/server.xml', env)
|
||||||
|
|
||||||
|
|
||||||
|
######################################################################
|
||||||
|
# Configure seraph login handling.
|
||||||
|
|
||||||
|
# The default is two weeks, in seconds, same as the seraph default.
|
||||||
|
env['atl_autologin_cookie_age'] = env.get('atl_autologin_cookie_age', "1209600")
|
||||||
|
|
||||||
|
gen_cfg('seraph-config.xml.j2', env['confluence_install_dir']+'/confluence/WEB-INF/classes/seraph-config.xml', env)
|
||||||
|
|
||||||
|
|
||||||
|
######################################################################
|
||||||
|
# Configure confluence-init.properties
|
||||||
|
|
||||||
|
|
||||||
|
gen_cfg('confluence-init.properties.j2', env['confluence_install_dir']+'/confluence/WEB-INF/classes/confluence-init.properties', env)
|
||||||
|
|
||||||
|
######################################################################
|
||||||
|
# Configure confluence.cfg.xml
|
||||||
|
|
||||||
|
gen_cfg('confluence.cfg.xml.j2', env['confluence_home']+'/confluence.cfg.xml', env,
|
||||||
|
user=env['run_user'], group=env['run_group'], mode=0o640)
|
||||||
|
|
||||||
|
|
||||||
|
######################################################################
|
||||||
|
# Start Confluence as the correct user
|
||||||
|
|
||||||
|
start_cmd = "{}/bin/start-confluence.sh".format(env['confluence_install_dir'])
|
||||||
|
if os.getuid() == 0:
|
||||||
|
logging.info("User is currently root. Will change directory ownership to {} then downgrade permissions".format(env['run_user']))
|
||||||
|
set_perms(env['confluence_home'], env['run_user'], env['run_group'], 0o700)
|
||||||
|
|
||||||
|
cmd = '/bin/su'
|
||||||
|
start_cmd = ' '.join([start_cmd] + sys.argv[1:])
|
||||||
|
args = [cmd, env['run_user'], '-c', start_cmd]
|
||||||
|
else:
|
||||||
|
cmd = start_cmd
|
||||||
|
args = [start_cmd] + sys.argv[1:]
|
||||||
|
|
||||||
|
logging.info("Running Confluence with command '{}', arguments {}".format(cmd, args))
|
||||||
|
os.execv(cmd, args)
|
@ -108,6 +108,27 @@ def test_server_xml_defaults(docker_cli, image):
|
|||||||
assert connector.get('proxyName') == ''
|
assert connector.get('proxyName') == ''
|
||||||
assert connector.get('proxyPort') == ''
|
assert connector.get('proxyPort') == ''
|
||||||
|
|
||||||
|
def test_server_xml_catalina_fallback(docker_cli, image):
|
||||||
|
environment = {
|
||||||
|
'CATALINA_CONNECTOR_PROXYNAME': 'PROXYNAME',
|
||||||
|
'CATALINA_CONNECTOR_PROXYPORT': 'PROXYPORT',
|
||||||
|
'CATALINA_CONNECTOR_SECURE': 'SECURE',
|
||||||
|
'CATALINA_CONNECTOR_SCHEME': 'SCHEME',
|
||||||
|
'CATALINA_CONTEXT_PATH': 'CONTEXT'
|
||||||
|
}
|
||||||
|
container = run_image(docker_cli, image, environment=environment)
|
||||||
|
_jvm = wait_for_proc(container, "org.apache.catalina.startup.Bootstrap")
|
||||||
|
|
||||||
|
xml = etree.fromstring(container.file('/opt/atlassian/confluence/conf/server.xml').content)
|
||||||
|
connector = xml.find('.//Connector')
|
||||||
|
context = xml.find('.//Context')
|
||||||
|
|
||||||
|
assert connector.get('proxyName') == 'PROXYNAME'
|
||||||
|
assert connector.get('proxyPort') == 'PROXYPORT'
|
||||||
|
assert connector.get('scheme') == 'SCHEME'
|
||||||
|
assert connector.get('secure') == 'SECURE'
|
||||||
|
assert context.get('path') == 'CONTEXT'
|
||||||
|
|
||||||
def test_server_xml_params(docker_cli, image):
|
def test_server_xml_params(docker_cli, image):
|
||||||
environment = {
|
environment = {
|
||||||
'ATL_TOMCAT_MGMT_PORT': '8006',
|
'ATL_TOMCAT_MGMT_PORT': '8006',
|
||||||
@ -182,6 +203,7 @@ def test_confluence_xml_default(docker_cli, image):
|
|||||||
xml = etree.fromstring(container.file('/var/atlassian/application-data/confluence/confluence.cfg.xml').content)
|
xml = etree.fromstring(container.file('/var/atlassian/application-data/confluence/confluence.cfg.xml').content)
|
||||||
assert xml.xpath('/confluence-configuration/buildNumber')[0].text == "0"
|
assert xml.xpath('/confluence-configuration/buildNumber')[0].text == "0"
|
||||||
assert xml.xpath('/confluence-configuration/properties/property[@name="hibernate.connection.url"]') == []
|
assert xml.xpath('/confluence-configuration/properties/property[@name="hibernate.connection.url"]') == []
|
||||||
|
assert xml.xpath('/confluence-configuration/properties/property[@name="confluence.cluster.home"]') == []
|
||||||
|
|
||||||
def test_confluence_xml_postgres(docker_cli, image):
|
def test_confluence_xml_postgres(docker_cli, image):
|
||||||
environment = {
|
environment = {
|
||||||
@ -226,10 +248,11 @@ def test_confluence_xml_postgres_all_set(docker_cli, image):
|
|||||||
'ATL_DB_VALIDATIONQUERY': 'xselect 1'
|
'ATL_DB_VALIDATIONQUERY': 'xselect 1'
|
||||||
}
|
}
|
||||||
container = run_image(docker_cli, image, environment=environment)
|
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)
|
xml = etree.fromstring(container.file('/var/atlassian/application-data/confluence/confluence.cfg.xml').content)
|
||||||
|
assert xml.xpath('//property[@name="hibernate.connection.driver_class"]')[0].text == "org.postgresql.Driver"
|
||||||
|
assert xml.xpath('//property[@name="hibernate.dialect"]')[0].text == "com.atlassian.confluence.impl.hibernate.dialect.PostgreSQLDialect"
|
||||||
assert xml.xpath('//property[@name="hibernate.c3p0.min_size"]')[0].text == "x20"
|
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.max_size"]')[0].text == "x100"
|
||||||
assert xml.xpath('//property[@name="hibernate.c3p0.timeout"]')[0].text == "x30"
|
assert xml.xpath('//property[@name="hibernate.c3p0.timeout"]')[0].text == "x30"
|
||||||
@ -238,3 +261,62 @@ def test_confluence_xml_postgres_all_set(docker_cli, image):
|
|||||||
assert xml.xpath('//property[@name="hibernate.c3p0.validate"]')[0].text == "xfalse"
|
assert xml.xpath('//property[@name="hibernate.c3p0.validate"]')[0].text == "xfalse"
|
||||||
assert xml.xpath('//property[@name="hibernate.c3p0.acquire_increment"]')[0].text == "x1"
|
assert xml.xpath('//property[@name="hibernate.c3p0.acquire_increment"]')[0].text == "x1"
|
||||||
assert xml.xpath('//property[@name="hibernate.c3p0.preferredTestQuery"]')[0].text == "xselect 1"
|
assert xml.xpath('//property[@name="hibernate.c3p0.preferredTestQuery"]')[0].text == "xselect 1"
|
||||||
|
|
||||||
|
|
||||||
|
def test_confluence_xml_cluster_aws(docker_cli, image):
|
||||||
|
environment = {
|
||||||
|
'ATL_CLUSTER_TYPE': 'aws',
|
||||||
|
'ATL_HAZELCAST_NETWORK_AWS_IAM_ROLE': 'atl_hazelcast_network_aws_iam_role',
|
||||||
|
'ATL_HAZELCAST_NETWORK_AWS_IAM_REGION': 'atl_hazelcast_network_aws_iam_region',
|
||||||
|
'ATL_HAZELCAST_NETWORK_AWS_HOST_HEADER': 'atl_hazelcast_network_aws_host_header',
|
||||||
|
'ATL_HAZELCAST_NETWORK_AWS_TAG_KEY': 'atl_hazelcast_network_aws_tag_key',
|
||||||
|
'ATL_HAZELCAST_NETWORK_AWS_TAG_VALUE': 'atl_hazelcast_network_aws_tag_value',
|
||||||
|
'ATL_CLUSTER_NAME': 'atl_cluster_name',
|
||||||
|
'ATL_CLUSTER_TTL': 'atl_cluster_ttl'
|
||||||
|
}
|
||||||
|
container = run_image(docker_cli, image, environment=environment)
|
||||||
|
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="confluence.cluster"]')[0].text == "true"
|
||||||
|
assert xml.xpath('//property[@name="confluence.cluster.join.type"]')[0].text == "aws"
|
||||||
|
|
||||||
|
assert xml.xpath('//property[@name="confluence.cluster.aws.iam.role"]')[0].text == "atl_hazelcast_network_aws_iam_role"
|
||||||
|
assert xml.xpath('//property[@name="confluence.cluster.aws.region"]')[0].text == "atl_hazelcast_network_aws_iam_region"
|
||||||
|
assert xml.xpath('//property[@name="confluence.cluster.aws.host.header"]')[0].text == "atl_hazelcast_network_aws_host_header"
|
||||||
|
assert xml.xpath('//property[@name="confluence.cluster.aws.tag.key"]')[0].text == "atl_hazelcast_network_aws_tag_key"
|
||||||
|
assert xml.xpath('//property[@name="confluence.cluster.aws.tag.value"]')[0].text == "atl_hazelcast_network_aws_tag_value"
|
||||||
|
assert xml.xpath('//property[@name="confluence.cluster.name"]')[0].text == "atl_cluster_name"
|
||||||
|
assert xml.xpath('//property[@name="confluence.cluster.ttl"]')[0].text == "atl_cluster_ttl"
|
||||||
|
|
||||||
|
def test_confluence_xml_cluster_multicast(docker_cli, image):
|
||||||
|
environment = {
|
||||||
|
'ATL_CLUSTER_TYPE': 'multicast',
|
||||||
|
'ATL_CLUSTER_NAME': 'atl_cluster_name',
|
||||||
|
'ATL_CLUSTER_TTL': 'atl_cluster_ttl',
|
||||||
|
'ATL_CLUSTER_ADDRESS': '99.99.99.99'
|
||||||
|
}
|
||||||
|
container = run_image(docker_cli, image, environment=environment)
|
||||||
|
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="confluence.cluster"]')[0].text == "true"
|
||||||
|
assert xml.xpath('//property[@name="confluence.cluster.join.type"]')[0].text == "multicast"
|
||||||
|
assert xml.xpath('//property[@name="confluence.cluster.name"]')[0].text == "atl_cluster_name"
|
||||||
|
assert xml.xpath('//property[@name="confluence.cluster.ttl"]')[0].text == "atl_cluster_ttl"
|
||||||
|
assert xml.xpath('//property[@name="confluence.cluster.address"]')[0].text == "99.99.99.99"
|
||||||
|
|
||||||
|
def test_confluence_xml_cluster_tcp(docker_cli, image):
|
||||||
|
environment = {
|
||||||
|
'ATL_CLUSTER_TYPE': 'tcp_ip',
|
||||||
|
'ATL_CLUSTER_PEERS': '1.1.1.1,99.99.99.99',
|
||||||
|
'ATL_CLUSTER_NAME': 'atl_cluster_name',
|
||||||
|
}
|
||||||
|
container = run_image(docker_cli, image, environment=environment)
|
||||||
|
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="confluence.cluster"]')[0].text == "true"
|
||||||
|
assert xml.xpath('//property[@name="confluence.cluster.join.type"]')[0].text == "tcp_ip"
|
||||||
|
assert xml.xpath('//property[@name="confluence.cluster.name"]')[0].text == "atl_cluster_name"
|
||||||
|
assert xml.xpath('//property[@name="confluence.cluster.peers"]')[0].text == "1.1.1.1,99.99.99.99"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user