summaryrefslogtreecommitdiff
path: root/CmdLine
diff options
context:
space:
mode:
authorGravatar Joey Hess <joeyh@joeyh.name>2016-11-30 15:26:16 -0400
committerGravatar Joey Hess <joeyh@joeyh.name>2016-11-30 15:26:55 -0400
commitdeca4cd90ad599f859fc9efafe509ed7375c6f39 (patch)
treeb0b9ea6af4bbc1228deb8f444fe23049728be97a /CmdLine
parentf14c412232808399c609e0dd484b8243af7daa3a (diff)
use P2P auth for git-remote-tor-annex
This changes the environment variable name to the more generic GIT_ANNEX_P2P_AUTHTOKEN. This commit was sponsored by andrea rota.
Diffstat (limited to 'CmdLine')
-rw-r--r--CmdLine/GitRemoteTorAnnex.hs6
1 files changed, 4 insertions, 2 deletions
diff --git a/CmdLine/GitRemoteTorAnnex.hs b/CmdLine/GitRemoteTorAnnex.hs
index 3b2dcc050..ea4532ae6 100644
--- a/CmdLine/GitRemoteTorAnnex.hs
+++ b/CmdLine/GitRemoteTorAnnex.hs
@@ -16,6 +16,8 @@ import Remote.Helper.Tor
import Utility.Tor
import Utility.AuthToken
import Annex.UUID
+import P2P.Address
+import P2P.Auth
run :: [String] -> IO ()
run (_remotename:address:[]) = forever $ do
@@ -54,7 +56,7 @@ connectService address port service = do
state <- Annex.new =<< Git.CurrentRepo.get
Annex.eval state $ do
authtoken <- fromMaybe nullAuthToken
- <$> getTorAuthTokenFor address
+ <$> loadP2PRemoteAuthToken (TorAnnex address port)
myuuid <- getUUID
g <- Annex.gitRepo
h <- liftIO $ torHandle =<< connectHiddenService address port
@@ -62,4 +64,4 @@ connectService address port service = do
v <- auth myuuid authtoken
case v of
Just _theiruuid -> connect service stdin stdout
- Nothing -> giveup $ "authentication failed, perhaps you need to set " ++ torAuthTokenEnv
+ Nothing -> giveup $ "authentication failed, perhaps you need to set " ++ p2pAuthTokenEnv