Fix host url in dev

Change-Id: I4aaed8efb512fd2ab57cf82f27def815bf6f9ba0
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/293389
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Charley Kline <ckline@instructure.com>
QA-Review: Charley Kline <ckline@instructure.com>
Product-Review: Charley Kline <ckline@instructure.com>
This commit is contained in:
Jacob Burroughs 2022-06-07 08:15:19 -05:00
parent fd7e122969
commit 6f9dd83be1
1 changed files with 13 additions and 2 deletions

View File

@ -17,7 +17,14 @@
# You should have received a copy of the GNU Affero General Public License along
# with this program. If not, see <http://www.gnu.org/licenses/>.
require_dependency "host_url"
class HostUrlContainer
mattr_accessor :host_url
def self.===(host)
# rubocop:disable Style/CaseEquality
host_url.===(host)
# rubocop:enable Style/CaseEquality
end
end
environment_configuration(defined?(config) && config) do |config|
# Settings specified here will take precedence over those in config/application.rb
@ -69,7 +76,11 @@ environment_configuration(defined?(config) && config) do |config|
config.eager_load = false
config.hosts << HostUrl
config.hosts << HostUrlContainer
config.to_prepare do
HostUrlContainer.host_url = HostUrl
end
# allow docker dev setup to use http proxy
config.hosts << ENV["VIRTUAL_HOST"] if ENV["VIRTUAL_HOST"]