diff --git a/404.html b/404.html index cfaf5ee..2571a89 100644 --- a/404.html +++ b/404.html @@ -1 +1 @@ -404: This page could not be found

404

This page could not be found.

\ No newline at end of file +404: This page could not be found

404

This page could not be found.

\ No newline at end of file diff --git a/_next/data/rx8m7GxYH9FXVwb-YnlNW/docs/quick-start/infrastructure/cloudformation.json b/_next/data/-eqUGH_PmTLhFrYiCLemy/docs/quick-start/infrastructure/cloudformation.json similarity index 100% rename from _next/data/rx8m7GxYH9FXVwb-YnlNW/docs/quick-start/infrastructure/cloudformation.json rename to _next/data/-eqUGH_PmTLhFrYiCLemy/docs/quick-start/infrastructure/cloudformation.json diff --git a/_next/data/rx8m7GxYH9FXVwb-YnlNW/docs/quick-start/infrastructure/terraform.json b/_next/data/-eqUGH_PmTLhFrYiCLemy/docs/quick-start/infrastructure/terraform.json similarity index 100% rename from _next/data/rx8m7GxYH9FXVwb-YnlNW/docs/quick-start/infrastructure/terraform.json rename to _next/data/-eqUGH_PmTLhFrYiCLemy/docs/quick-start/infrastructure/terraform.json diff --git a/_next/static/rx8m7GxYH9FXVwb-YnlNW/_buildManifest.js b/_next/static/-eqUGH_PmTLhFrYiCLemy/_buildManifest.js similarity index 100% rename from _next/static/rx8m7GxYH9FXVwb-YnlNW/_buildManifest.js rename to _next/static/-eqUGH_PmTLhFrYiCLemy/_buildManifest.js diff --git a/_next/static/rx8m7GxYH9FXVwb-YnlNW/_ssgManifest.js b/_next/static/-eqUGH_PmTLhFrYiCLemy/_ssgManifest.js similarity index 100% rename from _next/static/rx8m7GxYH9FXVwb-YnlNW/_ssgManifest.js rename to _next/static/-eqUGH_PmTLhFrYiCLemy/_ssgManifest.js diff --git a/about.html b/about.html index 9ae01b4..78d35e1 100644 --- a/about.html +++ b/about.html @@ -9,7 +9,7 @@ .dark { --nextra-primary-hue: 209deg; } -

About

+
\ No newline at end of file +

Serverless IIIF is available under the Apache 2.0 license.

\ No newline at end of file diff --git a/docs.html b/docs.html index e3615b7..c5b79c0 100644 --- a/docs.html +++ b/docs.html @@ -9,7 +9,7 @@ .dark { --nextra-primary-hue: 209deg; } -
Documentation
Introduction

serverless-iiif

+

License

-

serverless-iiif is available under the Apache 2.0 license.

\ No newline at end of file +

serverless-iiif is available under the Apache 2.0 license.

Options
\ No newline at end of file diff --git a/docs/advanced-usage/cors.html b/docs/advanced-usage/cors.html index 9d26da1..e39b314 100644 --- a/docs/advanced-usage/cors.html +++ b/docs/advanced-usage/cors.html @@ -9,7 +9,7 @@ .dark { --nextra-primary-hue: 209deg; } -
Documentation
Advanced Usage
Cross-Origin Request Sharing (CORS)

Cross-Origin Request Sharing (CORS)

+
Documentation
Advanced Usage
Cross-Origin Request Sharing (CORS)

Cross-Origin Request Sharing (CORS)

For security reasons, web browsers have built in limits on what sort of requests can be made to a given domain from a page hosted under a different domain. Since this is a common use case for IIIF (resources embedded in pages whose domains differ from that of the server), IIIF interactions are particularly susceptible to these limits.

The mechanism for determining which of these requests should be allowed or blocked is known as Cross-Origin Resource Sharing, or CORS (opens in a new tab). A full explanation of CORS is beyond the scope of this project, but the SAM deploy template contains five parameters relating to how the IIIF server handles CORS:

    @@ -19,4 +19,4 @@
  • CorsExposeHeaders contains the value that will be returned in the Access-Control-Expose-Headers response header.
  • CorsMaxAge contains the value that will be returned in the Access-Control-Max-Age response header.
-

The default values will work in most circumstances, but if you need the IIIF server to accept requests that include credentials or other potentially sensitive information (e.g., Authorization and/or Cookie headers), you'll need to set CorsAllowOrigin to REFLECT_ORIGIN and CorsAllowCredentials to true. Other settings allow further customization.

\ No newline at end of file +

The default values will work in most circumstances, but if you need the IIIF server to accept requests that include credentials or other potentially sensitive information (e.g., Authorization and/or Cookie headers), you'll need to set CorsAllowOrigin to REFLECT_ORIGIN and CorsAllowCredentials to true. Other settings allow further customization.

\ No newline at end of file diff --git a/docs/advanced-usage/request-response-functions.html b/docs/advanced-usage/request-response-functions.html index 2be70e4..ef41882 100644 --- a/docs/advanced-usage/request-response-functions.html +++ b/docs/advanced-usage/request-response-functions.html @@ -9,7 +9,7 @@ .dark { --nextra-primary-hue: 209deg; } -
Documentation
Advanced Usage
Request Response Functions

Request/Response Functions

+
Documentation
Advanced Usage
Request Response Functions

Request/Response Functions

The IIIF service can be heavily customized through the use of CloudFront Functions (opens in a new tab) or Lambda@Edge Functions (opens in a new tab) attached to a CloudFront distribution in front of the service. It's important to understand the four stages of CloudFront processing in order to know where a given type of customization belongs.

  • A viewer-request function will be called on every request, cached or not. This is the appropriate place to attach @@ -54,4 +54,4 @@
    { width: 2048, height: 1536, limit: 480 }

The limit calculator will keep going until both dimensions are less than the limit, not less than or equal to. So a limit: 512 on the third example above would generate a fourth page at { width: 256, height: 192 }.

-
💡

If you plan to use CloudFront functions to add either of the above x-preflight- headers to incoming requests, you must set the value of the Preflight parameter to true when deploying serverless-iiif. The function will only look for the preflight headers if this environment variable is true. This prevents requests from including those headers directly if no preflight function is present. If you do use a preflight function, make sure it strips out any x-preflight-location and x-preflight-dimensions headers that it doesn't set itself.

\ No newline at end of file +
💡

If you plan to use CloudFront functions to add either of the above x-preflight- headers to incoming requests, you must set the value of the Preflight parameter to true when deploying serverless-iiif. The function will only look for the preflight headers if this environment variable is true. This prevents requests from including those headers directly if no preflight function is present. If you do use a preflight function, make sure it strips out any x-preflight-location and x-preflight-dimensions headers that it doesn't set itself.

\ No newline at end of file diff --git a/docs/communities/iiif.html b/docs/communities/iiif.html index 64e2009..10466e4 100644 --- a/docs/communities/iiif.html +++ b/docs/communities/iiif.html @@ -9,4 +9,4 @@ .dark { --nextra-primary-hue: 209deg; } -
\ No newline at end of file +
\ No newline at end of file diff --git a/docs/communities/samvera.html b/docs/communities/samvera.html index 6e8c62a..c8d1a29 100644 --- a/docs/communities/samvera.html +++ b/docs/communities/samvera.html @@ -9,4 +9,4 @@ .dark { --nextra-primary-hue: 209deg; } -
\ No newline at end of file +
\ No newline at end of file diff --git a/docs/contributors.html b/docs/contributors.html index 61ad006..6c6a604 100644 --- a/docs/contributors.html +++ b/docs/contributors.html @@ -9,7 +9,7 @@ .dark { --nextra-primary-hue: 209deg; } -
Documentation
Contributors

Contributors

+
\ No newline at end of file +
\ No newline at end of file diff --git a/docs/custom-sharp-layer.html b/docs/custom-sharp-layer.html index 721a1cb..543cb45 100644 --- a/docs/custom-sharp-layer.html +++ b/docs/custom-sharp-layer.html @@ -9,6 +9,6 @@ .dark { --nextra-primary-hue: 209deg; } -
Documentation
Custom Sharp Layer

Custom Sharp Layer

+
\ No newline at end of file +

You can build your own local version using that code and then deploy your own layer and set that layer in your SAM template.

\ No newline at end of file diff --git a/docs/how-to-contribute.html b/docs/how-to-contribute.html index 91462d5..449a2ae 100644 --- a/docs/how-to-contribute.html +++ b/docs/how-to-contribute.html @@ -9,6 +9,6 @@ .dark { --nextra-primary-hue: 209deg; } -
Documentation
Guide

How to Contribute?

+
Documentation
Guide

How to Contribute?

If you're working on a PR (opens in a new tab) for this project, create a feature branch off of main.

-

This repository follows the Samvera Community Code of Conduct (opens in a new tab) and language recommendations (opens in a new tab). Please do not create a branch called master for this repository or as part of your pull request; the branch will either need to be removed or renamed before it can be considered for inclusion in the code base and history of this repository.

\ No newline at end of file +

This repository follows the Samvera Community Code of Conduct (opens in a new tab) and language recommendations (opens in a new tab). Please do not create a branch called master for this repository or as part of your pull request; the branch will either need to be removed or renamed before it can be considered for inclusion in the code base and history of this repository.

\ No newline at end of file diff --git a/docs/notes.html b/docs/notes.html index e814a89..5036779 100644 --- a/docs/notes.html +++ b/docs/notes.html @@ -9,6 +9,6 @@ .dark { --nextra-primary-hue: 209deg; } -
Documentation
Notes

Notes

+
Documentation
Notes

Notes

Lambda Function URLs have a payload (request/response body) size limit of approximately 6MB in both directions. To overcome this limitation, the Lambda URL is configured behind an AWS CloudFront distribution with two origins - the API and a cache bucket. Responses larger than 6MB are saved to the cache bucket at the same relative path as the request, and the Lambda returns a 404 Not Found response to CloudFront. CloudFront then fails over to the second origin (the cache bucket), where it finds the actual response and returns it.

-

The cache bucket uses an S3 lifecycle rule to expire cached responses in 1 day.

\ No newline at end of file +

The cache bucket uses an S3 lifecycle rule to expire cached responses in 1 day.

\ No newline at end of file diff --git a/docs/quick-start.html b/docs/quick-start.html index 73361a8..73cfe7b 100644 --- a/docs/quick-start.html +++ b/docs/quick-start.html @@ -9,4 +9,4 @@ .dark { --nextra-primary-hue: 209deg; } -
\ No newline at end of file +
\ No newline at end of file diff --git a/docs/quick-start/deleting-the-app.html b/docs/quick-start/deleting-the-app.html index ae52437..c895304 100644 --- a/docs/quick-start/deleting-the-app.html +++ b/docs/quick-start/deleting-the-app.html @@ -9,7 +9,7 @@ .dark { --nextra-primary-hue: 209deg; } -
Documentation
Quick Start
Deleting the App

Deleting the application

+
Documentation
Quick Start
Deleting the App

Deleting the application

If you deployed the application on its own, the easiest way to delete the application is either from the Lambda Applications Console (opens in a new tab) or by deleting its CloudFormation Stack (opens in a new tab).

If you deployed from the command line, you can also use the npm run delete command.

-

If you deployed using an infrastructure tool such as AWS CloudFormation or Terraform, you should use that tool's destroy/teardown functionality to remove the IIIF stack as well.

\ No newline at end of file +

If you deployed using an infrastructure tool such as AWS CloudFormation or Terraform, you should use that tool's destroy/teardown functionality to remove the IIIF stack as well.

\ No newline at end of file diff --git a/docs/quick-start/deployment-command-line.html b/docs/quick-start/deployment-command-line.html index 02da290..6b12450 100644 --- a/docs/quick-start/deployment-command-line.html +++ b/docs/quick-start/deployment-command-line.html @@ -9,7 +9,7 @@ .dark { --nextra-primary-hue: 209deg; } -
Documentation
Quick Start
Deploying via the Command Line

Deploying via the Command Line

+

If you use the guided deploy, you'll be prompted for various configuration parameters, confirmations, and acknowledgments of specific issues (particularly the creation of IAM resources and the deployment of an open/unauthenticated Lambda Function URL). Otherwise, you'll simply be asked to confirm the calculated changeset.

Step 6

Follow the prompts to complete the deployment process and get the resulting endpoint.

\ No newline at end of file +$ npm run deploy

If you use the guided deploy, you'll be prompted for various configuration parameters, confirmations, and acknowledgments of specific issues (particularly the creation of IAM resources and the deployment of an open/unauthenticated Lambda Function URL). Otherwise, you'll simply be asked to confirm the calculated changeset.

Step 6

Follow the prompts to complete the deployment process and get the resulting endpoint.

Deploying via the AWS Serverless Application RepositoryIntroduction
\ No newline at end of file diff --git a/docs/quick-start/deployment-sam.html b/docs/quick-start/deployment-sam.html index fd55f45..52ffae0 100644 --- a/docs/quick-start/deployment-sam.html +++ b/docs/quick-start/deployment-sam.html @@ -9,11 +9,11 @@ .dark { --nextra-primary-hue: 209deg; } -
Documentation
Quick Start
Deploying via the AWS Serverless Application Repository

Deploying via the AWS Serverless Application Repository

+
Documentation
Quick Start
Deploying via the AWS Serverless Application Repository

Deploying via the AWS Serverless Application Repository

serverless-iiif is distributed and deployed via the AWS Serverless Application Repository (opens in a new tab). To deploy it using the AWS Console:

Step 1

Find the serverless-iiif application (opens in a new tab) in the AWS Serverless Application Repository.

Step 2

Make sure your currently selected region (in the console's top navigation bar) is the one you want to deploy to.

Step 3

Scroll down to the Application settings section.

Step 4

Configure the deploy template:

  • Give your stack a unique Application name
  • Enter the name of the SourceBucket the service will serve images from
  • Check the box acknowledging that the app will create a custom IAM roles and resource policies (and if deploying the Caching version, that it will also deploy a nested application)
  • Optional: Enter or change any other parameters that apply to your desired configuration.
  • -

Step 5

Click Deploy.

Step 6

When all the resources are properly created and configured, the new stack should be in the CREATE_COMPLETE stage. If there's an error, it will delete all the resources it created, roll back any changes it made, and eventually reach the ROLLBACK_COMPLETE stage.

Step 7

Click the CloudFormation stack link.

Step 8

Click the Outputs tab to see (and copy) the IIIF Endpoint URL.

\ No newline at end of file +

Step 5

Click Deploy.

Step 6

When all the resources are properly created and configured, the new stack should be in the CREATE_COMPLETE stage. If there's an error, it will delete all the resources it created, roll back any changes it made, and eventually reach the ROLLBACK_COMPLETE stage.

Step 7

Click the CloudFormation stack link.

Step 8

Click the Outputs tab to see (and copy) the IIIF Endpoint URL.

\ No newline at end of file diff --git a/docs/quick-start/infrastructure.html b/docs/quick-start/infrastructure.html index 348ba0e..3703571 100644 --- a/docs/quick-start/infrastructure.html +++ b/docs/quick-start/infrastructure.html @@ -9,5 +9,5 @@ .dark { --nextra-primary-hue: 209deg; } -
Documentation
Quick Start
Deploying via Infrastructure Tools
Introduction

Deploying via Infrastructure Tools

-

You will most likely want to deploy serverless-iiif as part of a larger infrastructure stack. This stack might include a caching layer (AWS CloudFront), functions to customize the services behavior, a custom domain name, and more. This section provides documentation and examples of how to deploy the service using AWS CloudFormation or Terraform.

\ No newline at end of file +
Documentation
Quick Start
Deploying via Infrastructure Tools
Introduction

Deploying via Infrastructure Tools

+

You will most likely want to deploy serverless-iiif as part of a larger infrastructure stack. This stack might include a caching layer (AWS CloudFront), functions to customize the services behavior, a custom domain name, and more. This section provides documentation and examples of how to deploy the service using AWS CloudFormation or Terraform.

\ No newline at end of file diff --git a/docs/quick-start/infrastructure/cloudformation.html b/docs/quick-start/infrastructure/cloudformation.html index 5b7e8f8..4275158 100644 --- a/docs/quick-start/infrastructure/cloudformation.html +++ b/docs/quick-start/infrastructure/cloudformation.html @@ -9,7 +9,7 @@ .dark { --nextra-primary-hue: 209deg; } -
Documentation
Quick Start
Deploying via Infrastructure Tools
AWS CloudFormation

Installing serverless-iiif as part of a CloudFormation (opens in a new tab) template makes it easy to integrate the service with other components. Please refer to the example and the CloudFormation documentation (opens in a new tab) for more information on how you might tailor these templates to your own needs and deploy them to AWS.

+
Documentation
Quick Start
Deploying via Infrastructure Tools
AWS CloudFormation

Installing serverless-iiif as part of a CloudFormation (opens in a new tab) template makes it easy to integrate the service with other components. Please refer to the example and the CloudFormation documentation (opens in a new tab) for more information on how you might tailor these templates to your own needs and deploy them to AWS.

Syntax

To declare this entity in your AWS CloudFormation template, use the following syntax:

Type: AWS::Serverless::Application
@@ -146,4 +146,4 @@ 

Value: !Ref CachingEndpoint Export: Name: !Sub "${AWS::StackName}:DistributionId" -

\ No newline at end of file +
IntroductionTerraform
\ No newline at end of file diff --git a/docs/quick-start/infrastructure/terraform.html b/docs/quick-start/infrastructure/terraform.html index b561c2c..51ad7b8 100644 --- a/docs/quick-start/infrastructure/terraform.html +++ b/docs/quick-start/infrastructure/terraform.html @@ -9,8 +9,8 @@ .dark { --nextra-primary-hue: 209deg; } -
Documentation
Quick Start
Deploying via Infrastructure Tools
Terraform

The serverless-iiif GitHub repository includes a Terraform Module (opens in a new tab) that can be used as a drop-in component in any +

Documentation
Quick Start
Deploying via Infrastructure Tools
Terraform

The serverless-iiif GitHub repository includes a Terraform Module (opens in a new tab) that can be used as a drop-in component in any Terraform manifest. Please refer to the documentation and examples below, as well as the Terraform documentation (opens in a new tab) for more information on how you might use these tools to deploy your own custom stack to AWS.

Required Inputs


These variables must be set in the module block when using this module.

source_bucket string

Description: Name of bucket containing source images

Optional Inputs


These variables have default values and don't have to be set to use this module. You may set these variables to override their default -values.

cors_allow_headers string

Description: Value of the CORS Access-Control-Allow-Headers response header

Default: *

cors_allow_origin string

Description: Value of the CORS Access-Control-Allow-Origin response header. Use the special value REFLECT_ORIGIN to copy the value from the Origin request header (required to emulate * for XHR requests using Authorization and/or Cookie headers).

Default: *

cors_expose_headers string

Description: Value of the CORS Access-Control-Expose-Headers response header

Default: cache-control,content-language,content-length,content-type,date,expires,last-modified,pragma

cors_max_age number

Description: Value of the CORS Access-Control-MaxAge response header

Default: 3600

force_host string

Description: Forced hostname to use in responses

Default: ""

iiif_lambda_memory number

Description: The memory provisioned for the lambda.

Default: 3008

iiif_lambda_timeout number

Description: The timeout for the lambda.

Default: 10

pixel_density number

Description: Hardcoded DPI/Pixel Density/Resolution to encode in output images

Default: 0

pyramid_limit number

Description: Smallest pyramid image dimension. Set to 0 to prevent server from auto-calculating pyramid page sizes.

Default: 256

resolver_template string

Description: A printf-style format string that determines the location of source image within the bucket given the image ID

Default: %s.tif

sharp_layer string

Description: ARN of a custom AWS Lambda Layer containing the sharp and libvips dependencies. Use the special value JP2 to use the managed JPEG2000-compatible layer, or INTERNAL to use the built-in dependencies (without JPEG2000 support).

Default: JP2

\ No newline at end of file +values.

cors_allow_headers string

Description: Value of the CORS Access-Control-Allow-Headers response header

Default: *

cors_allow_origin string

Description: Value of the CORS Access-Control-Allow-Origin response header. Use the special value REFLECT_ORIGIN to copy the value from the Origin request header (required to emulate * for XHR requests using Authorization and/or Cookie headers).

Default: *

cors_expose_headers string

Description: Value of the CORS Access-Control-Expose-Headers response header

Default: cache-control,content-language,content-length,content-type,date,expires,last-modified,pragma

cors_max_age number

Description: Value of the CORS Access-Control-MaxAge response header

Default: 3600

force_host string

Description: Forced hostname to use in responses

Default: ""

iiif_lambda_memory number

Description: The memory provisioned for the lambda.

Default: 3008

iiif_lambda_timeout number

Description: The timeout for the lambda.

Default: 10

pixel_density number

Description: Hardcoded DPI/Pixel Density/Resolution to encode in output images

Default: 0

pyramid_limit number

Description: Smallest pyramid image dimension. Set to 0 to prevent server from auto-calculating pyramid page sizes.

Default: 256

resolver_template string

Description: A printf-style format string that determines the location of source image within the bucket given the image ID

Default: %s.tif

sharp_layer string

Description: ARN of a custom AWS Lambda Layer containing the sharp and libvips dependencies. Use the special value JP2 to use the managed JPEG2000-compatible layer, or INTERNAL to use the built-in dependencies (without JPEG2000 support).

Default: JP2

AWS CloudFormationDeleting the App
\ No newline at end of file diff --git a/docs/source-images.html b/docs/source-images.html index 5d03078..68d62ef 100644 --- a/docs/source-images.html +++ b/docs/source-images.html @@ -9,11 +9,11 @@ .dark { --nextra-primary-hue: 209deg; } -
Documentation
Source Images

Source Images

+
Documentation
Source Images

Source Images

The S3 key of any given file, minus the extension, is its IIIF ID. For example, if you want to access the image manifest for the file at abcdef.tif, you would get https://.../iiif/2/abcdef/info.json. If your key contains slashes, they must be URL-encoded: e.g., ab/cd/ef/gh.tif would be at https://.../iiif/2/ab%2Fcd%2Fef%2Fgh/info.json. (This limitation could easily be fixed by encoding only the necessary slashes in the incoming URL before handing it off to the IIIF processor, but that's beyond the scope of the demo.)

iiif-processor can use any image format natively supported by libvips (opens in a new tab), including JPEG 2000 (.jp2), but best results will come from using tiled, multi-resolution TIFFs. The Lambda Function wrapper included in this application assumes a .tif extension unless you set ResolverTemplate in your .env file.

Creating tiled TIFFs

Using VIPS

vips tiffsave source_image.tif output_image.tif --tile --pyramid --compression jpeg --tile-width 256 --tile-height 256

Using ImageMagick

-
convert source_image.tif -define tiff:tile-geometry=256x256 -compress jpeg 'ptif:output_image.tif'
\ No newline at end of file +
convert source_image.tif -define tiff:tile-geometry=256x256 -compress jpeg 'ptif:output_image.tif'
\ No newline at end of file diff --git a/docs/testing.html b/docs/testing.html index d5a37df..75f2334 100644 --- a/docs/testing.html +++ b/docs/testing.html @@ -9,8 +9,8 @@ .dark { --nextra-primary-hue: 209deg; } -
Documentation
Testing

Testing

+
\ No newline at end of file +
npm test --coverage
\ No newline at end of file diff --git a/index.html b/index.html index 2e2b299..e4ffdd8 100644 --- a/index.html +++ b/index.html @@ -9,4 +9,4 @@ .dark { --nextra-primary-hue: 209deg; } -

Fast, zoomable images without servers

A cost-effective, infinitely scalable IIIF Image API v2.1 and v3.0 compliant service packaged as an AWS Serverless Application with minimum setup and no maintenance. Suitable for large institutional collections or small digital humanities projects.
Community Driven. Open Source.

Deploy Now  Read the Docs IIIF Image API
\ No newline at end of file +

Fast, zoomable images without servers

A cost-effective, infinitely scalable IIIF Image API v2.1 and v3.0 compliant service packaged as an AWS Serverless Application with minimum setup and no maintenance. Suitable for large institutional collections or small digital humanities projects.
Community Driven. Open Source.

Deploy Now  Read the Docs IIIF Image API
\ No newline at end of file