diff options
author | Joey Hess <joeyh@joeyh.name> | 2016-12-30 12:31:17 -0400 |
---|---|---|
committer | Joey Hess <joeyh@joeyh.name> | 2016-12-30 12:31:17 -0400 |
commit | c532deba4a8020a8e777eaa6e205133c8c169c4a (patch) | |
tree | 610568e8eb5fb5661a5c2638d309d1fa13aff746 /P2P | |
parent | 7cea120676d0315d8cf318f54aa64bfa621e0d5a (diff) |
refactor
Diffstat (limited to 'P2P')
-rw-r--r-- | P2P/Annex.hs | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/P2P/Annex.hs b/P2P/Annex.hs index 9971762f5..b7372fd4d 100644 --- a/P2P/Annex.hs +++ b/P2P/Annex.hs @@ -5,25 +5,32 @@ - Licensed under the GNU GPL version 3 or higher. -} -{-# LANGUAGE RankNTypes, FlexibleContexts #-} +{-# LANGUAGE RankNTypes, FlexibleContexts, CPP #-} module P2P.Annex ( RunMode(..) , P2PConnection(..) , runFullProto + , torSocketFile ) where import Annex.Common import Annex.Content import Annex.Transfer import Annex.ChangedRefs +import P2P.Address import P2P.Protocol import P2P.IO import Logs.Location import Types.NumCopies import Utility.Metered +import Utility.Tor +import Annex.UUID import Control.Monad.Free +#ifndef mingw32_HOST_OS +import System.Posix.User +#endif data RunMode = Serving UUID (Maybe ChangedRefsHandle) @@ -152,3 +159,10 @@ runLocal runmode runner a = case a of liftIO $ hSeek h AbsoluteSeek o b <- liftIO $ hGetContentsMetered h p' runner (sender b) + +torSocketFile :: Annex (Maybe FilePath) +torSocketFile = do + u <- getUUID + uid <- liftIO getRealUserID + let ident = fromUUID u + liftIO $ getHiddenServiceSocketFile torAppName uid ident |