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

tell backend about frontend host/port

Ivan Kuchin39a4fc7db2dd
diff --git a/app/helpers/frontend_asset_helper.rb b/app/helpers/frontend_asset_helper.rb
index f016772c423..38772224edd 100644
--- a/app/helpers/frontend_asset_helper.rb
+++ b/app/helpers/frontend_asset_helper.rb
@@ -27,14 +27,19 @@
#++
module FrontendAssetHelper
- CLI_DEFAULT_PROXY = "http://localhost:4200".freeze
+ CLI_DEFAULT_PROXY = begin
+ host = ENV.fetch("FE_HOST", "localhost")
+ port = ENV.fetch("FE_PORT", 4200)
+ "http://#{host}:#{port}"
+ end
+ CLI_PROXY = ENV.fetch("OPENPROJECT_CLI_PROXY", CLI_DEFAULT_PROXY)
def self.assets_proxied?
ENV["OPENPROJECT_DISABLE_DEV_ASSET_PROXY"].blank? && !Rails.env.production? && cli_proxy.present?
end
def self.cli_proxy
- ENV.fetch("OPENPROJECT_CLI_PROXY", CLI_DEFAULT_PROXY)
+ CLI_PROXY
end
##