Giter Site home page Giter Site logo

omeka-amazon-s3-storage-adapter's Introduction

Omeka Amazon S3 Storage Adapter

This is an S3 storage adapter for Omeka that provides an alternative to the Omeka_Storage_Adapter_ZendS3 which ships with the application.

The main differences are:

  • this adapter uses the official AWS SDK library
  • it requires PHP 5.5 or above
  • requires you supply the AWS region in the configuration
  • it supports the V4 authorization mechanism that is required on AWS regions created after July 2014

Usage

  1. Download the latest release from GitHub
  2. Extract it to the Omeka plugins directory
  3. Enable the AmazonS3StorageAdapter plugin in admin/plugins
  4. Add the following to your Omeka application/configuration/config.ini file:
storage.adapter = Omeka_Storage_Adapter_AmazonS3
storage.adapterOptions.accessKeyId = MY-ACCESS-KEY-ID
storage.adapterOptions.secretAccessKey = MY-SECRET-KEY
storage.adapterOptions.bucket = my-bucket-name
storage.adapterOptions.region = eu-central-1

(Being sure to set the correct bucket name and region, in addition to your access key and secret.)

To run the latest code from GitHub, rather than the last release:

  1. Download repo as a zip file
  2. Extract it to a folder named AmazonS3StorageAdapter in the plugins directory in your Omeka instance
  3. Run composer install within the plugin's folder to install the Amazon S3 PHP SDK

Note: including the AWS SDK makes this plugin package very large since there is currently no way to depend on just the S3-related parts. This will hopefully be remedied in future.

omeka-amazon-s3-storage-adapter's People

Contributors

mikesname avatar timstallmann avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

omeka-amazon-s3-storage-adapter's Issues

"expiration" implementation issue

There's a small but significant difference between the behavior of our old "ZendS3" adapter and this one, and it deals with the "expiration" setting.

In the Omeka core adapter, setting "expiration" means objects are stored privately and pre-signed URLs are generated to allow short-term public access to them. The implementation here of _getAcl() still goes along with that way of working, setting the ACL to private if some expiration was provided.

The divergence is what's actually being done with the expiration data itself. You're passing it along as "Expiration" when you put the object. I'm not sure this does anything at all (if it does do something, I don't know what). To keep in line with what the Omeka adapter does, you'd want to use _getExpiration in the getUri method.

If no expiration is set, the code you have there is fine, just returning a URL to the object. If there is a set expiration though, you want to pass the third argument to getObjectUrl (something like "+{$expiration} minutes", for example). Passing that third argument should get it to generate a pre-signed URL for you.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.