]> git.openstreetmap.org Git - rails.git/commitdiff
Make the storage service to use for avatars configurable
authorTom Hughes <tom@compton.nu>
Thu, 14 Oct 2021 17:39:05 +0000 (18:39 +0100)
committerTom Hughes <tom@compton.nu>
Thu, 16 Dec 2021 18:45:31 +0000 (18:45 +0000)
app/models/user.rb
config/settings.yml
config/settings/test.yml

index 8b8f31676b6e37870dfb9542ec8bad4229805b26..023604801cbf49183279acd55449a587e54c1e50 100644 (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]
index 801e8f2d1328045a0629870cd385aaf4afbc526a..929df7b8a15ee5bcc3e829a586927b401d122d8a 100644 (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"
index d3952e27bba028b91657916af8b10073103fc0be..77afe95ee3a94b2c7c0bf326c5d51b6af1cee8f7 100644 (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"