Skip to content

Commit

Permalink
Merge pull request #899 from portagenetwork/aaron/multiple-hosts
Browse files Browse the repository at this point in the history
Patch to allow multiple hosts when setting config of some environments
  • Loading branch information
aaronskiba authored Sep 12, 2024
2 parents ecd847d + 00ec1a5 commit 4b201d2
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 3 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# Changelog

## [4.1.1+portage-4.2.1] - 2024-09-12

### Changed

- Patch to allow multiple hosts when setting config of some environments [#899](https://github.com/portagenetwork/roadmap/pull/899)

## [4.1.1+portage-4.2.0] - 2024-09-11

### Added
Expand Down
8 changes: 7 additions & 1 deletion config/environments/production.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

require 'syslog/logger'

# rubocop:disable Metrics/BlockLength
Rails.application.configure do
# Settings specified here will take precedence over those in config/application.rb.

Expand Down Expand Up @@ -96,7 +97,12 @@
# 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?
# Convert comma-separated string to array
dmproadmap_hosts = Rails.application.secrets.dmproadmap_host.to_s.split(',').map(&:strip)
dmproadmap_hosts.each do |host|
config.hosts << host
end
end
# 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
6 changes: 5 additions & 1 deletion config/environments/sandbox.rb
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,11 @@
enable_starttls_auto: true
}

config.hosts << Rails.application.secrets.dmproadmap_host if Rails.application.secrets.dmproadmap_host.present?
# Convert comma-separated string to array
dmproadmap_hosts = Rails.application.secrets.dmproadmap_host.to_s.split(',').map(&:strip)
dmproadmap_hosts.each do |host|
config.hosts << host
end
end
# Fix JSON Download Error
Rails.application.routes.default_url_options[:host] = Rails.application.secrets.dmproadmap_host
6 changes: 5 additions & 1 deletion config/environments/staging.rb
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,10 @@
authentication: Rails.application.secrets.smtp_authentication || 'plain',
enable_starttls_auto: true
}
config.hosts << Rails.application.secrets.dmproadmap_host if Rails.application.secrets.dmproadmap_host.present?
# Convert comma-separated string to array
dmproadmap_hosts = Rails.application.secrets.dmproadmap_host.to_s.split(',').map(&:strip)
dmproadmap_hosts.each do |host|
config.hosts << host
end
end
Rails.application.routes.default_url_options[:host] = Rails.application.secrets.dmproadmap_host

0 comments on commit 4b201d2

Please sign in to comment.