mirror of
https://github.com/coder/code-server.git
synced 2026-09-06 18:21:17 +02:00
Compare commits
1 Commits
v4.133.0
...
45bdc54d0f
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
45bdc54d0f |
@@ -65,8 +65,8 @@ main() {
|
|||||||
echo "USE AT YOUR OWN RISK!"
|
echo "USE AT YOUR OWN RISK!"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ "$major_node_version" -ne "${FORCE_NODE_VERSION:-24}" ]; then
|
if [ "$major_node_version" -ne "${FORCE_NODE_VERSION:-22}" ]; then
|
||||||
echo "ERROR: code-server currently requires node v24."
|
echo "ERROR: code-server currently requires node v22."
|
||||||
if [ -n "$FORCE_NODE_VERSION" ]; then
|
if [ -n "$FORCE_NODE_VERSION" ]; then
|
||||||
echo "However, you have overrided the version check to use v$FORCE_NODE_VERSION."
|
echo "However, you have overrided the version check to use v$FORCE_NODE_VERSION."
|
||||||
fi
|
fi
|
||||||
|
|||||||
@@ -31,7 +31,7 @@ The prerequisites for contributing to code-server are almost the same as those
|
|||||||
for [VS Code](https://github.com/Microsoft/vscode/wiki/How-to-Contribute#prerequisites).
|
for [VS Code](https://github.com/Microsoft/vscode/wiki/How-to-Contribute#prerequisites).
|
||||||
Here is what is needed:
|
Here is what is needed:
|
||||||
|
|
||||||
- `node` v24.x
|
- `node` v22.x
|
||||||
- `git` v2.x or greater
|
- `git` v2.x or greater
|
||||||
- [`git-lfs`](https://git-lfs.github.com)
|
- [`git-lfs`](https://git-lfs.github.com)
|
||||||
- [`npm`](https://www.npmjs.com/)
|
- [`npm`](https://www.npmjs.com/)
|
||||||
|
|||||||
@@ -11,11 +11,11 @@ curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.0/install.sh | bash
|
|||||||
```
|
```
|
||||||
|
|
||||||
6. Exit the terminal using `exit` and then reopen the terminal
|
6. Exit the terminal using `exit` and then reopen the terminal
|
||||||
7. Install and use Node.js 24:
|
7. Install and use Node.js 22:
|
||||||
|
|
||||||
```shell
|
```shell
|
||||||
nvm install 24
|
nvm install 22
|
||||||
nvm use 24
|
nvm use 22
|
||||||
```
|
```
|
||||||
|
|
||||||
8. Install code-server globally on device with: `npm install --global code-server`
|
8. Install code-server globally on device with: `npm install --global code-server`
|
||||||
|
|||||||
@@ -29,7 +29,8 @@ includes installing instructions based on your operating system.
|
|||||||
|
|
||||||
## Node.js version
|
## Node.js version
|
||||||
|
|
||||||
We use Node.js `24.x`. VS Code also [lists Node.js
|
We use the same major version of Node.js shipped with Code's remote, which is
|
||||||
|
currently `22.x`. VS Code also [lists Node.js
|
||||||
requirements](https://github.com/microsoft/vscode/wiki/How-to-Contribute#prerequisites).
|
requirements](https://github.com/microsoft/vscode/wiki/How-to-Contribute#prerequisites).
|
||||||
|
|
||||||
Using other versions of Node.js [may lead to unexpected
|
Using other versions of Node.js [may lead to unexpected
|
||||||
@@ -77,7 +78,7 @@ Proceed to [installing](#installing)
|
|||||||
## FreeBSD
|
## FreeBSD
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
pkg install -y git python npm-node24 pkgconf
|
pkg install -y git python npm-node22 pkgconf
|
||||||
pkg install -y libinotify
|
pkg install -y libinotify
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|||||||
@@ -57,7 +57,7 @@ npm config set python python3
|
|||||||
node -v
|
node -v
|
||||||
```
|
```
|
||||||
|
|
||||||
you will get Node version `v24`
|
you will get Node version `v22`
|
||||||
|
|
||||||
5. Now install code-server following our guide on [installing with npm](./npm.md)
|
5. Now install code-server following our guide on [installing with npm](./npm.md)
|
||||||
|
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ Index: code-server/lib/vscode/src/vs/server/node/serverServices.ts
|
|||||||
===================================================================
|
===================================================================
|
||||||
--- code-server.orig/lib/vscode/src/vs/server/node/serverServices.ts
|
--- code-server.orig/lib/vscode/src/vs/server/node/serverServices.ts
|
||||||
+++ code-server/lib/vscode/src/vs/server/node/serverServices.ts
|
+++ code-server/lib/vscode/src/vs/server/node/serverServices.ts
|
||||||
@@ -13,7 +13,7 @@ import { IURITransformer } from '../../b
|
@@ -14,7 +14,7 @@ import { IURITransformer } from '../../b
|
||||||
import { generateUuid } from '../../base/common/uuid.js';
|
import { generateUuid } from '../../base/common/uuid.js';
|
||||||
import { getMachineId, getSqmMachineId, getDevDeviceId } from '../../base/node/id.js';
|
import { getMachineId, getSqmMachineId, getDevDeviceId } from '../../base/node/id.js';
|
||||||
import { Promises } from '../../base/node/pfs.js';
|
import { Promises } from '../../base/node/pfs.js';
|
||||||
@@ -18,7 +18,7 @@ Index: code-server/lib/vscode/src/vs/server/node/serverServices.ts
|
|||||||
import { ProtocolConstants } from '../../base/parts/ipc/common/ipc.net.js';
|
import { ProtocolConstants } from '../../base/parts/ipc/common/ipc.net.js';
|
||||||
import { createRandomIPCHandle } from '../../base/parts/ipc/node/ipc.net.js';
|
import { createRandomIPCHandle } from '../../base/parts/ipc/node/ipc.net.js';
|
||||||
import { IConfigurationService } from '../../platform/configuration/common/configuration.js';
|
import { IConfigurationService } from '../../platform/configuration/common/configuration.js';
|
||||||
@@ -417,6 +417,9 @@ export async function setupServerService
|
@@ -418,6 +418,9 @@ export async function setupServerService
|
||||||
|
|
||||||
socketServer.registerChannel('mcpManagement', new McpManagementChannel(mcpManagementService, (ctx: RemoteAgentConnectionContext) => getUriTransformer(ctx.remoteAuthority)));
|
socketServer.registerChannel('mcpManagement', new McpManagementChannel(mcpManagementService, (ctx: RemoteAgentConnectionContext) => getUriTransformer(ctx.remoteAuthority)));
|
||||||
|
|
||||||
|
|||||||
@@ -19,9 +19,9 @@ Index: code-server/lib/vscode/src/vs/platform/product/common/product.ts
|
|||||||
===================================================================
|
===================================================================
|
||||||
--- code-server.orig/lib/vscode/src/vs/platform/product/common/product.ts
|
--- code-server.orig/lib/vscode/src/vs/platform/product/common/product.ts
|
||||||
+++ code-server/lib/vscode/src/vs/platform/product/common/product.ts
|
+++ code-server/lib/vscode/src/vs/platform/product/common/product.ts
|
||||||
@@ -65,6 +65,17 @@ else if (globalThis._VSCODE_PRODUCT_JSON
|
@@ -104,6 +104,17 @@ else {
|
||||||
Object.assign(product, { copilotVersions: { runtime, sdk } });
|
}
|
||||||
}
|
});
|
||||||
}
|
}
|
||||||
+
|
+
|
||||||
+ Object.assign(product, {
|
+ Object.assign(product, {
|
||||||
@@ -36,7 +36,7 @@ Index: code-server/lib/vscode/src/vs/platform/product/common/product.ts
|
|||||||
+ });
|
+ });
|
||||||
}
|
}
|
||||||
|
|
||||||
// Web environment or unknown
|
export default product;
|
||||||
Index: code-server/lib/vscode/src/vs/server/node/webClientServer.ts
|
Index: code-server/lib/vscode/src/vs/server/node/webClientServer.ts
|
||||||
===================================================================
|
===================================================================
|
||||||
--- code-server.orig/lib/vscode/src/vs/server/node/webClientServer.ts
|
--- code-server.orig/lib/vscode/src/vs/server/node/webClientServer.ts
|
||||||
|
|||||||
@@ -12,7 +12,15 @@ Index: code-server/lib/vscode/src/vs/server/node/serverServices.ts
|
|||||||
===================================================================
|
===================================================================
|
||||||
--- code-server.orig/lib/vscode/src/vs/server/node/serverServices.ts
|
--- code-server.orig/lib/vscode/src/vs/server/node/serverServices.ts
|
||||||
+++ code-server/lib/vscode/src/vs/server/node/serverServices.ts
|
+++ code-server/lib/vscode/src/vs/server/node/serverServices.ts
|
||||||
@@ -68,6 +68,7 @@ import { IExtensionsScannerService } fro
|
@@ -5,6 +5,7 @@
|
||||||
|
|
||||||
|
import * as fs from 'fs';
|
||||||
|
import { hostname, release } from 'os';
|
||||||
|
+import { promises as fs } from 'fs';
|
||||||
|
import { Emitter, Event } from '../../base/common/event.js';
|
||||||
|
import { DisposableStore, toDisposable } from '../../base/common/lifecycle.js';
|
||||||
|
import { Schemas } from '../../base/common/network.js';
|
||||||
|
@@ -68,6 +69,7 @@ import { IExtensionsScannerService } fro
|
||||||
import { ExtensionsScannerService } from './extensionsScannerService.js';
|
import { ExtensionsScannerService } from './extensionsScannerService.js';
|
||||||
import { IExtensionsProfileScannerService } from '../../platform/extensionManagement/common/extensionsProfileScannerService.js';
|
import { IExtensionsProfileScannerService } from '../../platform/extensionManagement/common/extensionsProfileScannerService.js';
|
||||||
import { IUserDataProfilesService } from '../../platform/userDataProfile/common/userDataProfile.js';
|
import { IUserDataProfilesService } from '../../platform/userDataProfile/common/userDataProfile.js';
|
||||||
@@ -20,18 +28,18 @@ Index: code-server/lib/vscode/src/vs/server/node/serverServices.ts
|
|||||||
import { NullPolicyService } from '../../platform/policy/common/policy.js';
|
import { NullPolicyService } from '../../platform/policy/common/policy.js';
|
||||||
import { OneDataSystemAppender } from '../../platform/telemetry/node/1dsAppender.js';
|
import { OneDataSystemAppender } from '../../platform/telemetry/node/1dsAppender.js';
|
||||||
import { LoggerService } from '../../platform/log/node/loggerService.js';
|
import { LoggerService } from '../../platform/log/node/loggerService.js';
|
||||||
@@ -179,11 +180,23 @@ export async function setupServerService
|
@@ -179,11 +181,23 @@ export async function setupServerService
|
||||||
const requestService = new RequestService('remote', configurationService, environmentService, logService);
|
const requestService = new RequestService('remote', configurationService, environmentService, logService);
|
||||||
services.set(IRequestService, requestService);
|
services.set(IRequestService, requestService);
|
||||||
|
|
||||||
+ let isContainer = undefined;
|
+ let isContainer = undefined;
|
||||||
+ try {
|
+ try {
|
||||||
+ await fs.promises.stat('/run/.containerenv');
|
+ await fs.stat('/run/.containerenv');
|
||||||
+ isContainer = true;
|
+ isContainer = true;
|
||||||
+ } catch (error) { /* Does not exist, probably. */ }
|
+ } catch (error) { /* Does not exist, probably. */ }
|
||||||
+ if (!isContainer) {
|
+ if (!isContainer) {
|
||||||
+ try {
|
+ try {
|
||||||
+ const content = await fs.promises.readFile('/proc/self/cgroup', 'utf8')
|
+ const content = await fs.readFile('/proc/self/cgroup', 'utf8')
|
||||||
+ isContainer = content.includes('docker');
|
+ isContainer = content.includes('docker');
|
||||||
+ } catch (error) { /* Permission denied, probably. */ }
|
+ } catch (error) { /* Permission denied, probably. */ }
|
||||||
+ }
|
+ }
|
||||||
|
|||||||
Reference in New Issue
Block a user