Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell98 |
Synopsis
- data ScalewayCreateSettings = ScalewayCreateSettings {
- secretKey :: Text
- projectId :: ProjectId
- zone :: Zone
- instanceType :: Text
- volumeSizeGb :: Int
- imageId :: Text
- instanceSetup :: Maybe InstanceSetup
- mkSettings :: LocalConfFileOpts -> ScalewayCreateCliOpts -> IO ScalewayCreateSettings
- runCreate :: LocalConfFileOpts -> ScalewayCreateCliOpts -> IO ()
- createScalewayServer :: ScalewayCreateSettings -> Text -> ClientM (ServerId, IpId, Text)
- oneGb :: Int
- waitForScalewayServer :: ScalewayCreateSettings -> ServerId -> ClientM ()
- waitForSshPort :: Text -> IO ()
- getSshKeyFingerprints :: ScalewayCreateSettings -> ServerId -> ClientM Text
- updateSshHostKeys :: Text -> Text -> IO ()
- data Fingerprint = Fingerprint {}
- type Parser = Parsec Text ()
- parseFingerprints :: Text -> Text -> Either ParseError (NonEmpty Fingerprint)
- fingerprintsParser :: Parser (NonEmpty Fingerprint)
- fingerprintParser :: Parser Fingerprint
- getSshHostKeys :: Text -> IO Text
- fingerprintsFromHostKeys :: Text -> IO Text
- data FingerprintsMatch
- doFingerprintsMatch :: NonEmpty Fingerprint -> NonEmpty Fingerprint -> FingerprintsMatch
- removeOldHostKeysFromKnownHosts :: Text -> IO ()
- addNewHostKeysToKnownHosts :: Text -> IO ()
Documentation
data ScalewayCreateSettings Source #
ScalewayCreateSettings | |
|
runCreate :: LocalConfFileOpts -> ScalewayCreateCliOpts -> IO () Source #
createScalewayServer :: ScalewayCreateSettings -> Text -> ClientM (ServerId, IpId, Text) Source #
waitForScalewayServer :: ScalewayCreateSettings -> ServerId -> ClientM () Source #
waitForSshPort :: Text -> IO () Source #
Wait for port 22 to be available on the remote machine.
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)
Instances
Show Fingerprint Source # | |
Defined in Cloudy.Cmd.Scaleway.Create showsPrec :: Int -> Fingerprint -> ShowS # show :: Fingerprint -> String # showList :: [Fingerprint] -> ShowS # | |
Eq Fingerprint Source # | Note that we don't enforce |
Defined in Cloudy.Cmd.Scaleway.Create (==) :: Fingerprint -> Fingerprint -> Bool # (/=) :: Fingerprint -> Fingerprint -> Bool # | |
Ord Fingerprint Source # | |
Defined in Cloudy.Cmd.Scaleway.Create compare :: Fingerprint -> Fingerprint -> Ordering # (<) :: Fingerprint -> Fingerprint -> Bool # (<=) :: Fingerprint -> Fingerprint -> Bool # (>) :: Fingerprint -> Fingerprint -> Bool # (>=) :: Fingerprint -> Fingerprint -> Bool # max :: Fingerprint -> Fingerprint -> Fingerprint # min :: Fingerprint -> Fingerprint -> Fingerprint # |
:: Text | Where are these fingerprints coming from? Just used in error output to help debugging. |
-> Text | The raw fingerprint file. See |
-> 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"}
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 #
:: Text | A newline-separated file of SSH host keys. See the output of
|
-> 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.
FingerprintsMatch | |
FingerprintsNoMatch | |
FingerprintsMatchErr Text | There was some error when comparing the two sets of fingerprints. |
Instances
Show FingerprintsMatch Source # | |
Defined in Cloudy.Cmd.Scaleway.Create showsPrec :: Int -> FingerprintsMatch -> ShowS # show :: FingerprintsMatch -> String # showList :: [FingerprintsMatch] -> ShowS # |
removeOldHostKeysFromKnownHosts Source #
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 #
:: Text | A set of SSH host keys. See the output of |
-> 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)