Class: CommandTower::Install::Doctor
- Inherits:
-
Object
- Object
- CommandTower::Install::Doctor
- Defined in:
- lib/command_tower/install/doctor.rb
Overview
Friendly setup validation for host applications. Returns structured findings; rake task prints remediation text.
Defined Under Namespace
Classes: Finding
Constant Summary collapse
- INSECURE_JWT_DEFAULT =
"Thi$IsASeccretIwi::CH&ang3"- SUPPORTED_SMS_ADAPTERS =
Configuration::Messaging::Sms::ADAPTERS
- SUPPORTED_PUSHOVER_ADAPTERS =
Configuration::Messaging::Pushover::ADAPTERS
Instance Method Summary collapse
-
#initialize(host_root: Rails.root, config: CommandTower.config, env: Rails.env) ⇒ Doctor
constructor
A new instance of Doctor.
- #ok? ⇒ Boolean
- #run ⇒ Object
Constructor Details
#initialize(host_root: Rails.root, config: CommandTower.config, env: Rails.env) ⇒ Doctor
Returns a new instance of Doctor.
17 18 19 20 21 |
# File 'lib/command_tower/install/doctor.rb', line 17 def initialize(host_root: Rails.root, config: CommandTower.config, env: Rails.env) @host_root = Pathname(host_root) @config = config @env = env.to_s end |
Instance Method Details
#ok? ⇒ Boolean
34 35 36 |
# File 'lib/command_tower/install/doctor.rb', line 34 def ok? run.none? { |f| f.severity == :fail } end |
#run ⇒ Object
23 24 25 26 27 28 29 30 31 32 |
# File 'lib/command_tower/install/doctor.rb', line 23 def run findings = [] findings.concat(check_rails_version) findings.concat(check_engine_migrations) findings.concat(check_host_migrations) findings.concat(check_jwt_secret) findings.concat(check_session_secrets) findings.concat(check_messaging_adapters) findings end |