Skip to content

Commit 02b174c

Browse files
author
epriestley
committedFeb 18, 2015
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
1 parent 0b2697b commit 02b174c

File tree

3 files changed

+17
-0
lines changed

3 files changed

+17
-0
lines changed
 

‎scripts/ssh/ssh-exec.php

+1
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
EOSYNOPSIS
2020
);
2121

22+
$args->parseStandardArguments();
2223
$args->parse(
2324
array(
2425
array(

‎src/applications/diffusion/config/PhabricatorDiffusionConfigOptions.php

+11
Original file line numberDiff line numberDiff line change
@@ -113,19 +113,30 @@ public function getOptions() {
113113
"Consider using SSH for authenticated access to repositories ".
114114
"instead of HTTP.")),
115115
$this->newOption('diffusion.ssh-user', 'string', null)
116+
->setLocked(true)
116117
->setSummary(pht('Login username for SSH connections to repositories.'))
117118
->setDescription(
118119
pht(
119120
'When constructing clone URIs to show to users, Diffusion will '.
120121
'fill in this login username. If you have configured a VCS user '.
121122
'like `git`, you should provide it here.')),
122123
$this->newOption('diffusion.ssh-port', 'int', null)
124+
->setLocked(true)
123125
->setSummary(pht('Port for SSH connections to repositories.'))
124126
->setDescription(
125127
pht(
126128
'When constructing clone URIs to show to users, Diffusion by '.
127129
'default will not display a port assuming the default for your '.
128130
'VCS. Explicitly declare when running on a non-standard port.')),
131+
$this->newOption('diffusion.ssh-host', 'string', null)
132+
->setLocked(true)
133+
->setSummary(pht('Host for SSH connections to repositories.'))
134+
->setDescription(
135+
pht(
136+
'If you accept Phabricator SSH traffic on a different host '.
137+
'from web traffic (for example, if you use different SSH and '.
138+
'web load balancers), you can set the SSH hostname here. This '.
139+
'is an advanced option.')),
129140
);
130141
}
131142

‎src/applications/repository/storage/PhabricatorRepository.php

+5
Original file line numberDiff line numberDiff line change
@@ -1006,6 +1006,11 @@ public function getSSHCloneURIObject() {
10061006
$uri->setUser($ssh_user);
10071007
}
10081008

1009+
$ssh_host = PhabricatorEnv::getEnvConfig('diffusion.ssh-host');
1010+
if (strlen($ssh_host)) {
1011+
$uri->setDomain($ssh_host);
1012+
}
1013+
10091014
$uri->setPort(PhabricatorEnv::getEnvConfig('diffusion.ssh-port'));
10101015

10111016
return $uri;

0 commit comments

Comments
 (0)
Failed to load comments.