Skip to content

Commit

Permalink
Merge pull request #63 from axiom-data-science/2-23
Browse files Browse the repository at this point in the history
Upgrade to ERDDAP v2.23, generate random flagKeyKey if not set
  • Loading branch information
kwilcox authored Mar 4, 2023
2 parents a7ed3d4 + 48611d1 commit 4b05d14
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
7 changes: 4 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
ARG BASE_IMAGE=unidata/tomcat-docker:10.1.0-jdk17-openjdk@sha256:8b595bcd8eee410e2d610829b5d4e312d51e3ea6c6bde952a5838845f67a4839
ARG BASE_IMAGE=unidata/tomcat-docker:10.1.0-jdk17-temurin-focal@sha256:99c083fd17d1f8d6c85a0f771039ffb4d2430ff7fd6dabea8eb50f2731328af8
FROM ${BASE_IMAGE}
LABEL maintainer="Kyle Wilcox <[email protected]>"

ARG ERDDAP_VERSION=2.22
ARG ERDDAP_VERSION=2.23
ARG ERDDAP_CONTENT_URL=https://github.com/BobSimons/erddap/releases/download/v$ERDDAP_VERSION/erddapContent.zip
ARG ERDDAP_WAR_URL=https://github.com/BobSimons/erddap/releases/download/v$ERDDAP_VERSION/erddap.war
ENV ERDDAP_bigParentDirectory /erddapData
Expand Down Expand Up @@ -31,8 +31,9 @@ COPY update-server-xml.sh /opt/update-server-xml.sh
RUN /opt/update-server-xml.sh

# Default configuration
# Note: Make sure ERDDAP_flagKeyKey is set either in a runtime environment variable or in setup.xml
# If a value is not set, a random value for ERDDAP_flagKeyKey will be generated at runtime.
ENV ERDDAP_baseHttpsUrl="https://localhost:8443" \
ERDDAP_flagKeyKey="73976bb0-9cd4-11e3-a5e2-0800200c9a66" \
ERDDAP_emailEverythingTo="[email protected]" \
ERDDAP_emailDailyReportsTo="[email protected]" \
ERDDAP_emailFromAddress="[email protected]" \
Expand Down
6 changes: 6 additions & 0 deletions entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,12 @@ set -e
# catalina.sh

if [ "$1" = 'start-tomcat.sh' ] || [ "$1" = 'catalina.sh' ]; then
# generate random flagKeyKey if not set
if [ -z "$ERDDAP_flagKeyKey" ] && grep "<flagKeyKey>CHANGE THIS TO YOUR FAVORITE QUOTE</flagKeyKey>" \
"${CATALINA_HOME}/content/erddap/setup.xml" &> /dev/null; then
echo "flagKeyKey isn't properly set. Generating a random value." >&2
export ERDDAP_flagKeyKey=$(cat /proc/sys/kernel/random/uuid)
fi

USER_ID=${TOMCAT_USER_ID:-1000}
GROUP_ID=${TOMCAT_GROUP_ID:-1000}
Expand Down

0 comments on commit 4b05d14

Please sign in to comment.