Skip to content

Commit

Permalink
feat(frontend): add custom ssl truststore settings (datahub-project#6090
Browse files Browse the repository at this point in the history
)
  • Loading branch information
alexey-kravtsov authored and cccs-tom committed Nov 18, 2022
1 parent 349e814 commit 55f70aa
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 1 deletion.
5 changes: 5 additions & 0 deletions docker/datahub-frontend/env/docker.env
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,11 @@ JAVA_OPTS=-Xms512m -Xmx512m -Dhttp.port=9002 -Dconfig.file=datahub-frontend/conf
#DATAHUB_GMS_USE_SSL=true
#DATAHUB_GMS_SSL_PROTOCOL=

# Uncomment and set custom SSL truststore settings
# SSL_TRUSTSTORE_FILE=datahub-frontend/conf/truststore.jks
# SSL_TRUSTSTORE_TYPE=jks
# SSL_TRUSTSTORE_PASSWORD=MyTruststorePassword

# Uncomment to enable Metadata Service Authentication
# METADATA_SERVICE_AUTH_ENABLED=true

Expand Down
18 changes: 17 additions & 1 deletion docker/datahub-frontend/start.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,21 @@ if [[ ${ENABLE_OTEL:-false} == true ]]; then
OTEL_AGENT="-javaagent:/opentelemetry-javaagent-all.jar"
fi

TRUSTSTORE_FILE=""
if [[ ! -z ${SSL_TRUSTSTORE_FILE:-} ]]; then
TRUSTSTORE_FILE="-Djavax.net.ssl.trustStore=$SSL_TRUSTSTORE_FILE"
fi

TRUSTSTORE_TYPE=""
if [[ ! -z ${SSL_TRUSTSTORE_TYPE:-} ]]; then
TRUSTSTORE_TYPE="-Djavax.net.ssl.trustStoreType=$SSL_TRUSTSTORE_TYPE"
fi

TRUSTSTORE_PASSWORD=""
if [[ ! -z ${SSL_TRUSTSTORE_PASSWORD:-} ]]; then
TRUSTSTORE_PASSWORD="-Djavax.net.ssl.trustStorePassword=$SSL_TRUSTSTORE_PASSWORD"
fi

# make sure there is no whitespace at the beginning and the end of
# this string
export JAVA_OPTS="-Xms512m \
Expand All @@ -20,7 +35,8 @@ export JAVA_OPTS="-Xms512m \
-Djava.security.auth.login.config=datahub-frontend/conf/jaas.conf \
-Dlogback.configurationFile=datahub-frontend/conf/logback.xml \
-Dlogback.debug=false \
${PROMETHEUS_AGENT:-} ${OTEL_AGENT:-}
${PROMETHEUS_AGENT:-} ${OTEL_AGENT:-} \
${TRUSTSTORE_FILE:-} ${TRUSTSTORE_TYPE:-} ${TRUSTSTORE_PASSWORD:-} \
-Dpidfile.path=/dev/null"

exec ./datahub-frontend/bin/datahub-frontend
Expand Down

0 comments on commit 55f70aa

Please sign in to comment.