From: Tom Hughes Date: Thu, 14 Oct 2021 17:39:05 +0000 (+0100) Subject: Make the storage service to use for avatars configurable X-Git-Tag: live~1900^2~2 X-Git-Url: https://git.openstreetmap.org./rails.git/commitdiff_plain/ef85e8c7b346588a5e6ad0df7ddeb1046977c61a Make the storage service to use for avatars configurable --- diff --git a/app/models/user.rb b/app/models/user.rb index 8b8f31676..023604801 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -87,7 +87,7 @@ class User < ApplicationRecord scope :active, -> { where(:status => %w[active confirmed]) } scope :identifiable, -> { where(:data_public => true) } - has_one_attached :avatar + has_one_attached :avatar, :service => Settings.avatar_storage validates :display_name, :presence => true, :length => 3..255, :exclusion => %w[new terms save confirm confirm-email go_public reset-password forgot-password suspended] diff --git a/config/settings.yml b/config/settings.yml index 801e8f2d1..929df7b8a 100644 --- a/config/settings.yml +++ b/config/settings.yml @@ -132,3 +132,5 @@ smtp_enable_starttls_auto: false smtp_authentication: null smtp_user_name: null smtp_password: null +# Storage services +avatar_storage: "local" diff --git a/config/settings/test.yml b/config/settings/test.yml index d3952e27b..77afe95ee 100644 --- a/config/settings/test.yml +++ b/config/settings/test.yml @@ -19,3 +19,5 @@ wikipedia_auth_id: "dummy" wikipedia_auth_secret: "dummy" # Server URL for testing server_url: "test.host" +# Storage services for testing +avatar_storage: "test"