Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Private Rack middleware purpose is to protect your Rack application from anonymous via a secret code form.
Ruby
tag: 0.1

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
lib
.document
.gitignore
README.textile
Rakefile
staging.gemspec

README.textile

Staging Gem

Staging rack application purpose to protect you Rails application from anonymous and prying.

Usage

Examples

In you Rails initilizer

config.middleware.use 'Rack::Staging',
  :template_path => "#{RAILS_ROOT}/app/views/staging/index.html",
  :auth_codes => [ 'Hfgo_JHg+47', 'dh_JHg_ra988', 'fd-m*nKJ_DE7'] # Basic setup
config.middleware.use 'Staging',
  :session_key => :staging_auth, # Custom session key
  :code_param => :staging_code", # Custom input name (<input name="staging_code" />), defult is :code
  :template_path => "#{RAILS_ROOT}/app/views/staging/index.html",
  :auth_codes => [ 'Hfgo_JHg+47', 'dh_JHg_ra988', 'fd-m*nKJ_DE7']

In you staging template (“#{RAILS_ROOT}/app/views/staging/index.html”)

<html>
  <head>
    <title>Staging application</title>
  </head>
  <body>
    <h1>Please input staging code</h1>
    <form action="/" method="post">
      <input name="code" />
      <input type="submit" />
    </form>
  </body>
</html>

… and now you are ready to protected staging!

Something went wrong with that request. Please try again.