class Letsencrypt::Cli::App
Public Instance Methods
__print_version()
click to toggle source
# File lib/letsencrypt/cli/app.rb, line 105 def __print_version puts Letsencrypt::Cli::VERSION end
cert(*domains)
click to toggle source
# File lib/letsencrypt/cli/app.rb, line 58 def cert(*domains) if domains.length == 0 wrapper.log "no domains given", :fatal exit 1 end wrapper.cert(domains) end
check(path)
click to toggle source
# File lib/letsencrypt/cli/app.rb, line 68 def check(path) if !wrapper.check_certificate(path) exit 1 end end
manage(*domains)
click to toggle source
# File lib/letsencrypt/cli/app.rb, line 87 def manage(*domains) key_dir = File.join(@options[:key_directory], @options[:sub_directory] || domains.first) FileUtils.mkdir_p(key_dir) @options = @options.merge( :private_key_path => File.join(key_dir, 'key.pem'), :fullchain_path => File.join(key_dir, 'fullchain.pem'), :certificate_path => File.join(key_dir, 'cert.pem'), :chain_path => File.join(key_dir, 'chain.pem'), ) if wrapper.check_certificate(@options[:certificate_path]) exit 2 end authorize(*domains) cert(*domains) end
register(email)
click to toggle source
# File lib/letsencrypt/cli/app.rb, line 14 def register(email) if email.nil? || email == "" wrapper.log "no E-Mail specified!", :fatal exit 1 end if !email[/.*@.*/] wrapper.log "not an email", :fatal exit 1 end registration = wrapper.client.register(contact: "mailto:" + email) registration.agree_terms wrapper.log "Account created, Terms accepted" end
revoke(path)
click to toggle source
# File lib/letsencrypt/cli/app.rb, line 75 def revoke(path) if !wrapper.revoke_certificate(path) exit 1 end end
Private Instance Methods
wrapper()
click to toggle source
# File lib/letsencrypt/cli/app.rb, line 111 def wrapper @wrapper ||= AcmeWrapper.new(options) end