Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F14765125
D10225.id24608.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
1 KB
Referenced Files
None
Subscribers
None
D10225.id24608.diff
View Options
diff --git a/src/applications/drydock/interface/command/DrydockSSHCommandInterface.php b/src/applications/drydock/interface/command/DrydockSSHCommandInterface.php
--- a/src/applications/drydock/interface/command/DrydockSSHCommandInterface.php
+++ b/src/applications/drydock/interface/command/DrydockSSHCommandInterface.php
@@ -3,6 +3,7 @@
final class DrydockSSHCommandInterface extends DrydockCommandInterface {
private $passphraseSSHKey;
+ private $connectTimeout;
private function openCredentialsIfNotOpen() {
if ($this->passphraseSSHKey !== null) {
@@ -25,6 +26,11 @@
PhabricatorUser::getOmnipotentUser());
}
+ public function setConnectTimeout($timeout) {
+ $this->connectTimeout = $timeout;
+ return $this;
+ }
+
public function getExecFuture($command) {
$this->openCredentialsIfNotOpen();
@@ -44,8 +50,19 @@
$full_command = 'C:\\Windows\\system32\\cmd.exe /C '.$full_command;
}
+ $command_timeout = '';
+ if ($this->connectTimeout !== null) {
+ $command_timeout = csprintf(
+ '-o %s',
+ 'ConnectTimeout='.$this->connectTimeout);
+ }
+
return new ExecFuture(
- 'ssh -o StrictHostKeyChecking=no -p %s -i %P %P@%s -- %s',
+ 'ssh '.
+ '-o StrictHostKeyChecking=no '.
+ '-o BatchMode=yes '.
+ '%C -p %s -i %P %P@%s -- %s',
+ $command_timeout,
$this->getConfig('port'),
$this->passphraseSSHKey->getKeyfileEnvelope(),
$this->passphraseSSHKey->getUsernameEnvelope(),
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Fri, Jan 24, 3:20 PM (17 h, 44 m)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
7041145
Default Alt Text
D10225.id24608.diff (1 KB)
Attached To
Mode
D10225: Allow timeouts to be specified on Drydock SSH connections
Attached
Detach File
Event Timeline
Log In to Comment