Module: CertWatch

Defined in:
lib/cert_watch.rb,
lib/cert_watch/error.rb,
lib/cert_watch/engine.rb,
lib/cert_watch/client.rb,
lib/cert_watch/version.rb,
lib/cert_watch/sanitize.rb,
lib/cert_watch/installer.rb,
lib/cert_watch/renew_error.rb,
lib/cert_watch/domain_owner.rb,
lib/cert_watch/install_error.rb,
lib/cert_watch/configuration.rb,
lib/cert_watch/certbot_client.rb,
app/models/cert_watch/certificate.rb,
lib/cert_watch/views/certificate_state.rb,
lib/cert_watch/pem_directory_installer.rb,
app/jobs/cert_watch/renew_certificate_job.rb,
app/jobs/cert_watch/install_certificate_job.rb,
app/controllers/cert_watch/application_controller.rb,
app/jobs/cert_watch/renew_expiring_certificates_job.rb

Defined Under Namespace

Modules: DomainOwner, Sanitize, Views Classes: ApplicationController, CertbotClient, Certificate, Client, Configuration, Engine, Error, InstallCertificateJob, InstallError, PemDirectoryInstaller, RenewCertificateJob, RenewError, RenewExpiringCertificatesJob

Constant Summary collapse

VERSION =
'0.0.1'.freeze

Class Method Summary collapse

Class Method Details

.active_admin_load_pathObject


25
26
27
# File 'lib/cert_watch.rb', line 25

def self.active_admin_load_path
  Dir[CertWatch::Engine.root.join('admin')].first
end

.configObject


4
5
6
7
# File 'lib/cert_watch.rb', line 4

def self.config
  fail('Call CertWatch.setup before accessing CertWatch.config') unless @config
  @config
end

.domain_owner(options) ⇒ Object


29
30
31
# File 'lib/cert_watch.rb', line 29

def self.domain_owner(options)
  DomainOwner.define(options)
end

.setup {|@config| ... } ⇒ Object

Yields:


9
10
11
12
13
14
15
16
17
18
19
# File 'lib/cert_watch.rb', line 9

def self.setup
  @config = Configuration.new
  yield @config if block_given?

  self.client = CertbotClient.new(executable: config.certbot_executable,
                                  port: config.certbot_port)

  self.installer = PemDirectoryInstaller.new(pem_directory: config.pem_directory,
                                             input_directory: config.certbot_output_directory,
                                             reload_command: config.server_reload_command)
end