docstore lets you store and manage your documents in the cloud with Amazon S3 & SimpleDB.
It comes as a Rails 3 web application. Run it locally, or deploy it (runs fine on the Heroku free plan, see the guide below).
Run docstore like any other Rails3 application (bundle install
and
rails server
). See the Heroku deployment guide below for more details.
To run locally, you'll need Imagemagick and Ghostscript installed
(specifically, the convert
executable).
A few environment variables need to be set in order to authenticate with AWS, choose the right S3 bucket and SimpleDB domain, and provide basic authentication for the app:
AWS_ACCESS_KEY_ID
: your AWS access keyAWS_SECRET_ACCESS_KEY
: your AWS secret access keyDOCSTORE_S3_BUCKET_ID
: AWS S3 bucket to hold your documentsDOCSTORE_SDB_DOMAIN
: AWS SimpleDB domain to hold document metadataDOCSTORE_USER
: log in with this username over basic authDOCSTORE_PASS
: log in with this password over basic auth
After exporting the environment variables, you can use rake simpledb:setup
and rake s3:setup
to create the domain and bucket if they do not already
exist.
- AWS account
- Heroku account and the Heroku Toolbelt
-
Clone the docstore repo to your local machine:
git clone git://github.com/ndreynolds/docstore.git cd docstore
-
Create a
.env
file in the docstore directory. It should look like the one below (but with proper values filled in, of course):AWS_ACCESS_KEY_ID=my-access-key AWS_SECRET_ACCESS_KEY=my-secret-access-key DOCSTORE_S3_BUCKET_ID=my-documents DOCSTORE_SDB_DOMAIN=documents DOCSTORE_USER=test DOCSTORE_PASS=test
The first two are your Amazon AWS credentials, you can find these under Security Credentials on your AWS account page.
DOCSTORE_S3_BUCKET_ID
should be a globally-unique bucket name (e.g.myusername-docstore
). If it does not already exist, we'll create it in step 6.DOCSTORE_SDB_DOMAIN
is a SimpleDB domain name unique to your own SimpleDB domains (e.g.docstore-documents
). If it does not already exist, we'll create it in step 6.DOCSTORE_USER
andDOCSTORE_PASS
are the credentials of your choice that you'll use log in (basic authentication). -
Create a new Heroku app, get the heroku-config plugin and push your
.env
from earlier:heroku apps:create my-docstore heroku plugins:install git://github.com/ddollar/heroku-config.git heroku config:push
-
Push your docstore to Heroku
git push heroku master
-
Run the rake tasks to create your S3 bucket and SimpleDB domain. If these already exist, you can skip this step.
heroku run rake simpledb:setup heroku run rake s3:setup
-
Open your new docstore, log in and start uploading
heroku apps:open
- With thumbnail generation enabled, uploading large files may cause the Heroku dyno to exceed its 512MB memory limit. Despite receiving an error page, the upload will probably still succeed. If this becomes a problem, you can upload files to a local instance of the app (configured against the same AWS services), or increase your dyno size.