Make the storage service to use for avatars configurable

This commit is contained in:
Tom Hughes 2021-10-14 18:39:05 +01:00
parent 767051451c
commit ef85e8c7b3
3 changed files with 5 additions and 1 deletions

View file

@ -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]

View file

@ -132,3 +132,5 @@ smtp_enable_starttls_auto: false
smtp_authentication: null
smtp_user_name: null
smtp_password: null
# Storage services
avatar_storage: "local"

View file

@ -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"