GUACAMOLE-1218: Add auth-json extension and configuration to docker start & build scripts

This commit is contained in:
Bojan Zelic
2020-12-18 13:13:32 -07:00
parent 6fc7537c08
commit 720f884457
2 changed files with 26 additions and 0 deletions

View File

@@ -184,3 +184,11 @@ if [ -f extensions/guacamole-auth-cas/target/*.tar.gz ]; then
"*.jar" "*.jar"
fi fi
#
# Copy json auth extension if it was built
#
if [ -f extensions/guacamole-auth-json/target/guacamole-auth-json*.jar ]; then
mkdir -p "$DESTINATION/json"
cp extensions/guacamole-auth-json/target/guacamole-auth-json*.jar "$DESTINATION/json"
fi

View File

@@ -687,6 +687,19 @@ END
ln -s /opt/guacamole/cas/guacamole-auth-*.jar "$GUACAMOLE_EXT" ln -s /opt/guacamole/cas/guacamole-auth-*.jar "$GUACAMOLE_EXT"
} }
##
## Adds properties to guacamole.properties which configure the json
## authentication provider.
##
associate_json() {
# Update config file
set_property "json-secret-key" "$JSON_SECRET_KEY"
set_optional_property "json-trusted-networks" "$JSON_TRUSTED_NETWORKS"
# Add required .jar files to GUACAMOLE_EXT
ln -s /opt/guacamole/json/guacamole-auth-*.jar "$GUACAMOLE_EXT"
}
## ##
## Starts Guacamole under Tomcat, replacing the current process with the ## Starts Guacamole under Tomcat, replacing the current process with the
## Tomcat process. As the current process will be replaced, this MUST be the ## Tomcat process. As the current process will be replaced, this MUST be the
@@ -839,6 +852,11 @@ if [ -n "$CAS_AUTHORIZATION_ENDPOINT" ]; then
associate_cas associate_cas
fi fi
# Use json-auth if specified.
if [ -n "$JSON_SECRET_KEY" ]; then
associate_json
fi
# Set logback level if specified # Set logback level if specified
if [ -n "$LOGBACK_LEVEL" ]; then if [ -n "$LOGBACK_LEVEL" ]; then
unzip -o -j /opt/guacamole/guacamole.war WEB-INF/classes/logback.xml -d $GUACAMOLE_HOME unzip -o -j /opt/guacamole/guacamole.war WEB-INF/classes/logback.xml -d $GUACAMOLE_HOME