Commit 53fb244d by tady

add IP restriction setting

parent 7211f168
......@@ -6,3 +6,4 @@ RV_S3_SECRET_ACCESS_KEY=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
RV_S3_BACKET_NAME=xxxxxxxxxxxxxxxxxxxxx
RV_PDF_UPLOADING=1
DATABASE_URL=mysql2://user:passwd@localhost/rendezvous_development
RV_ALLOW_IPS=1.1.1.1,2.2.2.2
......@@ -158,3 +158,6 @@ gem 'rmagick', :require => 'RMagick'
# for heroku
gem 'rails_12factor', group: :production
gem 'mysql'
# for IP restriction
gem 'rack-contrib', require: 'rack/contrib'
......@@ -282,6 +282,8 @@ GEM
pry-rails (0.3.2)
pry (>= 0.9.10)
rack (1.5.2)
rack-contrib (1.2.0)
rack (>= 0.9.1)
rack-mini-profiler (0.9.2)
rack (>= 1.1.3)
rack-test (0.6.2)
......@@ -466,6 +468,7 @@ DEPENDENCIES
poltergeist
premailer
pry-rails
rack-contrib
rack-mini-profiler
rails (~> 4.1)
rails_12factor
......
......@@ -32,6 +32,11 @@ module Rendezvous
# oauth2_token: 'FIXME',
# account: 'FIXME'
}
# IP restriction.
if Rails.env.production? && ENV['RV_ALLOW_IPS']
config.middleware.use Rack::Access, { "/" => ENV['RV_ALLOW_IPS'].split(/,/) }
end
end
end
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment