Skip to content

Commit af26333

Browse files
iQQBotroboquat
authored andcommitted
Use a special domain name for SSH Gateway
1 parent 7726e49 commit af26333

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

components/dashboard/src/workspaces/ConnectToSSHModal.tsx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,10 @@ interface SSHProps {
5555
}
5656

5757
function SSHView(props: SSHProps) {
58-
const sshCommand = `ssh ${props.workspaceId}#${props.ownerToken}@${props.ideUrl}`;
58+
const sshCommand = `ssh ${props.workspaceId}#${props.ownerToken}@${props.ideUrl.replace(
59+
props.workspaceId,
60+
props.workspaceId + ".ssh",
61+
)}`;
5962
return (
6063
<div className="border-t border-b border-gray-200 dark:border-gray-800 mt-2 -mx-6 px-6 py-6">
6164
<div className="mt-1 mb-4">

components/ide/jetbrains/gateway-plugin/src/main/kotlin/io/gitpod/jetbrains/gateway/GitpodConnectionProvider.kt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -217,14 +217,15 @@ class GitpodConnectionProvider : GatewayConnectionProvider {
217217
thinClientJob = launch {
218218
try {
219219
val ideUrl = URL(update.ideUrl);
220+
val sshHostUrl = URL(update.ideUrl.replace(update.workspaceId, "${update.workspaceId}.ssh"));
220221
val hostKeys = resolveHostKeys(ideUrl, connectParams)
221222
if (hostKeys.isNullOrEmpty()) {
222223
setErrorMessage("${connectParams.gitpodHost} installation does not allow SSH access, public keys cannot be found")
223224
return@launch
224225
}
225226
val ownerToken = client.server.getOwnerToken(update.workspaceId).await()
226227
val credentials =
227-
resolveCredentials(ideUrl, update.workspaceId, ownerToken, hostKeys)
228+
resolveCredentials(sshHostUrl, update.workspaceId, ownerToken, hostKeys)
228229
val joinLink = resolveJoinLink(ideUrl, ownerToken, connectParams)
229230
val connector = ClientOverSshTunnelConnector(
230231
connectionLifetime,

0 commit comments

Comments
 (0)