mirror of
https://github.com/discourse/discourse.git
synced 2024-12-13 20:03:51 +08:00
26 lines
597 B
Ruby
26 lines
597 B
Ruby
|
# frozen_string_literal: true
|
||
|
|
||
|
class ProblemCheck::S3BackupConfig < ProblemCheck
|
||
|
self.priority = "low"
|
||
|
|
||
|
def call
|
||
|
return no_problem if GlobalSetting.use_s3?
|
||
|
return no_problem if SiteSetting.backup_location != BackupLocationSiteSetting::S3
|
||
|
return no_problem if !missing_keys? && SiteSetting.s3_backup_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
|
||
|
|
||
|
def translation_key
|
||
|
"dashboard.s3_backup_config_warning"
|
||
|
end
|
||
|
end
|