mirror of
				https://github.com/easingthemes/ssh-deploy.git
				synced 2025-10-30 23:30:09 +08:00 
			
		
		
		
	Merge pull request #116 from Cascade-Lab/sb-fix-host-scan-port
Use custom port for host scan
This commit is contained in:
		
						commit
						d5e1f75798
					
				
							
								
								
									
										2
									
								
								dist/index.js
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										2
									
								
								dist/index.js
									
									
									
									
										vendored
									
									
								
							
										
											
												File diff suppressed because one or more lines are too long
											
										
									
								
							
							
								
								
									
										1979
									
								
								package-lock.json
									
									
									
										generated
									
									
									
								
							
							
						
						
									
										1979
									
								
								package-lock.json
									
									
									
										generated
									
									
									
								
							
										
											
												File diff suppressed because it is too large
												Load Diff
											
										
									
								
							| @ -20,7 +20,7 @@ const run = async () => { | |||||||
|   const { path: privateKeyPath } = getPrivateKeyPath(deployKeyName); |   const { path: privateKeyPath } = getPrivateKeyPath(deployKeyName); | ||||||
|   // Update known hosts if ssh command is present to avoid prompt
 |   // Update known hosts if ssh command is present to avoid prompt
 | ||||||
|   if (scriptBefore || scriptAfter) { |   if (scriptBefore || scriptAfter) { | ||||||
|     updateKnownHosts(remoteHost); |     updateKnownHosts(remoteHost, remotePort); | ||||||
|   } |   } | ||||||
|   // Check Script before
 |   // Check Script before
 | ||||||
|   if (scriptBefore) { |   if (scriptBefore) { | ||||||
|  | |||||||
| @ -23,11 +23,11 @@ const addSshKey = (content, deployKeyName) => { | |||||||
|   console.log('✅ [SSH] key added to `.ssh` dir ', dir, filename); |   console.log('✅ [SSH] key added to `.ssh` dir ', dir, filename); | ||||||
| }; | }; | ||||||
| 
 | 
 | ||||||
| const updateKnownHosts = (host) => { | const updateKnownHosts = (host, remotePort) => { | ||||||
|   const { knownHostsPath } = getPrivateKeyPath(); |   const { knownHostsPath } = getPrivateKeyPath(); | ||||||
|   console.log('[SSH] Adding host to `known_hosts` ....', host, knownHostsPath); |   console.log('[SSH] Adding host to `known_hosts` ....', host, knownHostsPath); | ||||||
|   try { |   try { | ||||||
|     execSync(`ssh-keyscan -H ${host}  >> ${knownHostsPath}`, { |     execSync(`ssh-keyscan -p ${(remotePort || 22)} -H ${host}  >> ${knownHostsPath}`, { | ||||||
|       stdio: 'inherit' |       stdio: 'inherit' | ||||||
|     }); |     }); | ||||||
|   } catch (error) { |   } catch (error) { | ||||||
|  | |||||||
		Loading…
	
		Reference in New Issue
	
	Block a user
	 Dragan Filipović
						Dragan Filipović