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/assets.rb2
-rw-r--r--config/initializers/locale.rb6
-rw-r--r--config/initializers/premailer_rails.rb6
-rw-r--r--config/initializers/rack_attack.rb2
-rw-r--r--config/initializers/suppress_csrf_warnings.rb3
5 files changed, 17 insertions, 2 deletions
diff --git a/config/initializers/assets.rb b/config/initializers/assets.rb
index f2bf17364..53b39718d 100644
--- a/config/initializers/assets.rb
+++ b/config/initializers/assets.rb
@@ -8,6 +8,6 @@ Rails.application.config.assets.version = '1.0'
 
 # Precompile additional assets.
 # application.js, application.css, and all non-JS/CSS in app/assets folder are already added.
-# Rails.application.config.assets.precompile += %w(application_public.js custom.css)
+# Rails.application.config.assets.precompile += %w()
 
 Rails.application.config.assets.initialize_on_precompile = true
diff --git a/config/initializers/locale.rb b/config/initializers/locale.rb
new file mode 100644
index 000000000..04ed31646
--- /dev/null
+++ b/config/initializers/locale.rb
@@ -0,0 +1,6 @@
+# frozen_string_literal: true
+
+I18n.load_path += Dir[Rails.root.join('app', 'javascript', 'flavours', '*', 'names.{rb,yml}').to_s]
+I18n.load_path += Dir[Rails.root.join('app', 'javascript', 'flavours', '*', '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('app', 'javascript', 'skins', '*', '*', 'names', '*.{rb,yml}').to_s]
diff --git a/config/initializers/premailer_rails.rb b/config/initializers/premailer_rails.rb
new file mode 100644
index 000000000..31c02dffa
--- /dev/null
+++ b/config/initializers/premailer_rails.rb
@@ -0,0 +1,6 @@
+require_relative '../../lib/mastodon/premailer_webpack_strategy'
+
+Premailer::Rails.config.merge!(remove_ids: true,
+                               adapter: :nokogiri,
+                               generate_text_part: false,
+                               strategies: [PremailerWebpackStrategy])
diff --git a/config/initializers/rack_attack.rb b/config/initializers/rack_attack.rb
index b38fb302b..b35452f04 100644
--- a/config/initializers/rack_attack.rb
+++ b/config/initializers/rack_attack.rb
@@ -53,7 +53,7 @@ class Rack::Attack
     req.ip if req.api_request?
   end
 
-  throttle('protected_paths', limit: 5, period: 5.minutes) do |req|
+  throttle('protected_paths', limit: 25, period: 5.minutes) do |req|
     req.ip if req.post? && req.path =~ PROTECTED_PATHS_REGEX
   end
 
diff --git a/config/initializers/suppress_csrf_warnings.rb b/config/initializers/suppress_csrf_warnings.rb
new file mode 100644
index 000000000..410ab585b
--- /dev/null
+++ b/config/initializers/suppress_csrf_warnings.rb
@@ -0,0 +1,3 @@
+# frozen_string_literal: true
+
+ActionController::Base.log_warning_on_csrf_failure = false