class LetsEncrypt::Redis

Public Class Methods

connection() click to toggle source
# File lib/letsencrypt/redis.rb, line 7
def connection
  @connection ||= ::Redis.new(url: LetsEncrypt.config.redis_url)
end
delete(cert) click to toggle source

Delete certificate from redis.

# File lib/letsencrypt/redis.rb, line 20
def delete(cert)
  return unless cert.key.present? && cert.certificate.present?
  LetsEncrypt.logger.info "Delete #{cert.domain}'s certificate from redis"
  connection.del "#{cert.domain}.key"
  connection.del "#{cert.domain}.crt"
end
save(cert) click to toggle source

Save certificate into redis.

# File lib/letsencrypt/redis.rb, line 12
def save(cert)
  return unless cert.key.present? && cert.bundle.present?
  LetsEncrypt.logger.info "Save #{cert.domain}'s certificate (bundle) to redis"
  connection.set "#{cert.domain}.key", cert.key
  connection.set "#{cert.domain}.crt", cert.bundle
end