Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F15402149
D7854.id.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
1 KB
Referenced Files
None
Subscribers
None
D7854.id.diff
View Options
Index: scripts/ssh/ssh-exec.php
===================================================================
--- scripts/ssh/ssh-exec.php
+++ scripts/ssh/ssh-exec.php
@@ -58,11 +58,28 @@
$original_command = getenv('SSH_ORIGINAL_COMMAND');
}
+ $workflows = id(new PhutilSymbolLoader())
+ ->setAncestorClass('PhabricatorSSHWorkflow')
+ ->loadObjects();
+
+ $workflow_names = mpull($workflows, 'getName', 'getName');
+
// Now, rebuild the original command.
$original_argv = id(new PhutilShellLexer())
->splitArguments($original_command);
if (!$original_argv) {
- throw new Exception("No interactive logins.");
+ throw new Exception(
+ pht(
+ "Welcome to Phabricator.\n\n".
+ "You are logged in as %s.\n\n".
+ "You haven't specified a command to run. This means you're requesting ".
+ "an interactive shell, but Phabricator does not provide an ".
+ "interactive shell over SSH.\n\n".
+ "Usually, you should run a command like `git clone` or `hg push` ".
+ "rather than connecting directly with SSH.\n\n".
+ "Supported commands are: %s.",
+ $user->getUsername(),
+ implode(', ', $workflow_names)));
}
$ssh_log->setData(
@@ -78,15 +95,6 @@
$original_args = new PhutilArgumentParser($original_argv);
- $workflows = array(
- new ConduitSSHWorkflow(),
- new DiffusionSSHSubversionServeWorkflow(),
- new DiffusionSSHMercurialServeWorkflow(),
- new DiffusionSSHGitUploadPackWorkflow(),
- new DiffusionSSHGitReceivePackWorkflow(),
- );
-
- $workflow_names = mpull($workflows, 'getName', 'getName');
if (empty($workflow_names[$command])) {
throw new Exception("Invalid command.");
}
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Tue, Mar 18, 8:54 PM (1 w, 6 d ago)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
7506821
Default Alt Text
D7854.id.diff (1 KB)
Attached To
Mode
D7854: Provide a more helpful message if a user connects via raw SSH
Attached
Detach File
Event Timeline
Log In to Comment