Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions metacat/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ ADD metacat-bin-${METACAT_VERSION}.tar.gz /tmp/
ADD metacat/catalina.properties /tmp/
ADD metacat/server.xml.patch /tmp/
ADD metacat/skins /tmp/skins
ADD metacat/files /tmp/files
ADD image_version.yml image_version.yml


Expand All @@ -31,11 +32,13 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
procps \
logrotate \
rsync \
&& rm -rf /var/lib/apt/lists/* \
&& rm -rfv /var/lib/apt/lists/* \
&& unzip /tmp/metacat-index.war -d /usr/local/tomcat/webapps/metacat-index \
&& unzip /tmp/metacat.war -d /usr/local/tomcat/webapps/metacat \
&& rm -rfv /usr/local/tomcat/webapps/metacat/WEB-INF/lib/osti-elink-*.jar \
&& rsync -auv /tmp/files/ /usr/local/tomcat/webapps/metacat/ \
&& cat /tmp/catalina.properties >> /usr/local/tomcat/conf/catalina.properties \
&& rm -rf /tmp/*.war
&& rm -rvf /tmp/*.war /tmp/files /tmp/catalina.properties

ADD metacat/metacat.conf /etc/logrotate.d/

Expand Down
14 changes: 8 additions & 6 deletions metacat/docker-entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,6 @@ if [ "$1" = 'bin/catalina.sh' ]; then
mv $METACAT_DEFAULT_DIR $METACAT_DIR

fi

# change the context in the web.xml file
apply_context.py metacat ${METACAT_APP_CONTEXT}

Expand Down Expand Up @@ -197,7 +196,6 @@ if [ "$1" = 'bin/catalina.sh' ]; then

echo "cd ${METACAT_DIR}/WEB-INF/scripts/bash"
cd ${METACAT_DIR}/WEB-INF/scripts/bash

## Note: the Java bcrypt library only supports '2a' format hashes, so override the default python behavior
## so that the hases created start with '2a' rather than '2b'
bash ./authFileManager.sh useradd \
Expand Down Expand Up @@ -254,13 +252,17 @@ if [ "$1" = 'bin/catalina.sh' ]; then
echo

# Login to Metacat Admin and start a session (cookie.txt)
curl -v -X POST \
--data "loginAction=Login&configureType=login&processForm=true&password=${ADMINPASS}&username=${ADMIN}" \
curl -v --data "loginAction=Login&configureType=login&processForm=true&password=${ADMINPASS}&username=${ADMIN}" \
--cookie-jar /tmp/cookie.txt http://localhost:8080/${METACAT_APP_CONTEXT}/admin > /tmp/login_result.txt 2>&1


# Test the the admin logged in successfully
[ -f /tmp/login_result.txt ] && [ $(grep "User logged in as:" /tmp/login_result.txt| wc -l) -eq 1 ] || (echo "Administrator not logged in!!" && grep "<message>" /tmp/login_result.txt && exit -4)
if [ -f /tmp/login_result.txt ] && [ $(grep "User logged in as:" /tmp/login_result.txt| wc -l) -eq 1 ]; then
echo "Administrator logged in successfully"
else
echo "ERROR: Administrator not logged in!!"
grep "<message>" /tmp/login_result.txt || cat /tmp/login_result.txt
exit 4
fi

echo
echo '**************************************'
Expand Down
Binary file added metacat/files/WEB-INF/lib/osti-elink-2.0.0.jar
Binary file not shown.
Loading