Class: EasyCaddy::Commands::Audit

Inherits:
Object
  • Object
show all
Defined in:
lib/easy_caddy/commands/audit.rb

Overview

Prints a full system + TLS + site snapshot with per-domain TLS handshake probes. With fix: true, prompts to apply a remedy for each actionable finding, with automatic escalation to a chained next_fix when the primary fix doesn’t resolve it. rubocop:disable Metrics/ClassLength

Defined Under Namespace

Classes: Choice, Fix

Constant Summary collapse

RED =

ANSI colours — fall back gracefully if $stdout is not a TTY.

"\e[31m"
GREEN =
"\e[32m"
YELLW =
"\e[33m"
RESET =
"\e[0m"

Instance Method Summary collapse

Constructor Details

#initialize(site: nil, fix: false) ⇒ Audit

Returns a new instance of Audit.



37
38
39
40
41
# File 'lib/easy_caddy/commands/audit.rb', line 37

def initialize(site: nil, fix: false)
  @site_filter = site
  @fix_mode    = fix
  @fixes       = []
end

Instance Method Details

#callObject



43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
# File 'lib/easy_caddy/commands/audit.rb', line 43

def call
  section('SYSTEM')
  print_system

  section('TLS READINESS')
  print_tls_readiness

  section('SITES')
  print_sites

  section('CONFLICTS')
  print_conflicts

  run_fixes if @fix_mode
end