Skip to content

Commit

Permalink
secure staging enviroment (#20)
Browse files Browse the repository at this point in the history
  • Loading branch information
yannlugrin committed Mar 6, 2012
1 parent fa5245f commit 89c4065
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions config/environments/staging.rb
Expand Up @@ -59,6 +59,11 @@
# Enable threaded mode
# config.threadsafe!

# Secure staging enviroment
config.middleware.insert_before 'Rack::Cache', 'Rack::Auth::Digest::MD5', 'stopwat.ch staging', SecureRandom.base64 do |user|
user == ENV['STAGING_HTTP_AUTH_USER'] && ENV['STAGING_HTTP_AUTH_PSWD']
end

# Add Faye has middleware
redis_config = ENV['REDISTOGO_URL'].match(/redis:\/\/.+?:(?<password>.+?)@(?<host>.+?):(?<port>\d+)/)
config.middleware.insert_before 'Rack::Cache', 'Faye::RackAdapter',
Expand Down

0 comments on commit 89c4065

Please sign in to comment.