mirror of
				https://github.com/gyurix1968/guacamole-client.git
				synced 2025-10-31 00:53:21 +00:00 
			
		
		
		
	GUACAMOLE-1082: Merge add guacamole-auth-cas to Docker script
This commit is contained in:
		| @@ -168,3 +168,19 @@ if [ -f extensions/guacamole-auth-header/target/guacamole-auth-header*.jar ]; th | |||||||
|     mkdir -p "$DESTINATION/header" |     mkdir -p "$DESTINATION/header" | ||||||
|     cp extensions/guacamole-auth-header/target/guacamole-auth-header*.jar "$DESTINATION/header" |     cp extensions/guacamole-auth-header/target/guacamole-auth-header*.jar "$DESTINATION/header" | ||||||
| fi | fi | ||||||
|  |  | ||||||
|  | # | ||||||
|  | # Copy CAS auth extension if it was built | ||||||
|  | # | ||||||
|  |  | ||||||
|  | if [ -f extensions/guacamole-auth-cas/target/*.tar.gz ]; then | ||||||
|  |     mkdir -p "$DESTINATION/cas" | ||||||
|  |     tar -xzf extensions/guacamole-auth-cas/target/*.tar.gz  \ | ||||||
|  |     -C "$DESTINATION/cas/"                                  \ | ||||||
|  |     --wildcards                                             \ | ||||||
|  |     --no-anchored                                           \ | ||||||
|  |     --no-wildcards-match-slash                              \ | ||||||
|  |     --strip-components=1                                    \ | ||||||
|  |     "*.jar" | ||||||
|  | fi | ||||||
|  |  | ||||||
|   | |||||||
| @@ -652,6 +652,38 @@ associate_header() { | |||||||
|     ln -s /opt/guacamole/header/guacamole-auth-*.jar "$GUACAMOLE_EXT" |     ln -s /opt/guacamole/header/guacamole-auth-*.jar "$GUACAMOLE_EXT" | ||||||
| } | } | ||||||
|  |  | ||||||
|  | ## | ||||||
|  | ## Adds properties to guacamole.properties witch configure the CAS | ||||||
|  | ## authentication service. | ||||||
|  | ## | ||||||
|  | associate_cas() { | ||||||
|  |     # Verify required parameters are present | ||||||
|  |     if [ -z "$CAS_AUTHORIZATION_ENDPOINT" ] || \ | ||||||
|  |        [ -z "$CAS_REDIRECT_URI" ] | ||||||
|  |     then | ||||||
|  |         cat <<END | ||||||
|  | FATAL: Missing required environment variables | ||||||
|  | ----------------------------------------------------------------------------------- | ||||||
|  | If using the CAS authentication extension, you must provide each of the | ||||||
|  | following environment variables: | ||||||
|  |  | ||||||
|  |     CAS_AUTHORIZATION_ENDPOINT      The URL of the CAS authentication server. | ||||||
|  |  | ||||||
|  |     CAS_REDIRECT_URI                The URI to redirect back to upon successful authentication. | ||||||
|  |  | ||||||
|  | END | ||||||
|  |         exit 1; | ||||||
|  |     fi | ||||||
|  |  | ||||||
|  |     # Update config file | ||||||
|  |     set_property            "cas-authorization-endpoint"       "$CAS_AUTHORIZATION_ENDPOINT" | ||||||
|  |     set_property            "cas-redirect-uri"                 "$CAS_REDIRECT_URI" | ||||||
|  |     set_optional_property   "cas-clearpass-key"                "$CAS_CLEARPASS_KEY" | ||||||
|  |  | ||||||
|  |     # Add required .jar files to GUACAMOLE_EXT | ||||||
|  |     ln -s /opt/guacamole/cas/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 | ||||||
| @@ -799,6 +831,11 @@ if [ "$HEADER_ENABLED" = "true" ]; then | |||||||
|     associate_header |     associate_header | ||||||
| fi | fi | ||||||
|  |  | ||||||
|  | # Use CAS if specified. | ||||||
|  | if [ -n "$CAS_AUTHORIZATION_ENDPOINT" ]; then | ||||||
|  |     associate_cas | ||||||
|  | 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 | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user