X-Git-Url: https://git.openstreetmap.org./chef.git/blobdiff_plain/92a29616d713f11468545ceef7ac5c9d413e6e4d..86aeaefd2b815793d4bed90170428068e60f7c9f:/cookbooks/web/resources/rails_port.rb?ds=inline diff --git a/cookbooks/web/resources/rails_port.rb b/cookbooks/web/resources/rails_port.rb index fe55ec34e..189c01bbf 100644 --- a/cookbooks/web/resources/rails_port.rb +++ b/cookbooks/web/resources/rails_port.rb @@ -67,6 +67,10 @@ property :csp_enforce, [TrueClass, FalseClass], :default => false property :csp_report_url, String property :piwik_configuration, Hash property :trace_use_job_queue, [TrueClass, FalseClass], :default => false +property :diary_feed_delay, Integer +property :storage_configuration, Hash, :default => {} +property :storage_service, String, :default => "local" +property :storage_url, String action :create do package %W[ @@ -314,7 +318,10 @@ action :create do "totp_key", "csp_enforce", "csp_report_url", - "trace_use_job_queue" + "trace_use_job_queue", + "diary_feed_delay", + "storage_service", + "storage_url" ).reject { |_k, v| v.nil? }.merge( "server_protocol" => "https", "server_url" => new_resource.site, @@ -343,6 +350,21 @@ action :create do only_if { ::File.exist?("#{rails_directory}/config/settings.yml") } end + storage_configuration = new_resource.storage_configuration.merge( + "local" => { + "service" => "Disk", + "root" => "#{rails_directory}/storage" + } + ) + + file "#{rails_directory}/config/storage.yml" do + owner new_resource.user + group new_resource.group + mode 0o664 + content YAML.dump(storage_configuration) + notifies :run, "execute[#{rails_directory}/public/assets]" + end + if new_resource.piwik_configuration file "#{rails_directory}/config/piwik.yml" do owner new_resource.user