discourse/app/services/problem_check/s3_backup_config.rb
Ted Johansson 3137e60653
DEV: Database backed admin notices (#26192)
This PR introduces a basic AdminNotice model to store these notices. Admin notices are categorized by their source/type (currently only notices from problem check.) They also have a priority.
2024-05-23 09:29:08 +08:00

22 lines
527 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
end