Revert "Add linkup command to improve link functionality" (#4439)
This reverts commit 2504f6fce4
.
This commit is contained in:
@ -1,16 +0,0 @@
|
||||
import { logger } from "@coder/logger"
|
||||
import { ChildProcessWithoutNullStreams, spawn } from "child_process"
|
||||
import path from "path"
|
||||
|
||||
export function startLink(address: URL | string): ChildProcessWithoutNullStreams {
|
||||
if (typeof address === "string") {
|
||||
throw new Error("Cannot link socket paths")
|
||||
}
|
||||
|
||||
const port = parseInt(address.port, 10)
|
||||
logger.debug(`running link targeting ${port}`)
|
||||
|
||||
return spawn(path.resolve(__dirname, "../../lib/linkup"), ["--devurl", `code:${port}:code-server`], {
|
||||
shell: false,
|
||||
})
|
||||
}
|
@ -1,14 +1,12 @@
|
||||
import { field, logger } from "@coder/logger"
|
||||
import { ChildProcessWithoutNullStreams } from "child_process"
|
||||
import http from "http"
|
||||
import path from "path"
|
||||
import { Disposable } from "../common/emitter"
|
||||
import { plural, logError } from "../common/util"
|
||||
import { plural } from "../common/util"
|
||||
import { createApp, ensureAddress } from "./app"
|
||||
import { AuthType, DefaultedArgs, Feature } from "./cli"
|
||||
import { coderCloudBind } from "./coder_cloud"
|
||||
import { commit, version, vsRootPath } from "./constants"
|
||||
import { startLink } from "./link"
|
||||
import { register } from "./routes"
|
||||
import { humanPath, isFile, loadAMDModule, open } from "./util"
|
||||
|
||||
@ -156,19 +154,6 @@ export const runCodeServer = async (
|
||||
logger.info(" - Connected to cloud agent")
|
||||
}
|
||||
|
||||
let linkAgent: undefined | ChildProcessWithoutNullStreams
|
||||
try {
|
||||
linkAgent = startLink(serverAddress)
|
||||
linkAgent.on("error", (error) => {
|
||||
logError(logger, "link daemon", error)
|
||||
})
|
||||
linkAgent.on("close", (code) => {
|
||||
logger.debug("link daemon closed", field("code", code))
|
||||
})
|
||||
} catch (error) {
|
||||
logError(logger, "link daemon", error)
|
||||
}
|
||||
|
||||
if (args.enable && args.enable.length > 0) {
|
||||
logger.info("Enabling the following experimental features:")
|
||||
args.enable.forEach((feature) => {
|
||||
@ -196,7 +181,6 @@ export const runCodeServer = async (
|
||||
return {
|
||||
server: app.server,
|
||||
dispose: async () => {
|
||||
linkAgent?.kill()
|
||||
disposeRoutes()
|
||||
await app.dispose()
|
||||
},
|
||||
|
Reference in New Issue
Block a user