Cloudfiles storage for Imagine
npm install imagine-cloudfilesCloudfiles storage for Imagine.
If you haven't already done so, make sure to install imagine-cloudfiles in
your Imagine folder:
`` bash`
$ npm install imagine-cloudfiles
Then place something similar to the following into your config.json file for
Imagine:
` javascript
"storage": "imagine-cloudfiles",
"imagine-cloudfiles": {
"user": "USER",
"key": "KEY",
"containerPrefix": "imagine-assets",
"containerHashLength": 4
}
`USER
Replace and KEY with your Cloudfiles account data.
In order to sufficiently distribute images across containers in Cloudfiles
without user input, Imagine-Cloudfiles places images into containers based on
an MD5 hash of the image name that is trimmed to the size of the
containerHashLength and prefixed with the containerPrefix. Simply reverse
this container hash operation to find which container an image file resides.
containerPrefix and containerHashLength can be changed to meet your needs.
You can change the default Cloudfiles host (auth.api.rackspacecloud.com) by imagine-cloudfiles
adding the following to the section of your config:
` javascript`
"host": "lon.auth.api.rackspacecloud.com"
If you're using Rackspace Cloud Servers, be sure to turn on ServiceNet for
fast, unmetered access to Cloudfiles by adding this to the imagine-cloudfiles
section of your config:
` javascript``
"servicenet": true
Imagine-Cloudfiles is distributed under the MIT License. See
LICENSE for more
details.