Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #57 from OpenLiberty/arturdzm
Run docker image as non-root, add configuration snippets
- Loading branch information
Showing
157 changed files
with
2,194 additions
and
282 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
#!/bin/sh | ||
set -eox pipefail | ||
|
||
##Define variables for XML snippets source and target paths | ||
WLP_INSTALL_DIR=/opt/ol/wlp | ||
SHARED_CONFIG_DIR=${WLP_INSTALL_DIR}/usr/shared/config | ||
SHARED_RESOURCE_DIR=${WLP_INSTALL_DIR}/usr/shared/resources | ||
|
||
SNIPPETS_SOURCE=/opt/ol/helpers/build/configuration_snippets | ||
SNIPPETS_TARGET=/config/configDropins/overrides | ||
mkdir -p ${SNIPPETS_TARGET} | ||
|
||
|
||
#Check for each Liberty value-add functionality | ||
|
||
# MicroProfile Health | ||
if [ "$MP_HEALTH_CHECK" == "true" ]; then | ||
cp $SNIPPETS_SOURCE/mp-health-check.xml $SNIPPETS_TARGET/mp-health-check.xml | ||
fi | ||
|
||
# MicroProfile Monitoring | ||
if [ "$MP_MONITORING" == "true" ]; then | ||
cp $SNIPPETS_SOURCE/mp-monitoring.xml $SNIPPETS_TARGET/mp-monitoring.xml | ||
fi | ||
|
||
# SSL | ||
if [ "$SSL" == "true" ]; then | ||
cp $SNIPPETS_SOURCE/ssl.xml $SNIPPETS_TARGET/ssl.xml | ||
fi | ||
|
||
# HTTP Endpoint | ||
if [ "$HTTP_ENDPOINT" == "true" ]; then | ||
if [ "$SSL" == "true" ]; then | ||
cp $SNIPPETS_SOURCE/http-ssl-endpoint.xml $SNIPPETS_TARGET/http-ssl-endpoint.xml | ||
else | ||
cp $SNIPPETS_SOURCE/http-endpoint.xml $SNIPPETS_TARGET/http-endpoint.xml | ||
fi | ||
fi | ||
|
||
# Hazelcast Session Caching | ||
if [ "${HZ_SESSION_CACHE}" == "client" ] || [ "${HZ_SESSION_CACHE}" == "embedded" ] | ||
then | ||
cp ${SNIPPETS_SOURCE}/hazelcast-sessioncache.xml ${SNIPPETS_TARGET}/hazelcast-sessioncache.xml | ||
mkdir -p ${SHARED_CONFIG_DIR}/hazelcast | ||
cp ${SNIPPETS_SOURCE}/hazelcast-${HZ_SESSION_CACHE}.xml ${SHARED_CONFIG_DIR}/hazelcast/hazelcast.xml | ||
fi | ||
|
||
# IIOP Endpoint | ||
if [ "$IIOP_ENDPOINT" == "true" ]; then | ||
if [ "$SSL" == "true" ]; then | ||
cp $SNIPPETS_SOURCE/iiop-ssl-endpoint.xml $SNIPPETS_TARGET/iiop-ssl-endpoint.xml | ||
else | ||
cp $SNIPPETS_SOURCE/iiop-endpoint.xml $SNIPPETS_TARGET/iiop-endpoint.xml | ||
fi | ||
fi | ||
|
||
# JMS Endpoint | ||
if [ "$JMS_ENDPOINT" == "true" ]; then | ||
if [ "$SSL" == "true" ]; then | ||
cp $SNIPPETS_SOURCE/jms-ssl-endpoint.xml $SNIPPETS_TARGET/jms-ssl-endpoint.xml | ||
else | ||
cp $SNIPPETS_SOURCE/jms-endpoint.xml $SNIPPETS_TARGET/jms-endpoint.xml | ||
fi | ||
fi |
16 changes: 16 additions & 0 deletions
16
common/helpers/build/configuration_snippets/hazelcast-client.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<hazelcast-client xmlns="http://www.hazelcast.com/schema/client-config" | ||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xsi:schemaLocation="http://www.hazelcast.com/schema/client-config | ||
http://www.hazelcast.com/schema/client-config/hazelcast-client-config-3.11.xsd"> | ||
<properties> | ||
<property name="hazelcast.discovery.enabled">true</property> | ||
</properties> | ||
<network> | ||
<redo-operation>true</redo-operation> | ||
<discovery-strategies> | ||
<discovery-strategy enabled="true" class="com.hazelcast.kubernetes.HazelcastKubernetesDiscoveryStrategy"> | ||
</discovery-strategy> | ||
</discovery-strategies> | ||
</network> | ||
</hazelcast-client> |
19 changes: 19 additions & 0 deletions
19
common/helpers/build/configuration_snippets/hazelcast-embedded.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<hazelcast xmlns="http://www.hazelcast.com/schema/config" | ||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xsi:schemaLocation="http://www.hazelcast.com/schema/config | ||
http://www.hazelcast.com/schema/config/hazelcast-config-3.11.xsd"> | ||
<properties> | ||
<property name="hazelcast.discovery.enabled">true</property> | ||
</properties> | ||
<network> | ||
<join> | ||
<multicast enabled="false"/> | ||
<tcp-ip enabled="false"/> | ||
<discovery-strategies> | ||
<discovery-strategy enabled="true" class="com.hazelcast.kubernetes.HazelcastKubernetesDiscoveryStrategy"> | ||
</discovery-strategy> | ||
</discovery-strategies> | ||
</join> | ||
</network> | ||
</hazelcast> |
11 changes: 11 additions & 0 deletions
11
common/helpers/build/configuration_snippets/hazelcast-sessioncache.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
<server> | ||
<featureManager> | ||
<feature>sessionCache-1.0</feature> | ||
</featureManager> | ||
<httpSessionCache libraryRef="HazelcastLib"> | ||
<properties hazelcast.config.location="file:${shared.config.dir}/hazelcast/hazelcast.xml"/> | ||
</httpSessionCache> | ||
<library id="HazelcastLib"> | ||
<fileset dir="${shared.resource.dir}/hazelcast"/> | ||
</library> | ||
</server> |
4 changes: 4 additions & 0 deletions
4
common/helpers/build/configuration_snippets/http-endpoint.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<server> | ||
<httpEndpoint id="defaultHttpEndpoint" host="*" httpPort="9080" /> | ||
</server> |
4 changes: 4 additions & 0 deletions
4
common/helpers/build/configuration_snippets/http-ssl-endpoint.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<server> | ||
<httpEndpoint id="defaultHttpEndpoint" host="*" httpsPort="9443" httpPort="9080" /> | ||
</server> |
4 changes: 4 additions & 0 deletions
4
common/helpers/build/configuration_snippets/iiop-endpoint.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<server> | ||
<iiopEndpoint id="defaultIiopEndpoint" host="${env.IIOP_ENDPOINT_HOST}" iiopPort="2809" /> | ||
</server> |
6 changes: 6 additions & 0 deletions
6
common/helpers/build/configuration_snippets/iiop-ssl-endpoint.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<server> | ||
<iiopEndpoint id="defaultIiopEndpoint" host="${env.IIOP_ENDPOINT_HOST}" iiopPort="2809"> | ||
<iiopsOptions iiopsPort="9402" sslRef="defaultSSLConfig" /> | ||
</iiopEndpoint> | ||
</server> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<server> | ||
<wasJmsEndpoint id="InboundJmsEndpoint" host="*" wasJmsPort="7276" /> | ||
</server> |
4 changes: 4 additions & 0 deletions
4
common/helpers/build/configuration_snippets/jms-ssl-endpoint.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<server> | ||
<wasJmsEndpoint id="InboundJmsEndpoint" host="*" wasJmsSSLPort="7286" /> | ||
</server> |
6 changes: 6 additions & 0 deletions
6
common/helpers/build/configuration_snippets/mp-health-check.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<server> | ||
<featureManager> | ||
<feature>mpHealth-1.0</feature> | ||
</featureManager> | ||
</server> |
9 changes: 9 additions & 0 deletions
9
common/helpers/build/configuration_snippets/mp-monitoring.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<server> | ||
<featureManager> | ||
<feature>mpMetrics-1.1</feature> | ||
<feature>monitor-1.0</feature> | ||
</featureManager> | ||
|
||
<mpMetrics authentication="false" /> | ||
</server> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<server> | ||
<featureManager> | ||
<feature>ssl-1.0</feature> | ||
</featureManager> | ||
</server> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
#!/bin/bash | ||
set -Eeox pipefail | ||
|
||
##Define variables for XML snippets source and target paths | ||
WLP_INSTALL_DIR=/opt/ol/wlp | ||
SHARED_CONFIG_DIR=${WLP_INSTALL_DIR}/usr/shared/config | ||
SHARED_RESOURCE_DIR=${WLP_INSTALL_DIR}/usr/shared/resources | ||
|
||
SNIPPETS_SOURCE=/opt/ol/helpers/build/configuration_snippets | ||
SNIPPETS_TARGET=/config/configDropins/overrides | ||
mkdir -p ${SNIPPETS_TARGET} | ||
|
||
|
||
#Check for each Liberty value-add functionality | ||
|
||
# MicroProfile Health | ||
if [ "$MP_HEALTH_CHECK" == "true" ]; then | ||
cp $SNIPPETS_SOURCE/mp-health-check.xml $SNIPPETS_TARGET/mp-health-check.xml | ||
fi | ||
|
||
# MicroProfile Monitoring | ||
if [ "$MP_MONITORING" == "true" ]; then | ||
cp $SNIPPETS_SOURCE/mp-monitoring.xml $SNIPPETS_TARGET/mp-monitoring.xml | ||
fi | ||
|
||
# SSL | ||
if [ "$SSL" == "true" ]; then | ||
cp $SNIPPETS_SOURCE/ssl.xml $SNIPPETS_TARGET/ssl.xml | ||
fi | ||
|
||
# HTTP Endpoint | ||
if [ "$HTTP_ENDPOINT" == "true" ]; then | ||
if [ "$SSL" == "true" ]; then | ||
cp $SNIPPETS_SOURCE/http-ssl-endpoint.xml $SNIPPETS_TARGET/http-ssl-endpoint.xml | ||
else | ||
cp $SNIPPETS_SOURCE/http-endpoint.xml $SNIPPETS_TARGET/http-endpoint.xml | ||
fi | ||
fi | ||
|
||
# Hazelcast Session Caching | ||
if [ "${HZ_SESSION_CACHE}" == "client" ] || [ "${HZ_SESSION_CACHE}" == "embedded" ] | ||
then | ||
cp ${SNIPPETS_SOURCE}/hazelcast-sessioncache.xml ${SNIPPETS_TARGET}/hazelcast-sessioncache.xml | ||
mkdir -p ${SHARED_CONFIG_DIR}/hazelcast | ||
cp ${SNIPPETS_SOURCE}/hazelcast-${HZ_SESSION_CACHE}.xml ${SHARED_CONFIG_DIR}/hazelcast/hazelcast.xml | ||
fi | ||
|
||
# IIOP Endpoint | ||
if [ "$IIOP_ENDPOINT" == "true" ]; then | ||
if [ "$SSL" == "true" ]; then | ||
cp $SNIPPETS_SOURCE/iiop-ssl-endpoint.xml $SNIPPETS_TARGET/iiop-ssl-endpoint.xml | ||
else | ||
cp $SNIPPETS_SOURCE/iiop-endpoint.xml $SNIPPETS_TARGET/iiop-endpoint.xml | ||
fi | ||
fi | ||
|
||
# JMS Endpoint | ||
if [ "$JMS_ENDPOINT" == "true" ]; then | ||
if [ "$SSL" == "true" ]; then | ||
cp $SNIPPETS_SOURCE/jms-ssl-endpoint.xml $SNIPPETS_TARGET/jms-ssl-endpoint.xml | ||
else | ||
cp $SNIPPETS_SOURCE/jms-endpoint.xml $SNIPPETS_TARGET/jms-endpoint.xml | ||
fi | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
16 changes: 16 additions & 0 deletions
16
community/javaee8/java8/openj9/helpers/build/configuration_snippets/hazelcast-client.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<hazelcast-client xmlns="http://www.hazelcast.com/schema/client-config" | ||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xsi:schemaLocation="http://www.hazelcast.com/schema/client-config | ||
http://www.hazelcast.com/schema/client-config/hazelcast-client-config-3.11.xsd"> | ||
<properties> | ||
<property name="hazelcast.discovery.enabled">true</property> | ||
</properties> | ||
<network> | ||
<redo-operation>true</redo-operation> | ||
<discovery-strategies> | ||
<discovery-strategy enabled="true" class="com.hazelcast.kubernetes.HazelcastKubernetesDiscoveryStrategy"> | ||
</discovery-strategy> | ||
</discovery-strategies> | ||
</network> | ||
</hazelcast-client> |
19 changes: 19 additions & 0 deletions
19
community/javaee8/java8/openj9/helpers/build/configuration_snippets/hazelcast-embedded.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<hazelcast xmlns="http://www.hazelcast.com/schema/config" | ||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xsi:schemaLocation="http://www.hazelcast.com/schema/config | ||
http://www.hazelcast.com/schema/config/hazelcast-config-3.11.xsd"> | ||
<properties> | ||
<property name="hazelcast.discovery.enabled">true</property> | ||
</properties> | ||
<network> | ||
<join> | ||
<multicast enabled="false"/> | ||
<tcp-ip enabled="false"/> | ||
<discovery-strategies> | ||
<discovery-strategy enabled="true" class="com.hazelcast.kubernetes.HazelcastKubernetesDiscoveryStrategy"> | ||
</discovery-strategy> | ||
</discovery-strategies> | ||
</join> | ||
</network> | ||
</hazelcast> |
11 changes: 11 additions & 0 deletions
11
...nity/javaee8/java8/openj9/helpers/build/configuration_snippets/hazelcast-sessioncache.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
<server> | ||
<featureManager> | ||
<feature>sessionCache-1.0</feature> | ||
</featureManager> | ||
<httpSessionCache libraryRef="HazelcastLib"> | ||
<properties hazelcast.config.location="file:${shared.config.dir}/hazelcast/hazelcast.xml"/> | ||
</httpSessionCache> | ||
<library id="HazelcastLib"> | ||
<fileset dir="${shared.resource.dir}/hazelcast"/> | ||
</library> | ||
</server> |
4 changes: 4 additions & 0 deletions
4
community/javaee8/java8/openj9/helpers/build/configuration_snippets/http-endpoint.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<server> | ||
<httpEndpoint id="defaultHttpEndpoint" host="*" httpPort="9080" /> | ||
</server> |
Oops, something went wrong.