Skip to content

Commit

Permalink
GRP-2765: hsql 2.3.2 from tomee has sql issues so go back to 2.3.5 in
Browse files Browse the repository at this point in the history
grouper and tomee
  • Loading branch information
mchyzer committed May 7, 2020
1 parent ad4e39d commit 842c50a
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 30 deletions.
4 changes: 2 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ RUN yum update -y \
RUN yum install -y wget tar unzip dos2unix

ARG GROUPER_CONTAINER_VERSION
ENV GROUPER_VERSION=2.5.27 \
ENV GROUPER_VERSION=2.5.28 \
GROUPER_CONTAINER_VERSION=$GROUPER_CONTAINER_VERSION

# Install Corretto Java JDK
Expand All @@ -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.5.27 \
ENV GROUPER_VERSION=2.5.28 \
TOMEE_VERSION=7.0.0
RUN mkdir -p /opt/grouper/grouperWebapp/
RUN mkdir -p /opt/tomee/
Expand Down
2 changes: 1 addition & 1 deletion container_files/tier-support/supervisord-hsqldb.conf
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[program:hsqldb]
user=tomcat
directory=/opt/hsqldb
command=/usr/lib/jvm/java-1.8.0-amazon-corretto/bin/java -cp /opt/grouper/grouperWebapp/WEB-INF/lib/hsqldb-2.3.2.jar org.hsqldb.Server -port 9001 -database.0 file:/opt/hsqldb/grouperHSQL -dbname.0 grouper
command=/usr/lib/jvm/java-1.8.0-amazon-corretto/bin/java -cp /opt/grouper/grouperWebapp/WEB-INF/lib/hsqldb-2.3.5.jar org.hsqldb.Server -port 9001 -database.0 file:/opt/hsqldb/grouperHSQL -dbname.0 grouper
stderr_logfile = /tmp/loghsqldb
stderr_logfile_maxbytes=0
stdout_logfile = /tmp/loghsqldb
Expand Down
60 changes: 33 additions & 27 deletions container_files/usr-local-bin/library.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,6 @@

dest=/opt/grouper/grouperWebapp/WEB-INF/

if [ -d "/opt/grouper/slashRoot" ]; then
# Copy any files into the root filesystem
rsync -l -r -v /opt/grouper/slashRoot/ /
fi

setupPipe() {
if [ -e $1 ]; then
rm $1
Expand Down Expand Up @@ -125,10 +120,14 @@ prepWS() {


prepConf() {
setupLoggingPipe
setupSupervisordLogPipe
setupGrouperLogPipe

linkGrouperSecrets $dest/classes
}

tomeeContextGrouperForAll() {
tomeeContextGrouperForUiOrAll() {
# allow all grouper contexts to run
rm /opt/tomee/conf/Catalina/localhost/grouper-ws.xml
rm /opt/tomee/conf/Catalina/localhost/grouper-ws-scim.xml
Expand All @@ -146,19 +145,34 @@ tomeeContextGrouperScimOnly() {
rm /opt/tomee/conf/Catalina/localhost/grouper.xml
sed -i "s|__THE_AJP_URL__|ajp://localhost:8009/grouper-ws-scim|g" /etc/httpd/conf.d/grouper-www.conf
}
tomeeContextGrouperUiOnly() {
# only UI env, optimize the context
rm /opt/tomee/conf/Catalina/localhost/grouper-ws.xml
rm /opt/tomee/conf/Catalina/localhost/grouper-ws-scim.xml
sed -i "s|__THE_AJP_URL__|ajp://localhost:8009/grouper|g" /etc/httpd/conf.d/grouper-www.conf
}


#finishPrep() {
#
# finishPrep2
#
# mv /opt/tomee/conf/Catalina/localhost/grouper.xml /opt/tomee/conf/Catalina/localhost/grouper2.xml
# sed -i 's|path="/grouper"|path="/grouper2"|g' /opt/tomee/conf/Catalina/localhost/grouper2.xml
# sed -i 's|ajp://localhost:8009/grouper|ajp://localhost:8009/grouper2|g' /etc/httpd/conf.d/grouper-www.conf
# sed -i 's|ProxyPass /grouper |ProxyPass /grouper2 |g' /etc/httpd/conf.d/grouper-www.conf
# sed -i 's|/grouper/|/grouper2/|g' /etc/httpd/conf.d/grouper-www.conf
# sed -i 's|/grouper/|/grouper2/|g' /etc/httpd/conf.d/ssl-enabled.conf
# # do the httpd-shibd.conf too if needed
#
#}
#
#finishPrep2() {

finishPrep() {

setupLoggingPipe
setupGrouperLogPipe
setupSupervisordLogPipe
if [ -d "/opt/grouper/slashRoot" ]; then
# Copy any files into the root filesystem
rsync -l -r -v /opt/grouper/slashRoot/ /
fi

# tomee hsql must match the grouper one, and the version cannot be 2.3.2 since it is query bugs (unit tests fail)
rm -v /opt/tomee/lib/hsqldb-*.jar
cp -v /opt/grouper/grouperWebapp/WEB-INF/lib/hsqldb-*.jar /opt/tomee/lib/

# clear out existing supervisord config
cat /opt/tier-support/supervisord-base.conf > /opt/tier-support/supervisord.conf
Expand Down Expand Up @@ -265,7 +279,7 @@ finishPrep() {
# keep it simple and use grouper
if [ "$GROUPER_USE_GROUPER_CONTEXT" = "true" ]
then
tomeeContextGrouperForAll
tomeeContextGrouperForUiOrAll
else
if [ "$GROUPER_WS" = "true" ] && [ "$GROUPER_UI" != "true" ] && [ "$GROUPER_SCIM" != "true" ]
then
Expand All @@ -281,18 +295,10 @@ finishPrep() {
tomeeContextGrouperScimOnly
else

# otherwise we are just grouper and everything (similar to above)
# note things will be available as needed
tomeeContextGrouperForUiOrAll

if [ "$GROUPER_WS" != "true" ] && [ "$GROUPER_UI" = "true" ] && [ "$GROUPER_SCIM" != "true" ]
then

# only UI env, optimize the context
tomeeContextGrouperUiOnly
else

# otherwise we are just grouper and everything (similar to above)
tomeeContextGrouperForAll
fi

fi
fi

Expand Down

0 comments on commit 842c50a

Please sign in to comment.