Skip to content

Commit 7691912

Browse files
authored
Merge branch 'coder:main' into master
2 parents 3bd44a4 + be40eca commit 7691912

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

66 files changed

+835
-556
lines changed

.github/CODEOWNERS

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,5 @@
33
ci/helm-chart/ @Matthew-Beckett @alexgorbatchev
44

55
docs/install.md @GNUxeava
6+
7+
src/node/i18n/locales/zh-cn.json @zhaozhiming

.github/dependabot.yaml

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
version: 2
2+
updates:
3+
- package-ecosystem: "github-actions"
4+
directory: "/"
5+
schedule:
6+
interval: "monthly"
7+
time: "06:00"
8+
timezone: "America/Chicago"
9+
labels: []
10+
commit-message:
11+
prefix: "chore"
12+
13+
- package-ecosystem: "npm"
14+
directory: "/"
15+
schedule:
16+
interval: "monthly"
17+
time: "06:00"
18+
timezone: "America/Chicago"
19+
commit-message:
20+
prefix: "chore"
21+
labels: []
22+
ignore:
23+
# Ignore patch updates for all dependencies
24+
- dependency-name: "*"
25+
update-types:
26+
- version-update:semver-patch
27+
# Ignore major updates to Node.js types, because they need to
28+
# correspond to the Node.js engine version
29+
- dependency-name: "@types/node"
30+
update-types:
31+
- version-update:semver-major

.github/workflows/build.yaml

Lines changed: 13 additions & 60 deletions
Original file line numberDiff line numberDiff line change
@@ -139,6 +139,18 @@ jobs:
139139
if: steps.changed-files.outputs.any_changed == 'true'
140140
run: yarn lint:ts
141141

142+
lint-actions:
143+
name: Lint GitHub Actions
144+
runs-on: ubuntu-latest
145+
steps:
146+
- name: Checkout repo
147+
uses: actions/checkout@v3
148+
- name: Check workflow files
149+
run: |
150+
bash <(curl https://raw.githubusercontent.com/rhysd/actionlint/7fdc9630cc360ea1a469eed64ac6d78caeda1234/scripts/download-actionlint.bash)
151+
./actionlint -color -shellcheck= -ignore "set-output"
152+
shell: bash
153+
142154
test-unit:
143155
name: Run unit tests
144156
runs-on: ubuntu-20.04
@@ -271,65 +283,6 @@ jobs:
271283
name: npm-package
272284
path: ./package.tar.gz
273285

274-
npm:
275-
name: Publish npm package
276-
# the npm-package gets uploaded as an artifact in Build
277-
# so we need that to complete before this runs
278-
needs: build
279-
# This environment "npm" requires someone from
280-
# coder/code-server-reviewers to approve the PR before this job runs.
281-
environment: npm
282-
# Only run if PR comes from base repo or event is not a PR
283-
# Reason: forks cannot access secrets and this will always fail
284-
if: github.event.pull_request.head.repo.full_name == github.repository || github.event_name != 'pull_request'
285-
runs-on: ubuntu-20.04
286-
steps:
287-
- name: Checkout repo
288-
uses: actions/checkout@v3
289-
290-
- name: Download artifact
291-
uses: actions/download-artifact@v3
292-
id: download
293-
with:
294-
name: "npm-package"
295-
path: release-npm-package
296-
297-
- name: Run ./ci/steps/publish-npm.sh
298-
run: yarn publish:npm
299-
env:
300-
# NOTE@jsjoeio
301-
# This is because npm enforces semantic versioning
302-
# so it has to be a valid version. We only use this
303-
# to publish dev versions from prs
304-
# and beta versions from main.
305-
VERSION: "0.0.0"
306-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
307-
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
308-
# NOTE@jsjoeio
309-
# NPM_ENVIRONMENT intentionally not set here.
310-
# Instead, itis determined in publish-npm.sh script
311-
# using GITHUB environment variables
312-
313-
- name: Comment npm information
314-
uses: marocchino/sticky-pull-request-comment@v2
315-
with:
316-
GITHUB_TOKEN: ${{ github.token }}
317-
header: npm-dev-build
318-
message: |
319-
✨ code-server dev build published to npm for PR #${{ github.event.number }}!
320-
* _Last publish status_: success
321-
* _Commit_: ${{ github.event.pull_request.head.sha }}
322-
323-
To install in a local project, run:
324-
```shell-session
325-
npm install @coder/code-server-pr@${{ github.event.number }}
326-
```
327-
328-
To install globally, run:
329-
```shell-session
330-
npm install -g @coder/code-server-pr@${{ github.event.number }}
331-
```
332-
333286
test-e2e:
334287
name: Run e2e tests
335288
needs: build
@@ -443,7 +396,7 @@ jobs:
443396
if: steps.caddy-cache.outputs.cache-hit != 'true'
444397
run: |
445398
gh release download v2.5.2 --repo caddyserver/caddy --pattern "caddy_2.5.2_linux_amd64.tar.gz"
446-
mkdir -p ~/.cache/caddy
399+
mkdir -p ~/.cache/caddy
447400
tar -xzf caddy_2.5.2_linux_amd64.tar.gz --directory ~/.cache/caddy
448401
449402
- name: Start Caddy

.github/workflows/docs-preview.yaml

Lines changed: 0 additions & 46 deletions
This file was deleted.

.github/workflows/publish.yaml

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,12 @@ jobs:
2929
- name: Checkout code-server
3030
uses: actions/checkout@v3
3131

32+
- name: Install Node.js v16
33+
uses: actions/setup-node@v3
34+
with:
35+
node-version: "16"
36+
cache: "yarn"
37+
3238
- name: Download npm package from release artifacts
3339
uses: robinraju/[email protected]
3440
with:
@@ -141,7 +147,7 @@ jobs:
141147
VERSION: ${{ env.VERSION }}
142148
run: |
143149
git checkout -b update-version-${{ env.VERSION }}
144-
git add .
150+
git add .
145151
git commit -m "chore: updating version to ${{ env.VERSION }}"
146152
git push -u origin $(git branch --show)
147153
gh pr create --repo coder/code-server-aur --title "chore: bump version to ${{ env.VERSION }}" --body "PR opened by @$GITHUB_ACTOR" --assignee $GITHUB_ACTOR
@@ -186,7 +192,7 @@ jobs:
186192
out-file-path: "release-packages"
187193

188194
- name: Publish to Docker
189-
run: yarn publish:docker
195+
run: ./ci/steps/docker-buildx-push.sh
190196
env:
191197
VERSION: ${{ env.VERSION }}
192198
GITHUB_TOKEN: ${{ github.token }}

.github/workflows/security.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ jobs:
6565
fetch-depth: 0
6666

6767
- name: Run Trivy vulnerability scanner in repo mode
68-
uses: aquasecurity/trivy-action@9ab158e8597f3b310480b9a69402b419bc03dbd5
68+
uses: aquasecurity/trivy-action@cff3e9a7f62c41dd51975266d0ae235709e39c41
6969
with:
7070
scan-type: "fs"
7171
scan-ref: "."

.github/workflows/trivy-docker.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ jobs:
5151
uses: actions/checkout@v3
5252

5353
- name: Run Trivy vulnerability scanner in image mode
54-
uses: aquasecurity/trivy-action@9ab158e8597f3b310480b9a69402b419bc03dbd5
54+
uses: aquasecurity/trivy-action@cff3e9a7f62c41dd51975266d0ae235709e39c41
5555
with:
5656
image-ref: "docker.io/codercom/code-server:latest"
5757
ignore-unfixed: true

CHANGELOG.md

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,31 @@ Code v99.99.999
2020
2121
-->
2222

23+
## [4.10.1](https://github.com/coder/code-server/releases/tag/v4.10.1) - 2023-03-04
24+
25+
Code v1.75.1
26+
27+
### Security
28+
29+
Added an origin check to web sockets to prevent cross-site hijacking attacks on
30+
users using older or niche browser that do not support SameSite cookies and
31+
attacks across sub-domains that share the same root domain.
32+
33+
The check requires the host header to be set so if you use a reverse proxy
34+
ensure it forwards that information otherwise web sockets will be blocked.
35+
36+
## [4.10.0](https://github.com/coder/code-server/releases/tag/v4.10.0) - 2023-02-15
37+
38+
Code v1.75.1
39+
40+
### Changed
41+
42+
- Updated to Code 1.75.1
43+
44+
### Removed
45+
46+
- Removed `--link` (was deprecated over thirteen months ago in 4.0.1).
47+
2348
## [4.9.1](https://github.com/coder/code-server/releases/tag/v4.9.1) - 2022-12-15
2449

2550
Code v1.73.1

ci/build/build-code-server.sh

Lines changed: 0 additions & 16 deletions
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

Lines changed: 0 additions & 2 deletions
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

Lines changed: 2 additions & 21 deletions
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"

ci/dev/watch.ts

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { spawn, fork, ChildProcess } from "child_process"
1+
import { spawn, ChildProcess } from "child_process"
22
import * as path from "path"
33
import { onLine, OnLineCallback } from "../../src/node/util"
44

@@ -30,12 +30,13 @@ class Watcher {
3030

3131
// Pass CLI args, save for `node` and the initial script name.
3232
const args = process.argv.slice(2)
33-
this.webServer = fork(path.join(this.rootPath, "out/node/entry.js"), args)
33+
this.webServer = spawn("node", [path.join(this.rootPath, "out/node/entry.js"), ...args])
34+
onLine(this.webServer, (line) => console.log("[code-server]", line))
3435
const { pid } = this.webServer
3536

36-
this.webServer.on("exit", () => console.log("[Code Server]", `Web process ${pid} exited`))
37+
this.webServer.on("exit", () => console.log("[code-server]", `Web process ${pid} exited`))
3738

38-
console.log("\n[Code Server]", `Spawned web server process ${pid}`)
39+
console.log("\n[code-server]", `Spawned web server process ${pid}`)
3940
}
4041

4142
//#endregion
@@ -82,21 +83,21 @@ class Watcher {
8283
private parseVSCodeLine: OnLineCallback = (strippedLine, originalLine) => {
8384
if (!strippedLine.length) return
8485

85-
console.log("[VS Code]", originalLine)
86+
console.log("[Code OSS]", originalLine)
8687

8788
if (strippedLine.includes("Finished compilation with")) {
88-
console.log("[VS Code] ✨ Finished compiling! ✨", "(Refresh your web browser ♻️)")
89+
console.log("[Code OSS] ✨ Finished compiling! ✨", "(Refresh your web browser ♻️)")
8990
this.reloadWebServer()
9091
}
9192
}
9293

9394
private parseCodeServerLine: OnLineCallback = (strippedLine, originalLine) => {
9495
if (!strippedLine.length) return
9596

96-
console.log("[Compiler][Code Server]", originalLine)
97+
console.log("[Compiler][code-server]", originalLine)
9798

9899
if (strippedLine.includes("Watching for file changes")) {
99-
console.log("[Compiler][Code Server]", "Finished compiling!", "(Refresh your web browser ♻️)")
100+
console.log("[Compiler][code-server]", "Finished compiling!", "(Refresh your web browser ♻️)")
100101
this.reloadWebServer()
101102
}
102103
}

ci/helm-chart/Chart.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,9 @@ type: application
1515
# This is the chart version. This version number should be incremented each time you make changes
1616
# to the chart and its templates, including the app version.
1717
# Versions are expected to follow Semantic Versioning (https://semver.org/)
18-
version: 3.4.1
18+
version: 3.6.1
1919

2020
# This is the version number of the application being deployed. This version number should be
2121
# incremented each time you make changes to the application. Versions are not expected to
2222
# follow Semantic Versioning. They should reflect the version the application is using.
23-
appVersion: 4.9.1
23+
appVersion: 4.10.1

0 commit comments

Comments
 (0)