Allow to enabled internal asset server

[ci skip]
pull/6227/head
Oliver Günther 7 years ago
parent 60a45e6854
commit d4a4a18de6
No known key found for this signature in database
GPG Key ID: 88872239EB414F99
  1. 2
      Gemfile
  2. 2
      Gemfile.lock
  3. 12
      config/environments/production.rb
  4. 2
      lib/open_project/configuration.rb

@ -265,6 +265,8 @@ group :opf_plugins do
end
group :docker, optional: true do
# Puma server
gem 'puma', '~> 3.11.3'
gem 'passenger'
# Used to easily precompile assets

@ -403,6 +403,7 @@ GEM
binding_of_caller (>= 0.7)
pry (>= 0.9.11)
public_suffix (3.0.0)
puma (3.11.3)
rabl (0.13.1)
activesupport (>= 2.3.14)
rack (2.0.4)
@ -677,6 +678,7 @@ DEPENDENCIES
pry-rails (~> 0.3.6)
pry-rescue (~> 1.4.5)
pry-stack_explorer (~> 0.4.9.2)
puma (~> 3.11.3)
rabl (~> 0.13.0)
rack-attack (~> 5.0.1)
rack-protection (~> 2.0.0)

@ -51,8 +51,16 @@ OpenProject::Application.configure do
# For large-scale production use, consider using a caching reverse proxy like nginx, varnish or squid.
# config.action_dispatch.rack_cache = true
# Disable Rails's static asset server (Apache or nginx will already do this).
config.public_file_server.enabled = false
# Enable Rails's static asset server when requested
if OpenProject::Configuration.enable_internal_assets_server?
config.public_file_server.enabled = true
config.public_file_server.headers = {
'Access-Control-Allow-Origin' => '*',
'Access-Control-Allow-Methods' => 'GET, OPTIONS, HEAD',
'Cache-Control' => 'public, s-maxage=31536000, max-age=15552000',
'Expires' => "#{1.year.from_now.to_formatted_s(:rfc822)}"
}
end
# Compress JavaScripts and CSS.
config.assets.js_compressor = nil

@ -65,6 +65,8 @@ module OpenProject
'rails_relative_url_root' => '',
'rails_force_ssl' => false,
'rails_asset_host' => nil,
# Enable internal asset server
'enable_internal_assets_server' => false,
# user configuration
'default_comment_sort_order' => 'asc',

Loading…
Cancel
Save