This commit is contained in:
Joey Hess 2011-04-17 00:40:23 -04:00
parent d996637fd6
commit b6b04642c8
4 changed files with 9 additions and 9 deletions

View file

@ -29,7 +29,7 @@ import Utility
import Messages import Messages
import Ssh import Ssh
import Remote.Special import Remote.Special
import Remote.Encrypted import Remote.Encryptable
import Crypto import Crypto
type BupRepo = String type BupRepo = String
@ -49,7 +49,7 @@ gen r u c = do
bupr <- liftIO $ bup2GitRemote buprepo bupr <- liftIO $ bup2GitRemote buprepo
(u', bupr') <- getBupUUID bupr u (u', bupr') <- getBupUUID bupr u
return $ encryptedRemote c return $ encryptableRemote c
(storeEncrypted r buprepo) (storeEncrypted r buprepo)
(retrieveEncrypted buprepo) (retrieveEncrypted buprepo)
Remote { Remote {

View file

@ -27,7 +27,7 @@ import Config
import Content import Content
import Utility import Utility
import Remote.Special import Remote.Special
import Remote.Encrypted import Remote.Encryptable
import Crypto import Crypto
remote :: RemoteType Annex remote :: RemoteType Annex
@ -42,7 +42,7 @@ gen :: Git.Repo -> UUID -> Maybe RemoteConfig -> Annex (Remote Annex)
gen r u c = do gen r u c = do
dir <- getConfig r "directory" (error "missing directory") dir <- getConfig r "directory" (error "missing directory")
cst <- remoteCost r cheapRemoteCost cst <- remoteCost r cheapRemoteCost
return $ encryptedRemote c return $ encryptableRemote c
(storeEncrypted dir) (storeEncrypted dir)
(retrieveEncrypted dir) (retrieveEncrypted dir)
Remote { Remote {

View file

@ -1,11 +1,11 @@
{- common functions for encrypted remotes {- common functions for encryptable remotes
- -
- Copyright 2011 Joey Hess <joey@kitenet.net> - Copyright 2011 Joey Hess <joey@kitenet.net>
- -
- Licensed under the GNU GPL version 3 or higher. - Licensed under the GNU GPL version 3 or higher.
-} -}
module Remote.Encrypted where module Remote.Encryptable where
import qualified Data.Map as M import qualified Data.Map as M
import Control.Monad.State (liftIO) import Control.Monad.State (liftIO)
@ -37,13 +37,13 @@ encryptionSetup c =
- -
- Two additional functions must be provided by the remote, - Two additional functions must be provided by the remote,
- to support storing and retrieving encrypted content. -} - to support storing and retrieving encrypted content. -}
encryptedRemote encryptableRemote
:: Maybe RemoteConfig :: Maybe RemoteConfig
-> ((Cipher, Key) -> Key -> Annex Bool) -> ((Cipher, Key) -> Key -> Annex Bool)
-> ((Cipher, Key) -> FilePath -> Annex Bool) -> ((Cipher, Key) -> FilePath -> Annex Bool)
-> Remote Annex -> Remote Annex
-> Remote Annex -> Remote Annex
encryptedRemote c storeKeyEncrypted retrieveKeyFileEncrypted r = encryptableRemote c storeKeyEncrypted retrieveKeyFileEncrypted r =
r { r {
storeKey = store, storeKey = store,
retrieveKeyFile = retrieve, retrieveKeyFile = retrieve,

View file

@ -28,7 +28,7 @@ import Messages
import Locations import Locations
import Config import Config
import Remote.Special import Remote.Special
import Remote.Encrypted import Remote.Encryptable
remote :: RemoteType Annex remote :: RemoteType Annex
remote = RemoteType { remote = RemoteType {