Skip to content

Commit

Permalink
Revert "Add linkup command to improve link functionality"
Browse files Browse the repository at this point in the history
This reverts commit 2504f6f.
  • Loading branch information
Joe committed Nov 3, 2021
1 parent 13e91de commit be26e12
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 56 deletions.
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ vendor/modules
node-*
/plugins
/lib/coder-cloud-agent
/lib/linkup
.home
coverage
**/.DS_Store
Expand Down
23 changes: 8 additions & 15 deletions ci/build/build-code-server.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,30 +15,23 @@ main() {
chmod +x out/node/entry.js
fi

# for arch; we do not use OS from lib.sh and get our own.
# lib.sh normalizes macos to darwin - but cloud-agent's binaries do not
source ./ci/lib.sh
OS="$(uname | tr '[:upper:]' '[:lower:]')"

mkdir -p ./lib

if ! [ -f ./lib/coder-cloud-agent ]; then
echo "Downloading the cloud agent..."

# for arch; we do not use OS from lib.sh and get our own.
# lib.sh normalizes macos to darwin - but cloud-agent's binaries do not
source ./ci/lib.sh
OS="$(uname | tr '[:upper:]' '[:lower:]')"

set +e
curl -fsSL "https://github.com/cdr/cloud-agent/releases/latest/download/cloud-agent-$OS-$ARCH" -o ./lib/coder-cloud-agent
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
yarn browserify out/browser/register.js -o out/browser/register.browserified.js
yarn browserify out/browser/pages/login.js -o out/browser/pages/login.browserified.js
yarn browserify out/browser/pages/vscode.js -o out/browser/pages/vscode.browserified.js
}

main "$@"
1 change: 0 additions & 1 deletion ci/build/build-release.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

Expand Down
6 changes: 0 additions & 6 deletions ci/build/npm-postinstall.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
16 changes: 0 additions & 16 deletions src/node/link.ts

This file was deleted.

19 changes: 2 additions & 17 deletions src/node/main.ts
Original file line number Diff line number Diff line change
@@ -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 { commit, version } from "./constants"
import { register } from "./routes"
import { humanPath, isFile, loadAMDModule, open } from "./util"

Expand Down Expand Up @@ -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) => {
Expand Down

0 comments on commit be26e12

Please sign in to comment.