Skip to content

Commit ac1fba8

Browse files
authored
Remove deprecated --link (#6018)
1 parent 6d8ed77 commit ac1fba8

File tree

11 files changed

+18
-169
lines changed

11 files changed

+18
-169
lines changed

CHANGELOG.md

+6-2
Original file line numberDiff line numberDiff line change
@@ -22,11 +22,15 @@ Code v99.99.999
2222

2323
## [4.10.0](https://github.com/coder/code-server/releases/tag/v4.10.0) - TBD
2424

25-
Code v1.75.0
25+
Code v1.75.1
2626

2727
### Changed
2828

29-
- Updated to Code 1.75.0
29+
- Updated to Code 1.75.1
30+
31+
### Removed
32+
33+
- Removed `--link` (was deprecated in 4.0.1).
3034

3135
## [4.9.1](https://github.com/coder/code-server/releases/tag/v4.9.1) - 2022-12-15
3236

ci/build/build-code-server.sh

-16
Original file line numberDiff line numberDiff line change
@@ -14,22 +14,6 @@ main() {
1414
sed -i.bak "1s;^;#!/usr/bin/env node\n;" out/node/entry.js && rm out/node/entry.js.bak
1515
chmod +x out/node/entry.js
1616
fi
17-
18-
# for arch; we do not use OS from lib.sh and get our own.
19-
# lib.sh normalizes macos to darwin - but cloud-agent's binaries do not
20-
source ./ci/lib.sh
21-
OS="$(uname | tr '[:upper:]' '[:lower:]')"
22-
23-
mkdir -p ./lib
24-
25-
if ! [ -f ./lib/coder-cloud-agent ]; then
26-
echo "Downloading the cloud agent..."
27-
28-
set +e
29-
curl -fsSL "https://github.com/coder/cloud-agent/releases/latest/download/cloud-agent-$OS-$ARCH" -o ./lib/coder-cloud-agent
30-
chmod +x ./lib/coder-cloud-agent
31-
set -e
32-
fi
3317
}
3418

3519
main "$@"

ci/build/build-release.sh

-2
Original file line numberDiff line numberDiff line change
@@ -63,8 +63,6 @@ EOF
6363

6464
if [ "$KEEP_MODULES" = 1 ]; then
6565
rsync node_modules/ "$RELEASE_PATH/node_modules"
66-
mkdir -p "$RELEASE_PATH/lib"
67-
rsync ./lib/coder-cloud-agent "$RELEASE_PATH/lib"
6866
fi
6967
}
7068

ci/build/npm-postinstall.sh

+2-21
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,8 @@
11
#!/usr/bin/env sh
22
set -eu
33

4-
# Copied from ../lib.sh.
5-
arch() {
6-
cpu="$(uname -m)"
7-
case "$cpu" in
8-
aarch64) cpu=arm64 ;;
9-
x86_64) cpu=amd64 ;;
10-
esac
11-
echo "$cpu"
12-
}
13-
14-
# Copied from ../lib.sh except we do not rename Darwin since the cloud agent
15-
# uses "darwin" in the release names and we do not need to detect Alpine.
4+
# Copied from ../lib.sh except we do not rename Darwin and we do not need to
5+
# detect Alpine.
166
os() {
177
osname=$(uname | tr '[:upper:]' '[:lower:]')
188
case $osname in
@@ -61,7 +51,6 @@ symlink_bin_script() {
6151
cd "$oldpwd"
6252
}
6353

64-
ARCH="${NPM_CONFIG_ARCH:-$(arch)}"
6554
OS="$(os)"
6655

6756
# This is due to an upstream issue with RHEL7/CentOS 7 comptability with node-argon2
@@ -102,14 +91,6 @@ main() {
10291
;;
10392
esac
10493

105-
mkdir -p ./lib
106-
107-
if curl -fsSL "https://github.com/coder/cloud-agent/releases/latest/download/cloud-agent-$OS-$ARCH" -o ./lib/coder-cloud-agent; then
108-
chmod +x ./lib/coder-cloud-agent
109-
else
110-
echo "Failed to download cloud agent; --link will not work"
111-
fi
112-
11394
if ! vscode_install; then
11495
echo "You may not have the required dependencies to build the native modules."
11596
echo "Please see https://github.com/coder/code-server/blob/main/docs/npm.md"

docs/install.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -297,9 +297,9 @@ You can install code-server using the [Helm package manager](https://coder.com/d
297297

298298
## Windows
299299

300-
We currently [do not publish Windows releases](https://github.com/coder/code-server/issues/1397). We recommend installing code-server onto Windows with [`npm`](#npm).
301-
302-
> Note: You will also need to [build coder/cloud-agent manually](https://github.com/coder/cloud-agent/issues/17) if you would like to use `code-server --link` on Windows.
300+
We currently [do not publish Windows
301+
releases](https://github.com/coder/code-server/issues/1397). We recommend
302+
installing code-server onto Windows with [`npm`](#npm).
303303

304304
## Raspberry Pi
305305

docs/link.md

-11
This file was deleted.

docs/manifest.json

-5
Original file line numberDiff line numberDiff line change
@@ -42,11 +42,6 @@
4242
"description": "How to run code-server in Coder",
4343
"path": "./coder.md"
4444
},
45-
{
46-
"title": "--link",
47-
"description": "How to run code-server --link",
48-
"path": "./link.md"
49-
},
5045
{
5146
"title": "iPad",
5247
"description": "How to access your code-server installation using an iPad.",

src/node/cli.ts

+1-22
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,6 @@ export interface UserProvidedArgs extends UserProvidedCodeArgs {
8484
"reuse-window"?: boolean
8585
"new-window"?: boolean
8686
"ignore-last-opened"?: boolean
87-
link?: OptionalString
8887
verbose?: boolean
8988
"app-name"?: string
9089
"welcome-text"?: string
@@ -184,7 +183,7 @@ export const options: Options<Required<UserProvidedArgs>> = {
184183
// The preferred way to set the locale is via the UI.
185184
type: "string",
186185
description: `
187-
Set vscode display language and language to show on the login page, more info see
186+
Set vscode display language and language to show on the login page, more info see
188187
https://en.wikipedia.org/wiki/IETF_language_tag
189188
`,
190189
},
@@ -262,15 +261,6 @@ export const options: Options<Required<UserProvidedArgs>> = {
262261
short: "w",
263262
description: "Text to show on login page",
264263
},
265-
link: {
266-
type: OptionalString,
267-
description: `
268-
Securely bind code-server via our cloud service with the passed name. You'll get a URL like
269-
https://hostname-username.coder.co at which you can easily access your code-server instance.
270-
Authorization is done via GitHub.
271-
`,
272-
deprecated: true,
273-
},
274264
}
275265

276266
export const optionDescriptions = (opts: Partial<Options<Required<UserProvidedArgs>>> = options): string[] => {
@@ -547,17 +537,6 @@ export async function setDefaults(cliArgs: UserProvidedArgs, configArgs?: Config
547537
args.host = addr.host
548538
args.port = addr.port
549539

550-
// If we're being exposed to the cloud, we listen on a random address and
551-
// disable auth.
552-
if (args.link) {
553-
args.host = "localhost"
554-
args.port = 0
555-
args.socket = undefined
556-
args["socket-mode"] = undefined
557-
args.cert = undefined
558-
args.auth = AuthType.None
559-
}
560-
561540
if (args.cert && !args.cert.value) {
562541
const { cert, certKey } = await generateCertificate(args["cert-host"] || "localhost")
563542
args.cert = {

src/node/coder_cloud.ts

-43
This file was deleted.

src/node/main.ts

+3-13
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ import { Disposable } from "../common/emitter"
66
import { plural } from "../common/util"
77
import { createApp, ensureAddress } from "./app"
88
import { AuthType, DefaultedArgs, Feature, SpawnCodeCli, toCodeArgs, UserProvidedArgs } from "./cli"
9-
import { coderCloudBind } from "./coder_cloud"
109
import { commit, version } from "./constants"
1110
import { register } from "./routes"
1211
import { humanPath, isDirectory, loadAMDModule, open } from "./util"
@@ -127,11 +126,7 @@ export const runCodeServer = async (
127126
const disposeRoutes = await register(app, args)
128127

129128
logger.info(`Using config file ${humanPath(os.homedir(), args.config)}`)
130-
logger.info(
131-
`${protocol.toUpperCase()} server listening on ${serverAddress.toString()} ${
132-
args.link ? "(randomized by --link)" : ""
133-
}`,
134-
)
129+
logger.info(`${protocol.toUpperCase()} server listening on ${serverAddress.toString()}`)
135130

136131
if (args.auth === AuthType.Password) {
137132
logger.info(" - Authentication is enabled")
@@ -143,25 +138,20 @@ export const runCodeServer = async (
143138
logger.info(` - Using password from ${humanPath(os.homedir(), args.config)}`)
144139
}
145140
} else {
146-
logger.info(` - Authentication is disabled ${args.link ? "(disabled by --link)" : ""}`)
141+
logger.info(" - Authentication is disabled")
147142
}
148143

149144
if (args.cert) {
150145
logger.info(` - Using certificate for HTTPS: ${humanPath(os.homedir(), args.cert.value)}`)
151146
} else {
152-
logger.info(` - Not serving HTTPS ${args.link ? "(disabled by --link)" : ""}`)
147+
logger.info(" - Not serving HTTPS")
153148
}
154149

155150
if (args["proxy-domain"].length > 0) {
156151
logger.info(` - ${plural(args["proxy-domain"].length, "Proxying the following domain")}:`)
157152
args["proxy-domain"].forEach((domain) => logger.info(` - *.${domain}`))
158153
}
159154

160-
if (args.link) {
161-
await coderCloudBind(serverAddress, args.link.value)
162-
logger.info(" - Connected to cloud agent")
163-
}
164-
165155
if (args.enable && args.enable.length > 0) {
166156
logger.info("Enabling the following experimental features:")
167157
args.enable.forEach((feature) => {

test/unit/node/cli.test.ts

+3-31
Original file line numberDiff line numberDiff line change
@@ -297,26 +297,6 @@ describe("parser", () => {
297297
})
298298
})
299299

300-
it("should override with --link", async () => {
301-
const args = parse(
302-
"--cert test --cert-key test --socket test --socket-mode 777 --host 0.0.0.0 --port 8888 --link test".split(" "),
303-
)
304-
const defaultArgs = await setDefaults(args)
305-
expect(defaultArgs).toEqual({
306-
...defaults,
307-
auth: "none",
308-
host: "localhost",
309-
link: {
310-
value: "test",
311-
},
312-
port: 0,
313-
cert: undefined,
314-
"cert-key": path.resolve("test"),
315-
socket: undefined,
316-
"socket-mode": undefined,
317-
})
318-
})
319-
320300
it("should use env var password", async () => {
321301
process.env.PASSWORD = "test"
322302
const args = parse([])
@@ -881,21 +861,13 @@ describe("optionDescriptions", () => {
881861

882862
it("should show if an option is deprecated", () => {
883863
const opts: Partial<Options<Required<UserProvidedArgs>>> = {
884-
link: {
864+
cert: {
885865
type: OptionalString,
886-
description: `
887-
Securely bind code-server via our cloud service with the passed name. You'll get a URL like
888-
https://hostname-username.coder.co at which you can easily access your code-server instance.
889-
Authorization is done via GitHub.
890-
`,
866+
description: "foo",
891867
deprecated: true,
892868
},
893869
}
894-
expect(optionDescriptions(opts)).toStrictEqual([
895-
` --link (deprecated) Securely bind code-server via our cloud service with the passed name. You'll get a URL like
896-
https://hostname-username.coder.co at which you can easily access your code-server instance.
897-
Authorization is done via GitHub.`,
898-
])
870+
expect(optionDescriptions(opts)).toStrictEqual([" --cert (deprecated) foo"])
899871
})
900872

901873
it("should show newlines in description", () => {

0 commit comments

Comments
 (0)