Revert "Add linkup command to improve link functionality" (#4439)
This reverts commit 2504f6fce4
.
This commit is contained in:
parent
dcc9cf3dd2
commit
219cad1783
|
@ -12,7 +12,6 @@ vendor/modules
|
||||||
node-*
|
node-*
|
||||||
/plugins
|
/plugins
|
||||||
/lib/coder-cloud-agent
|
/lib/coder-cloud-agent
|
||||||
/lib/linkup
|
|
||||||
.home
|
.home
|
||||||
coverage
|
coverage
|
||||||
**/.DS_Store
|
**/.DS_Store
|
||||||
|
|
|
@ -30,15 +30,6 @@ main() {
|
||||||
chmod +x ./lib/coder-cloud-agent
|
chmod +x ./lib/coder-cloud-agent
|
||||||
set -e
|
set -e
|
||||||
fi
|
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 "$@"
|
main "$@"
|
||||||
|
|
|
@ -61,7 +61,6 @@ EOF
|
||||||
rsync node_modules/ "$RELEASE_PATH/node_modules"
|
rsync node_modules/ "$RELEASE_PATH/node_modules"
|
||||||
mkdir -p "$RELEASE_PATH/lib"
|
mkdir -p "$RELEASE_PATH/lib"
|
||||||
rsync ./lib/coder-cloud-agent "$RELEASE_PATH/lib"
|
rsync ./lib/coder-cloud-agent "$RELEASE_PATH/lib"
|
||||||
rsync ./lib/linkup "$RELEASE_PATH/lib"
|
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -66,12 +66,6 @@ main() {
|
||||||
echo "Failed to download cloud agent; --link will not work"
|
echo "Failed to download cloud agent; --link will not work"
|
||||||
fi
|
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
|
if ! vscode_yarn; then
|
||||||
echo "You may not have the required dependencies to build the native modules."
|
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"
|
echo "Please see https://github.com/cdr/code-server/blob/master/docs/npm.md"
|
||||||
|
|
|
@ -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 { field, logger } from "@coder/logger"
|
||||||
import { ChildProcessWithoutNullStreams } from "child_process"
|
|
||||||
import http from "http"
|
import http from "http"
|
||||||
import path from "path"
|
import path from "path"
|
||||||
import { Disposable } from "../common/emitter"
|
import { Disposable } from "../common/emitter"
|
||||||
import { plural, logError } from "../common/util"
|
import { plural } from "../common/util"
|
||||||
import { createApp, ensureAddress } from "./app"
|
import { createApp, ensureAddress } from "./app"
|
||||||
import { AuthType, DefaultedArgs, Feature } from "./cli"
|
import { AuthType, DefaultedArgs, Feature } from "./cli"
|
||||||
import { coderCloudBind } from "./coder_cloud"
|
import { coderCloudBind } from "./coder_cloud"
|
||||||
import { commit, version, vsRootPath } from "./constants"
|
import { commit, version, vsRootPath } from "./constants"
|
||||||
import { startLink } from "./link"
|
|
||||||
import { register } from "./routes"
|
import { register } from "./routes"
|
||||||
import { humanPath, isFile, loadAMDModule, open } from "./util"
|
import { humanPath, isFile, loadAMDModule, open } from "./util"
|
||||||
|
|
||||||
|
@ -156,19 +154,6 @@ export const runCodeServer = async (
|
||||||
logger.info(" - Connected to cloud agent")
|
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) {
|
if (args.enable && args.enable.length > 0) {
|
||||||
logger.info("Enabling the following experimental features:")
|
logger.info("Enabling the following experimental features:")
|
||||||
args.enable.forEach((feature) => {
|
args.enable.forEach((feature) => {
|
||||||
|
@ -196,7 +181,6 @@ export const runCodeServer = async (
|
||||||
return {
|
return {
|
||||||
server: app.server,
|
server: app.server,
|
||||||
dispose: async () => {
|
dispose: async () => {
|
||||||
linkAgent?.kill()
|
|
||||||
disposeRoutes()
|
disposeRoutes()
|
||||||
await app.dispose()
|
await app.dispose()
|
||||||
},
|
},
|
||||||
|
|
Loading…
Reference in New Issue