Class: Kamal::Cli::App::SslCertificates
- Inherits:
-
Object
- Object
- Kamal::Cli::App::SslCertificates
- Defined in:
- lib/kamal/cli/app/ssl_certificates.rb
Instance Attribute Summary collapse
-
#host ⇒ Object
readonly
Returns the value of attribute host.
-
#role ⇒ Object
readonly
Returns the value of attribute role.
-
#sshkit ⇒ Object
readonly
Returns the value of attribute sshkit.
Instance Method Summary collapse
-
#initialize(host, role, sshkit) ⇒ SslCertificates
constructor
A new instance of SslCertificates.
- #run ⇒ Object
Constructor Details
#initialize(host, role, sshkit) ⇒ SslCertificates
Returns a new instance of SslCertificates.
5 6 7 8 9 |
# File 'lib/kamal/cli/app/ssl_certificates.rb', line 5 def initialize(host, role, sshkit) @host = host @role = role @sshkit = sshkit end |
Instance Attribute Details
#host ⇒ Object (readonly)
Returns the value of attribute host.
2 3 4 |
# File 'lib/kamal/cli/app/ssl_certificates.rb', line 2 def host @host end |
#role ⇒ Object (readonly)
Returns the value of attribute role.
2 3 4 |
# File 'lib/kamal/cli/app/ssl_certificates.rb', line 2 def role @role end |
#sshkit ⇒ Object (readonly)
Returns the value of attribute sshkit.
2 3 4 |
# File 'lib/kamal/cli/app/ssl_certificates.rb', line 2 def sshkit @sshkit end |
Instance Method Details
#run ⇒ Object
11 12 13 14 15 16 17 18 19 20 21 22 |
# File 'lib/kamal/cli/app/ssl_certificates.rb', line 11 def run if role.running_proxy? && role.proxy.custom_ssl_certificate? info "Writing SSL certificates for #{role.name} on #{host}" execute *app.create_ssl_directory if cert_content = role.proxy.certificate_pem_content upload!(StringIO.new(cert_content), role.proxy.host_tls_cert, mode: "0644") end if key_content = role.proxy.private_key_pem_content upload!(StringIO.new(key_content), role.proxy.host_tls_key, mode: "0644") end end end |