about summary refs log tree commit diff
path: root/config/initializers
diff options
context:
space:
mode:
authorStarfall <root@starfall.blue>2020-04-11 20:04:56 -0500
committerStarfall <root@starfall.blue>2020-04-11 20:04:56 -0500
commitb107e4f771f036b214563764fcd95786f8016ee7 (patch)
tree22397105f42f30eceacdf84671d1c4d807c9dd73 /config/initializers
parent144ecfcfc7d9974117f1563084409a9558290a60 (diff)
parentc47be5bd864a1f5244f35122ba7fae31a149c73d (diff)
Merge branch 'glitch'
Diffstat (limited to 'config/initializers')
-rw-r--r--config/initializers/content_security_policy.rb1
-rw-r--r--config/initializers/kaminari_config.rb2
-rw-r--r--config/initializers/rack_attack.rb2
-rw-r--r--config/initializers/sidekiq.rb7
4 files changed, 9 insertions, 3 deletions
diff --git a/config/initializers/content_security_policy.rb b/config/initializers/content_security_policy.rb
index 221afab93..0ee16d509 100644
--- a/config/initializers/content_security_policy.rb
+++ b/config/initializers/content_security_policy.rb
@@ -37,6 +37,7 @@ if Rails.env.production?
     p.style_src       :self, :unsafe_inline, assets_host
     p.media_src       :self, :data, *data_hosts, "pool.jortage.com", "blob.jortage.com", "s3-us-east-2.amazonaws.com"
     p.frame_src       :self, :https
+    p.child_src       :self, :blob, assets_host
     p.worker_src      :self, :blob, assets_host
     p.connect_src     :self, :blob, :data, Rails.configuration.x.streaming_api_base_url, *data_hosts
     p.manifest_src    :self, assets_host
diff --git a/config/initializers/kaminari_config.rb b/config/initializers/kaminari_config.rb
index aa1517256..4fec4320c 100644
--- a/config/initializers/kaminari_config.rb
+++ b/config/initializers/kaminari_config.rb
@@ -2,6 +2,6 @@
 
 Kaminari.configure do |config|
   config.default_per_page = 40
-  config.window = 1
+  config.window = 2
   config.outer_window = 1
 end
diff --git a/config/initializers/rack_attack.rb b/config/initializers/rack_attack.rb
index 3cd7ea3a6..09458c540 100644
--- a/config/initializers/rack_attack.rb
+++ b/config/initializers/rack_attack.rb
@@ -42,6 +42,7 @@ class Rack::Attack
     /auth/sign_in
     /auth
     /auth/password
+    /auth/confirmation
   ).freeze
 
   PROTECTED_PATHS_REGEX = Regexp.union(PROTECTED_PATHS.map { |path| /\A#{Regexp.escape(path)}/ })
@@ -70,7 +71,6 @@ class Rack::Attack
     req.remote_ip if req.post? && req.path == '/api/v1/accounts'
   end
 
-  # Throttle paging, as it is mainly used for public pages and AP collections
   throttle('throttle_authenticated_paging', limit: 300, period: 15.minutes) do |req|
     req.authenticated_user_id if req.paging_request?
   end
diff --git a/config/initializers/sidekiq.rb b/config/initializers/sidekiq.rb
index 7f8a40d7b..f2733562f 100644
--- a/config/initializers/sidekiq.rb
+++ b/config/initializers/sidekiq.rb
@@ -13,10 +13,15 @@ Sidekiq.configure_server do |config|
   config.server_middleware do |chain|
     chain.add SidekiqErrorHandler
   end
+
+  config.death_handlers << lambda do |job, _ex|
+    digest = job['lock_digest']
+    SidekiqUniqueJobs::Digests.delete_by_digest(digest) if digest
+  end
 end
 
 Sidekiq.configure_client do |config|
   config.redis = redis_params
 end
 
-Sidekiq::Logging.logger.level = ::Logger.const_get(ENV.fetch('RAILS_LOG_LEVEL', 'info').upcase.to_s)
+Sidekiq.logger.level = ::Logger.const_get(ENV.fetch('RAILS_LOG_LEVEL', 'info').upcase.to_s)