Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions config/environments/development.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,14 @@
# Show full error reports.
config.consider_all_requests_local = true

# Allowed hosts
if ENV["ALLOWED_HOSTS_REGEX"].present?
config.hosts << Regexp.new(ENV['ALLOWED_HOSTS_REGEX'])
end
if ENV['HOST_NAME'].present?
config.hosts << ENV['HOST_NAME']
end

# Enable/disable caching. By default caching is disabled.
# Run rails dev:cache to toggle caching.
if Rails.root.join("tmp", "caching-dev.txt").exist?
Expand Down
8 changes: 8 additions & 0 deletions config/environments/production.rb
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,14 @@
config.consider_all_requests_local = true
config.action_controller.perform_caching = true

# Allowed hosts
if ENV["ALLOWED_HOSTS_REGEX"].present?
config.hosts << Regexp.new(ENV['ALLOWED_HOSTS_REGEX'])
end
if ENV['HOST_NAME'].present?
config.hosts << ENV['HOST_NAME']
end

# Ensures that a master key has been made available in either ENV["RAILS_MASTER_KEY"]
# or in config/master.key. This key is used to decrypt credentials (and other encrypted files).
# config.require_master_key = true
Expand Down
8 changes: 8 additions & 0 deletions config/environments/test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,14 @@
config.consider_all_requests_local = true
config.action_controller.perform_caching = false

# Allowed hosts
if ENV["ALLOWED_HOSTS_REGEX"].present?
config.hosts << Regexp.new(ENV['ALLOWED_HOSTS_REGEX'])
end
if ENV['HOST_NAME'].present?
config.hosts << ENV['HOST_NAME']
end

# Raise exceptions instead of rendering exception templates.
config.action_dispatch.show_exceptions = false

Expand Down
8 changes: 7 additions & 1 deletion example.env
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,12 @@ SECRET_KEY_BASE="beefaroni"
RAILS_ENV=development
PUMA_ENV=development

# If both ALLOWED_HOSTS_REGEX and HOST_NAME are populated, both will be allowed
# ALLOWED_HOSTS_REGEX=/.*\.compute\.amazonaws\.com/
ALLOWED_HOSTS_REGEX=
HOST_NAME=
# Restart nginx after modifying HOST_NAME and/or ALLOWED_HOSTS_REGEX

BUNDLE_GEMFILE=Gemfile
# BUNDLE_PATH=/app/scholarspace/bundle
CH12N_TOOL=fits_servlet
Expand Down Expand Up @@ -70,4 +76,4 @@ AWS_ACCESS_KEY=
AWS_SECRET_KEY=
S3_BUCKET_NAME=
# Optional -- for pointing Fedora to a specific path within a bucket
S3_PREFIX=
S3_PREFIX=