Class: Kitsune::Kit::Configuration::Ssh

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

Instance Method Summary collapse

Constructor Details

#initialize(user: "deploy", port: 22, key_path: "~/.ssh/id_ed25519", allowed_cidrs: []) ⇒ Ssh

Returns a new instance of Ssh.



35
36
37
38
39
40
41
42
43
44
# File 'lib/kitsune/kit/configuration.rb', line 35

def initialize(user: "deploy", port: 22, key_path: "~/.ssh/id_ed25519", allowed_cidrs: [])
  super(
    user: user.to_s,
    port: Integer(port),
    key_path: Pathname(key_path.to_s).expand_path.to_s,
    allowed_cidrs: Array(allowed_cidrs).map(&:to_s).freeze
  )
rescue ArgumentError, TypeError
  raise Errors::ConfigurationError, "ssh.port must be an integer"
end