Ensure correctly setting http and https flags in packager

[ci skip]
pull/7389/head
Oliver Günther 5 years ago
parent e0a0be419b
commit 5116decf2b
No known key found for this signature in database
GPG Key ID: A3A8BDAD7C0C552C
  1. 12
      lib/tasks/packager.rake

@ -70,16 +70,14 @@ namespace :packager do
# Allow overriding the protocol setting from ENV
# to allow instances where SSL is terminated earlier to respect that setting
Setting.protocol =
if ENV['SERVER_PROTOCOL_FORCE_HTTPS']
'https'
if ENV.fetch('SERVER_PROTOCOL', Setting.protocol) == 'https'
Setting.protocol = 'https'
shell_setup(['config:set', "OPENPROJECT_RAILS__FORCE__SSL=true"])
else
ENV.fetch('SERVER_PROTOCOL', Setting.protocol)
Setting.protocol = 'http'
shell_setup(['config:unset', "OPENPROJECT_RAILS__FORCE__SSL"])
end
# Set https configured, set Rails force_ssl to true
shell_setup(['config:set', "OPENPROJECT_RAILS__FORCE__SSL=#{Setting.https?}"])
# Run customization step, if it is defined.
# Use to define custom postinstall steps required after each configure,
# or to configure products.

Loading…
Cancel
Save