Changeset View
Changeset View
Standalone View
Standalone View
src/applications/almanac/util/AlmanacKeys.php
Show First 20 Lines • Show All 51 Lines • ▼ Show 20 Lines | if (!$device) { | ||||
} | } | ||||
$cache->setKey($cache_key, $device); | $cache->setKey($cache_key, $device); | ||||
} | } | ||||
return $device; | return $device; | ||||
} | } | ||||
public static function getClusterSSHUser() { | public static function getClusterSSHUser() { | ||||
// NOTE: When instancing, we currently use the SSH username to figure out | |||||
// which instance you are connecting to. We can't use the host name because | |||||
// we have no way to tell which host you think you're reaching: the SSH | |||||
// protocol does not have a mechanism like a "Host" header. | |||||
$username = PhabricatorEnv::getEnvConfig('cluster.instance'); | |||||
if (strlen($username)) { | |||||
return $username; | |||||
} | |||||
$username = PhabricatorEnv::getEnvConfig('diffusion.ssh-user'); | $username = PhabricatorEnv::getEnvConfig('diffusion.ssh-user'); | ||||
if (strlen($username)) { | if (strlen($username)) { | ||||
return $username; | return $username; | ||||
} | } | ||||
return null; | return null; | ||||
} | } | ||||
} | } |