Overview

This is a note on how to serve images stored in Amazon S3 using Cantaloupe Image Server, one of the IIIF image servers.

As an alternative method for serving images stored in Amazon S3, I also introduced an approach in the following article. (The tools may have been updated since the article was written, so the instructions may not work exactly as described.)

Configuration

The official manual is available at the following link.

https://cantaloupe-project.github.io/manual/5.0/sources.html#S3Source

Edit the following file:

/cantaloupe-5.0.5/cantaloupe.properties

First, change source.static to S3Source.

###########################################################################
# SOURCES
###########################################################################

# Uses one source for all requests. Available values are `FilesystemSource`,
# `HttpSource`, `JdbcSource`, `S3Source`, and `AzureStorageSource`.
# source.static = FilesystemSource
source.static = S3Source

Next, configure S3Source.access_key_id, S3Source.secret_key, and S3Source.BasicLookupStrategy.bucket.name.

#----------------------------------------
# S3Source
#----------------------------------------

# !! Endpoint URI. Only needed for non-AWS endpoints.
S3Source.endpoint =

# !! AWS region. Only needed for AWS endpoints.
S3Source.region =

# !! Credentials for your AWS account.
# See: http://aws.amazon.com/security-credentials
# Note that this info can be obtained from elsewhere rather than setting
# it here; see the user manual.
S3Source.access_key_id = <access key>
S3Source.secret_key = <secret key>

# How to look up objects. Allowed values are `BasicLookupStrategy` and
# `ScriptLookupStrategy`. ScriptLookupStrategy uses a delegate method for
# dynamic lookups; see the user manual.
S3Source.lookup_strategy = BasicLookupStrategy

# !! Name of the bucket containing images to be served.
S3Source.BasicLookupStrategy.bucket.name = <bucket name>

With this, images stored in Amazon S3 are now referenced.

Other Notes

For uploading images to Amazon S3, I used the AWS CLI (Amazon Web Services Command Line Interface) with the following command.

aws s3 sync <path to local image folder> s3://<bucket name>/<S3 path> --exclude "*/.DS_Store"

Summary

I hope this is helpful for using Cantaloupe Image Server.