Skip to content

Commit

Permalink
add application.properties to envsubst block, remove nonfunctional en…
Browse files Browse the repository at this point in the history
…v var defaults
  • Loading branch information
labkey-willm committed Apr 16, 2024
1 parent c2a70ec commit 607457c
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 24 deletions.
17 changes: 10 additions & 7 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -41,12 +41,11 @@ ENV DEBUG="${DEBUG}" \
POSTGRES_DB="${POSTGRES_USER}" \
POSTGRES_PARAMETERS= \
\
POSTGRES_MAX_TOTAL_CONNECTIONS= \
POSTGRES_MAX_IDLE_CONNECTIONS= \
POSTGRES_MAX_WAIT_MILLIS= \
POSTGRES_ACCESS_UNDERLYING_CONNECTIONS= \
POSTGRES_VALIDATION_QUERY= \
\
POSTGRES_MAX_TOTAL_CONNECTIONS=50 \
POSTGRES_MAX_IDLE_CONNECTIONS=10 \
POSTGRES_MAX_WAIT_MILLIS=120000 \
POSTGRES_ACCESS_UNDERLYING_CONNECTIONS=true \
POSTGRES_VALIDATION_QUERY="SELECT 1" \
\
LABKEY_VERSION="${LABKEY_VERSION}" \
LABKEY_DISTRIBUTION="${LABKEY_DISTRIBUTION}" \
Expand All @@ -69,13 +68,17 @@ ENV DEBUG="${DEBUG}" \
LABKEY_CREATE_INITIAL_USER_APIKEY= \
LABKEY_INITIAL_USER_APIKEY= \
\
LOG_LEVEL_TOMCAT="OFF" \
LOG_LEVEL_SPRING_WEB="OFF" \
LOG_LEVEL_SQL="OFF" \
\
TOMCAT_KEYSTORE_FILENAME="labkey.p12" \
TOMCAT_KEYSTORE_FORMAT="PKCS12" \
TOMCAT_KEYSTORE_ALIAS="tomcat" \
\
TOMCAT_SSL_CIPHERS="HIGH:!ADH:!EXP:!SSLv2:!SSLv3:!MEDIUM:!LOW:!NULL:!aNULL" \
TOMCAT_SSL_PROTOCOL="TLS" \
TOMCAT_SSL_ENABLED_PROTOCOLS="TLSv1.3,TLSv1.2" \
TOMCAT_SSL_PROTOCOL="TLS" \
\
TOMCAT_ENABLE_ACCESS_LOG=

Expand Down
32 changes: 16 additions & 16 deletions application.properties
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
# debug=true
# trace=true

server.tomcat.basedir=${TOMCAT_BASE_DIR:-/}
server.tomcat.basedir=${TOMCAT_BASE_DIR}

server.port=${LABKEY_PORT:-8443}
server.port=${LABKEY_PORT}

spring.main.log-startup-info=true

Expand All @@ -23,13 +23,13 @@ logging.level.root=WARN

# custom tomcat group
logging.group.tomcat=org.apache.catalina, org.apache.coyote, org.apache.tomcat
logging.level.tomcat=${LOG_LEVEL_TOMCAT:OFF}
logging.level.tomcat=${LOG_LEVEL_TOMCAT}

logging.level.org.apache.coyote.http2=OFF

# default groups
logging.level.web=${LOG_LEVEL_SPRING_WEB:OFF}
logging.level.sql=${LOG_LEVEL_SQL:OFF}
logging.level.web=${LOG_LEVEL_SPRING_WEB}
logging.level.sql=${LOG_LEVEL_SQL}

logging.level.net.sf.ehcache=ERROR

Expand Down Expand Up @@ -89,11 +89,11 @@ context.resources.jdbc.labkeyDataSource.username=@@jdbcUser@@
context.resources.jdbc.labkeyDataSource.password=@@jdbcPassword@@

# the ':-' setup doesn't appeear to work. They have to be set as env vars anyway, but at least this shows the indended defaults set elsewhere
context.resources.jdbc.labkeyDataSource.maxTotal=${POSTGRES_MAX_TOTAL_CONNECTIONS:-50}
context.resources.jdbc.labkeyDataSource.maxIdle=${POSTGRES_MAX_IDLE_CONNECTIONS:-10}
context.resources.jdbc.labkeyDataSource.maxWaitMillis=${POSTGRES_MAX_WAIT_MILLIS:-120000}
context.resources.jdbc.labkeyDataSource.accessToUnderlyingConnectionAllowed=${POSTGRES_ACCESS_UNDERLYING_CONNECTIONS:-true}
context.resources.jdbc.labkeyDataSource.validationQuery=${POSTGRES_VALIDATION_QUERY:-SELECT 1}
context.resources.jdbc.labkeyDataSource.maxTotal=${POSTGRES_MAX_TOTAL_CONNECTIONS}
context.resources.jdbc.labkeyDataSource.maxIdle=${POSTGRES_MAX_IDLE_CONNECTIONS}
context.resources.jdbc.labkeyDataSource.maxWaitMillis=${POSTGRES_MAX_WAIT_MILLIS}
context.resources.jdbc.labkeyDataSource.accessToUnderlyingConnectionAllowed=${POSTGRES_ACCESS_UNDERLYING_CONNECTIONS}
context.resources.jdbc.labkeyDataSource.validationQuery=${POSTGRES_VALIDATION_QUERY}

# send access logs to stdout:
server.tomcat.accesslog.enabled=true
Expand All @@ -115,16 +115,16 @@ server.http2.enabled=true

server.ssl.enabled=true

server.ssl.ciphers=${TOMCAT_SSL_CIPHERS:-HIGH:!ADH:!EXP:!SSLv2:!SSLv3:!MEDIUM:!LOW:!NULL:!aNULL}
server.ssl.enabled-protocols=${TOMCAT_SSL_ENABLED_PROTOCOLS:-TLSv1.3,TLSv1.2}
server.ssl.protocol=${TOMCAT_SSL_PROTOCOL:-TLS}
server.ssl.ciphers=${TOMCAT_SSL_CIPHERS}
server.ssl.enabled-protocols=${TOMCAT_SSL_ENABLED_PROTOCOLS}
server.ssl.protocol=${TOMCAT_SSL_PROTOCOL}


# must match values in entrypoint.sh
server.ssl.key-alias=${TOMCAT_KEYSTORE_ALIAS:-tomcat}
server.ssl.key-store=${LABKEY_HOME}/${TOMCAT_KEYSTORE_FILENAME:-labkey.p12}
server.ssl.key-alias=${TOMCAT_KEYSTORE_ALIAS}
server.ssl.key-store=${LABKEY_HOME}/${TOMCAT_KEYSTORE_FILENAME}
# server.ssl.key-store-password=${TOMCAT_KEYSTORE_PASSWORD}
server.ssl.key-store-type=${TOMCAT_KEYSTORE_FORMAT:-PKCS12}
server.ssl.key-store-type=${TOMCAT_KEYSTORE_FORMAT}

context.encryptionKey=@@encryptionKey@@

Expand Down
2 changes: 1 addition & 1 deletion entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ main() {
# echo "sleeping for $SLEEP seconds..."
# sleep $SLEEP

for prop_file in startup/*.properties; do
for prop_file in startup/*.properties config/application.properties; do
envsubst < "$prop_file" > "${prop_file}.tmp" \
&& mv "${prop_file}.tmp" "$prop_file"
done
Expand Down

0 comments on commit 607457c

Please sign in to comment.