Usage¶
S3 file storage support for Invenio.
To use this module together with Invenio-Files-Rest there are a few things you need to keep in mind.
The storage factory configuration variable, FILES_REST_STORAGE_FACTORY
needs to be set to 'invenio_s3.s3fs_storage_factory'
importable string.
We think the best way to use this module is to have one Localtion for each S3 bucket. This is just for simplicity, it can used however needed.
When creating a new location which will use the S3 API, the URI needs to start
with s3://
, for example
invenio files location s3_default s3://my-bucket --default
will
create a new location, set it as default location for your instance and use the
bucket my-bucket
. For more information about this command check
Invenio-Files-Rest
documentation.
Then, there are a few configuration variables that need to be set on your instance, like the endpoint, the access key and the secret access key, see a more detailed description in Configuration.
Note
This module doesn’t create S3 buckets automatically, so before starting they need to be created.
You might also want to set the correct CORS configuration so files can be used by your interface for things like previewing a PDF with some Javascript library.