propellor spin
This commit is contained in:
parent
fdde4d91c7
commit
0b9164e286
|
@ -74,7 +74,7 @@ updateServer target relay hst connect = connect go
|
||||||
sendRepoUrl toh
|
sendRepoUrl toh
|
||||||
loop
|
loop
|
||||||
(Just NeedPrivData) -> do
|
(Just NeedPrivData) -> do
|
||||||
sendPrivData hn hst toh
|
sendPrivData hn hst toh relay
|
||||||
loop
|
loop
|
||||||
(Just NeedGitPush) -> do
|
(Just NeedGitPush) -> do
|
||||||
sendGitUpdate hn fromh toh
|
sendGitUpdate hn fromh toh
|
||||||
|
@ -96,12 +96,21 @@ updateServer target relay hst connect = connect go
|
||||||
sendRepoUrl :: Handle -> IO ()
|
sendRepoUrl :: Handle -> IO ()
|
||||||
sendRepoUrl toh = sendMarked toh repoUrlMarker =<< (fromMaybe "" <$> getRepoUrl)
|
sendRepoUrl toh = sendMarked toh repoUrlMarker =<< (fromMaybe "" <$> getRepoUrl)
|
||||||
|
|
||||||
sendPrivData :: HostName -> Host -> Handle -> IO ()
|
sendPrivData :: HostName -> Host -> Handle -> Maybe HostName -> IO ()
|
||||||
sendPrivData hn hst toh = do
|
sendPrivData hn hst toh target = do
|
||||||
privdata <- show . filterPrivData hst <$> decryptPrivData
|
privdata <- getdata
|
||||||
void $ actionMessage ("Sending privdata (" ++ show (length privdata) ++ " bytes) to " ++ hn) $ do
|
void $ actionMessage ("Sending privdata (" ++ show (length privdata) ++ " bytes) to " ++ hn) $ do
|
||||||
sendMarked toh privDataMarker privdata
|
sendMarked toh privDataMarker privdata
|
||||||
return True
|
return True
|
||||||
|
where
|
||||||
|
getdata
|
||||||
|
| isNothing target =
|
||||||
|
show . filterPrivData hst <$> decryptPrivData
|
||||||
|
| otherwise = do
|
||||||
|
let f = privDataRelay hn
|
||||||
|
d <- readFileStrictAnyEncoding f
|
||||||
|
nukeFile f
|
||||||
|
return d
|
||||||
|
|
||||||
sendGitUpdate :: HostName -> Handle -> Handle -> IO ()
|
sendGitUpdate :: HostName -> Handle -> Handle -> IO ()
|
||||||
sendGitUpdate hn fromh toh =
|
sendGitUpdate hn fromh toh =
|
||||||
|
|
Loading…
Reference in New Issue