Proxy VCS SSH requests

Summary: Fixes T7034. Like HTTP, proxy requests to the correct host if a repository has an Almanac service host.

Test Plan: Ran VCS requests through the proxy.

Reviewers: btrahan

Reviewed By: btrahan

Subscribers: epriestley

Maniphest Tasks: T7034

Differential Revision: https://secure.phabricator.com/D11543
This commit is contained in:
epriestley
2015-01-28 14:41:24 -08:00
parent fe0ca0abf2
commit 8798083ad9
9 changed files with 289 additions and 48 deletions

View File

@@ -19,7 +19,11 @@ final class DiffusionGitReceivePackSSHWorkflow extends DiffusionGitSSHWorkflow {
// This is a write, and must have write access.
$this->requireWriteAccess();
$command = csprintf('git-receive-pack %s', $repository->getLocalPath());
if ($this->shouldProxy()) {
$command = $this->getProxyCommand();
} else {
$command = csprintf('git-receive-pack %s', $repository->getLocalPath());
}
$command = PhabricatorDaemon::sudoCommandAsDaemonUser($command);
$future = id(new ExecFuture('%C', $command))