Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'readme' into development
- Loading branch information
Showing
4 changed files
with
124 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
Copyright (c) 2011 Nathaniel Jones | ||
|
||
Permission is hereby granted, free of charge, to any person obtaining | ||
a copy of this software and associated documentation files (the | ||
"Software"), to deal in the Software without restriction, including | ||
without limitation the rights to use, copy, modify, merge, publish, | ||
distribute, sublicense, and/or sell copies of the Software, and to | ||
permit persons to whom the Software is furnished to do so, subject to | ||
the following conditions: | ||
|
||
The above copyright notice and this permission notice shall be | ||
included in all copies or substantial portions of the Software. | ||
|
||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, | ||
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF | ||
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND | ||
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE | ||
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION | ||
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION | ||
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
Shadow is an AWS S3 image processing application that runs on Heroku. | ||
|
||
Given an S3 bucket, Shadow processes approximately 11,000 photos an hour: | ||
|
||
* resizing, | ||
* watermarking, and | ||
* extracting EXIF data | ||
|
||
SETUP | ||
===== | ||
|
||
After you've cloned the repository locally, run `rake setup` to start the wizard. | ||
Here is a list of credentials Shadow will ask you for: | ||
|
||
* Amazon access key ID | ||
* Amazon secret access key | ||
* S3 source bucket (where your originals or masters reside) | ||
* S3 destination bucket (where Shadow will place your processed photos) | ||
* Google Maps API key (for geocoding your photos) | ||
* Heroku API key (for automatically scaling your workers) | ||
|
||
Additionally, Shadow expects you to have a Heroku (http://heroku.com) account, | ||
and will ask to install the following free add-ons into your app: | ||
|
||
* Memcached | ||
* MongoHQ | ||
* Redis To Go | ||
|
||
CONFIGURATION | ||
============= | ||
|
||
By default, you have several processors... | ||
* Change Showcase dimensions in app/concerns/processors/showcaser.rb | ||
* Change out the watermark in config/watermark.png | ||
* Change Previewer dimensions (thumbnail dimensions) in app/concerns/processors/previewer.rb | ||
|
||
USAGE | ||
===== | ||
|
||
To get started, you'll probably want to queue up photos to be processed: | ||
|
||
heroku rake photos:queue | ||
|
||
Note on Patches/Pull Requests | ||
============================= | ||
|
||
* Fork the project. | ||
* Make your feature addition or bug fix. | ||
* Add tests for it. This is important so I don’t break it in a future version unintentionally. | ||
* Commit, do not mess with rakefile, version, or history. (if you want to have your own version, that is fine but bump version in a commit by itself I can ignore when I pull) | ||
* Send me a pull request. Bonus points for topic branches. | ||
|
||
Copyright | ||
========= | ||
|
||
Copyright © 2011 Nathaniel Jones. See LICENSE for details. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
desc 'Initial Heroku setup' | ||
task :setup => :environment do | ||
abort "Please sign up for Heroku: http://heroku.com" unless `which heroku` | ||
Setup.setup_heroku_app | ||
|
||
Setup.config 'AMAZON_ACCESS_KEY_ID', 'Amazon Access Key ID' | ||
Setup.config 'AMAZON_SECRET_ACCESS_KEY' | ||
Setup.config 'AMAZON_S3_SOURCE_BUCKET', 'S3 source bucket name', 'where your original or master photos reside' | ||
Setup.config 'AMAZON_S3_DESTINATION_BUCKET', 'S3 destination bucket name', 'which S3 bucket to place your processed photos' | ||
Setup.config 'GOOGLE_MAPS_API_KEY', 'Google Maps API key', 'http://code.google.com/apis/maps/signup.html' | ||
|
||
Setup.execute | ||
end | ||
|
||
class Setup | ||
@config = { } | ||
|
||
class << self | ||
def config key, label = nil, explanation = nil | ||
label ||= key.titleize | ||
label << " (#{explanation})" if explanation.present? | ||
label << ": " | ||
puts label | ||
@config[key] = $stdin.gets.chomp | ||
puts "" | ||
end | ||
|
||
def execute | ||
puts `heroku config:add #{@config.map { |c| c.join("=") }.join(' ')}` | ||
puts "Add Memcache, MongoHQ, and RedisToGo addons? (free, y/n)" | ||
['memcache:5mb', 'mongohq:free', 'redistogo:nano'].each do |addon| | ||
puts `heroku addons:add #{addon}` | ||
end if ['y', 'yes'].include?($stdin.gets.chomp.downcase) | ||
end | ||
|
||
def setup_heroku_app | ||
if `git remote -v` =~ /heroku/ | ||
app = `git remote -v`.match(/git@heroku\.[\w]+:([\w\-]+)\.git/)[1] | ||
else | ||
puts "Create Heroku app with name: " | ||
`heroku create #{app = $stdin.gets.chomp}` | ||
end | ||
|
||
@config['HEROKU_API_KEY'] = "#{app}@#{`tail -1 ~/.heroku/credentials`}".chomp | ||
end | ||
|
||
end | ||
end |