From 4c86cf524c7a6161af3c9fbb56f61c3cb6305fef Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Wed, 18 Sep 2013 15:30:53 -0400 Subject: webapp: support adding existing gcrypt special remotes from removable drives When adding a removable drive, it's now detected if the drive contains a gcrypt special remote, and that's all handled nicely. This includes fetching the git-annex branch from the gcrypt repo in order to find out how to set up the special remote. Note that gcrypt repos that are not git-annex special remotes are not supported. It will attempt to detect such a gcrypt repo and refuse to use it. (But this is hard to do any may fail; see https://github.com/blake2-ppc/git-remote-gcrypt/issues/6) The problem with supporting regular gcrypt repos is that we don't know what the gcrypt.participants setting is intended to be for the repo. So even if we can decrypt it, if we push changes to it they might not be visible to other participants. Anyway, encrypted sneakernet (or mailnet) is now fully possible with the git-annex assistant! Assuming that the gpg key distribution is handled somehow, which the assistant doesn't yet help with. This commit was sponsored by Navishkar Rao. --- Assistant/DeleteRemote.hs | 13 ++----------- Assistant/MakeRemote.hs | 2 -- 2 files changed, 2 insertions(+), 13 deletions(-) (limited to 'Assistant') diff --git a/Assistant/DeleteRemote.hs b/Assistant/DeleteRemote.hs index 2e06d52cd..6a77eedc6 100644 --- a/Assistant/DeleteRemote.hs +++ b/Assistant/DeleteRemote.hs @@ -17,8 +17,7 @@ import Logs.Location import Assistant.DaemonStatus import qualified Remote import Remote.List -import qualified Git.Command -import qualified Git.BuildVersion +import qualified Git.Remote import Logs.Trust import qualified Annex @@ -35,15 +34,7 @@ disableRemote uuid = do remote <- fromMaybe (error "unknown remote") <$> liftAnnex (Remote.remoteFromUUID uuid) liftAnnex $ do - inRepo $ Git.Command.run - [ Param "remote" - -- name of this subcommand changed - , Param $ - if Git.BuildVersion.older "1.8.0" - then "rm" - else "remove" - , Param (Remote.name remote) - ] + inRepo $ Git.Remote.remove (Remote.name remote) void $ remoteListRefresh updateSyncRemotes return remote diff --git a/Assistant/MakeRemote.hs b/Assistant/MakeRemote.hs index fa662babd..4b0a4c7d9 100644 --- a/Assistant/MakeRemote.hs +++ b/Assistant/MakeRemote.hs @@ -27,8 +27,6 @@ import Creds import qualified Data.Text as T import qualified Data.Map as M -type RemoteName = String - {- Sets up and begins syncing with a new ssh or rsync remote. -} makeSshRemote :: Bool -> SshData -> Maybe Cost -> Assistant Remote makeSshRemote forcersync sshdata mcost = do -- cgit v1.2.3