Class: LetsencryptWebfaction::Application::Run

Inherits:
Object
  • Object
show all
Defined in:
lib/letsencrypt_webfaction/application/run.rb

Constant Summary collapse

RENEWAL_DELTA =

days

14

Instance Method Summary collapse

Constructor Details

#initialize(args) ⇒ Run

Returns a new instance of Run.



15
16
17
18
19
20
21
22
23
24
25
# File 'lib/letsencrypt_webfaction/application/run.rb', line 15

def initialize(args)
  parse_quiet(args)

  # TODO: args should be supported: --config
  unless Options.default_options_path.exist?
    $stderr.puts 'The configuration file is missing.'
    $stderr.puts 'You may need to run `letsencrypt_webfaction init`'
    raise AppExitError, 'config missing'
  end
  @options = LetsencryptWebfaction::Options.from_toml(Options.default_options_path)
end

Instance Method Details

#run!Object



27
28
29
30
31
32
33
34
35
36
37
38
39
# File 'lib/letsencrypt_webfaction/application/run.rb', line 27

def run!
  validate_options

  # Check credentials
  unless api_credentials.valid?
    $stderr.puts 'WebFaction API username, password, and/or servername are incorrect. Login failed.'
    raise AppExitError, 'WebFaction credentials failed'
  end

  register_key

  process_certs
end