Skip to content

Commit d0d5461

Browse files
committed
Remove SSH server
Closes #1502
1 parent 8608ae2 commit d0d5461

File tree

7 files changed

+1
-473
lines changed

7 files changed

+1
-473
lines changed

src/node/cli.ts

-5
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,6 @@ export interface Args extends VsArgs {
3131
readonly open?: boolean
3232
readonly port?: number
3333
readonly socket?: string
34-
readonly "ssh-host-key"?: string
35-
readonly "disable-ssh"?: boolean
3634
readonly version?: boolean
3735
readonly force?: boolean
3836
readonly "list-extensions"?: boolean
@@ -99,9 +97,6 @@ const options: Options<Required<Args>> = {
9997
version: { type: "boolean", short: "v", description: "Display version information." },
10098
_: { type: "string[]" },
10199

102-
"disable-ssh": { type: "boolean", description: "Disable the SSH server." },
103-
"ssh-host-key": { type: "string", path: true, description: "SSH server host key." },
104-
105100
"user-data-dir": { type: "string", path: true, description: "Path to the user data directory." },
106101
"extensions-dir": { type: "string", path: true, description: "Path to the extensions directory." },
107102
"builtin-extensions-dir": { type: "string", path: true },

src/node/entry.ts

+1-28
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,7 @@ import { UpdateHttpProvider } from "./app/update"
1111
import { VscodeHttpProvider } from "./app/vscode"
1212
import { Args, optionDescriptions, parse } from "./cli"
1313
import { AuthType, HttpServer, HttpServerOptions } from "./http"
14-
import { SshProvider } from "./ssh/server"
15-
import { generateCertificate, generatePassword, generateSshHostKey, hash, open } from "./util"
14+
import { generateCertificate, generatePassword, hash, open } from "./util"
1615
import { ipcMain, wrap } from "./wrapper"
1716

1817
process.on("uncaughtException", (error) => {
@@ -101,32 +100,6 @@ const main = async (args: Args): Promise<void> => {
101100

102101
logger.info(`Automatic updates are ${update.enabled ? "enabled" : "disabled"}`)
103102

104-
let sshHostKey = args["ssh-host-key"]
105-
if (!args["disable-ssh"] && !sshHostKey) {
106-
try {
107-
sshHostKey = await generateSshHostKey()
108-
} catch (error) {
109-
logger.error("Unable to start SSH server", field("error", error.message))
110-
}
111-
}
112-
113-
let sshPort: number | undefined
114-
if (!args["disable-ssh"] && sshHostKey) {
115-
const sshProvider = httpServer.registerHttpProvider("/ssh", SshProvider, sshHostKey)
116-
try {
117-
sshPort = await sshProvider.listen()
118-
} catch (error) {
119-
logger.warn(`SSH server: ${error.message}`)
120-
}
121-
}
122-
123-
if (typeof sshPort !== "undefined") {
124-
logger.info(`SSH server listening on localhost:${sshPort}`)
125-
logger.info(" - To disable use `--disable-ssh`")
126-
} else {
127-
logger.info("SSH server disabled")
128-
}
129-
130103
if (serverAddress && !options.socket && args.open) {
131104
// The web socket doesn't seem to work if browsing with 0.0.0.0.
132105
const openAddress = serverAddress.replace(/:\/\/0.0.0.0/, "://localhost")

src/node/ssh/server.ts

-110
This file was deleted.

src/node/ssh/sftp.ts

-201
This file was deleted.

0 commit comments

Comments
 (0)