Skip to content

umd-lib/umd-fcrepo-webapp

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

UMD Libraries Fedora Web Application

This is a custom build of Fedora as a servlet-deployable web application.

Building

mvn clean package

The resulting umd-fcrepo-webapp-{version}.war file will be in the target directory.

Running with Cargo

The application can also be run locally using the Maven Cargo plugin and cargo:run command. This requires the WAR file to already be built using mvn package.

The POM file contains configuration suitable for running the application using the umd-fcrepo-docker stack to provide the backing services. However, this does require you to remove the umd-fcrepo_repository service after deploying the stack:

# in the umd-fcrepo-docker directory
docker stack deploy -c umd-fcrepo.yml umd-fcrepo
docker service rm umd-fcrepo_repository

You must also provide environment variables for the LDAP bind password, Postgres database password, and JWT secret:

mvn clean package

export MODESHAPE_DB_PASSWORD=...  # default in the umd-fcrepo-docker stack is "fcrepo"
export LDAP_BIND_PASSWORD=...     # see the SSDR "Identities" document for this
export JWT_SECRET=...             # can be anything, but must be sufficiently long
                                  # one method to generate a random secret is:
                                  #   uuidgen | shasum -a256 | cut -d' ' -f1
mvn cargo:run

Configuration

The IpMapperFilter, which determines access rights to resources, uses the src/test/resources/test-ip-mapping.properties file by default, which does not provide any access rights for the localhost user. This can be modified by adding the localhost address (127.0.0.1/32) to a category in the test-ip-mapping.properties file, or by specifying a different file in the pom.xml file.

Environment Variables

These values MUST be set, either via environment variables of Java system properties, to run the application:

Name Provided by cargo:run Value provided by cargo:run
ACTIVEMQ_URL tcp://localhost:61616
CAS_URL_PREFIX https://shib.idm.umd.edu/shibboleth-idp/profile/cas
FCREPO_BASE_URL http://localhost:8080/
IP_MAPPING_FILE conf/test-ip-mapping.properties
IP_MAPPING_HEADER_NAME X-Auth-IP-Mapping
JWT_SECRET
LDAP_URL ldap://directory.umd.edu
LDAP_BASE_DN ou=people,dc=umd,dc=edu
LDAP_BIND_DN uid=libr-fedora,cn=auth,ou=ldap,dc=umd,dc=edu
LDAP_BIND_PASSWORD
LDAP_MEMBER_ATTRIBUTE memberOf
LDAP_ADMIN_GROUP cn=Application_Roles:Libraries:FCREPO:FCREPO-Administrator,ou=grouper,ou=group,dc=umd,dc=edu
LDAP_USER_GROUP cn=Application_Roles:Libraries:FCREPO:FCREPO-User,ou=grouper,ou=group,dc=umd,dc=edu
MODESHAPE_DB_DRIVER org.postgresql.Driver
MODESHAPE_DB_URL jdbc:postgresql://localhost:5432/fcrepo_modeshape5
MODESHAPE_DB_USERNAME fcrepo
MODESHAPE_DB_PASSWORD

Docker

This repository contains a Dockerfile for creating a Docker image. The configuration files used to create the Docker image are located in the src/docker directory, in a path structure that mirrors their destination locations in the image.

⚠️ Note: The following instructions only create a single-architecture build for the architecture of the current host machine. To create a multi-architecture build, you will need to run docker buildx build ... directly.

The POM file includes the fabric8io docker-maven-plugin, so creating the image is as simple as running:

mvn docker:build

The resulting image will be tagged as docker.lib.umd.edu/fcrepo-webapp, plus a version string. If the project.version property defined in the POM file is a SNAPSHOT, the version string will be "latest". Otherwise, it will be the project.version property value from the POM file.

Docker plugin configuration

Special Thanks

This repository is based on the Amherst College custom Fedora build created and maintained by Aaron Coburn and Bethany Seeger.

License

See the LICENSE file for license rights and limitations (Apache 2.0).