diff --git a/README.md b/README.md index 61df8fc6bb44e..c87fa3b976670 100644 --- a/README.md +++ b/README.md @@ -1,57 +1,64 @@ -# Visual Studio Code - Open Source ("Code - OSS") +# OpenVSCode Web Server -[![Feature Requests](https://img.shields.io/github/issues/microsoft/vscode/feature-request.svg)](https://github.com/microsoft/vscode/issues?q=is%3Aopen+is%3Aissue+label%3Afeature-request+sort%3Areactions-%2B1-desc) -[![Bugs](https://img.shields.io/github/issues/microsoft/vscode/bug.svg)](https://github.com/microsoft/vscode/issues?utf8=✓&q=is%3Aissue+is%3Aopen+label%3Abug) -[![Gitter](https://img.shields.io/badge/chat-on%20gitter-yellow.svg)](https://gitter.im/Microsoft/vscode) +[![GitHub](https://img.shields.io/github/license/runcode-io/openvscode-web-server)](https://github.com/runcode-io/openvscode-web-server/blob/main/LICENSE.txt) -## The Repository +## What is this? -This repository ("`Code - OSS`") is where we (Microsoft) develop the [Visual Studio Code](https://code.visualstudio.com) product together with the community. Not only do we work on code and issues here, we also publish our [roadmap](https://github.com/microsoft/vscode/wiki/Roadmap), [monthly iteration plans](https://github.com/microsoft/vscode/wiki/Iteration-Plans), and our [endgame plans](https://github.com/microsoft/vscode/wiki/Running-the-Endgame). This source code is available to everyone under the standard [MIT license](https://github.com/microsoft/vscode/blob/main/LICENSE.txt). +This project provides a version of VS Code that runs as a server on a remote machine, accessible through a modern web browser. It utilizes the same architecture used by [RunCode](https://runcode.io) to deliver scalable remote development environments. -## Visual Studio Code +## Why? -

- VS Code in action -

+VS Code was originally developed as a desktop IDE using web technologies. As remote development gained popularity, the community began adapting it for remote access via web browsers. However, these adaptations were often complex and error-prone due to the extensive changes required across VS Code's large codebase. -[Visual Studio Code](https://code.visualstudio.com) is a distribution of the `Code - OSS` repository with Microsoft-specific customizations released under a traditional [Microsoft product license](https://code.visualstudio.com/License/). +In 2019, the VS Code team began restructuring its architecture to natively support a browser-based environment. While platforms like Gitpod and GitHub adopted this architecture, the key components remained closed-source until recently. Consequently, many developers continued to use the older, more difficult methods. -[Visual Studio Code](https://code.visualstudio.com) combines the simplicity of a code editor with what developers need for their core edit-build-debug cycle. It provides comprehensive code editing, navigation, and understanding support along with lightweight debugging, a rich extensibility model, and lightweight integration with existing tools. +At RunCode, we've frequently been asked about our approach. To support the community, we're sharing the minimal set of changes required to utilize the latest version of VS Code, ensuring easier upgrades and reduced maintenance. -Visual Studio Code is updated monthly with new features and bug fixes. You can download it for Windows, macOS, and Linux on [Visual Studio Code's website](https://code.visualstudio.com/Download). To get the latest releases every day, install the [Insiders build](https://code.visualstudio.com/insiders). +## Getting started -## Contributing +### Docker -There are many ways in which you can participate in this project, for example: +- Start the server: +```bash +docker run -it --init -p 8000:8000 -v "$(pwd):/home/runcode/workspace:cached" runcode/runcode-server +``` +- Visit the URL printed in your terminal. -* [Submit bugs and feature requests](https://github.com/microsoft/vscode/issues), and help us verify as they are checked in -* Review [source code changes](https://github.com/microsoft/vscode/pulls) -* Review the [documentation](https://github.com/microsoft/vscode-docs) and make pull requests for anything from typos to additional and new content -If you are interested in fixing issues and contributing directly to the code base, -please see the document [How to Contribute](https://github.com/microsoft/vscode/wiki/How-to-Contribute), which covers the following: -* [How to build and run from source](https://github.com/microsoft/vscode/wiki/How-to-Contribute) -* [The development workflow, including debugging and running tests](https://github.com/microsoft/vscode/wiki/How-to-Contribute#debugging) -* [Coding guidelines](https://github.com/microsoft/vscode/wiki/Coding-Guidelines) -* [Submitting pull requests](https://github.com/microsoft/vscode/wiki/How-to-Contribute#pull-requests) -* [Finding an issue to work on](https://github.com/microsoft/vscode/wiki/How-to-Contribute#where-to-contribute) -* [Contributing to translations](https://aka.ms/vscodeloc) +#### Custom Environment +- For additional possibilities, please consult the `Dockerfile` for OpenVSCode Web Server at https://github.com/runcode-io/runcode-releases/ -## Feedback -* Ask a question on [Stack Overflow](https://stackoverflow.com/questions/tagged/vscode) -* [Request a new feature](CONTRIBUTING.md) -* Upvote [popular feature requests](https://github.com/microsoft/vscode/issues?q=is%3Aopen+is%3Aissue+label%3Afeature-request+sort%3Areactions-%2B1-desc) -* [File an issue](https://github.com/microsoft/vscode/issues) -* Connect with the extension author community on [GitHub Discussions](https://github.com/microsoft/vscode-discussions/discussions) or [Slack](https://aka.ms/vscode-dev-community) -* Follow [@code](https://twitter.com/code) and let us know what you think! +### Web Server -See our [wiki](https://github.com/microsoft/vscode/wiki/Feedback-Channels) for a description of each of these channels and information on some other available community-driven channels. +- [Download the latest release](https://github.com/runcode-io/openvscode-web-server/releases/latest) +- Untar and run the server + ```bash + unzip openvscode-web-server-v${OPENVSCODE_SERVER_VERSION}.zip + cd vscode-reh-web-linux-x64 + ./bin/runcode-server # you can add arguments here, use --help to list all of the possible options + ``` -## Related Projects + From the possible entrypoint arguments, the most notable ones are + - `--port` - the port number to start the server on, this is 8000 by default + - `--without-connection-token` - used by default in the docker image + - `--connection-token` & `--connection-token-file` for securing access to the IDE, you can read more about it in [Securing access to your IDE](#securing-access-to-your-ide). + - `--host` - determines the host the server is listening on. It defaults to `localhost`, so for accessing remotely it's a good idea to add `--host 0.0.0.0` to your launch arguments. -Many of the core components and extensions to VS Code live in their own repositories on GitHub. For example, the [node debug adapter](https://github.com/microsoft/vscode-node-debug) and the [mono debug adapter](https://github.com/microsoft/vscode-mono-debug) repositories are separate from each other. For a complete list, please visit the [Related Projects](https://github.com/microsoft/vscode/wiki/Related-Projects) page on our [wiki](https://github.com/microsoft/vscode/wiki). +- Visit the URL printed in your terminal. + +### Securing access to your IDE + +You can access the Web UI without authentication (anyone can access the IDE using just the hostname and port), if you need some kind of basic authentication then you can start the server with `--connection-token YOUR_TOKEN`, the provided `YOUR_TOKEN` will be used and the authenticated URL will be displayed in your terminal once you start the server. You can also create a plaintext file with the desired token as its contents and provide it to the server with `--connection-token-file YOUR_SECRET_TOKEN_FILE`. + +If you want to use a connection token and are working with OpenVSCode Web Server via [the Docker image](https://hub.docker.com/r/runcode/runcode-server), you will have to edit the `ENTRYPOINT` in [the Dockerfile](https://github.com/runcode-io/runcode-releases/blob/main/Dockerfile) or modify it with the [`entrypoint` option](https://docs.docker.com/compose/compose-file/compose-file-v3/#entrypoint) when working with `docker-compose`. + +## The scope of this project + +This project only adds minimal bits required to run VS Code in a server scenario. We have no intention of changing VS Code in any way or to add additional features to VS Code itself. Please report feature requests, bug fixes, etc. in the upstream repository. + +> **For any feature requests, bug reports, or contributions that are not specific to running VS Code in a server context, please go to [Visual Studio Code - Open Source "OSS"](https://github.com/microsoft/vscode)** ## Bundled Extensions @@ -61,19 +68,56 @@ VS Code includes a set of built-in extensions located in the [extensions](extens This repository includes a Visual Studio Code Dev Containers / GitHub Codespaces development container. -* For [Dev Containers](https://aka.ms/vscode-remote/download/containers), use the **Dev Containers: Clone Repository in Container Volume...** command which creates a Docker volume for better disk I/O on macOS and Windows. - * If you already have VS Code and Docker installed, you can also click [here](https://vscode.dev/redirect?url=vscode://ms-vscode-remote.remote-containers/cloneInVolume?url=https://github.com/microsoft/vscode) to get started. This will cause VS Code to automatically install the Dev Containers extension if needed, clone the source code into a container volume, and spin up a dev container for use. - -* For Codespaces, install the [GitHub Codespaces](https://marketplace.visualstudio.com/items?itemName=GitHub.codespaces) extension in VS Code, and use the **Codespaces: Create New Codespace** command. +- For [Dev Containers](https://aka.ms/vscode-remote/download/containers), use the **Dev Containers: Clone Repository in Container Volume...** command which creates a Docker volume for better disk I/O on macOS and Windows. + - If you already have VS Code and Docker installed, you can also click [here](https://vscode.dev/redirect?url=vscode://ms-vscode-remote.remote-containers/cloneInVolume?url=https://github.com/microsoft/vscode) to get started. This will cause VS Code to automatically install the Dev Containers extension if needed, clone the source code into a container volume, and spin up a dev container for use. +- For Codespaces, install the [GitHub Codespaces](https://marketplace.visualstudio.com/items?itemName=GitHub.codespaces) extension in VS Code, and use the **Codespaces: Create New Codespace** command. Docker / the Codespace should have at least **4 Cores and 6 GB of RAM (8 GB recommended)** to run full build. See the [development container README](.devcontainer/README.md) for more information. -## Code of Conduct +## Legal +This project is not affiliated with Microsoft Corporation. + + + + + + + + + + + + + + + +docker run -it --network=host -v "$(pwd):/home/" ubuntu:22.04 + + +apt update && apt install sudo git wget build-essential + +sudo apt update && sudo apt upgrade -y +sudo apt-get install -y libkrb5-dev libx11-dev libxkbfile-dev pkg-config libsecret-1-dev + +wget -qO- https://raw.githubusercontent.com/nvm-sh/nvm/v0.40.0/install.sh | bash + +source /root/.bashrc + +nvm install 20.14.0 + +corepack enable + +git config --global --add safe.directory /home + + + -This project has adopted the [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/). For more information see the [Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/) or contact [opencode@microsoft.com](mailto:opencode@microsoft.com) with any additional questions or comments. +docker run -itd -p 8000:8000 -v "$(pwd):/home" ubuntu:22.04 +apt update && apt upgrade -y && apt install unzip sudo -y -## License +./vscode-reh-web-linux-x64/bin/runcode-server --default-folder=/home/ --host=0.0.0.0 -Copyright (c) Microsoft Corporation. All rights reserved. -Licensed under the [MIT](LICENSE.txt) license. +apt-get update && apt-get install -y software-properties-common +add-apt-repository ppa:ubuntu-toolchain-r/test +apt-get update && apt-get install -y libstdc++6 diff --git a/build/.cachesalt b/build/.cachesalt index d7d415d321357..ba8be214f4221 100644 --- a/build/.cachesalt +++ b/build/.cachesalt @@ -1 +1 @@ -2024-07-04T16:31:11.121Z +2024-07-05T08:35:22.799Z \ No newline at end of file diff --git a/build/lib/compilation.ts b/build/lib/compilation.ts index 8c3614b4c137c..9bc76ba3ca8a7 100644 --- a/build/lib/compilation.ts +++ b/build/lib/compilation.ts @@ -21,7 +21,9 @@ import { Mangler } from './mangle/index'; import { RawSourceMap } from 'source-map'; import { gulpPostcss } from './postcss'; const watch = require('./watch'); - +const packageJson = require('../../package.json'); +const productJson = require('../../product.json'); +const replace = require('gulp-replace'); // --- gulp-tsb: compile and transpile -------------------------------- @@ -77,8 +79,20 @@ function createCompile(src: string, { build, emitError, transpileOnly, preserveE const postcssNesting = require('postcss-nesting'); + const productJsFilter = util.filter(data => !build && data.path.endsWith('vs/platform/product/common/product.ts')); + const productConfiguration = JSON.stringify({ + ...productJson, + version: `${packageJson.version}-dev`, + nameShort: `${productJson.nameShort} Dev`, + nameLong: `${productJson.nameLong} Dev`, + dataFolderName: `${productJson.dataFolderName}-dev` + }); + const input = es.through(); const output = input + .pipe(productJsFilter) + .pipe(replace(/{\s*\/\*BUILD->INSERT_PRODUCT_CONFIGURATION\*\/\s*}/, productConfiguration, { skipBinary: true })) + .pipe(productJsFilter.restore) .pipe(util.$if(isUtf8Test, bom())) // this is required to preserve BOM in test files that loose it otherwise .pipe(util.$if(!build && isRuntimeJs, util.appendOwnPathSourceURL())) .pipe(util.$if(isCSS, gulpPostcss([postcssNesting()], err => reporter(String(err))))) diff --git a/extensions/git/src/historyProvider.ts b/extensions/git/src/historyProvider.ts index 1d9641474e934..134db819efaa8 100644 --- a/extensions/git/src/historyProvider.ts +++ b/extensions/git/src/historyProvider.ts @@ -173,6 +173,37 @@ export class GitHistoryProvider implements SourceControlHistoryProvider, FileDec this.logger.error(`[GitHistoryProvider][provideHistoryItems2] Failed to get history items '${options.limit.id}..': ${err}`); return []; } + + const historyItems: SourceControlHistoryItem[] = []; + + try { + // Get the commits + const commits = await this.repository.log({ range: `${refsMergeBase}^..`, refNames }); + + await ensureEmojis(); + + historyItems.push(...commits.map(commit => { + const newLineIndex = commit.message.indexOf('\n'); + const subject = newLineIndex !== -1 ? commit.message.substring(0, newLineIndex) : commit.message; + + const labels = this.resolveHistoryItemLabels(commit, refNames); + + return { + id: commit.hash, + parentIds: commit.parents, + message: emojify(subject), + author: commit.authorName, + icon: new ThemeIcon('git-commit'), + timestamp: commit.authorDate?.getTime(), + statistics: commit.shortStat ?? { files: 0, insertions: 0, deletions: 0 }, + labels: labels.length !== 0 ? labels : undefined + }; + })); + } catch (err) { + this.logger.error(`[GitHistoryProvider][provideHistoryItems2] Failed to get history items '${refsMergeBase}^..': ${err}`); + } + + return historyItems; } async provideHistoryItemSummary(historyItemId: string, historyItemParentId: string | undefined): Promise { diff --git a/package.json b/package.json index fb8b786f98c12..aebda696e67fd 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "code-oss-dev", - "version": "1.93.0", - "distro": "a08b8e0a3ee750481000d63bf36e5a206fe6aecf", + "version": "1.91.1", + "distro": "a08799837ca498c02f445ca7a896f446419af238", "author": { "name": "Microsoft Corporation" }, diff --git a/product.json b/product.json index 9c0dec611327f..3c0b812b43fef 100644 --- a/product.json +++ b/product.json @@ -1,18 +1,18 @@ { "nameShort": "RunCode Server", "nameLong": "RunCode Server", - "applicationName": "runcode", - "dataFolderName": ".runcode", - "win32MutexName": "runcode", + "applicationName": "runcode-server", + "dataFolderName": ".runcode-server", + "win32MutexName": "runcodeserver", "licenseName": "MIT", "licenseUrl": "https://github.com/runcode-io/openvscode-web-server/blob/main/LICENSE.txt", "serverLicenseUrl": "https://github.com/runcode-io/openvscode-web-server/blob/main/LICENSE.txt", "serverGreeting": [], "serverLicense": [], "serverLicensePrompt": "", - "serverApplicationName": "runcode", - "serverDataFolderName": ".runcode", - "tunnelApplicationName": "runcode-tunnel", + "serverApplicationName": "runcode-server", + "serverDataFolderName": ".runcode-server", + "tunnelApplicationName": "runcode-server-tunnel", "win32DirName": "RunCode", "win32NameVersion": "RunCode", "win32RegValueName": "RunCode", diff --git a/src/vs/workbench/contrib/webview/browser/pre/index.html b/src/vs/workbench/contrib/webview/browser/pre/index.html index 6a1f3d459abf6..73ee42e274ebc 100644 --- a/src/vs/workbench/contrib/webview/browser/pre/index.html +++ b/src/vs/workbench/contrib/webview/browser/pre/index.html @@ -5,8 +5,8 @@ + content="default-src 'none'; script-src 'sha256-dvxt5dlghGbz8hrqqochfoKEaHIMZ+yJVRvjJnGopzs=' 'self'; frame-src 'self'; style-src 'unsafe-inline';"> { if (!document.body) { return; diff --git a/src/vs/workbench/contrib/webview/browser/webviewElement.ts b/src/vs/workbench/contrib/webview/browser/webviewElement.ts index 8870ddf4cc639..e1efba3e8025e 100644 --- a/src/vs/workbench/contrib/webview/browser/webviewElement.ts +++ b/src/vs/workbench/contrib/webview/browser/webviewElement.ts @@ -34,7 +34,7 @@ import { loadLocalResource, WebviewResourceResponse } from 'vs/workbench/contrib import { WebviewThemeDataProvider } from 'vs/workbench/contrib/webview/browser/themeing'; import { areWebviewContentOptionsEqual, IWebview, WebviewContentOptions, WebviewExtensionDescription, WebviewInitInfo, WebviewMessageReceivedEvent, WebviewOptions } from 'vs/workbench/contrib/webview/browser/webview'; import { WebviewFindDelegate, WebviewFindWidget } from 'vs/workbench/contrib/webview/browser/webviewFindWidget'; -import { FromWebviewMessage, KeyEvent, ToWebviewMessage, WebViewDragEvent } from 'vs/workbench/contrib/webview/browser/webviewMessages'; +import { FromWebviewMessage, KeyEvent, ToWebviewMessage } from 'vs/workbench/contrib/webview/browser/webviewMessages'; import { decodeAuthority, webviewGenericCspSource, webviewRootResourceAuthority } from 'vs/workbench/contrib/webview/common/webview'; import { IWorkbenchEnvironmentService } from 'vs/workbench/services/environment/common/environmentService'; import { CodeWindow } from 'vs/base/browser/window'; @@ -310,10 +310,6 @@ export class WebviewElement extends Disposable implements IWebview, WebviewFindD this._startBlockingIframeDragEvents(); })); - this._register(this.on('drag', (event) => { - this.handleDragEvent('drag', event); - })); - if (initInfo.options.enableFindWidget) { this._webviewFindWidget = this._register(instantiationService.createInstance(WebviewFindWidget, this)); } @@ -701,17 +697,6 @@ export class WebviewElement extends Disposable implements IWebview, WebviewFindD this.window?.dispatchEvent(emulatedKeyboardEvent); } - private handleDragEvent(type: 'drag', event: WebViewDragEvent) { - // Create a fake DragEvent from the data provided - const emulatedDragEvent = new DragEvent(type, event); - // Force override the target - Object.defineProperty(emulatedDragEvent, 'target', { - get: () => this.element, - }); - // And re-dispatch - this.window?.dispatchEvent(emulatedDragEvent); - } - windowDidDragStart(): void { // Webview break drag and dropping around the main window (no events are generated when you are over them) // Work around this by disabling pointer events during the drag. diff --git a/src/vs/workbench/contrib/webview/browser/webviewMessages.d.ts b/src/vs/workbench/contrib/webview/browser/webviewMessages.d.ts index dde553ec05724..eae9c80fa6872 100644 --- a/src/vs/workbench/contrib/webview/browser/webviewMessages.d.ts +++ b/src/vs/workbench/contrib/webview/browser/webviewMessages.d.ts @@ -17,10 +17,6 @@ type KeyEvent = { repeat: boolean; } -type WebViewDragEvent = { - shiftKey: boolean; -} - export type FromWebviewMessage = { 'onmessage': { message: any; transfer?: ArrayBuffer[] }; 'did-click-link': { uri: string }; @@ -40,7 +36,6 @@ export type FromWebviewMessage = { 'did-keyup': KeyEvent; 'did-context-menu': { clientX: number; clientY: number; context: { [key: string]: unknown } }; 'drag-start': void; - 'drag': WebViewDragEvent }; interface UpdateContentEvent { diff --git a/src/vs/workbench/contrib/webview/browser/webviewWindowDragMonitor.ts b/src/vs/workbench/contrib/webview/browser/webviewWindowDragMonitor.ts index d009ae186da59..e4dc5eaf0e904 100644 --- a/src/vs/workbench/contrib/webview/browser/webviewWindowDragMonitor.ts +++ b/src/vs/workbench/contrib/webview/browser/webviewWindowDragMonitor.ts @@ -18,41 +18,19 @@ export class WebviewWindowDragMonitor extends Disposable { constructor(targetWindow: CodeWindow, getWebview: () => IWebview | undefined) { super(); - const onDragStart = () => { + this._register(DOM.addDisposableListener(targetWindow, DOM.EventType.DRAG_START, () => { getWebview()?.windowDidDragStart(); - }; + })); const onDragEnd = () => { getWebview()?.windowDidDragEnd(); }; - this._register(DOM.addDisposableListener(targetWindow, DOM.EventType.DRAG_START, () => { - onDragStart(); - })); - this._register(DOM.addDisposableListener(targetWindow, DOM.EventType.DRAG_END, onDragEnd)); - this._register(DOM.addDisposableListener(targetWindow, DOM.EventType.MOUSE_MOVE, currentEvent => { if (currentEvent.buttons === 0) { onDragEnd(); } })); - - this._register(DOM.addDisposableListener(targetWindow, DOM.EventType.DRAG, (event) => { - if (event.shiftKey) { - onDragEnd(); - } else { - onDragStart(); - } - })); - - this._register(DOM.addDisposableListener(targetWindow, DOM.EventType.DRAG_OVER, (event) => { - if (event.shiftKey) { - onDragEnd(); - } else { - onDragStart(); - } - })); - } } diff --git a/src/vs/workbench/services/extensions/common/extensionsProposedApi.ts b/src/vs/workbench/services/extensions/common/extensionsProposedApi.ts index 8133ef3e43a03..e69cfd4a80740 100644 --- a/src/vs/workbench/services/extensions/common/extensionsProposedApi.ts +++ b/src/vs/workbench/services/extensions/common/extensionsProposedApi.ts @@ -31,7 +31,8 @@ export class ExtensionsProposedApi { this._envEnabledExtensions = new Set((_environmentService.extensionEnabledProposedApi ?? []).map(id => ExtensionIdentifier.toKey(id))); - this._envEnablesProposedApiForAll = + // this._envEnablesProposedApiForAll = + this._envEnablesProposedApiForAll = true || // always enable proposed API !_environmentService.isBuilt || // always allow proposed API when running out of sources (_environmentService.isExtensionDevelopment && productService.quality !== 'stable') || // do not allow proposed API against stable builds when developing an extension (this._envEnabledExtensions.size === 0 && Array.isArray(_environmentService.extensionEnabledProposedApi)); // always allow proposed API if --enable-proposed-api is provided without extension ID