I\'m trying to work out what the best way to secure my staging environment would be. Currently I\'m running both staging and production on the same server.
The two
bumping this to help others, like myself as I read this before settling on an similar, but cleaner solution.
# config/environments/staging.rb
MyApp::Application.configure do
config.middleware.insert_after(::Rack::Lock, "::Rack::Auth::Basic", "Staging") do |u, p|
[u, p] == ['username', 'password']
end
#... other config
end
I wrote a short blog post about it.