diff --git a/Dockerfile b/Dockerfile index e0a77c38..4cd81305 100644 --- a/Dockerfile +++ b/Dockerfile @@ -6,7 +6,7 @@ RUN yum update -y \ RUN yum install -y wget tar unzip dos2unix patch ARG GROUPER_CONTAINER_VERSION -ENV GROUPER_VERSION=2.6.7 \ +ENV GROUPER_VERSION=2.6.8 \ GROUPER_CONTAINER_VERSION=$GROUPER_CONTAINER_VERSION # Install Corretto Java JDK @@ -32,7 +32,7 @@ RUN echo 'Installing Grouper'; \ cd /opt/grouper/$GROUPER_VERSION/ \ && $JAVA_HOME/bin/java -cp :grouperInstaller.jar edu.internet2.middleware.grouperInstaller.GrouperInstaller FROM centos:centos7 as cleanup -ENV GROUPER_VERSION=2.6.7 \ +ENV GROUPER_VERSION=2.6.8 \ TOMEE_VERSION=7.0.0 RUN mkdir -p /opt/grouper/grouperWebapp/ RUN mkdir -p /opt/tomee/ diff --git a/container_files/api/log4j2.additionalAppenders.xml.txt b/container_files/api/log4j2.additionalAppenders.xml.txt new file mode 100644 index 00000000..e69de29b diff --git a/container_files/api/log4j2.xml b/container_files/api/log4j2.xml index e360ddcb..c0209b0d 100644 --- a/container_files/api/log4j2.xml +++ b/container_files/api/log4j2.xml @@ -50,7 +50,31 @@ - + + + + + + + + + + + + + + + + + + + + + + + + + @@ -89,6 +113,14 @@ + + + + + + + + \ No newline at end of file diff --git a/container_files/tier-support/test/grouperContainerUnitTest.sh b/container_files/tier-support/test/grouperContainerUnitTest.sh index 343a479c..8305ad4f 100644 --- a/container_files/tier-support/test/grouperContainerUnitTest.sh +++ b/container_files/tier-support/test/grouperContainerUnitTest.sh @@ -5,7 +5,7 @@ if [ "$#" -ne 4 ]; then exit 1 fi -expectedSuccesses=715 +expectedSuccesses=716 export containerName=$1 export imageName=$2 diff --git a/container_files/tier-support/test/grouperContainerUnitTestSlashRoot.sh b/container_files/tier-support/test/grouperContainerUnitTestSlashRoot.sh index e1d1a463..42e012c9 100644 --- a/container_files/tier-support/test/grouperContainerUnitTestSlashRoot.sh +++ b/container_files/tier-support/test/grouperContainerUnitTestSlashRoot.sh @@ -22,6 +22,7 @@ testContainerSlashRoot() { echo 'whatever' > someDir/tmp/temp.txt mkdir -p someDir/opt/grouper/grouperWebapp/WEB-INF/classes echo 'someSettings' > someDir/opt/grouper/grouperWebapp/WEB-INF/classes/log4j2.additionalLoggers.xml.txt + echo 'otherSettings' > someDir/opt/grouper/grouperWebapp/WEB-INF/classes/log4j2.additionalAppenders.xml.txt docker run --detach --name $containerName --mount type=bind,src=$someDir,dst=/opt/grouper/slashRoot --publish 443:443 $imageName ui sleep $globalSleepSecondsAfterRun @@ -29,6 +30,7 @@ testContainerSlashRoot() { assertFileExists /tmp/temp.txt assertFileContains /opt/grouper/grouperWebapp/WEB-INF/classes/log4j2.xml "someSettings" + assertFileContains /opt/grouper/grouperWebapp/WEB-INF/classes/log4j2.xml "otherSettings" #rm -rf someDir diff --git a/container_files/usr-local-bin/librarySetupFiles.sh b/container_files/usr-local-bin/librarySetupFiles.sh index 76618484..1b24f58d 100644 --- a/container_files/usr-local-bin/librarySetupFiles.sh +++ b/container_files/usr-local-bin/librarySetupFiles.sh @@ -58,6 +58,16 @@ setupFiles_localLogging() { if [ $returnCode != 0 ]; then exit $returnCode; fi fi + if [ -f /opt/grouper/grouperWebapp/WEB-INF/classes/log4j2.additionalAppenders.xml.txt ]; then + additionalAppendersFile=`cat /opt/grouper/grouperWebapp/WEB-INF/classes/log4j2.additionalAppenders.xml.txt` + # replace quote, but then double escape the result for some reason. this replaces quote with slash quote + additionalAppendersFile="$(sed s/\"/\\\\\\\"/g <<<$additionalAppendersFile)" + sed -i "s||$additionalAppendersFile|g" /opt/grouper/grouperWebapp/WEB-INF/classes/log4j2.xml + returnCode=$? + echo "grouperContainer; INFO: (librarySetupFiles.sh-setupFiles_localLogging) sed -i \"s||$additionalAppendersFile|g\" /opt/grouper/grouperWebapp/WEB-INF/classes/log4j2.xml, result: $returnCode" + if [ $returnCode != 0 ]; then exit $returnCode; fi + fi + } setupFiles_loggingPrefix() { diff --git a/container_files/usr-local-bin/librarySetupFilesApache.sh b/container_files/usr-local-bin/librarySetupFilesApache.sh index dec78a9c..bd64adba 100644 --- a/container_files/usr-local-bin/librarySetupFilesApache.sh +++ b/container_files/usr-local-bin/librarySetupFilesApache.sh @@ -121,6 +121,16 @@ setupFilesApache_remoteip() { echo "grouperContainer; INFO: (librarySetupFilesApache.sh-setupFilesApache_remoteip) echo \"RemoteIPTrustedProxy $GROUPER_APACHE_REMOTE_IP_TRUSTED_PROXY\" >> /etc/httpd/conf.d/grouper-www.conf , result: $?" if [ $returnCode != 0 ]; then exit $returnCode; fi fi + if [ "$GROUPER_RUN_APACHE" = "true" ] && [ ! -z "$GROUPER_APACHE_REMOTE_IP_INTERNAL_PROXY" ] && [ "$GROUPER_APACHE_REMOTE_IP_INTERNAL_PROXY" != "" ] && [ -f /etc/httpd/conf.d/grouper-www.conf ] + then + echo "grouperContainer; INFO: (librarySetupFilesApache.sh-setupFilesApache_remoteip) Appending RemoteIPInternalProxy to grouper-www.conf" + echo >> /etc/httpd/conf.d/grouper-www.conf + echo "RemoteIPInternalProxy $GROUPER_APACHE_REMOTE_IP_INTERNAL_PROXY" >> /etc/httpd/conf.d/grouper-www.conf + returnCode=$? + echo >> /etc/httpd/conf.d/grouper-www.conf + echo "grouperContainer; INFO: (librarySetupFilesApache.sh-setupFilesApache_remoteip) echo \"RemoteIPInternalProxy $GROUPER_APACHE_REMOTE_IP_INTERNAL_PROXY\" >> /etc/httpd/conf.d/grouper-www.conf , result: $?" + if [ $returnCode != 0 ]; then exit $returnCode; fi + fi }