summaryrefslogtreecommitdiff
path: root/Assistant/Ssh.hs
diff options
context:
space:
mode:
authorGravatar Joey Hess <joey@kitenet.net>2013-09-29 14:39:10 -0400
committerGravatar Joey Hess <joey@kitenet.net>2013-09-29 15:14:09 -0400
commit80333594c4c06839af4fe109e2dac8a7481adea3 (patch)
treea7066872782c6957c2b76b4d598178c9c7c9d6b7 /Assistant/Ssh.hs
parent209f178e8c481a3ccab1ebe2e59b1412652b3906 (diff)
UI for making encrypted ssh remotes with gcrypt
Improved probing the remote server, so it gathers a list of the capabilities it has. From that list, we can determine which types of remotes are supported, and display an appropriate UI. The new buttons for making gcrypt repos don't work yet, but the old buttons for unencrypted git repo and encrypted rsync repo have been adapted to the new data types and are working. This commit was sponsored by David Schmitt.
Diffstat (limited to 'Assistant/Ssh.hs')
-rw-r--r--Assistant/Ssh.hs8
1 files changed, 7 insertions, 1 deletions
diff --git a/Assistant/Ssh.hs b/Assistant/Ssh.hs
index a62319096..9df9b64b9 100644
--- a/Assistant/Ssh.hs
+++ b/Assistant/Ssh.hs
@@ -25,10 +25,16 @@ data SshData = SshData
, sshRepoName :: String
, sshPort :: Int
, needsPubKey :: Bool
- , rsyncOnly :: Bool
+ , sshCapabilities :: [SshServerCapability]
}
deriving (Read, Show, Eq)
+data SshServerCapability = GitAnnexShellCapable | GitCapable | RsyncCapable
+ deriving (Read, Show, Eq)
+
+hasCapability :: SshData -> SshServerCapability -> Bool
+hasCapability d c = c `elem` sshCapabilities d
+
data SshKeyPair = SshKeyPair
{ sshPubKey :: String
, sshPrivKey :: String