about summary refs log tree commit diff
path: root/config/initializers
diff options
context:
space:
mode:
Diffstat (limited to 'config/initializers')
-rw-r--r--config/initializers/2_whitelist_mode.rb2
-rw-r--r--config/initializers/doorkeeper.rb9
-rw-r--r--config/initializers/inflections.rb2
-rw-r--r--config/initializers/locale.rb1
-rw-r--r--config/initializers/rack_attack.rb4
-rw-r--r--config/initializers/sidekiq.rb4
6 files changed, 19 insertions, 3 deletions
diff --git a/config/initializers/2_whitelist_mode.rb b/config/initializers/2_whitelist_mode.rb
index 1cc6a8e72..3ac6d7a09 100644
--- a/config/initializers/2_whitelist_mode.rb
+++ b/config/initializers/2_whitelist_mode.rb
@@ -1,5 +1,5 @@
 # frozen_string_literal: true
 
 Rails.application.configure do
-  config.x.whitelist_mode = (ENV['LIMITED_FEDERATION_MODE'] || ENV['WHITELIST_MODE']) == 'true'
+  config.x.whitelist_mode = true
 end
diff --git a/config/initializers/doorkeeper.rb b/config/initializers/doorkeeper.rb
index 63cff7c59..1c790e90a 100644
--- a/config/initializers/doorkeeper.rb
+++ b/config/initializers/doorkeeper.rb
@@ -76,6 +76,10 @@ Doorkeeper.configure do
                   :'write:notifications',
                   :'write:reports',
                   :'write:statuses',
+                  :'write:statuses:publish',
+                  :'write:domain_permissions',
+                  :'write:domain_permissions:account',
+                  :'write:domain_permissions:statuses',
                   :read,
                   :'read:accounts',
                   :'read:blocks',
@@ -88,11 +92,16 @@ Doorkeeper.configure do
                   :'read:notifications',
                   :'read:search',
                   :'read:statuses',
+                  :'read:domain_permissions',
+                  :'read:domain_permissions:account',
+                  :'read:domain_permissions:statuses',
                   :follow,
                   :push,
                   :'admin:read',
                   :'admin:read:accounts',
                   :'admin:read:reports',
+                  :'admin:read:domain_blocks',
+                  :'admin:read:domain_allows',
                   :'admin:write',
                   :'admin:write:accounts',
                   :'admin:write:reports',
diff --git a/config/initializers/inflections.rb b/config/initializers/inflections.rb
index ebb7541eb..4170b69ba 100644
--- a/config/initializers/inflections.rb
+++ b/config/initializers/inflections.rb
@@ -22,4 +22,6 @@ ActiveSupport::Inflector.inflections(:en) do |inflect|
   inflect.acronym 'Ed25519'
 
   inflect.singular 'data', 'data'
+
+  inflect.irregular 'publish', 'publishing'
 end
diff --git a/config/initializers/locale.rb b/config/initializers/locale.rb
index fed182a71..aa271dc56 100644
--- a/config/initializers/locale.rb
+++ b/config/initializers/locale.rb
@@ -5,3 +5,4 @@ I18n.load_path += Dir[Rails.root.join('app', 'javascript', 'flavours', '*', 'nam
 I18n.load_path += Dir[Rails.root.join('app', 'javascript', 'skins', '*', '*', 'names.{rb,yml}').to_s]
 I18n.load_path += Dir[Rails.root.join('app', 'javascript', 'skins', '*', '*', 'names', '*.{rb,yml}').to_s]
 I18n.load_path += Dir[Rails.root.join('config', 'locales-glitch', '*.{rb,yml}').to_s]
+I18n.load_path += Dir[Rails.root.join('config', 'locales-monsterfork', '*.{rb,yml}').to_s]
diff --git a/config/initializers/rack_attack.rb b/config/initializers/rack_attack.rb
index 6662ef40b..4904b8d57 100644
--- a/config/initializers/rack_attack.rb
+++ b/config/initializers/rack_attack.rb
@@ -109,6 +109,10 @@ class Rack::Attack
     req.session[:attempt_user_id] || req.params.dig('user', 'email').presence if req.post? && req.path == '/auth/sign_in'
   end
 
+  throttle('throttle_matrix_auth_attempts/ip', limit: 5, period: 1.minute) do |req|
+    req.remote_ip if req.path == '/_matrix-internal/identity/v1/check_credentials'
+  end
+
   self.throttled_response = lambda do |env|
     now        = Time.now.utc
     match_data = env['rack.attack.match_data']
diff --git a/config/initializers/sidekiq.rb b/config/initializers/sidekiq.rb
index f2733562f..2ed0554de 100644
--- a/config/initializers/sidekiq.rb
+++ b/config/initializers/sidekiq.rb
@@ -15,8 +15,8 @@ Sidekiq.configure_server do |config|
   end
 
   config.death_handlers << lambda do |job, _ex|
-    digest = job['lock_digest']
-    SidekiqUniqueJobs::Digests.delete_by_digest(digest) if digest
+    SidekiqUniqueJobs::Digests.delete_by_digest(job['lock_digest']) if job['lock_digest']
+    SidekiqUniqueJobs::Digests.delete_by_digest(job['unique_digest']) if job['unique_digest']
   end
 end