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
This commit is contained in:
		| @@ -7,7 +7,7 @@ | |||||||
|  */ |  */ | ||||||
| return array( | return array( | ||||||
|   'names' => array( |   'names' => array( | ||||||
|     'core.pkg.css' => '8815f87d', |     'core.pkg.css' => '04a24e98', | ||||||
|     'core.pkg.js' => 'efa12ecc', |     'core.pkg.js' => 'efa12ecc', | ||||||
|     'darkconsole.pkg.js' => '8ab24e01', |     'darkconsole.pkg.js' => '8ab24e01', | ||||||
|     'differential.pkg.css' => '8af45893', |     'differential.pkg.css' => '8af45893', | ||||||
| @@ -125,7 +125,7 @@ return array( | |||||||
|     'rsrc/css/phui/phui-action-list.css' => '9ee9910a', |     'rsrc/css/phui/phui-action-list.css' => '9ee9910a', | ||||||
|     'rsrc/css/phui/phui-box.css' => '7b3a2eed', |     'rsrc/css/phui/phui-box.css' => '7b3a2eed', | ||||||
|     'rsrc/css/phui/phui-button.css' => '008ba5e2', |     '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-document.css' => 'bbeb1890', | ||||||
|     'rsrc/css/phui/phui-feed-story.css' => 'c9f3a0b5', |     'rsrc/css/phui/phui-feed-story.css' => 'c9f3a0b5', | ||||||
|     'rsrc/css/phui/phui-fontkit.css' => '9c3d2dce', |     '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-info-panel.css' => '27ea50a1', | ||||||
|     'rsrc/css/phui/phui-list.css' => '53deb25c', |     'rsrc/css/phui/phui-list.css' => '53deb25c', | ||||||
|     'rsrc/css/phui/phui-object-box.css' => '0d47b3c8', |     '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-pinboard-view.css' => '3dd4a269', | ||||||
|     'rsrc/css/phui/phui-property-list-view.css' => '51480060', |     'rsrc/css/phui/phui-property-list-view.css' => '51480060', | ||||||
|     'rsrc/css/phui/phui-remarkup-preview.css' => '19ad512b', |     'rsrc/css/phui/phui-remarkup-preview.css' => '19ad512b', | ||||||
| @@ -770,7 +770,7 @@ return array( | |||||||
|     'phui-calendar-day-css' => 'de035c8a', |     'phui-calendar-day-css' => 'de035c8a', | ||||||
|     'phui-calendar-list-css' => 'c1d0ca59', |     'phui-calendar-list-css' => 'c1d0ca59', | ||||||
|     'phui-calendar-month-css' => 'a92e47d2', |     'phui-calendar-month-css' => 'a92e47d2', | ||||||
|     'phui-crumbs-view-css' => '646a8830', |     'phui-crumbs-view-css' => '3e362700', | ||||||
|     'phui-document-view-css' => 'bbeb1890', |     'phui-document-view-css' => 'bbeb1890', | ||||||
|     'phui-feed-story-css' => 'c9f3a0b5', |     'phui-feed-story-css' => 'c9f3a0b5', | ||||||
|     'phui-font-icon-base-css' => '3dad2ae3', |     'phui-font-icon-base-css' => '3dad2ae3', | ||||||
| @@ -783,7 +783,7 @@ return array( | |||||||
|     'phui-info-panel-css' => '27ea50a1', |     'phui-info-panel-css' => '27ea50a1', | ||||||
|     'phui-list-view-css' => '53deb25c', |     'phui-list-view-css' => '53deb25c', | ||||||
|     'phui-object-box-css' => '0d47b3c8', |     '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-pinboard-view-css' => '3dd4a269', | ||||||
|     'phui-property-list-view-css' => '51480060', |     'phui-property-list-view-css' => '51480060', | ||||||
|     'phui-remarkup-preview-css' => '19ad512b', |     'phui-remarkup-preview-css' => '19ad512b', | ||||||
|   | |||||||
| @@ -26,7 +26,17 @@ $bin = $root.'/bin/ssh-exec'; | |||||||
| foreach ($keys as $ssh_key) { | foreach ($keys as $ssh_key) { | ||||||
|   $user = $ssh_key->getObject()->getUsername(); |   $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. |   // This is additional escaping for the SSH 'command="..."' string. | ||||||
|   $cmd = addcslashes($cmd, '"\\'); |   $cmd = addcslashes($cmd, '"\\'); | ||||||
|  |  | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user
	 epriestley
					epriestley