mirror of
https://github.com/discourse/discourse.git
synced 2024-11-23 18:36:35 +08:00
22 lines
498 B
Ruby
22 lines
498 B
Ruby
|
# frozen_string_literal: true
|
||
|
|
||
|
class ProblemCheck::S3UploadConfig < ProblemCheck
|
||
|
self.priority = "low"
|
||
|
|
||
|
def call
|
||
|
return no_problem if GlobalSetting.use_s3?
|
||
|
return no_problem if !SiteSetting.enable_s3_uploads?
|
||
|
return no_problem if !missing_keys? && SiteSetting.s3_upload_bucket.present?
|
||
|
|
||
|
problem
|
||
|
end
|
||
|
|
||
|
private
|
||
|
|
||
|
def missing_keys?
|
||
|
return false if SiteSetting.s3_use_iam_profile
|
||
|
|
||
|
SiteSetting.s3_access_key_id.blank? || SiteSetting.s3_secret_access_key.blank?
|
||
|
end
|
||
|
end
|