Skip to content

Commit b86fc8c

Browse files
filiptronicekjeanp413
authored andcommitted
code web server initial commit
1 parent cd4ee3b commit b86fc8c

File tree

14 files changed

+1109
-83
lines changed

14 files changed

+1109
-83
lines changed

.gitpod.Dockerfile

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
FROM gitpod/workspace-full:latest
2+
3+
USER gitpod
4+
5+
# We use latest major version of Node.js distributed VS Code. (see about dialog in your local VS Code)
6+
RUN bash -c ". .nvm/nvm.sh \
7+
&& nvm install 20 \
8+
&& nvm use 20 \
9+
&& nvm alias default 20"
10+
11+
RUN echo "nvm use default &>/dev/null" >> ~/.bashrc.d/51-nvm-fix
12+
13+
# Install dependencies
14+
RUN sudo apt-get update \
15+
&& sudo apt-get install -y --no-install-recommends \
16+
xvfb x11vnc fluxbox dbus-x11 x11-utils x11-xserver-utils xdg-utils \
17+
fbautostart xterm eterm gnome-terminal gnome-keyring seahorse nautilus \
18+
libx11-dev libxkbfile-dev libsecret-1-dev libnotify4 libnss3 libxss1 \
19+
libasound2 libgbm1 xfonts-base xfonts-terminus fonts-noto fonts-wqy-microhei \
20+
fonts-droid-fallback vim-tiny nano libgconf2-dev libgtk-3-dev twm \
21+
&& sudo apt-get clean && sudo rm -rf /var/cache/apt/* && sudo rm -rf /var/lib/apt/lists/* && sudo rm -rf /tmp/*
22+
23+
ENV DISABLE_V8_COMPILE_CACHE=1

.gitpod.yml

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
image:
2+
file: .gitpod.Dockerfile
3+
ports:
4+
- port: 9888
5+
onOpen: open-browser
6+
tasks:
7+
- init: |
8+
yarn
9+
yarn server:init
10+
command: |
11+
gp sync-done init
12+
export NODE_ENV=development
13+
export VSCODE_DEV=1
14+
yarn gulp watch-init
15+
name: watch app
16+
- command: |
17+
export NODE_ENV=development
18+
export VSCODE_DEV=1
19+
gp sync-await init
20+
./scripts/code-server.sh --without-connection-token
21+
name: run app
22+
openMode: split-right
23+
github:
24+
prebuilds:
25+
pullRequestsFromForks: true
26+
vscode:
27+
extensions:
28+
- dbaeumer.vscode-eslint

README.md

Lines changed: 84 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -1,79 +1,114 @@
1-
# Visual Studio Code - Open Source ("Code - OSS")
1+
# OpenVSCode Server
22

3-
[![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)
4-
[![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)
5-
[![Gitter](https://img.shields.io/badge/chat-on%20gitter-yellow.svg)](https://gitter.im/Microsoft/vscode)
3+
[![Gitpod ready-to-code](https://img.shields.io/badge/Gitpod-ready--to--code-908a85?logo=gitpod)](https://gitpod.io/from-referrer)
4+
[![GitHub](https://img.shields.io/github/license/gitpod-io/openvscode-server)](https://github.com/gitpod-io/openvscode-server/blob/main/LICENSE.txt)
5+
[![Discord](https://img.shields.io/discord/816244985187008514)](https://www.gitpod.io/chat)
66

7-
## The Repository
7+
## What is this?
88

9-
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).
9+
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.
1010

11-
## Visual Studio Code
11+
<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">
1212

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

17-
[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/).
15+
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.
1816

19-
[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.
17+
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.
2018

21-
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).
19+
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.
2220

23-
## Contributing
21+
## Getting started
2422

25-
There are many ways in which you can participate in this project, for example:
23+
### Docker
2624

27-
* [Submit bugs and feature requests](https://github.com/microsoft/vscode/issues), and help us verify as they are checked in
28-
* Review [source code changes](https://github.com/microsoft/vscode/pulls)
29-
* Review the [documentation](https://github.com/microsoft/vscode-docs) and make pull requests for anything from typos to additional and new content
25+
- Start the server:
26+
```bash
27+
docker run -it --init -p 3000:3000 -v "$(pwd):/home/workspace:cached" gitpod/openvscode-server
28+
```
29+
- Visit the URL printed in your terminal.
3030

31-
If you are interested in fixing issues and contributing directly to the code base,
32-
please see the document [How to Contribute](https://github.com/microsoft/vscode/wiki/How-to-Contribute), which covers the following:
3331

34-
* [How to build and run from source](https://github.com/microsoft/vscode/wiki/How-to-Contribute)
35-
* [The development workflow, including debugging and running tests](https://github.com/microsoft/vscode/wiki/How-to-Contribute#debugging)
36-
* [Coding guidelines](https://github.com/microsoft/vscode/wiki/Coding-Guidelines)
37-
* [Submitting pull requests](https://github.com/microsoft/vscode/wiki/How-to-Contribute#pull-requests)
38-
* [Finding an issue to work on](https://github.com/microsoft/vscode/wiki/How-to-Contribute#where-to-contribute)
39-
* [Contributing to translations](https://aka.ms/vscodeloc)
32+
_Note_: Feel free to use the `nightly` tag to test the latest version, i.e. `gitpod/openvscode-server:nightly`.
4033

41-
## Feedback
34+
#### Custom Environment
35+
- If you want to add dependencies to this Docker image, here is a template to help:
36+
```Dockerfile
4237

43-
* Ask a question on [Stack Overflow](https://stackoverflow.com/questions/tagged/vscode)
44-
* [Request a new feature](CONTRIBUTING.md)
45-
* Upvote [popular feature requests](https://github.com/microsoft/vscode/issues?q=is%3Aopen+is%3Aissue+label%3Afeature-request+sort%3Areactions-%2B1-desc)
46-
* [File an issue](https://github.com/microsoft/vscode/issues)
47-
* Connect with the extension author community on [GitHub Discussions](https://github.com/microsoft/vscode-discussions/discussions) or [Slack](https://aka.ms/vscode-dev-community)
48-
* Follow [@code](https://twitter.com/code) and let us know what you think!
38+
FROM gitpod/openvscode-server:latest
4939

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

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

54-
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).
47+
### Linux
5548

56-
## Bundled Extensions
49+
- [Download the latest release](https://github.com/gitpod-io/openvscode-server/releases/latest)
50+
- Untar and run the server
51+
```bash
52+
tar -xzf openvscode-server-v${OPENVSCODE_SERVER_VERSION}.tar.gz
53+
cd openvscode-server-v${OPENVSCODE_SERVER_VERSION}
54+
./bin/openvscode-server # you can add arguments here, use --help to list all of the possible options
55+
```
5756

58-
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`.
57+
From the possible entrypoint arguments, the most notable ones are
58+
- `--port` - the port number to start the server on, this is 3000 by default
59+
- `--without-connection-token` - used by default in the docker image
60+
- `--connection-token` & `--connection-secret` for securing access to the IDE, you can read more about it in [Securing access to your IDE](#securing-access-to-your-ide).
61+
- `--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.
5962

60-
## Development Container
63+
- Visit the URL printed in your terminal.
6164

62-
This repository includes a Visual Studio Code Dev Containers / GitHub Codespaces development container.
65+
_Note_: You can use [pre-releases](https://github.com/gitpod-io/openvscode-server/releases) to test nightly changes.
6366

64-
* 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.
65-
* 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.
67+
### Securing access to your IDE
6668

67-
* 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.
69+
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-secret YOUR_SECRET_FILE`.
6870

69-
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.
71+
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/eb59ab37e23f8d17532b4af4de37eafaf48037a5/Dockerfile#L64) or modify it with the [`entrypoint` option](https://docs.docker.com/compose/compose-file/compose-file-v3/#entrypoint) when working with `docker-compose`.
72+
73+
### Deployment guides
7074

71-
## Code of Conduct
75+
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.
7276

73-
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 [[email protected]](mailto:[email protected]) with any additional questions or comments.
77+
## The scope of this project
7478

75-
## License
79+
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.
80+
81+
> **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)**
82+
83+
## Documentation
84+
85+
All documentation is available in [the `docs` branch](https://github.com/gitpod-io/openvscode-server/tree/docs) of this project.
86+
87+
## Supporters
88+
89+
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/).
90+
91+
## Contributing
7692

77-
Copyright (c) Microsoft Corporation. All rights reserved.
93+
Thanks for your interest in contributing to the project 🙏. You can start a development environment with the following button:
94+
95+
[![Open in Gitpod](https://gitpod.io/button/open-in-gitpod.svg)](https://gitpod.io/from-referrer)
96+
97+
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).
98+
99+
## Bundled Extensions
100+
101+
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`.
102+
103+
## Development Container
104+
105+
This repository includes a Visual Studio Code Dev Containers / GitHub Codespaces development container.
106+
107+
- 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.
108+
- 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.
109+
- 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.
110+
111+
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.
78112

79-
Licensed under the [MIT](LICENSE.txt) license.
113+
## Legal
114+
This project is not affiliated with Microsoft Corporation.

build/gulpfile.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,8 @@ gulp.task(compileClientTask);
3434
const watchClientTask = task.define('watch-client', task.series(util.rimraf('out'), task.parallel(watchTask('out', false), watchApiProposalNamesTask)));
3535
gulp.task(watchClientTask);
3636

37+
gulp.task(task.define('watch-init', require('./lib/compilation').watchTask('out', false)));
38+
3739
// All
3840
const _compileTask = task.define('compile', task.parallel(monacoTypecheckTask, compileClientTask, compileExtensionsTask, compileExtensionMediaTask));
3941
gulp.task(_compileTask);

build/lib/compilation.js

Lines changed: 14 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)