Allow setting up a gcrypt special remote with encryption=shared
It was documented to work, but seems it has been broken for a while/forever.
This commit is contained in:
parent
c527ae5887
commit
8401b09e32
2 changed files with 12 additions and 9 deletions
|
@ -3,6 +3,7 @@ git-annex (7.20190731) UNRELEASED; urgency=medium
|
||||||
* Use the same optimisation for --in=here as has always been
|
* Use the same optimisation for --in=here as has always been
|
||||||
used for --in=. rather than the slow code path that unncessarily
|
used for --in=. rather than the slow code path that unncessarily
|
||||||
queries the git-annex branch.
|
queries the git-annex branch.
|
||||||
|
* Allow setting up a gcrypt special remote with encryption=shared.
|
||||||
|
|
||||||
-- Joey Hess <id@joeyh.name> Thu, 01 Aug 2019 00:11:56 -0400
|
-- Joey Hess <id@joeyh.name> Thu, 01 Aug 2019 00:11:56 -0400
|
||||||
|
|
||||||
|
|
|
@ -318,16 +318,18 @@ shellOrRsync r ashell arsync
|
||||||
setGcryptEncryption :: RemoteConfig -> String -> Annex ()
|
setGcryptEncryption :: RemoteConfig -> String -> Annex ()
|
||||||
setGcryptEncryption c remotename = do
|
setGcryptEncryption c remotename = do
|
||||||
let participants = remoteconfig Git.GCrypt.remoteParticipantConfigKey
|
let participants = remoteconfig Git.GCrypt.remoteParticipantConfigKey
|
||||||
case cipherKeyIds =<< extractCipher c of
|
case extractCipher c of
|
||||||
Nothing -> noCrypto
|
Nothing -> noCrypto
|
||||||
Just (KeyIds { keyIds = ks}) -> do
|
Just cip -> case cipherKeyIds cip of
|
||||||
setConfig participants (unwords ks)
|
Nothing -> noop
|
||||||
let signingkey = ConfigKey $ Git.GCrypt.remoteSigningKey remotename
|
Just (KeyIds { keyIds = ks}) -> do
|
||||||
cmd <- gpgCmd <$> Annex.getGitConfig
|
setConfig participants (unwords ks)
|
||||||
skeys <- M.keys <$> liftIO (secretKeys cmd)
|
let signingkey = ConfigKey $ Git.GCrypt.remoteSigningKey remotename
|
||||||
case filter (`elem` ks) skeys of
|
cmd <- gpgCmd <$> Annex.getGitConfig
|
||||||
[] -> noop
|
skeys <- M.keys <$> liftIO (secretKeys cmd)
|
||||||
(k:_) -> setConfig signingkey k
|
case filter (`elem` ks) skeys of
|
||||||
|
[] -> noop
|
||||||
|
(k:_) -> setConfig signingkey k
|
||||||
setConfig (remoteconfig Git.GCrypt.remotePublishParticipantConfigKey)
|
setConfig (remoteconfig Git.GCrypt.remotePublishParticipantConfigKey)
|
||||||
(Git.Config.boolConfig True)
|
(Git.Config.boolConfig True)
|
||||||
where
|
where
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue