mirror of
https://we.phorge.it/source/phorge.git
synced 2024-11-26 00:32:42 +01:00
Allow a different SSH host to be set in Diffusion
Summary: Ref T6941. In the cluster (and in other reasonable setups) we've separated SSH load balancers from HTTP load balancers. In particular, ELBs will not let you load balance port 22, so this is likely a reasonable/common issue in larger clusters in AWS. Allow users to specify an alternate host for SSH traffic. Test Plan: Set host to someting different, saw it reflected in UI. Reviewers: btrahan Reviewed By: btrahan Subscribers: epriestley Maniphest Tasks: T6941 Differential Revision: https://secure.phabricator.com/D11800
This commit is contained in:
parent
0b2697bb92
commit
02b174c2af
3 changed files with 17 additions and 0 deletions
|
@ -19,6 +19,7 @@ $args->setSynopsis(<<<EOSYNOPSIS
|
|||
EOSYNOPSIS
|
||||
);
|
||||
|
||||
$args->parseStandardArguments();
|
||||
$args->parse(
|
||||
array(
|
||||
array(
|
||||
|
|
|
@ -113,6 +113,7 @@ final class PhabricatorDiffusionConfigOptions
|
|||
"Consider using SSH for authenticated access to repositories ".
|
||||
"instead of HTTP.")),
|
||||
$this->newOption('diffusion.ssh-user', 'string', null)
|
||||
->setLocked(true)
|
||||
->setSummary(pht('Login username for SSH connections to repositories.'))
|
||||
->setDescription(
|
||||
pht(
|
||||
|
@ -120,12 +121,22 @@ final class PhabricatorDiffusionConfigOptions
|
|||
'fill in this login username. If you have configured a VCS user '.
|
||||
'like `git`, you should provide it here.')),
|
||||
$this->newOption('diffusion.ssh-port', 'int', null)
|
||||
->setLocked(true)
|
||||
->setSummary(pht('Port for SSH connections to repositories.'))
|
||||
->setDescription(
|
||||
pht(
|
||||
'When constructing clone URIs to show to users, Diffusion by '.
|
||||
'default will not display a port assuming the default for your '.
|
||||
'VCS. Explicitly declare when running on a non-standard port.')),
|
||||
$this->newOption('diffusion.ssh-host', 'string', null)
|
||||
->setLocked(true)
|
||||
->setSummary(pht('Host for SSH connections to repositories.'))
|
||||
->setDescription(
|
||||
pht(
|
||||
'If you accept Phabricator SSH traffic on a different host '.
|
||||
'from web traffic (for example, if you use different SSH and '.
|
||||
'web load balancers), you can set the SSH hostname here. This '.
|
||||
'is an advanced option.')),
|
||||
);
|
||||
}
|
||||
|
||||
|
|
|
@ -1006,6 +1006,11 @@ final class PhabricatorRepository extends PhabricatorRepositoryDAO
|
|||
$uri->setUser($ssh_user);
|
||||
}
|
||||
|
||||
$ssh_host = PhabricatorEnv::getEnvConfig('diffusion.ssh-host');
|
||||
if (strlen($ssh_host)) {
|
||||
$uri->setDomain($ssh_host);
|
||||
}
|
||||
|
||||
$uri->setPort(PhabricatorEnv::getEnvConfig('diffusion.ssh-port'));
|
||||
|
||||
return $uri;
|
||||
|
|
Loading…
Reference in a new issue