Skip to content

Commit

Permalink
Config host with ENV (not secret) for development
Browse files Browse the repository at this point in the history
  • Loading branch information
aaronskiba committed Nov 23, 2023
1 parent b7f20f4 commit fe4e181
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
5 changes: 2 additions & 3 deletions config/environments/development.rb
Original file line number Diff line number Diff line change
Expand Up @@ -91,9 +91,8 @@
# This allows us to define the hostname and add it to the whitelist. If you attempt
# to access the site and receive a 'Blocked host' error then you will need to
# set this environment variable
config.hosts << Rails.application.secrets.dmproadmap_host if Rails.application.secrets.dmproadmap_host.present?
end
config.hosts << ENV.fetch('DMPROADMAP_HOST', 'localhost:3000')
# rubocop:enable Metrics/BlockLength

# Used by Rails' routes url_helpers (typically when including a link in an email)
Rails.application.routes.default_url_options[:host] = Rails.application.secrets.dmproadmap_host
Rails.application.routes.default_url_options[:host] = ENV.fetch('DMPROADMAP_HOST', 'localhost:3000')
1 change: 0 additions & 1 deletion config/secrets.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@ development:
database_url: <%= ENV['DATABASE_URL'] %>
devise_pepper: <%= ENV['DEVISE_PEPPER'] %>
devise_secret_key: <%= ENV['DEVISE_SECRET_KEY'] %>
dmproadmap_host: <%= ENV['DMPROADMAP_HOST'] || 'localhost:3000' %>
dragonfly_secret: <%= ENV['DRAGONFLY_SECRET'] %>
google_analytics_token: <%= ENV['GOOGLE_ANALYTICS_TOKEN'] %>
mailer_default_host: <%= ENV['MAILER_DEFAULT_HOST'] || Socket.gethostname %>
Expand Down

0 comments on commit fe4e181

Please sign in to comment.