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. 16
      lib/tasks/packager.rake

@ -70,15 +70,13 @@ 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'
else
ENV.fetch('SERVER_PROTOCOL', Setting.protocol)
end
# Set https configured, set Rails force_ssl to true
shell_setup(['config:set', "OPENPROJECT_RAILS__FORCE__SSL=#{Setting.https?}"])
if ENV.fetch('SERVER_PROTOCOL', Setting.protocol) == 'https'
Setting.protocol = 'https'
shell_setup(['config:set', "OPENPROJECT_RAILS__FORCE__SSL=true"])
else
Setting.protocol = 'http'
shell_setup(['config:unset', "OPENPROJECT_RAILS__FORCE__SSL"])
end
# Run customization step, if it is defined.
# Use to define custom postinstall steps required after each configure,

Loading…
Cancel
Save