From 219cad17838b3a13c32b6aae2995d72b87e8db15 Mon Sep 17 00:00:00 2001 From: Joe Previte Date: Wed, 3 Nov 2021 14:42:14 -0700 Subject: [PATCH] Revert "Add linkup command to improve link functionality" (#4439) This reverts commit 2504f6fce475ee353c1b494c1506ece4e395babc. --- .gitignore | 1 - ci/build/build-code-server.sh | 9 --------- ci/build/build-release.sh | 1 - ci/build/npm-postinstall.sh | 6 ------ src/node/link.ts | 16 ---------------- src/node/main.ts | 18 +----------------- 6 files changed, 1 insertion(+), 50 deletions(-) delete mode 100644 src/node/link.ts diff --git a/.gitignore b/.gitignore index 8f02ff03..3cc6e31d 100644 --- a/.gitignore +++ b/.gitignore @@ -12,7 +12,6 @@ vendor/modules node-* /plugins /lib/coder-cloud-agent -/lib/linkup .home coverage **/.DS_Store diff --git a/ci/build/build-code-server.sh b/ci/build/build-code-server.sh index 2b834f96..99f0df69 100755 --- a/ci/build/build-code-server.sh +++ b/ci/build/build-code-server.sh @@ -30,15 +30,6 @@ main() { chmod +x ./lib/coder-cloud-agent set -e fi - - if ! [ -f ./lib/linkup ]; then - echo "Downloading Link agent..." - - set +e - curl -fsSL "https://storage.googleapis.com/coder-link-releases/latest/linkup-$OS-$ARCH" -o ./lib/linkup - chmod +x ./lib/linkup - set -e - fi } main "$@" diff --git a/ci/build/build-release.sh b/ci/build/build-release.sh index 263b8c3b..1981215a 100755 --- a/ci/build/build-release.sh +++ b/ci/build/build-release.sh @@ -61,7 +61,6 @@ EOF rsync node_modules/ "$RELEASE_PATH/node_modules" mkdir -p "$RELEASE_PATH/lib" rsync ./lib/coder-cloud-agent "$RELEASE_PATH/lib" - rsync ./lib/linkup "$RELEASE_PATH/lib" fi } diff --git a/ci/build/npm-postinstall.sh b/ci/build/npm-postinstall.sh index 99b897ec..0722f4c6 100755 --- a/ci/build/npm-postinstall.sh +++ b/ci/build/npm-postinstall.sh @@ -66,12 +66,6 @@ main() { echo "Failed to download cloud agent; --link will not work" fi - if curl -fsSL "https://storage.googleapis.com/coder-link-releases/latest/linkup-$OS-$ARCH" -o ./lib/linkup; then - chmod +x ./lib/linkup - else - echo "Failed to download Link agent; the Link extension will not work" - fi - if ! vscode_yarn; then echo "You may not have the required dependencies to build the native modules." echo "Please see https://github.com/cdr/code-server/blob/master/docs/npm.md" diff --git a/src/node/link.ts b/src/node/link.ts deleted file mode 100644 index 8c21210f..00000000 --- a/src/node/link.ts +++ /dev/null @@ -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, - }) -} diff --git a/src/node/main.ts b/src/node/main.ts index 9235218f..698f3e1a 100644 --- a/src/node/main.ts +++ b/src/node/main.ts @@ -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() },