How to protect my staging app from being visited and referenced?
6
Not solved Solved
11 months ago

Hi buddies, I have 2 apps in production on Heroku. One is the real one named prod and the second one is the test app named dev. I don't want people and bots access my dev app. I read about wwwhisper on Heroku, does somebody faces the issue and could suggest me a solution? Thanks Kevin

11 months ago

https://openclassrooms.com/courses/le-htaccess-et-ses-fonctionnalites

11 months ago

If you wanna stay in the Rails environment, you can use a snippet like this one:

# config/application.rb
if ENV['HTTP_AUTH_ENABLED'] == 'true'
  config.middleware.use '::Rack::Auth::Basic' do |username, password|
    [username, password] == [ENV['HTTP_AUTH_USERNAME'], ENV['HTTP_AUTH_PASSWORD']]
  end
end

# config/application.yml
staging:
  HTTP_AUTH_ENABLED: "true"
  HTTP_AUTH_USERNAME: "keuvain"
  HTTP_AUTH_PASSWORD: "coucoulechat"
11 months ago

Thanks I'm gonna explore both! <3

Cancel
Submit your answer