From 48611d1697c31f0050efa3d1be375d17d87f6dd6 Mon Sep 17 00:00:00 2001 From: Shane St Savage Date: Fri, 3 Mar 2023 17:01:39 -0800 Subject: [PATCH] Upgrade to ERDDAP v2.23, generate random flagKeyKey if not set --- Dockerfile | 7 ++++--- entrypoint.sh | 6 ++++++ 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/Dockerfile b/Dockerfile index 0dc12f0..b26a99c 100644 --- a/Dockerfile +++ b/Dockerfile @@ -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 " -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 @@ -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="nobody@example.com" \ ERDDAP_emailDailyReportsTo="nobody@example.com" \ ERDDAP_emailFromAddress="nothing@example.com" \ diff --git a/entrypoint.sh b/entrypoint.sh index f00b79c..2ec2f0b 100755 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -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 "CHANGE THIS TO YOUR FAVORITE QUOTE" \ + "${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}