Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is it possible to setup a VPN on Heroku?

Is it possible to setup a VPN using openVPN on heroku to keep a staging environment private? If so, anyone have a writeup or links?

like image 212
Justin Avatar asked Nov 13 '09 01:11

Justin


1 Answers

You can't do this with a VPN, but you could password protect a staging instance of your site. In order to do this you'd want to set up a new Rails environment called "staging" and include something like the following in your ApplicationController:

class ApplicationController

  before_filter :password_protected if Rails.env.staging?

  protected

  def password_protected
    authenticate_or_request_with_http_basic do |username, password|
      username == "foo" && password == "bar"
    end
  end

end

You would then need to make sure your staging instance's environment:

heroku config:add RACK_ENV=staging
like image 97
David Dollar Avatar answered Sep 29 '22 03:09

David Dollar