Ruby client for Camo - the SSL image proxy
Note: If you have not set up the Camo server, start with Deploying the Server.
Add this line to your application’s Gemfile:
Add your Camo host and key to your environment or create an initializer
ENV["CAMO_HOST"] = "https://camo.herokuapp.com" ENV["CAMO_KEY"] = "rzsJbU5YxDfdP3FXHjshtgEN"
You can now use the
camo method in your views and controllers.
<%= image_tag camo("https://placekitten.com/g/200/300") %>
It’s that easy!
Deploying the Server
Clone the camo repository.
git clone https://github.com/atmos/camo.git cd camo
Create a new project on Heroku.
heroku create myapp-camo git push heroku master
Choose a random secret key and add it to your app.
heroku config:set CAMO_KEY=rzsJbU5YxDfdP3FXHjshtgEN
Open your app to make sure it’s working. You should see the text “hwhat”.
Thanks to Corey Donohoe for creating Camo and providing most of the Ruby code for this gem.
Everyone is encouraged to help improve this project. Here are a few ways you can help:
- Report bugs
- Fix bugs and submit pull requests
- Write, clarify, or fix documentation
- Suggest or add new features
To get started with development:
git clone https://github.com/ankane/camo.git cd camo bundle install bundle exec rake test