Skip to content

OpenProject is the leading open source project management software for product, project and portfolio management. A powerful Jira alternative with agile planning, issue tracking, roadmaps, Gantt charts, time tracking, collaboration features, and more. Available on premises or in the cloud. ⭐ Star us on GitHub

Fix CSP for augur host

Oliver Günther823574d25131
diff --git a/app/controllers/enterprises_controller.rb b/app/controllers/enterprises_controller.rb
index a2c074388dd..7108a412ca5 100644
--- a/app/controllers/enterprises_controller.rb
+++ b/app/controllers/enterprises_controller.rb
@@ -101,7 +101,7 @@ class EnterprisesController < ApplicationController
end
def write_augur_to_gon
- gon.augur_url = Rails.env.production? ? OpenProject::Configuration[:enterprise_trial_creation_host] : 'https://augur.openproject-edge.com'
+ gon.augur_url = OpenProject::Configuration.enterprise_trial_creation_host
end
def default_breadcrumb
diff --git a/app/helpers/enterprise_trial_helper.rb b/app/helpers/enterprise_trial_helper.rb
index 2e2d51c8d62..e63a87094a4 100644
--- a/app/helpers/enterprise_trial_helper.rb
+++ b/app/helpers/enterprise_trial_helper.rb
@@ -1,7 +1,7 @@
module EnterpriseTrialHelper
def augur_content_security_policy
append_content_security_policy_directives(
- connect_src: %w(augur.openproject-edge.com)
+ connect_src: [OpenProject::Configuration.enterprise_trial_creation_host]
)
end
diff --git a/lib/open_project/configuration/helpers.rb b/lib/open_project/configuration/helpers.rb
index 712868a434b..536bcf3a5fc 100644
--- a/lib/open_project/configuration/helpers.rb
+++ b/lib/open_project/configuration/helpers.rb
@@ -41,6 +41,15 @@ module OpenProject
(self['attachments_storage'] || 'file').to_sym
end
+ # Augur connect host
+ def enterprise_trial_creation_host
+ if Rails.env.production?
+ self['enterprise_trial_creation_host']
+ else
+ 'https://augur.openproject-edge.com'
+ end
+ end
+
def file_storage?
attachments_storage == :file
end