From 834079f76689af1e1c7af51c93bff5d3d1a29f15 Mon Sep 17 00:00:00 2001 From: epriestley Date: Wed, 28 Jan 2015 10:17:40 -0800 Subject: [PATCH] Pass cluster.instance to ssh-exec if it is defined Summary: Ref T7034. This is a second special case, like commit hooks, where we need some help from Phabricator to make instance identity knowable. Test Plan: Connected to an instance and ran SSH commands. Reviewers: btrahan Reviewed By: btrahan Subscribers: epriestley Maniphest Tasks: T7034 Differential Revision: https://secure.phabricator.com/D11539 --- resources/celerity/map.php | 10 +++++----- scripts/ssh/ssh-auth.php | 12 +++++++++++- 2 files changed, 16 insertions(+), 6 deletions(-) diff --git a/resources/celerity/map.php b/resources/celerity/map.php index 7442ca2abd..3b914fbb39 100644 --- a/resources/celerity/map.php +++ b/resources/celerity/map.php @@ -7,7 +7,7 @@ */ return array( 'names' => array( - 'core.pkg.css' => '8815f87d', + 'core.pkg.css' => '04a24e98', 'core.pkg.js' => 'efa12ecc', 'darkconsole.pkg.js' => '8ab24e01', 'differential.pkg.css' => '8af45893', @@ -125,7 +125,7 @@ return array( 'rsrc/css/phui/phui-action-list.css' => '9ee9910a', 'rsrc/css/phui/phui-box.css' => '7b3a2eed', 'rsrc/css/phui/phui-button.css' => '008ba5e2', - 'rsrc/css/phui/phui-crumbs-view.css' => '646a8830', + 'rsrc/css/phui/phui-crumbs-view.css' => '3e362700', 'rsrc/css/phui/phui-document.css' => 'bbeb1890', 'rsrc/css/phui/phui-feed-story.css' => 'c9f3a0b5', 'rsrc/css/phui/phui-fontkit.css' => '9c3d2dce', @@ -137,7 +137,7 @@ return array( 'rsrc/css/phui/phui-info-panel.css' => '27ea50a1', 'rsrc/css/phui/phui-list.css' => '53deb25c', 'rsrc/css/phui/phui-object-box.css' => '0d47b3c8', - 'rsrc/css/phui/phui-object-item-list-view.css' => '2686a80e', + 'rsrc/css/phui/phui-object-item-list-view.css' => '832c58fe', 'rsrc/css/phui/phui-pinboard-view.css' => '3dd4a269', 'rsrc/css/phui/phui-property-list-view.css' => '51480060', 'rsrc/css/phui/phui-remarkup-preview.css' => '19ad512b', @@ -770,7 +770,7 @@ return array( 'phui-calendar-day-css' => 'de035c8a', 'phui-calendar-list-css' => 'c1d0ca59', 'phui-calendar-month-css' => 'a92e47d2', - 'phui-crumbs-view-css' => '646a8830', + 'phui-crumbs-view-css' => '3e362700', 'phui-document-view-css' => 'bbeb1890', 'phui-feed-story-css' => 'c9f3a0b5', 'phui-font-icon-base-css' => '3dad2ae3', @@ -783,7 +783,7 @@ return array( 'phui-info-panel-css' => '27ea50a1', 'phui-list-view-css' => '53deb25c', 'phui-object-box-css' => '0d47b3c8', - 'phui-object-item-list-view-css' => '2686a80e', + 'phui-object-item-list-view-css' => '832c58fe', 'phui-pinboard-view-css' => '3dd4a269', 'phui-property-list-view-css' => '51480060', 'phui-remarkup-preview-css' => '19ad512b', diff --git a/scripts/ssh/ssh-auth.php b/scripts/ssh/ssh-auth.php index f4f3de9e67..4e3ee7a34b 100755 --- a/scripts/ssh/ssh-auth.php +++ b/scripts/ssh/ssh-auth.php @@ -26,7 +26,17 @@ $bin = $root.'/bin/ssh-exec'; foreach ($keys as $ssh_key) { $user = $ssh_key->getObject()->getUsername(); - $cmd = csprintf('%s --phabricator-ssh-user %s', $bin, $user); + $key_argv = array(); + $key_argv[] = '--phabricator-ssh-user'; + $key_argv[] = $user; + + $cmd = csprintf('%s %Ls', $bin, $key_argv); + + $instance = PhabricatorEnv::getEnvConfig('cluster.instance'); + if (strlen($instance)) { + $cmd = csprintf('PHABRICATOR_INSTANCE=%s %C', $instance, $cmd); + } + // This is additional escaping for the SSH 'command="..."' string. $cmd = addcslashes($cmd, '"\\');