Skip to content

Commit

Permalink
Enable s3 for f6 (#134)
Browse files Browse the repository at this point in the history
* Accept parameters for s3 storage

* Documenting available values for S3

* Fix formatting in documentation

* Added default s3 options and AWS credentials

* removed test.

* Updated flags to match what fedora is actually expecting

* Removed overrride for AWS_ keys and added a negative timepout for now

Co-authored-by: Noah W. Smith <[email protected]>
Co-authored-by: Nigel Banks <[email protected]>
Co-authored-by: Hertzel Armengol <[email protected]>
  • Loading branch information
4 people authored May 31, 2021
1 parent 1b4f62a commit b7bcc90
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 13 deletions.
8 changes: 6 additions & 2 deletions fcrepo6/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,13 @@ ENV \
FCREPO_DB_USER=fcrepo \
FCREPO_DISABLE_SYN=false \
FCREPO_PERSISTENCE_TYPE=file \
FCREPO_TOMCAT_ADMIN_ROLES=manager-gui,fedoraAdmin
FCREPO_TOMCAT_ADMIN_ROLES=manager-gui,fedoraAdmin \
FCREPO_S3_BUCKET= \
FCREPO_S3_PASSWORD= \
FCREPO_S3_USER= \
FCREPO_AWS_REGION=us-east-1 \
FCREPO_S3_PREFIX=

COPY --from=download --chown=tomcat:tomcat /opt/tomcat /opt/tomcat

COPY rootfs /
COPY --chown=tomcat:tomcat rootfs/opt/tomcat /opt/tomcat
27 changes: 16 additions & 11 deletions fcrepo6/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ additional settings, volumes, ports, etc.
## Volumes

| Path | Description |
| :---- | :---------------|
| :---- | :-------------- |
| /data | OCFL Filesystem |

> N.B. Volumes are not created automatically. It is up to the user to either bind
Expand All @@ -30,16 +30,21 @@ additional settings, volumes, ports, etc.

### Confd Settings

| Environment Variable | Confd Key | Default | Description |
| :----------------------------- | :------------------------------ | :-------------------------------- | :------------------------------------------------------------------------------------------------ |
| FCREPO_ACTIVEMQ_BROKER | /fcrepo/activemq/broker | tcp://activemq:61616 | The location of the ActiveMQ Broker in which to publish JMS messages to |
| FCREPO_ACTIVEMQ_QUEUE | /fcrepo/activemq/queue | fedora | The ActiveMQ Queue in which to publish JMS messages |
| FCREPO_ACTIVEMQ_QUEUE_ENABLE | /fcrepo/activemq/queue | false | If `true` publish JMS messages on the queue `FCREPO_ACTIVEMQ_QUEUE` |
| FCREPO_ACTIVEMQ_TOPIC | /fcrepo/activemq/topic | fedora | The ActiveMQ Topic in which to publish JMS messages |
| FCREPO_ACTIVEMQ_TOPIC_ENABLE | /fcrepo/activemq/topic | true | If `true` publish JMS messages on the topic `FCREPO_ACTIVEMQ_TOPIC` |
| FCREPO_BINARYSTORAGE_TYPE | /fcrepo/binarystorage/type | file | The binary storage type. Only `file` and `s3` are supported at this time |
| FCREPO_PERSISTENCE_TYPE | /fcrepo/persistence/type | file | The object store type. Only `file`, `mysql`, `postgresql` are supported at this time |
| FCREPO_DISABLE_SYN | /fcrepo/disable/syn | false | Enable or disable authentication via [Syn](https://github.com/Islandora/Syn) |
| Environment Variable | Confd Key | Default | Description |
| :--------------------------- | :------------------------- | :------------------- | :----------------------------------------------------------------------------------- |
| FCREPO_ACTIVEMQ_BROKER | /fcrepo/activemq/broker | tcp://activemq:61616 | The location of the ActiveMQ Broker in which to publish JMS messages to |
| FCREPO_ACTIVEMQ_QUEUE | /fcrepo/activemq/queue | fedora | The ActiveMQ Queue in which to publish JMS messages |
| FCREPO_ACTIVEMQ_QUEUE_ENABLE | /fcrepo/activemq/queue | false | If `true` publish JMS messages on the queue `FCREPO_ACTIVEMQ_QUEUE` |
| FCREPO_ACTIVEMQ_TOPIC | /fcrepo/activemq/topic | fedora | The ActiveMQ Topic in which to publish JMS messages |
| FCREPO_ACTIVEMQ_TOPIC_ENABLE | /fcrepo/activemq/topic | true | If `true` publish JMS messages on the topic `FCREPO_ACTIVEMQ_TOPIC` |
| FCREPO_BINARYSTORAGE_TYPE | /fcrepo/binarystorage/type | file | The binary storage type. Only `file` and `s3` are supported at this time |
| FCREPO_AWS_REGION | /fcrepo/aws/region | us-east-1 | AWS Region for S3 Bucket |
| FCREPO_S3_BUCKET | /fcrepo/s3/bucket | | Bucket to use for S3 Storage |
| FCREPO_S3_USER | /fcrepo/s3/user | | AWS User for S3 Storage |
| FCREPO_S3_PASSWORD | /fcrepo/s3/password | | AWS Secret Token for S3 Storage |
| FCREPO_S3_PREFIX | /fcrepo/s3/prefix | | AWS Prefix for S3 Storage |
| FCREPO_PERSISTENCE_TYPE | /fcrepo/persistence/type | file | The object store type. Only `file`, `mysql`, `postgresql` are supported at this time |
| FCREPO_DISABLE_SYN | /fcrepo/disable/syn | false | Enable or disable authentication via [Syn](https://github.com/Islandora/Syn) |

To allow [external content] provide sites as key pairs. Wherein multiple values
is the url and the 'name' is a key that replaces the '*' symbol below.
Expand Down
10 changes: 10 additions & 0 deletions fcrepo6/rootfs/opt/tomcat/bin/setenv.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ export CATALINA_OPTS="${CATALINA_OPTS} -Dfcrepo.external.content.allowed=/opt/to
export CATALINA_OPTS="${CATALINA_OPTS} -Dfcrepo.autoversioning.enabled=false"
export CATALINA_OPTS="${CATALINA_OPTS} -Dfcrepo.activemq.directory=file:///data/home/data/Activemq"
export CATALINA_OPTS="${CATALINA_OPTS} -Dfcrepo.activemq.configuration=file:///opt/tomcat/conf/activemq.xml"
# Set timeout
export CATALINA_OPTS="${CATALINA_OPTS} -DconnectionTimeout=${FCREPO_CATALINA_TIMEOUT:=-1}"

case "${DB_DRIVER}" in
none)
Expand All @@ -32,3 +34,11 @@ fi
if [[ "${FCREPO_DISABLE_SYN}" == "true" ]]; then
export CATALINA_OPTS="${CATALINA_OPTS} -Dfcrepo.properties.management=relaxed"
fi

if [[ "${FCREPO_BINARYSTORAGE_TYPE}" == "file" ]]; then
export CATALINA_OPTS="${CATALINA_OPTS} -Dfcrepo.storage=ocfl-fs"
fi
if [[ "${FCREPO_BINARYSTORAGE_TYPE}" == "s3" ]]; then
# Enable S3 mode and set default options
export CATALINA_OPTS="${CATALINA_OPTS} -Dfcrepo.storage=ocfl-s3 -Dfcrepo.aws.region=${FCREPO_AWS_REGION} -Dfcrepo.ocfl.s3.bucket=${FCREPO_S3_BUCKET} -Dfcrepo.ocfl.s3.prefix=${FCREPO_S3_PREFIX}"
fi

0 comments on commit b7bcc90

Please sign in to comment.