Skip to content

Commit

Permalink
Added optional internal audit capability to vagrant
Browse files Browse the repository at this point in the history
  • Loading branch information
mohideen authored and Andrew Woods committed Apr 26, 2015
1 parent b1af963 commit 8f379ca
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 4 deletions.
1 change: 1 addition & 0 deletions README.md
Expand Up @@ -29,6 +29,7 @@ Fedora 4 Vagrant Virtual Machine
* user account `testuser`, with password `password1`
* user account `adminuser`, with password `password2`
* admin account `fedoraAdmin` with the password `secret3`
* (optional) to enable fedora internal audit capability, edit `install_scripts/config` and change the FEDORA_AUDIT variable to true. The FEDORA_AUDIT_LOCATION can also be changed from its default "/audit", if necessary.
* `vagrant up`

###Support
Expand Down
5 changes: 4 additions & 1 deletion install_scripts/config
Expand Up @@ -13,9 +13,12 @@ if [ ! -d $DOWNLOAD_DIR ]; then
fi

FEDORA_VERSION=4.1.2-SNAPSHOT
FEDORA_TAG=4.1.1-audit.0
FEDORA_TAG=4.1.1-audit.1
# true to enable auth, false to disable it
FEDORA_AUTH=false
FEDORA_AUDIT=true
FEDORA_AUDIT_LOCATION=/audit


FUSEKI_VERSION=1.1.2
FUSEKI_HOME=/usr/share/fuseki
Expand Down
19 changes: 16 additions & 3 deletions install_scripts/fedora4.sh
Expand Up @@ -10,10 +10,16 @@ if [ -f "$SHARED_DIR/install_scripts/config" ]; then
. $SHARED_DIR/install_scripts/config
fi

if [ "${FEDORA_AUTH}" = "true" ]; then
if [ "${FEDORA_AUTH}" = "true" ] && [ "${FEDORA_AUDIT}" = "true" ]; then
WEBAPP="fcrepo-webapp-plus-rbacl-audit-${FEDORA_VERSION}.war"
RELEASES="https://github.com/fcrepo4-labs/fcrepo-webapp-plus/releases/download/fcrepo-webapp-plus-${FEDORA_TAG}"
elif [ "${FEDORA_AUTH}" = "true" ]; then
WEBAPP="fcrepo-webapp-plus-rbacl-${FEDORA_VERSION}.war"
RELEASES="https://github.com/fcrepo4-labs/fcrepo-webapp-plus/releases/download/fcrepo-webapp-plus-${FEDORA_TAG}"
else
elif [ "${FEDORA_AUDIT}" = "true" ]; then
WEBAPP="fcrepo-webapp-plus-audit-${FEDORA_VERSION}.war"
RELEASES="https://github.com/fcrepo4-labs/fcrepo-webapp-plus/releases/download/fcrepo-webapp-plus-${FEDORA_TAG}"
else
WEBAPP="fcrepo-webapp-${FEDORA_VERSION}.war"
RELEASES="https://github.com/fcrepo4/fcrepo4/releases/download/fcrepo-${FEDORA_TAG}"
fi
Expand All @@ -25,10 +31,17 @@ chown tomcat7:tomcat7 /var/lib/tomcat7/fcrepo4-data
chmod g-w /var/lib/tomcat7/fcrepo4-data

if [ ! -f "$DOWNLOAD_DIR/$WEBAPP" ]; then
echo -n "Downloading Fedora 4... ${FEDORA_VERSION}"
echo -n "Downloading Fedora 4... $RELEASES/$WEBAPP"
curl -L -s -o "$DOWNLOAD_DIR/$WEBAPP" "$RELEASES/$WEBAPP"
echo " done"
fi

cp "$DOWNLOAD_DIR/$WEBAPP" /var/lib/tomcat7/webapps/fcrepo.war
chown tomcat7:tomcat7 /var/lib/tomcat7/webapps/fcrepo.war

if [ "${FEDORA_AUDIT}" = "true" ]; then
echo $'\n' >> /etc/default/tomcat7;
echo "CATALINA_OPTS=\"-Dfcrepo.audit.container=/audit\"" >> /etc/default/tomcat7;
fi

service tomcat7 restart

0 comments on commit 8f379ca

Please sign in to comment.