From b9a99f0bc16181f2edcea86a90fb5738a760e90d Mon Sep 17 00:00:00 2001 From: Scott Paschke Date: Fri, 11 Jan 2019 13:33:15 -0500 Subject: [PATCH] GUACAMOLE-271: add Duo to Docker build --- guacamole-docker/bin/build-guacamole.sh | 15 +++++++++ guacamole-docker/bin/start.sh | 44 +++++++++++++++++++++++++ 2 files changed, 59 insertions(+) diff --git a/guacamole-docker/bin/build-guacamole.sh b/guacamole-docker/bin/build-guacamole.sh index c5ff255d4..88087e5bf 100755 --- a/guacamole-docker/bin/build-guacamole.sh +++ b/guacamole-docker/bin/build-guacamole.sh @@ -134,3 +134,18 @@ if [ -f extensions/guacamole-auth-openid/target/guacamole-auth-openid*.jar ]; th mkdir -p "$DESTINATION/openid" cp extensions/guacamole-auth-openid/target/guacamole-auth-openid*.jar "$DESTINATION/openid" fi + +# +# Copy Duo auth extension if it was built +# + +if [ -f extensions/guacamole-auth-duo/target/*.tar.gz ]; then + mkdir -p "$DESTINATION/duo" + tar -xzf extensions/guacamole-auth-duo/target/*.tar.gz \ + -C "$DESTINATION/duo/" \ + --wildcards \ + --no-anchored \ + --no-wildcards-match-slash \ + --strip-components=1 \ + "*.jar" +fi diff --git a/guacamole-docker/bin/start.sh b/guacamole-docker/bin/start.sh index 2ed50a929..48eae9d93 100755 --- a/guacamole-docker/bin/start.sh +++ b/guacamole-docker/bin/start.sh @@ -460,6 +460,45 @@ END } +## +## Adds properties to guacamole.properties which configure the Duo two-factor +## authentication service. Checks to see if all variables are defined and makes sure +## DUO_APPLICATION_KEY is >= 40 characters. +## +associate_duo() { + # Verify required parameters are present + if [ -z "$DUO_INTEGRATION_KEY" ] || \ + [ -z "$DUO_SECRET_KEY" ] || \ + [ ${#DUO_APPLICATION_KEY} -lt 40 ] + then + cat <