Skip to content

Commit

Permalink
Merge branch 'main' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
SongXiaoXi authored Feb 12, 2025
2 parents 9b2c85b + a6fad66 commit 320559f
Show file tree
Hide file tree
Showing 8 changed files with 25 additions and 17 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ jobs:
run: npm run test:unit

- name: Upload coverage report to Codecov
uses: codecov/codecov-action@v4
uses: codecov/codecov-action@v5
with:
token: ${{ secrets.CODECOV_TOKEN }}
if: success()
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ jobs:
- run: npm run test:integration

- name: Upload coverage report to Codecov
uses: codecov/codecov-action@v4
uses: codecov/codecov-action@v5
with:
token: ${{ secrets.CODECOV_TOKEN }}
if: success()
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/security.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ jobs:
fetch-depth: 0

- name: Run Trivy vulnerability scanner in repo mode
uses: aquasecurity/trivy-action@915b19bbe73b92a6cf82a1bc12b087c9a19a5fe2
uses: aquasecurity/trivy-action@18f2510ee396bbf400402947b394f2dd8c87dbb0
with:
scan-type: "fs"
scan-ref: "."
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/trivy-docker.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ jobs:
uses: actions/checkout@v4

- name: Run Trivy vulnerability scanner in image mode
uses: aquasecurity/trivy-action@915b19bbe73b92a6cf82a1bc12b087c9a19a5fe2
uses: aquasecurity/trivy-action@18f2510ee396bbf400402947b394f2dd8c87dbb0
with:
image-ref: "docker.io/codercom/code-server:latest"
ignore-unfixed: true
Expand Down
6 changes: 3 additions & 3 deletions docs/guide.md
Original file line number Diff line number Diff line change
Expand Up @@ -271,9 +271,9 @@ should see OSSStatus: 9836 in the browser console.
If you want to use external authentication mechanism (e.g., Sign in with
Google), you can do this with a reverse proxy such as:

- [Pomerium](https://www.pomerium.io/guides/code-server.html)
- [oauth2_proxy](https://github.com/pusher/oauth2_proxy)
- [Cloudflare Access](https://teams.cloudflare.com/access)
- [Pomerium](https://www.pomerium.com/docs/guides/code-server.html)
- [oauth2-proxy](https://oauth2-proxy.github.io/oauth2-proxy/)
- [Cloudflare Access](https://www.cloudflare.com/zero-trust/products/access/)

## HTTPS and self-signed certificates

Expand Down
14 changes: 6 additions & 8 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 6 additions & 1 deletion src/node/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import { commit, version, vsRootPath } from "./constants"
import { register } from "./routes"
import { VSCodeModule } from "./routes/vscode"
import { isDirectory, open } from "./util"
import * as os from "os"

/**
* Return true if the user passed an extension-related VS Code flag.
Expand Down Expand Up @@ -51,7 +52,11 @@ export const runCodeCli = async (args: DefaultedArgs): Promise<void> => {
try {
// See vscode.loadVSCode for more on this jank.
process.env.CODE_SERVER_PARENT_PID = process.pid.toString()
const modPath = path.join(vsRootPath, "out/server-main.js")
let modPath = path.join(vsRootPath, "out/server-main.js")
if (os.platform() === "win32") {
// On Windows, absolute paths of ESM modules must be a valid file URI.
modPath = "file:///" + modPath.replace(/\\/g, "/")
}
const mod = (await eval(`import("${modPath}")`)) as VSCodeModule
const serverModule = await mod.loadCodeWithNls()
await serverModule.spawnCli(await toCodeArgs(args))
Expand Down
7 changes: 6 additions & 1 deletion src/node/routes/vscode.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import { promises as fs } from "fs"
import * as http from "http"
import * as net from "net"
import * as path from "path"
import * as os from "os"
import { WebsocketRequest } from "../../../typings/pluginapi"
import { logError } from "../../common/util"
import { CodeArgs, toCodeArgs } from "../cli"
Expand Down Expand Up @@ -58,7 +59,11 @@ async function loadVSCode(req: express.Request): Promise<IVSCodeServerAPI> {
// which will also require that we switch to ESM, since a hybrid approach
// breaks importing `rotating-file-stream` for some reason. To work around
// this, use `eval` for now, but we should consider switching to ESM.
const modPath = path.join(vsRootPath, "out/server-main.js")
let modPath = path.join(vsRootPath, "out/server-main.js")
if (os.platform() === "win32") {
// On Windows, absolute paths of ESM modules must be a valid file URI.
modPath = "file:///" + modPath.replace(/\\/g, "/")
}
const mod = (await eval(`import("${modPath}")`)) as VSCodeModule
const serverModule = await mod.loadCodeWithNls()
return serverModule.createServer(null, {
Expand Down

0 comments on commit 320559f

Please sign in to comment.