diff --git a/src/applications/diffusion/config/PhabricatorDiffusionConfigOptions.php b/src/applications/diffusion/config/PhabricatorDiffusionConfigOptions.php index 477836fdb6..40821e3f89 100644 --- a/src/applications/diffusion/config/PhabricatorDiffusionConfigOptions.php +++ b/src/applications/diffusion/config/PhabricatorDiffusionConfigOptions.php @@ -109,6 +109,13 @@ final class PhabricatorDiffusionConfigOptions 'When constructing clone URIs to show to users, Diffusion will '. '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) + ->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.')), ); } diff --git a/src/applications/diffusion/controller/DiffusionRepositoryController.php b/src/applications/diffusion/controller/DiffusionRepositoryController.php index 4d51da9c60..b415e22f81 100644 --- a/src/applications/diffusion/controller/DiffusionRepositoryController.php +++ b/src/applications/diffusion/controller/DiffusionRepositoryController.php @@ -185,11 +185,7 @@ final class DiffusionRepositoryController extends DiffusionController { $uri->setUser($ssh_user); } - // This isn't quite right, but for now it's probably better to drop - // the port than sometimes show ":8080", etc. Using most VCS commands - // against nonstandard ports is a huge pain so few installs are likely - // to configure SSH on a nonstandard port. - $uri->setPort(null); + $uri->setPort(PhabricatorEnv::getEnvConfig('diffusion.ssh-port')); $clone_uri = $this->renderCloneURI( $uri,