remove windows-specific rsync.net code, no longer necessary thanks to ssh password handling
Since ssh password prompting no longer happens on stdin, the authorized_keys line can be sent on stdin. Yay!
This commit is contained in:
		
					parent
					
						
							
								f41b585c29
							
						
					
				
			
			
				commit
				
					
						c705df5651
					
				
			
		
					 1 changed files with 0 additions and 20 deletions
				
			
		| 
						 | 
					@ -578,11 +578,6 @@ enableRsyncNetGCrypt sshinput reponame =
 | 
				
			||||||
 - To append the ssh key to rsync.net's authorized_keys, their
 | 
					 - To append the ssh key to rsync.net's authorized_keys, their
 | 
				
			||||||
 - documentation recommends a dd methodd, where the line is fed
 | 
					 - documentation recommends a dd methodd, where the line is fed
 | 
				
			||||||
 - in to ssh over stdin.
 | 
					 - in to ssh over stdin.
 | 
				
			||||||
 -
 | 
					 | 
				
			||||||
 - On Windows, ssh password prompting happens on stdin, so cannot
 | 
					 | 
				
			||||||
 - feed the key in that way. Instead, first rsync down any current
 | 
					 | 
				
			||||||
 - authorized_keys file, then modifiy it, and then rsync it back up.
 | 
					 | 
				
			||||||
 - This means 2 password prompts rather than one for Windows.
 | 
					 | 
				
			||||||
 -}
 | 
					 -}
 | 
				
			||||||
prepRsyncNet :: SshInput -> String -> (SshData -> Handler Html) -> Handler Html
 | 
					prepRsyncNet :: SshInput -> String -> (SshData -> Handler Html) -> Handler Html
 | 
				
			||||||
prepRsyncNet sshinput reponame a = do
 | 
					prepRsyncNet sshinput reponame a = do
 | 
				
			||||||
| 
						 | 
					@ -600,7 +595,6 @@ prepRsyncNet sshinput reponame a = do
 | 
				
			||||||
		, sshhost
 | 
							, sshhost
 | 
				
			||||||
		, cmd
 | 
							, cmd
 | 
				
			||||||
		]
 | 
							]
 | 
				
			||||||
#ifndef mingw32_HOST_OS
 | 
					 | 
				
			||||||
	{- I'd prefer to separate commands with && , but
 | 
						{- I'd prefer to separate commands with && , but
 | 
				
			||||||
	 - rsync.net's shell does not support that. -}
 | 
						 - rsync.net's shell does not support that. -}
 | 
				
			||||||
	let remotecommand = intercalate ";"
 | 
						let remotecommand = intercalate ";"
 | 
				
			||||||
| 
						 | 
					@ -610,20 +604,6 @@ prepRsyncNet sshinput reponame a = do
 | 
				
			||||||
		, "mkdir -p " ++ T.unpack (sshDirectory sshdata)
 | 
							, "mkdir -p " ++ T.unpack (sshDirectory sshdata)
 | 
				
			||||||
		]
 | 
							]
 | 
				
			||||||
	sshSetup sshinput (torsyncnet remotecommand) (Just $ sshPubKey keypair) (a sshdata)
 | 
						sshSetup sshinput (torsyncnet remotecommand) (Just $ sshPubKey keypair) (a sshdata)
 | 
				
			||||||
#else
 | 
					 | 
				
			||||||
	liftIO $ withTmpDir "rsyncnet" $ \tmpdir -> do
 | 
					 | 
				
			||||||
		createDirectory $ tmpdir </> ".ssh"
 | 
					 | 
				
			||||||
		(oldkeys, _) <- sshTranscript (torsyncnet "cat .ssh/authorized_keys") Nothing
 | 
					 | 
				
			||||||
		writeFile (tmpdir </> ".ssh" </> "authorized_keys")
 | 
					 | 
				
			||||||
			(sshPubKey keypair ++ "\n" ++ oldkeys)
 | 
					 | 
				
			||||||
		void $ rsync
 | 
					 | 
				
			||||||
			[ Param "-r"
 | 
					 | 
				
			||||||
			, File $ tmpdir </> ".ssh/"
 | 
					 | 
				
			||||||
			, Param $ sshhost ++ ":.ssh/"
 | 
					 | 
				
			||||||
			]
 | 
					 | 
				
			||||||
	let remotecommand = "mkdir -p " ++ T.unpack (sshDirectory sshdata)
 | 
					 | 
				
			||||||
	sshSetup sshinput (torsyncnet remotecommand) Nothing (a sshdata)
 | 
					 | 
				
			||||||
#endif
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
isRsyncNet :: Maybe Text -> Bool
 | 
					isRsyncNet :: Maybe Text -> Bool
 | 
				
			||||||
isRsyncNet Nothing = False
 | 
					isRsyncNet Nothing = False
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue