cloudy-0.1.0.1: CLI tool to easily spin up and control compute instances in various cloud environments
Safe HaskellSafe-Inferred
LanguageHaskell98

Cloudy.Cmd.Scaleway.Create

Synopsis

Documentation

waitForSshPort :: Text -> IO () Source #

Wait for port 22 to be available on the remote machine.

updateSshHostKeys Source #

Arguments

:: Text 
-> Text

IP Address

-> IO () 

data Fingerprint Source #

This datatype represents a line from an SSH fingerprint file, normally as output by ssh-keygen -l.

Here's an example line:

3072 SHA256:dRJ/XiNOlh9UGnnN5/a2N+EMSP+OkqyHy8WTzHlUt5U root@cloudy-complete-knife (RSA)

Constructors

Fingerprint 

Fields

  • size :: Word64

    Size of the key. Example: 3072

  • fingerprint :: Text

    The fingerprint of the key. Example: "SHA256:n6fLRD4O2Me3bRXhzHyCca1vWdQ2utxuPZVsIDUm6o0"

  • server :: Text

    User and hostname. Example: "root@cloudy-complete-knife"

  • keyType :: Text

    Type of key. Example: RSA

Instances

Instances details
Show Fingerprint Source # 
Instance details

Defined in Cloudy.Cmd.Scaleway.Create

Eq Fingerprint Source #

Note that we don't enforce $sel:server:Fingerprint to be same between two Fingerprints.

Instance details

Defined in Cloudy.Cmd.Scaleway.Create

Ord Fingerprint Source # 
Instance details

Defined in Cloudy.Cmd.Scaleway.Create

parseFingerprints Source #

Arguments

:: Text

Where are these fingerprints coming from?

Just used in error output to help debugging.

-> Text

The raw fingerprint file. See Fingerprint for what a single line of this file looks like. The whole file is just multiple of these lines, separate by a new line.

-> Either ParseError (NonEmpty Fingerprint) 

fingerprintParser :: Parser Fingerprint Source #

Parse a single Fingerprint.

>>> let finger = "3072 SHA256:dRJ/XiNOlh9UGnnN5/a2N+EMSP+OkqyHy8WTzHlUt5U root@cloudy-complete-knife (RSA)"
>>> parseTest fingerprintParser finger
Fingerprint {size = 3072, fingerprint = "SHA256:dRJ/XiNOlh9UGnnN5/a2N+EMSP+OkqyHy8WTzHlUt5U", server = "root@cloudy-complete-knife", keyType = "RSA"}

getSshHostKeys Source #

Arguments

:: Text

IP Address or hostname. Example: "123.100.200.3"

-> IO Text 

Returns the SSH host keys for the given host.

This effectively just runs ssh-keyscan on the given host.

This returns an output that looks like the following:

123.100.200.3 ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQCiRtLMhK1Dh72tpJIXF+NjLAPPyXbq/tYC0ztDTMBFfQEj2jixURcugtGM7WjcqDCHHgnPDcSHrlkl9dMOV0MvjA2WxNupDU1bPQ31h10rIiiSjL+IB+c9e1wEgJylt72pDPzxDjdNfuAS3gspOjYNuy2vRBlV8rQ9GDlSoSvqMGbQ7W9bdCLnANsUkI+FCXFZCzIL3MU26ddqrBdCgiTvFUVxHjfFJMxwsKwLa18P6dc586mYXocmQGwjyXfJCiOw5kajvH4a9BzRr21nQT23GI2e4RlJ2Rkum9lazBNaVaQBYIUgLVVFMSfxbEt2GGBv82UKbQTbk6KHrrKE8ABYmkE81lgE+8zlnh6lxlaEQ9if6/KvtwP97g0md3hxc9b2MvGnQLEX9jjHJ/B9bHW7jJzqWRQAnCQZzenbyTht5lNK480Q9qGTu0h8FNteapzos/JnQ3B8taGQI5fpxosRLyhX3wzdQrmaAiBnILgYV2sPWZT3th0M6gsLDi4ao40=
123.100.200.3 ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIBJKYO35BsIkFjiAXACgkWzTC+tA2sH5RSqoYoGq8Lv+
123.100.200.3 ecdsa-sha2-nistp256 AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBKR0UH9ZSmUyYUJfE/4mUT4SLZ9wskvsCXkVL8QNIprmFt7Zz7eRerQVyqoOm4/Zhu2OWlleqfIWOmuyPDGkImo=

fingerprintsFromHostKeys Source #

Arguments

:: Text

A newline-separated file of SSH host keys. See the output of getSshHostKeys for what this should look like.

-> IO Text 

Return the fingerprints for a set of raw host keys.

This effectively just runs ssh-keygen -l on a set of raw host keys.

See the docs for Fingerprint for an example of what this function outputs.

data FingerprintsMatch Source #

Results of comparing whether two sets of fingerprints match.

Constructors

FingerprintsMatch 
FingerprintsNoMatch 
FingerprintsMatchErr Text

There was some error when comparing the two sets of fingerprints.

Instances

Instances details
Show FingerprintsMatch Source # 
Instance details

Defined in Cloudy.Cmd.Scaleway.Create

removeOldHostKeysFromKnownHosts Source #

Arguments

:: Text

IP Address or hostname. Example: "123.100.200.3".

-> IO () 

Remove old, out-of-date host keys from the user's ~.sshknown_hosts file.

This effectively just runs ssh-keygen -R on the passed-in IP address.

addNewHostKeysToKnownHosts Source #

Arguments

:: Text

A set of SSH host keys. See the output of getSshHostKeys for what this should look like.

-> IO () 

Add a set of new SSH host keys to the ~.sshknown_hosts file.

This effectively just appends the passed-in host keys to the file.

>>> import Text.Parsec (parseTest)