sameas RemoteConfig inheritance
I found a way to avoid inheritance complicating anything outside of Logs.Remote. It seems fine to require all inherited values to be inherited and not set in the sameas remote's config. Since inherited values will be used for stuff like encryption and perhaps chunking, which control the actual content stored on the remote, it seems likely that there will not be any reason to need them to vary between two remotes that access the same underlying data store. The newer version of containers is free; the minimum ghc version is bundled with a newer version than that.
This commit is contained in:
parent
59908586f4
commit
c3975ff3b4
8 changed files with 54 additions and 14 deletions
|
@ -10,6 +10,7 @@ module Assistant.Gpg where
|
|||
import Utility.Gpg
|
||||
import Utility.UserInfo
|
||||
import Types.Remote (RemoteConfigField)
|
||||
import Annex.SpecialRemote.Config
|
||||
|
||||
import qualified Data.Map as M
|
||||
import Control.Applicative
|
||||
|
@ -31,6 +32,6 @@ data EnableEncryption = HybridEncryption | SharedEncryption | NoEncryption
|
|||
|
||||
{- Generates Remote configuration for encryption. -}
|
||||
configureEncryption :: EnableEncryption -> (RemoteConfigField, String)
|
||||
configureEncryption SharedEncryption = ("encryption", "shared")
|
||||
configureEncryption NoEncryption = ("encryption", "none")
|
||||
configureEncryption HybridEncryption = ("encryption", "hybrid")
|
||||
configureEncryption SharedEncryption = (encryptionField, "shared")
|
||||
configureEncryption NoEncryption = (encryptionField, "none")
|
||||
configureEncryption HybridEncryption = (encryptionField, "hybrid")
|
||||
|
|
|
@ -18,6 +18,7 @@ import qualified Git
|
|||
import qualified Git.Command
|
||||
import qualified Annex
|
||||
import qualified Annex.SpecialRemote
|
||||
import Annex.SpecialRemote.Config
|
||||
import Logs.UUID
|
||||
import Logs.Remote
|
||||
import Git.Remote
|
||||
|
@ -55,7 +56,7 @@ makeRsyncRemote name location = makeRemote name location $ const $ void $
|
|||
go (Just (u, c)) = setupSpecialRemote name Rsync.remote config Nothing
|
||||
(Just u, R.Enable c, c)
|
||||
config = M.fromList
|
||||
[ ("encryption", "shared")
|
||||
[ (encryptionField, "shared")
|
||||
, ("rsyncurl", location)
|
||||
, ("type", "rsync")
|
||||
]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue