Class: Encryptbot::Configuration

Inherits:
Object
  • Object
show all
Defined in:
lib/encryptbot/configuration.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeConfiguration

Returns a new instance of Configuration.



11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
# File 'lib/encryptbot/configuration.rb', line 11

def initialize
  @heroku_app = nil
  @heroku_token = nil
  @cloudflare_api_key = nil
  @cloudflare_email = nil
  @dyn_customer_name = nil
  @dyn_username = nil
  @dyn_password = nil
  @route53_hosted_zone_id = nil
  @route53_acme_record_name = nil
  @route53_access_key_id = nil
  @route53_secret_access_key = nil
  @acme_email = nil
  @slack_webhook = nil
  @slack_bot_username = "encryptbot"
  @test_mode = false # use lets encrypt staging
  @domains = [] #[{domain: "*.domain.com", service: "cloudflare"}, {domain: "*.domain.com", service: "dyn"}]
end

Instance Attribute Details

#acme_emailObject

Returns the value of attribute acme_email.



3
4
5
# File 'lib/encryptbot/configuration.rb', line 3

def acme_email
  @acme_email
end

#cloudflare_api_keyObject

Returns the value of attribute cloudflare_api_key.



3
4
5
# File 'lib/encryptbot/configuration.rb', line 3

def cloudflare_api_key
  @cloudflare_api_key
end

#cloudflare_emailObject

Returns the value of attribute cloudflare_email.



3
4
5
# File 'lib/encryptbot/configuration.rb', line 3

def cloudflare_email
  @cloudflare_email
end

#domainsObject

Returns the value of attribute domains.



3
4
5
# File 'lib/encryptbot/configuration.rb', line 3

def domains
  @domains
end

#dyn_customer_nameObject

Returns the value of attribute dyn_customer_name.



3
4
5
# File 'lib/encryptbot/configuration.rb', line 3

def dyn_customer_name
  @dyn_customer_name
end

#dyn_passwordObject

Returns the value of attribute dyn_password.



3
4
5
# File 'lib/encryptbot/configuration.rb', line 3

def dyn_password
  @dyn_password
end

#dyn_usernameObject

Returns the value of attribute dyn_username.



3
4
5
# File 'lib/encryptbot/configuration.rb', line 3

def dyn_username
  @dyn_username
end

#heroku_appObject

Returns the value of attribute heroku_app.



3
4
5
# File 'lib/encryptbot/configuration.rb', line 3

def heroku_app
  @heroku_app
end

#heroku_tokenObject

Returns the value of attribute heroku_token.



3
4
5
# File 'lib/encryptbot/configuration.rb', line 3

def heroku_token
  @heroku_token
end

#route53_access_key_idObject

Returns the value of attribute route53_access_key_id.



3
4
5
# File 'lib/encryptbot/configuration.rb', line 3

def route53_access_key_id
  @route53_access_key_id
end

#route53_acme_record_nameObject

Returns the value of attribute route53_acme_record_name.



3
4
5
# File 'lib/encryptbot/configuration.rb', line 3

def route53_acme_record_name
  @route53_acme_record_name
end

#route53_hosted_zone_idObject

Returns the value of attribute route53_hosted_zone_id.



3
4
5
# File 'lib/encryptbot/configuration.rb', line 3

def route53_hosted_zone_id
  @route53_hosted_zone_id
end

#route53_secret_access_keyObject

Returns the value of attribute route53_secret_access_key.



3
4
5
# File 'lib/encryptbot/configuration.rb', line 3

def route53_secret_access_key
  @route53_secret_access_key
end

#slack_bot_usernameObject

Returns the value of attribute slack_bot_username.



3
4
5
# File 'lib/encryptbot/configuration.rb', line 3

def slack_bot_username
  @slack_bot_username
end

#slack_webhookObject

Returns the value of attribute slack_webhook.



3
4
5
# File 'lib/encryptbot/configuration.rb', line 3

def slack_webhook
  @slack_webhook
end

#test_modeObject

Returns the value of attribute test_mode.



3
4
5
# File 'lib/encryptbot/configuration.rb', line 3

def test_mode
  @test_mode
end

Instance Method Details

#valid?Boolean

Returns:

  • (Boolean)


30
31
32
33
# File 'lib/encryptbot/configuration.rb', line 30

def valid?
  heroku_app && heroku_token && acme_email && domains.any? &&
  (cloudflare_api_key || dyn_customer_name || route53_access_key_id)
end