From 9ab2a15691de4c280e234be8d50b0526b657db83 Mon Sep 17 00:00:00 2001 From: Robin Ward Date: Thu, 5 Mar 2020 15:37:49 -0500 Subject: [PATCH] Warn if their CDN URL doesn't have a protocol This can be confusing: https://meta.discourse.org/t/discourse-cdn-url-breaks-rebuild-restore/136844 --- config/application.rb | 3 +++ 1 file changed, 3 insertions(+) diff --git a/config/application.rb b/config/application.rb index 52820120be0..e2b271c947f 100644 --- a/config/application.rb +++ b/config/application.rb @@ -35,6 +35,9 @@ unless Rails.env.test? && ENV['LOAD_PLUGINS'] != "1" require_relative '../lib/custom_setting_providers' end GlobalSetting.load_defaults +if GlobalSetting.try(:cdn_url).present? && GlobalSetting.cdn_url !~ /^https?:\/\// + STDERR.puts "WARNING: Your CDN URL does not begin with a protocol like `https://` - this is probably not going to work" +end if ENV['SKIP_DB_AND_REDIS'] == '1' GlobalSetting.skip_db = true