Created
February 3, 2015 17:24
-
-
Save afiedler/c06b12f6476d855ac237 to your computer and use it in GitHub Desktop.
Lock down Heroku with HTTP Auth
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# in config/environments/production.rb | |
if ENV['HTTP_AUTH'].present? | |
config.middleware.use '::Rack::Auth::Basic' do |u, p| | |
[u, p] == ENV['HTTP_AUTH'].split(',') | |
end | |
end | |
# Set HTTP_AUTH on staging: | |
# $ heroku config:set HTTP_AUTH=username,password | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment