Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: microsoft/vscode
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: main
Choose a base ref
...
head repository: gitpod-io/openvscode-server
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: main
Choose a head ref
Able to merge. These branches can be automatically merged.
  • 13 commits
  • 20 files changed
  • 9 contributors

Commits on Mar 3, 2025

  1. code web server initial commit

    Tool: gitpod/catfood.gitpod.cloud
    filiptronicek authored and jeanp413 committed Mar 3, 2025
    Copy the full SHA
    230df2d View commit details
  2. enable prebuilds for all branches

    Tool: gitpod/catfood.gitpod.cloud
    akosyakov authored and jeanp413 committed Mar 3, 2025
    Copy the full SHA
    6027282 View commit details
  3. Add example guide for pre-installing vscode extensions with docker in…

    …stallation
    
    Tool: gitpod/catfood.gitpod.cloud
    axonasif authored and jeanp413 committed Mar 3, 2025
    Copy the full SHA
    a8a5ddd View commit details
  4. 💄

    Tool: gitpod/catfood.gitpod.cloud
    jeanp413 committed Mar 3, 2025
    Copy the full SHA
    4c9429d View commit details
  5. Update deprecated example in README

    Option 'connection-secret' is deprecated: Use connection-token-file instead.
    
    Tool: gitpod/catfood.gitpod.cloud
    bjrne authored and jeanp413 committed Mar 3, 2025
    Copy the full SHA
    2011ddd View commit details
  6. Patch yarnInstall for openvscode-release

    Tool: gitpod/catfood.gitpod.cloud
    jeanp413 committed Mar 3, 2025
    Copy the full SHA
    54521d4 View commit details
  7. fix: make sure user-data-dir command line parameter is customizable

    The `--user-data-dir` command-line parameter is currently unusable. Its functionality is hampered due to an automatically appended `/data` directory, rendering the parameter completely ineffective.
    
    The proposed minor modification allows users to accurately customize this variable, enhancing its utility.
    
    Tool: gitpod/catfood.gitpod.cloud
    drupol authored and jeanp413 committed Mar 3, 2025
    Copy the full SHA
    8c9ee60 View commit details
  8. Disable Git: Continue Working in New Local Clone

    Tool: gitpod/catfood.gitpod.cloud
    filiptronicek authored and jeanp413 committed Mar 3, 2025
    Copy the full SHA
    3e41bd0 View commit details
  9. spread originalConfig rather than reconstructing it

    Tool: gitpod/catfood.gitpod.cloud
    jeremie-stripe authored and jeanp413 committed Mar 3, 2025
    Copy the full SHA
    38c5c1a View commit details
  10. Sync upstream product.json

    Tool: gitpod/catfood.gitpod.cloud
    mustard-mh authored and jeanp413 committed Mar 3, 2025
    Copy the full SHA
    e41b077 View commit details
  11. Use npm

    Tool: gitpod/catfood.gitpod.cloud
    mustard-mh authored and jeanp413 committed Mar 3, 2025
    Copy the full SHA
    bb281b5 View commit details
  12. update docker file

    Tool: gitpod/catfood.gitpod.cloud
    jeanp413 committed Mar 3, 2025
    Copy the full SHA
    35a716f View commit details
  13. fix compiled file

    jeanp413 committed Mar 3, 2025
    Copy the full SHA
    a31351e View commit details
21 changes: 21 additions & 0 deletions .gitpod.Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
FROM gitpod/workspace-full:latest

USER gitpod

# We use latest major version of Node.js distributed VS Code. (see about dialog in your local VS Code)
RUN bash -c ". .nvm/nvm.sh \
&& nvm install 20 \
&& nvm use 20 \
&& nvm alias default 20"

RUN echo "nvm use default &>/dev/null" >> ~/.bashrc.d/51-nvm-fix

# Install dependencies
RUN sudo apt-get update \
&& sudo apt-get install -y --no-install-recommends \
xvfb x11vnc fluxbox dbus-x11 x11-utils x11-xserver-utils xdg-utils \
fbautostart xterm eterm gnome-terminal gnome-keyring seahorse nautilus \
libx11-dev libxkbfile-dev libsecret-1-dev libnotify4 libnss3 libxss1 \
libasound2 libgbm1 xfonts-base xfonts-terminus fonts-noto fonts-wqy-microhei \
fonts-droid-fallback vim-tiny nano libgconf2-dev libgtk-3-dev twm \
&& sudo apt-get clean && sudo rm -rf /var/cache/apt/* && sudo rm -rf /var/lib/apt/lists/* && sudo rm -rf /tmp/*
29 changes: 29 additions & 0 deletions .gitpod.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
image:
file: .gitpod.Dockerfile
ports:
- port: 9888
onOpen: open-browser
tasks:
- init: |
npm ci
npm run server:init
command: |
gp sync-done init
export NODE_ENV=development
export VSCODE_DEV=1
npm run watch
name: watch app
- command: |
export NODE_ENV=development
export VSCODE_DEV=1
gp sync-await init
./scripts/code-server.sh --without-connection-token
name: run app
openMode: split-right
github:
prebuilds:
branches: true
pullRequestsFromForks: true
vscode:
extensions:
- dbaeumer.vscode-eslint
166 changes: 117 additions & 49 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,79 +1,147 @@
# Visual Studio Code - Open Source ("Code - OSS")
# OpenVSCode 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)
[![Gitpod ready-to-code](https://img.shields.io/badge/Gitpod-ready--to--code-908a85?logo=gitpod)](https://gitpod.io/from-referrer)
[![GitHub](https://img.shields.io/github/license/gitpod-io/openvscode-server)](https://github.com/gitpod-io/openvscode-server/blob/main/LICENSE.txt)
[![Discord](https://img.shields.io/discord/816244985187008514)](https://www.gitpod.io/chat)

## 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 a server on a remote machine and allows access through a modern web browser. It's based on the very same architecture used by [Gitpod](https://www.gitpod.io) or [GitHub Codespaces](https://github.com/features/codespaces) at scale.

## Visual Studio Code
<img width="1624" alt="Screenshot 2021-09-02 at 08 39 26" src="https://user-images.githubusercontent.com/372735/131794918-d6602646-4d67-435b-88fe-620a3cc0a3aa.png">

<p align="center">
<img alt="VS Code in action" src="https://user-images.githubusercontent.com/35271042/118224532-3842c400-b438-11eb-923d-a5f66fa6785a.png">
</p>
## Why?

[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/).
VS Code has traditionally been a desktop IDE built with web technologies. A few years back, people started patching it in order to run it in a remote context and to make it accessible through web browsers. These efforts have been complex and error prone, because many changes had to be made across the large code base of VS Code.

[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.
Luckily, in 2019 the VS Code team started to refactor its architecture to support a browser-based working mode. While this architecture has been adopted by Gitpod and GitHub, the important bits have not been open-sourced, until now. As a result, many people in the community still use the old, hard to maintain and error-prone approach.

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).
At Gitpod, we've been asked a lot about how we do it. So we thought we might as well share the minimal set of changes needed so people can rely on the latest version of VS Code, have a straightforward upgrade path and low maintenance effort.

## Contributing
## Getting started

There are many ways in which you can participate in this project, for example:
### Docker

* [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
- Start the server:
```bash
docker run -it --init -p 3000:3000 -v "$(pwd):/home/workspace:cached" gitpod/openvscode-server
```
- Visit the URL printed in your terminal.

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)
_Note_: Feel free to use the `nightly` tag to test the latest version, i.e. `gitpod/openvscode-server:nightly`.

## Feedback
#### Custom Environment
- If you want to add dependencies to this Docker image, here is a template to help:
```Dockerfile

* 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!
FROM gitpod/openvscode-server:latest

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.
USER root # to get permissions to install packages and such
RUN # the installation process for software needed
USER openvscode-server # to restore permissions for the web interface

## Related Projects
```
- For additional possibilities, please consult the `Dockerfile` for OpenVSCode Server at https://github.com/gitpod-io/openvscode-releases/

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).
#### Pre-installing VSCode extensions

## Bundled Extensions
You can pre-install vscode extensions in such a way:

VS Code includes a set of built-in extensions located in the [extensions](extensions) folder, including grammars and snippets for many languages. Extensions that provide rich language support (code completion, Go to Definition) for a language have the suffix `language-features`. For example, the `json` extension provides coloring for `JSON` and the `json-language-features` extension provides rich language support for `JSON`.
```dockerfile
FROM gitpod/openvscode-server:latest

## Development Container
ENV OPENVSCODE_SERVER_ROOT="/home/.openvscode-server"
ENV OPENVSCODE="${OPENVSCODE_SERVER_ROOT}/bin/openvscode-server"

This repository includes a Visual Studio Code Dev Containers / GitHub Codespaces development container.
SHELL ["/bin/bash", "-c"]
RUN \
# Direct download links to external .vsix not available on https://open-vsx.org/
# The two links here are just used as example, they are actually available on https://open-vsx.org/
urls=(\
https://github.com/rust-lang/rust-analyzer/releases/download/2022-12-26/rust-analyzer-linux-x64.vsix \
https://github.com/VSCodeVim/Vim/releases/download/v1.24.3/vim-1.24.3.vsix \
)\
# Create a tmp dir for downloading
&& tdir=/tmp/exts && mkdir -p "${tdir}" && cd "${tdir}" \
# Download via wget from $urls array.
&& wget "${urls[@]}" && \
# List the extensions in this array
exts=(\
# From https://open-vsx.org/ registry directly
gitpod.gitpod-theme \
# From filesystem, .vsix that we downloaded (using bash wildcard '*')
"${tdir}"/* \
)\
# Install the $exts
&& for ext in "${exts[@]}"; do ${OPENVSCODE} --install-extension "${ext}"; done
```

* 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.
### Linux

* 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.
- [Download the latest release](https://github.com/gitpod-io/openvscode-server/releases/latest)
- Untar and run the server
```bash
tar -xzf openvscode-server-v${OPENVSCODE_SERVER_VERSION}.tar.gz
cd openvscode-server-v${OPENVSCODE_SERVER_VERSION}
./bin/openvscode-server # you can add arguments here, use --help to list all of the possible options
```

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.
From the possible entrypoint arguments, the most notable ones are
- `--port` - the port number to start the server on, this is 3000 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.

- Visit the URL printed in your terminal.

_Note_: You can use [pre-releases](https://github.com/gitpod-io/openvscode-server/releases) to test nightly changes.

### Securing access to your IDE

Since OpenVSCode Server v1.64, 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 Server via [the Docker image](https://hub.docker.com/r/gitpod/openvscode-server), you will have to edit the `ENTRYPOINT` in [the Dockerfile](https://github.com/gitpod-io/openvscode-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`.

### Deployment guides

Please refer to [Guides](https://github.com/gitpod-io/openvscode-server/tree/docs/guides) to learn how to deploy OpenVSCode Server to your cloud provider of choice.

## 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)**
## Code of Conduct
## Documentation

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.
All documentation is available in [the `docs` branch](https://github.com/gitpod-io/openvscode-server/tree/docs) of this project.

## License
## Supporters

Copyright (c) Microsoft Corporation. All rights reserved.
The project is supported by companies such as [GitLab](https://gitlab.com/), [VMware](https://www.vmware.com/), [Uber](https://www.uber.com/), [SAP](https://www.sap.com/), [Sourcegraph](https://sourcegraph.com/), [RStudio](https://www.rstudio.com/), [SUSE](https://rancher.com/), [Tabnine](https://www.tabnine.com/), [Render](https://render.com/) and [TypeFox](https://www.typefox.io/).

## Contributing

Thanks for your interest in contributing to the project 🙏. You can start a development environment with the following button:

[![Open in Gitpod](https://gitpod.io/button/open-in-gitpod.svg)](https://gitpod.io/from-referrer)

To learn about the code structure and other topics related to contributing, please refer to the [development docs](https://github.com/gitpod-io/openvscode-server/blob/docs/development.md).

## Bundled Extensions

VS Code includes a set of built-in extensions located in the [extensions](extensions) folder, including grammars and snippets for many languages. Extensions that provide rich language support (code completion, Go to Definition) for a language have the suffix `language-features`. For example, the `json` extension provides coloring for `JSON` and the `json-language-features` extension provides rich language support for `JSON`.

## Development Container

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.

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.

Licensed under the [MIT](LICENSE.txt) license.
## Legal
This project is not affiliated with Microsoft Corporation.
12 changes: 6 additions & 6 deletions build/checksums/vscode-sysroot.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
68a17006021975ff271a1dd615f9db9eda7c25f2cc65e750c87980dc57a06c94 aarch64-linux-gnu-glibc-2.17.tar.gz
0de422a81683cf9e8cf875dbd1e0c27545ac3c775b2d53015daf3ca2b31d3f15 aarch64-linux-gnu-glibc-2.28.tar.gz
3ced48cb479f2cdba95aa649710fcb7778685551c745bbd76ac706c3c0ead9fb arm-rpi-linux-gnueabihf-glibc-2.17.tar.gz
7aea163f7fad8cc50000c86b5108be880121d35e2f55d016ef8c96bbe54129eb arm-rpi-linux-gnueabihf-glibc-2.28.tar.gz
5aae21115f1d284c3cdf32c83db15771b59bc80793f1423032abf5a823c0d658 x86_64-linux-gnu-glibc-2.17.tar.gz
dbb927408393041664a020661f2641c9785741be3d29b050b9dac58980967784 x86_64-linux-gnu-glibc-2.28.tar.gz
4aa30f61adde7839ca5616e23cb44625a16b4dd77e5ce38df214d8dfbf4d3596 aarch64-linux-gnu-glibc-2.17.tar.gz
4a00f87f0d109f66698244cf2bca4c237ff5bb84be4953bd2e624df7d46a4ccb aarch64-linux-gnu-glibc-2.28.tar.gz
76226b2a2be87c1d6cbd60371df30b2794d7c9595794786e1be34318be201948 arm-rpi-linux-gnueabihf-glibc-2.17.tar.gz
3625f8b5e36a42615f904fa3c222dcf35e37d4a46c2ea52f81cad36af5d1c07a arm-rpi-linux-gnueabihf-glibc-2.28.tar.gz
2ab8ad5a09270df7562ff79662f07c23d857ca19fa34dbe63999feabf4375bbb x86_64-linux-gnu-glibc-2.17.tar.gz
e655175b6143145f5d5f7d84a894f405e0df597b811a507dced6ead03f773bcb x86_64-linux-gnu-glibc-2.28.tar.gz
2 changes: 2 additions & 0 deletions build/gulpfile.js
Original file line number Diff line number Diff line change
@@ -34,6 +34,8 @@ gulp.task(compileClientTask);
const watchClientTask = task.define('watch-client', task.series(util.rimraf('out'), task.parallel(watchTask('out', false), watchApiProposalNamesTask)));
gulp.task(watchClientTask);

gulp.task(task.define('watch-init', require('./lib/compilation').watchTask('out', false)));

// All
const _compileTask = task.define('compile', task.parallel(monacoTypecheckTask, compileClientTask, compileExtensionsTask, compileExtensionMediaTask));
gulp.task(_compileTask);
14 changes: 14 additions & 0 deletions build/lib/compilation.js
15 changes: 15 additions & 0 deletions build/lib/compilation.ts
Original file line number Diff line number Diff line change
@@ -21,6 +21,9 @@ import { RawSourceMap } from 'source-map';
import { gulpPostcss } from './postcss';
import ts = require('typescript');
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 +80,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)))))
4 changes: 2 additions & 2 deletions build/linux/debian/install-sysroot.js
4 changes: 2 additions & 2 deletions build/linux/debian/install-sysroot.ts
Original file line number Diff line number Diff line change
@@ -81,7 +81,7 @@ async function fetchUrl(options: IFetchOptions, retries = 10, retryDelay = 1000)
const timeout = setTimeout(() => controller.abort(), 30 * 1000);
const version = '20240129-253798';
try {
const response = await fetch(`https://api.github.com/repos/Microsoft/vscode-linux-build-agent/releases/tags/v${version}`, {
const response = await fetch(`https://api.github.com/repos/gitpod-io/vscode-linux-build-agent/releases/tags/v${version}`, {
headers: ghApiHeaders,
signal: controller.signal as any /* Typings issue with lib.dom.d.ts */
});
@@ -90,7 +90,7 @@ async function fetchUrl(options: IFetchOptions, retries = 10, retryDelay = 1000)
const contents = Buffer.from(await response.arrayBuffer());
const asset = JSON.parse(contents.toString()).assets.find((a: { name: string }) => a.name === options.assetName);
if (!asset) {
throw new Error(`Could not find asset in release of Microsoft/vscode-linux-build-agent @ ${version}`);
throw new Error(`Could not find asset in release of gitpod-io/vscode-linux-build-agent @ ${version}`);
}
console.log(`Found asset ${options.assetName} @ ${asset.url}.`);
const assetResponse = await fetch(asset.url, {
2 changes: 1 addition & 1 deletion build/npm/postinstall.js
Original file line number Diff line number Diff line change
@@ -56,7 +56,7 @@ function npmInstall(dir, opts) {
if (process.env['npm_config_arch'] === 'arm64') {
run('sudo', ['docker', 'run', '--rm', '--privileged', 'multiarch/qemu-user-static', '--reset', '-p', 'yes'], opts);
}
run('sudo', ['docker', 'run', '-e', 'GITHUB_TOKEN', '-v', `${process.env['VSCODE_HOST_MOUNT']}:/root/vscode`, '-v', `${process.env['VSCODE_HOST_MOUNT']}/.build/.netrc:/root/.netrc`, '-w', path.resolve('/root/vscode', dir), process.env['VSCODE_REMOTE_DEPENDENCIES_CONTAINER_NAME'], 'sh', '-c', `\"chown -R root:root ${path.resolve('/root/vscode', dir)} && npm i -g node-gyp-build && npm ci\"`], opts);
run('sudo', ['docker', 'run', '-e', 'GITHUB_TOKEN', '-v', `${process.env['VSCODE_HOST_MOUNT']}:/root/vscode`, /* '-v', `${process.env['VSCODE_HOST_MOUNT']}/.build/.netrc:/root/.netrc`, */'-w', path.resolve('/root/vscode', dir), process.env['VSCODE_REMOTE_DEPENDENCIES_CONTAINER_NAME'], 'sh', '-c', `\"chown -R root:root ${path.resolve('/root/vscode', dir)} && npm i -g node-gyp-build && npm ci\"`], opts);
run('sudo', ['chown', '-R', `${userinfo.uid}:${userinfo.gid}`, `${path.resolve(root, dir)}`], opts);
} else {
log(dir, 'Installing dependencies...');
4 changes: 2 additions & 2 deletions extensions/git/package.json
Original file line number Diff line number Diff line change
@@ -71,7 +71,7 @@
"title": "%command.continueInLocalClone%",
"category": "Git",
"icon": "$(repo-clone)",
"enablement": "config.git.enabled && !git.missing && gitOpenRepositoryCount != 0 && remoteName"
"enablement": "false && config.git.enabled && !git.missing && gitOpenRepositoryCount != 0 && remoteName"
},
{
"command": "git.clone",
@@ -956,7 +956,7 @@
{
"command": "git.continueInLocalClone",
"qualifiedName": "%command.continueInLocalClone.qualifiedName%",
"when": "config.git.enabled && !git.missing && gitOpenRepositoryCount != 0 && remoteName",
"when": "false && config.git.enabled && !git.missing && gitOpenRepositoryCount != 0 && remoteName",
"remoteGroup": "remote_42_git_0_local@0"
}
],
4 changes: 3 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -65,7 +65,9 @@
"extensions-ci": "node ./node_modules/gulp/bin/gulp.js extensions-ci",
"extensions-ci-pr": "node ./node_modules/gulp/bin/gulp.js extensions-ci-pr",
"perf": "node scripts/code-perf.js",
"update-build-ts-version": "npm install typescript@next && tsc -p ./build/tsconfig.build.json"
"update-build-ts-version": "npm install typescript@next && tsc -p ./build/tsconfig.build.json",
"server:init": "npm run compile && npm run download-builtin-extensions",
"server:smoketest": "npm run smoketest -- --web --verbose --headless --electronArgs=\"--disable-dev-shm-usage --use-gl=swiftshader\""
},
"dependencies": {
"@microsoft/1ds-core-js": "^3.2.13",
1,124 changes: 1,103 additions & 21 deletions product.json

Large diffs are not rendered by default.

221 changes: 221 additions & 0 deletions scripts/sync-helper.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,221 @@
/* eslint-disable header/header */

const path = require('path');
const fs = require('fs');
const https = require('https');

const pickKeys = [
'extensionTips',
'extensionImportantTips',
'keymapExtensionTips',
'configBasedExtensionTips',
'extensionKeywords',
'extensionAllowedBadgeProviders',
'extensionAllowedBadgeProvidersRegex',
'extensionAllowedProposedApi',
'extensionEnabledApiProposals',
'extensionKind',
'languageExtensionTips'
];

const AllowMissKeys = [
'win32SetupExeBasename',
'darwinCredits',
'darwinExecutable',
'downloadUrl',
'updateUrl',
'webEndpointUrl',
'webEndpointUrlTemplate',
'quality',
'exeBasedExtensionTips',
'webExtensionTips',
'remoteExtensionTips',
'crashReporter',
'appCenter',
'enableTelemetry',
'aiConfig',
'msftInternalDomains',
'sendASmile',
'documentationUrl',
'releaseNotesUrl',
'keyboardShortcutsUrlMac',
'keyboardShortcutsUrlLinux',
'keyboardShortcutsUrlWin',
'introductoryVideosUrl',
'tipsAndTricksUrl',
'newsletterSignupUrl',
'twitterUrl',
'requestFeatureUrl',
'reportMarketplaceIssueUrl',
'privacyStatementUrl',
'showTelemetryOptOut',
'npsSurveyUrl',
'cesSurveyUrl',
'checksumFailMoreInfoUrl',
'electronRepository',
'settingsSearchUrl',
'surveys',
'tasConfig',
'experimentsUrl',
'extensionSyncedKeys',
'extensionVirtualWorkspacesSupport',
'auth',
'configurationSync.store',
'commit',
'date',
'checksums',
'settingsSearchBuildId',
'darwinUniversalAssetId',
];

const propiertaryExtension = [
'ms-vscode-remote.remote-containers',
'ms-dotnettools.csharp',
'ms-vscode.cpptools-extension-pack',
'ms-azure-devops.azure-pipelines',
'msazurermtools.azurerm-vscode-tools',
'ms-azuretools.vscode-bicep',
'usqlextpublisher.usql-vscode-ext',
'ms-azuretools.vscode-azureterraform',
'VisualStudioExptTeam.vscodeintellicode-completions',
'ms-vsliveshare.vsliveshare',
'ms-toolsai.vscode-ai-remote',
'GitHub.codespaces',
'ms-vscode.azure-repos',
'ms-vscode.remote-repositories',
'ms-vscode-remote.remote-wsl',
'ms-vscode-remote.remote-ssh',
'ms-vscode.remote-server',
'GitHub.copilot',
'GitHub.copilot-nightly',
'GitHub.remotehub',
'GitHub.remotehub-insiders',
'ms-python.vscode-pylance',
'ms-vscode.azure-sphere-tools-ui',
'ms-azuretools.vscode-azureappservice',
];

const openvsxExtensionMap = {
'ms-dotnettools.csharp': 'muhammad-sammy.csharp'
};

function filterObj(obj, predicate) {
const result = Object.create(null);
for (const [key, value] of Object.entries(obj)) {
if (predicate(key, value)) {
result[key] = value;
}
}
return result;
}

function renameObjKey(obj, predicate) {
const result = Object.create(null);
for (const [key, value] of Object.entries(obj)) {
const newKey = predicate(key, value) ?? key;
result[newKey] = value;
}
return result;
}

async function start() {
const localPath = path.join(__dirname, '../product.json');
const releasePath = path.join(__dirname, '../product-release.json');
if (!fs.existsSync(releasePath)) {
console.error('product-release.json is not exists, please copy product.json from VSCode Desktop Stable');
return;
}

const branchProduct = JSON.parse(await fs.promises.readFile(localPath, { encoding: 'utf8' }));
const releaseProduct = JSON.parse(await fs.promises.readFile(releasePath, { encoding: 'utf8' }));
const tmpProductPath = path.join(__dirname, '../product-tmp.json');
for (let key of pickKeys) {
let newValue = releaseProduct[key];
if (Array.isArray(newValue) && newValue.length && typeof newValue[0] === 'string') {
newValue = newValue.map(v => openvsxExtensionMap[v] ?? v).filter(v => !propiertaryExtension.includes(v));
} else if (typeof newValue === 'object' && newValue !== null) {
newValue = renameObjKey(newValue, k => openvsxExtensionMap[k] ?? k);
newValue = filterObj(newValue, k => !propiertaryExtension.includes(k));
}
branchProduct[key] = newValue;
}

await fs.promises.writeFile(tmpProductPath, JSON.stringify(branchProduct, null, '\t'));

if (keysDiff(branchProduct, releaseProduct)) {
// allow-any-unicode-next-line
console.log('📦 check if you need these keys or not');
}
await checkProductExtensions(branchProduct);
// allow-any-unicode-next-line
console.log('📦 you can copy product-tmp.json file to product.json file and resolve logs above by yourself');
// allow-any-unicode-next-line
console.log('✅ done');
}

function keysDiff(branch, release) {
const toMap = (ret, e) => {
ret[e] = true;
return ret;
};
const map1 = Object.keys(branch).reduce(toMap, {});
const map2 = Object.keys(release).reduce(toMap, {});
let changed = false;
for (let key in branch) {
if (!!!map2[key]) {
changed = true;
// allow-any-unicode-next-line
console.log(`🟠 Remove key: ${key}`);
}
}
for (let key in release) {
if (!!!map1[key] && !AllowMissKeys.includes(key)) {
changed = true;
// allow-any-unicode-next-line
console.log(`🟠 Add key: ${key}`);
}
}
return changed;
}

async function checkProductExtensions(product) {
const uniqueExtIds = new Set();
// Allow extension that downloaded from ms marketplace by users to use proposed api
// uniqueExtIds.push(...product.extensionAllowedProposedApi);

// Check recommand extension tips
for (let key in product.configBasedExtensionTips) {
Object.keys(product.configBasedExtensionTips[key].recommendations ?? {}).forEach(id => uniqueExtIds.add(id));
}
Object.keys(product.extensionImportantTips).forEach(id => uniqueExtIds.add(id));
Object.keys(product.extensionTips).forEach(id => uniqueExtIds.add(id));
Object.keys(product.extensionEnabledApiProposals).forEach(id => uniqueExtIds.add(id));
product.keymapExtensionTips.forEach(id => uniqueExtIds.add(id));
product.languageExtensionTips.forEach(id => uniqueExtIds.add(id));

// Check if extensions exists in openvsx
for (let id of uniqueExtIds) {
if (propiertaryExtension.includes(id)) {
continue;
}

const openvsxUrl = `https://open-vsx.org/api/${id.replace(/\./g, '/')}`;
const ok = await urlExists(openvsxUrl);
if (!ok) {
// allow-any-unicode-next-line
console.error(`🔴 Extension not exists: ${id}`);
}
}
}

async function urlExists(url) {
return new Promise((resolve, reject) => {
https.get(url, res => {
resolve(res.statusCode === 200);
}).on('error', error => {
reject(error);
});
});
}

start().catch(console.error);
89 changes: 89 additions & 0 deletions scripts/sync-with-upstream.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
#!/usr/bin/env bash

echo "Syncing openvscode-server with upstream"

upstream_url="https://github.com/microsoft/vscode.git"
upstream_branch=${1:-"upstream/main"}
local_branch=${2:-"main"}
base_commit_msg=${3:-"code web server initial commit"}
only_sync=${4:-"true"}

exit_script() {
reason=$1
echo "Update script ended unsucessfully"
echo "Reason: $reason"
exit 1
}

if [[ "$OSTYPE" == "darwin"* ]]; then
realpath() { [[ $1 = /* ]] && echo "$1" || echo "$PWD/${1#./}"; }
ROOT=$(dirname $(dirname $(realpath "$0")))
else
ROOT=$(dirname $(dirname $(readlink -f $0)))
# --disable-dev-shm-usage --use-gl=swiftshader: when run on docker containers where size of /dev/shm
# partition < 64MB which causes OOM failure for chromium compositor that uses the partition for shared memory
LINUX_EXTRA_ARGS="--disable-dev-shm-usage --use-gl=swiftshader"
fi

# Checks is there's an upstream remote repository and if not
# set it to $upstream_url
check_upstream() {
git remote -v | grep --quiet upstream
if [[ $? -ne 0 ]]; then
echo "Upstream repository not configured"
echo "Setting upstream URL to ${upstream_url}"
git remote add upstream $upstream_url
fi
}

# Gets the base commit
get_base_commit() {
local base_commit=$(git log --pretty="%H" --max-count=1 --grep "$base_commit_msg")
if [[ -z $base_commit ]]; then
exit_script "Could not find base commit"
fi
echo $base_commit
}

# Fetch updates from upstream and rebase
sync() {
echo "Shallow fetching upstream..."
git fetch upstream
git checkout $local_branch
echo "Rebasing $local_branch branch onto $upstream_branch from upstream"
git rebase --onto=$upstream_branch $(get_base_commit)~ $local_branch
if [[ $? -ne 0 ]]; then
echo "There are merge conflicts doing the rebase."
echo "Please resolve them or abort the rebase."
exit_script "Could not rebase succesfully"
fi
echo "$local_branch sucessfully updated"
}

cd $ROOT

# Sync
check_upstream
sync

if [[ "$only_sync" == "true" ]]; then
exit 0
fi

# Clean and build
# git clean -dfx
yarn && yarn server:init
if [[ $? -ne 0 ]]; then
exit_script "There are some errors during compilation"
fi

# Configuration
export NODE_ENV=development
export VSCODE_DEV=1
export VSCODE_CLI=1

# Run smoke tests
yarn smoketest --web --headless --verbose --electronArgs=$LINUX_EXTRA_ARGS
if [[ $? -ne 0 ]]; then
exit_script "Some smoke test are failing"
fi
2 changes: 1 addition & 1 deletion src/server-main.ts
Original file line number Diff line number Diff line change
@@ -189,7 +189,7 @@ async function parsePort(host: string | undefined, strPort: string | undefined):
process.exit(1);
}
}
return 8000;
return 3000;
}

function parseRange(strRange: string): { start: number; end: number } | undefined {
6 changes: 5 additions & 1 deletion src/vs/code/browser/workbench/workbench.ts
Original file line number Diff line number Diff line change
@@ -582,10 +582,14 @@ function readCookie(name: string): string | undefined {
if (!configElement || !configElementAttribute) {
throw new Error('Missing web configuration element');
}
const config: IWorkbenchConstructionOptions & { folderUri?: UriComponents; workspaceUri?: UriComponents; callbackRoute: string } = JSON.parse(configElementAttribute);
const originalConfig: IWorkbenchConstructionOptions & { folderUri?: UriComponents; workspaceUri?: UriComponents; callbackRoute: string } = JSON.parse(configElementAttribute);
const secretStorageKeyPath = readCookie('vscode-secret-key-path');
const secretStorageCrypto = secretStorageKeyPath && ServerKeyedAESCrypto.supported()
? new ServerKeyedAESCrypto(secretStorageKeyPath) : new TransparentCrypto();
const config: IWorkbenchConstructionOptions & { folderUri?: UriComponents; workspaceUri?: UriComponents; callbackRoute: string } = {
...originalConfig,
remoteAuthority: window.location.host,
};

// Create workbench
create(mainWindow.document.body, {
4 changes: 2 additions & 2 deletions src/vs/server/node/server.main.ts
Original file line number Diff line number Diff line change
@@ -37,14 +37,14 @@ const errorReporter: ErrorReporter = {
const args = parseArgs(process.argv.slice(2), serverOptions, errorReporter);

const REMOTE_DATA_FOLDER = args['server-data-dir'] || process.env['VSCODE_AGENT_FOLDER'] || join(os.homedir(), product.serverDataFolderName || '.vscode-remote');
const USER_DATA_PATH = join(REMOTE_DATA_FOLDER, 'data');
const USER_DATA_PATH = args['user-data-dir'] || join(REMOTE_DATA_FOLDER, 'data');
const APP_SETTINGS_HOME = join(USER_DATA_PATH, 'User');
const GLOBAL_STORAGE_HOME = join(APP_SETTINGS_HOME, 'globalStorage');
const LOCAL_HISTORY_HOME = join(APP_SETTINGS_HOME, 'History');
const MACHINE_SETTINGS_HOME = join(USER_DATA_PATH, 'Machine');
args['user-data-dir'] = USER_DATA_PATH;
const APP_ROOT = dirname(FileAccess.asFileUri('').fsPath);
const BUILTIN_EXTENSIONS_FOLDER_PATH = join(APP_ROOT, 'extensions');
args['user-data-dir'] = USER_DATA_PATH;
args['builtin-extensions-dir'] = BUILTIN_EXTENSIONS_FOLDER_PATH;
args['extensions-dir'] = args['extensions-dir'] || join(REMOTE_DATA_FOLDER, 'extensions');

20 changes: 10 additions & 10 deletions src/vs/server/node/webClientServer.ts
Original file line number Diff line number Diff line change
@@ -321,7 +321,7 @@ export class WebClientServer {

const staticRoute = posix.join(basePath, this._productPath, STATIC_PATH);
const callbackRoute = posix.join(basePath, this._productPath, CALLBACK_PATH);
const webExtensionRoute = posix.join(basePath, this._productPath, WEB_EXTENSION_PATH);
// const webExtensionRoute = posix.join(basePath, this._productPath, WEB_EXTENSION_PATH);

const resolveWorkspaceURI = (defaultLocation?: string) => defaultLocation && URI.file(path.resolve(defaultLocation)).with({ scheme: Schemas.vscodeRemote, authority: remoteAuthority });

@@ -334,15 +334,15 @@ export class WebClientServer {
} : undefined;

const productConfiguration = {
embedderIdentifier: 'server-distro',
extensionsGallery: this._webExtensionResourceUrlTemplate && this._productService.extensionsGallery ? {
...this._productService.extensionsGallery,
resourceUrlTemplate: this._webExtensionResourceUrlTemplate.with({
scheme: 'http',
authority: remoteAuthority,
path: `${webExtensionRoute}/${this._webExtensionResourceUrlTemplate.authority}${this._webExtensionResourceUrlTemplate.path}`
}).toString(true)
} : undefined
// embedderIdentifier: 'server-distro',
// extensionsGallery: this._webExtensionResourceUrlTemplate && this._productService.extensionsGallery ? {
// ...this._productService.extensionsGallery,
// resourceUrlTemplate: this._webExtensionResourceUrlTemplate.with({
// scheme: 'http',
// authority: remoteAuthority,
// path: `${webExtensionRoute}/${this._webExtensionResourceUrlTemplate.authority}${this._webExtensionResourceUrlTemplate.path}`
// }).toString(true)
// } : undefined
} satisfies Partial<IProductConfiguration>;

if (!this._environmentService.isBuilt) {
Original file line number Diff line number Diff line change
@@ -31,7 +31,7 @@ export class ExtensionsProposedApi {

this._envEnabledExtensions = new Set((_environmentService.extensionEnabledProposedApi ?? []).map(id => ExtensionIdentifier.toKey(id)));

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