Skip to content

Commit

Permalink
Add CUL load balancer IP to the set of trusted proxy IPs (for the aca…
Browse files Browse the repository at this point in the history
…demiccommons_prod environment) (#273)

* Add CUL load balancer IP to the set of trusted proxy IPs (for the academiccommons_prod environment) so that the X-Forwarded-For header value is usable by request.remote_ip

* Update webdrivers gem so that CI passes on Github Actions

* Allow webmock to make connections to an additional chromedriver download domain
  • Loading branch information
elohanlon authored Oct 5, 2023
1 parent ed45c3c commit 5e63021
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 8 deletions.
3 changes: 1 addition & 2 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -72,10 +72,9 @@ group :development, :test do
gem 'json_spec'
gem 'rspec-its'
gem 'rspec-rails'
gem 'selenium-webdriver'
gem 'simplecov', require: false
gem 'solr_wrapper', '~> 4.0'
gem 'webdrivers', '~> 5.2', require: false
gem 'webdrivers', '~> 5.3.0', require: false
gem 'webmock'
end

Expand Down
7 changes: 3 additions & 4 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -600,10 +600,10 @@ GEM
rack (>= 1.4, < 3.0)
warden (1.2.9)
rack (>= 2.0.9)
webdrivers (5.2.0)
webdrivers (5.3.1)
nokogiri (~> 1.6)
rubyzip (>= 1.3.0)
selenium-webdriver (~> 4.0)
selenium-webdriver (~> 4.0, < 4.11)
webmock (3.14.0)
addressable (>= 2.8.0)
crack (>= 0.3.2)
Expand Down Expand Up @@ -679,7 +679,6 @@ DEPENDENCIES
rspec-rails
rubocul (~> 4.0)
rubyzip
selenium-webdriver
simplecov
sitemap_generator
solr_wrapper (~> 4.0)
Expand All @@ -689,7 +688,7 @@ DEPENDENCIES
uglifier
unicode
voight_kampff
webdrivers (~> 5.2)
webdrivers (~> 5.3.0)
webmock
webpacker (~> 5.4.0)
whenever
Expand Down
4 changes: 4 additions & 0 deletions config/environments/academiccommons_prod.rb
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,10 @@
# Specifies the header that your server uses for sending files
config.action_dispatch.x_sendfile_header = 'X-Accel-Redirect'

# Set the CUL load balancer IP as our trusted proxy so that the X-Forwarded-For value set
# by the load balancer is whitelisted for use by the request.remote_ip IP-determining mechanism.
config.action_dispatch.trusted_proxies = [IPAddr.new('128.59.241.217')]

# Reducing logging in production.
config.log_level = :warn

Expand Down
4 changes: 2 additions & 2 deletions spec/spec_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,14 @@
#
# See http://rubydoc.info/gems/rspec-core/RSpec/Core/Configuration

require 'webdrivers/chromedriver'
require 'webdrivers'
require 'capybara/rspec'
require 'equivalent-xml/rspec_matchers'

require 'webmock/rspec'
WebMock.disable_net_connect!(
allow_localhost: true,
allow: 'chromedriver.storage.googleapis.com'
allow: ['chromedriver.storage.googleapis.com', 'googlechromelabs.github.io', 'edgedl.me.gvt1.com']
)

# on-screen widgets will collapse at certain width breakpoints, so feature specs need to define window dimensions
Expand Down

0 comments on commit 5e63021

Please sign in to comment.