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/active_model_serializers.rb2
-rw-r--r--config/initializers/doorkeeper.rb2
-rw-r--r--config/initializers/http_client_proxy.rb3
-rw-r--r--config/initializers/paperclip.rb1
4 files changed, 6 insertions, 2 deletions
diff --git a/config/initializers/active_model_serializers.rb b/config/initializers/active_model_serializers.rb
index b0230267d..0e69e1d96 100644
--- a/config/initializers/active_model_serializers.rb
+++ b/config/initializers/active_model_serializers.rb
@@ -1,3 +1,5 @@
 ActiveModelSerializers.config.tap do |config|
   config.default_includes = '**'
 end
+
+ActiveSupport::Notifications.unsubscribe(ActiveModelSerializers::Logging::RENDER_EVENT)
diff --git a/config/initializers/doorkeeper.rb b/config/initializers/doorkeeper.rb
index 074f8c410..469553803 100644
--- a/config/initializers/doorkeeper.rb
+++ b/config/initializers/doorkeeper.rb
@@ -55,7 +55,7 @@ Doorkeeper.configure do
   # For more information go to
   # https://github.com/doorkeeper-gem/doorkeeper/wiki/Using-Scopes
   default_scopes  :read
-  optional_scopes :write, :follow
+  optional_scopes :write, :follow, :push
 
   # Change the way client credentials are retrieved from the request object.
   # By default it retrieves first from the `HTTP_AUTHORIZATION` header, then
diff --git a/config/initializers/http_client_proxy.rb b/config/initializers/http_client_proxy.rb
index f5026d59e..52c595c5d 100644
--- a/config/initializers/http_client_proxy.rb
+++ b/config/initializers/http_client_proxy.rb
@@ -18,7 +18,8 @@ module Goldfinger
   def self.finger(uri, opts = {})
     to_hidden = /\.(onion|i2p)(:\d+)?$/.match(uri)
     raise Mastodon::HostValidationError, 'Instance does not support hidden service connections' if !Rails.configuration.x.access_to_hidden_service && to_hidden
-    opts = opts.merge(Rails.configuration.x.http_client_proxy).merge(ssl: !to_hidden)
+    opts = { ssl: !to_hidden, headers: {} }.merge(Rails.configuration.x.http_client_proxy).merge(opts)
+    opts[:headers]['User-Agent'] ||= Mastodon::Version.user_agent
     Goldfinger::Client.new(uri, opts).finger
   end
 end
diff --git a/config/initializers/paperclip.rb b/config/initializers/paperclip.rb
index 17a520aa2..c134bc5b8 100644
--- a/config/initializers/paperclip.rb
+++ b/config/initializers/paperclip.rb
@@ -60,6 +60,7 @@ elsif ENV['SWIFT_ENABLED'] == 'true'
     fog_credentials: {
       provider: 'OpenStack',
       openstack_username: ENV['SWIFT_USERNAME'],
+      openstack_project_id: ENV['SWIFT_PROJECT_ID'],
       openstack_project_name: ENV['SWIFT_TENANT'],
       openstack_tenant: ENV['SWIFT_TENANT'], # Some OpenStack-v2 ignores project_name but needs tenant
       openstack_api_key: ENV['SWIFT_PASSWORD'],