
Security News
New Website “Is It Really FOSS?” Tracks Transparency in Open Source Distribution Models
A new site reviews software projects to reveal if they’re truly FOSS, making complex licensing and distribution models easy to understand.
Shutterbug has two parts: a browser javascript library for taking html snapshots, and a server side utility for turning those html snapshots into images. This repository consists of JavaScript library.
A rack utility using phantomjs that will create and save images (pngs) from parts of your html's documents current dom. These images become available as public png resources in the rack application. Currently shutterbug supports HTML, SVG and Canvas elements. Here is a sample config.ru file:
use Shutterbug::Rackapp do |config|
conf.resource_dir = "/Users/npaessel/tmp"
config.uri_prefix = "http://shutterbug.herokuapp.com"
config.path_prefix = "/shutterbug"
config.phantom_bin_path = "/app/vendor/phantomjs/bin/phantomjs"
end
Configuration options default to reasonable defaults.
Shutterbug is distributed as a Ruby Gem. The rack service delivers a javascript library to the browser that can send HTML fragments back to the Rack service. The Rack service generates images from these fragments using PhantomJS. In the following image “getDomSnapshot()” triggers a request to the Shutterbug service. The response from the POST request contains an image tag, that points to a newly created image on the server.
Add this line to your application's Gemfile:
gem 'shutterbug'
And then execute:
$ bundle
Or install it yourself as:
$ gem install shutterbug
Shutterbug is Copyright 2012 © by the Concord Consortium and is distributed under the MIT License.
To deploy on heroku, you are going to want to modify your stack following these instructions.
Your app should have a config.ru that looks something like this:
require 'shutterbug'
require 'rack/cors'
use Rack::Cors do
allow do
origins '*'
resource '/shutterbug/*'', :headers => :any, :methods => [:get, :post, :options]
end
end
# Without a complete set of S3 credentials, Shutterbug
# Places images in a temporary directory where
# you will LOSE your images...
use Shutterbug::Rackapp do |config|
config.uri_prefix = "http://<your app name>.herokuapp.com/"
config.path_prefix = "/shutterbug"
config.phantom_bin_path = "/app/vendor/phantomjs/bin/phantomjs"
# config.s3_key = "your_S3_KEY"
# config.s3_secret = "your_S3_SECRET_DONT_COMMIT_IT"
# config.s3_bin = "your_S3_bucket_name"
end
app = proc do |env|
[200, { 'Content-Type' => 'text/html' }, ['move along']]
end
run app
And a Procfile which looks like this:
web: bundle exec rackup config.ru -p $PORT
December 3, 2015 – v 0.5.9
October 6, 2015 – v 0.5.8
Add error_trigger handler, to verify exception reporting.
Remove Ruby 1.9x travis tests, because of Fog and Net-SSH deps on Ruby 2.0
September 4, 2015 – v 0.5.6
Prevent some iFrame data-url decoding problems by inserting magical "#". For reasons we don't yet understand, iframes with base hrefs without hash (#) symbols can sometimes cause the data-urls to decode incorrectly. Our Longterm solution will be to base64 encode iFrame data-urls.
August 25, 2015 – v 0.5.5
More aggressive single quote replacement in phantom_job.rb
August 14, 2015 – v 0.5.4
Fix single quote encoding issue in phantom_job.rb. DM:
Phantom's html entity decoder borks on single quotes when you have an encoded block with single quotes embedded in another encoded block with single quotes. The decoder will decode correctly up to the first single quote but then will leave the rest of the string encoded. If the single quotes are changed to double quotes then they are properly encoded within the enclosing block.
June 4, 2105 – v 0.5.3
Rasterize.js
: Also loads non-base64 encoded iframe src content when walking
the iFrames. Also, better mechanics for waiting for page rendering.s3_storage.rb
: Look for existing S3 bucket using get
, to avoid 404 errors
when bucket limit of 100 is hit. (github issue #15)May 28, 2015 – v 0.5.2
Rasterize.js
: "Loads an html page and does a depth-first walk of its
iframes. As the walk returns to the root each iframe's src is set to the
base64 png rendering of its contents." The purpose of this change was toDecember 11, 2014 – v 0.5.0
December 4, 2014 – v 0.4.3
December 2, 2014 – v 0.3.0
November 12, 2014 – v 0.2.5
git checkout -b my-new-feature
)git commit -am 'Add some feature'
)git push origin my-new-feature
)© 2013 The Concord Consortium.
FAQs
Unknown package
We found that shutterbug demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 3 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
A new site reviews software projects to reveal if they’re truly FOSS, making complex licensing and distribution models easy to understand.
Security News
Astral unveils pyx, a Python-native package registry in beta, designed to speed installs, enhance security, and integrate deeply with uv.
Security News
The Latio podcast explores how static and runtime reachability help teams prioritize exploitable vulnerabilities and streamline AppSec workflows.