Skip to content

Commit 9001270

Browse files
committed
code web server initial commit
1 parent 379476f commit 9001270

31 files changed

+2926
-53
lines changed

.eslintrc.json

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -789,6 +789,18 @@
789789
"**/vs/workbench/workbench.web.api"
790790
]
791791
},
792+
{
793+
"target": "**/vs/server/browser/**",
794+
"restrictions": [
795+
"vs/nls",
796+
"vs/css!./**/*",
797+
"**/vs/base/**/{common,browser}/**",
798+
"**/vs/base/parts/**/{common,browser}/**",
799+
"**/vs/platform/**/{common,browser}/**",
800+
"**/vs/code/**/{common,browser}/**",
801+
"**/vs/workbench/workbench.web.api"
802+
]
803+
},
792804
{
793805
"target": "**/vs/code/node/**",
794806
"restrictions": [
@@ -824,7 +836,7 @@
824836
]
825837
},
826838
{
827-
"target": "**/vs/server/**",
839+
"target": "**/vs/server/node/**",
828840
"restrictions": [
829841
"vs/nls",
830842
"**/vs/base/**/{common,node}/**",
@@ -981,16 +993,6 @@
981993
"xterm*"
982994
]
983995
}
984-
],
985-
"header/header": [
986-
2,
987-
"block",
988-
[
989-
"---------------------------------------------------------------------------------------------",
990-
" * Copyright (c) Microsoft Corporation. All rights reserved.",
991-
" * Licensed under the MIT License. See License.txt in the project root for license information.",
992-
" *--------------------------------------------------------------------------------------------"
993-
]
994996
]
995997
},
996998
"overrides": [

.gitignore

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
.DS_Store
1+
*.DS_Store
22
.cache
33
npm-debug.log
44
Thumbs.db
@@ -7,8 +7,6 @@ node_modules/
77
extensions/**/dist/
88
/out*/
99
/extensions/**/out/
10-
src/vs/server
11-
resources/server
1210
build/node_modules
1311
coverage/
1412
test_data/

.gitpod.Dockerfile

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
FROM gitpod/workspace-full:latest
2+
3+
USER root
4+
5+
# leeway
6+
ENV LEEWAY_NESTED_WORKSPACE=true
7+
RUN cd /usr/bin && curl -fsSL https://github.com/gitpod-io/leeway/releases/download/v0.2.5/leeway_0.2.5_Linux_x86_64.tar.gz | tar xz
8+
9+
USER gitpod
10+
11+
# We use latest major version of Node.js distributed VS Code. (see about dialog in your local VS Code)
12+
RUN bash -c ". .nvm/nvm.sh \
13+
&& nvm install 14 \
14+
&& nvm use 14 \
15+
&& nvm alias default 14"
16+
17+
RUN echo "nvm use default &>/dev/null" >> ~/.bashrc.d/51-nvm-fix
18+
19+
# Install dependencies
20+
RUN sudo apt-get update \
21+
&& sudo apt-get install -y --no-install-recommends \
22+
xvfb x11vnc fluxbox dbus-x11 x11-utils x11-xserver-utils xdg-utils \
23+
fbautostart xterm eterm gnome-terminal gnome-keyring seahorse nautilus \
24+
libx11-dev libxkbfile-dev libsecret-1-dev libnotify4 libnss3 libxss1 \
25+
libasound2 libgbm1 xfonts-base xfonts-terminus fonts-noto fonts-wqy-microhei \
26+
fonts-droid-fallback vim-tiny nano libgconf2-dev libgtk-3-dev twm \
27+
&& sudo apt-get clean && sudo rm -rf /var/cache/apt/* && sudo rm -rf /var/lib/apt/lists/* && sudo rm -rf /tmp/*
28+
29+
## Register leeway autocompletion in bashrc
30+
RUN bash -c "echo . \<\(leeway bash-completion\) >> ~/.bashrc"
31+
32+
### Google Cloud ###
33+
# not installed via repository as then 'docker-credential-gcr' is not available
34+
ARG GCS_DIR=/opt/google-cloud-sdk
35+
ENV PATH=$GCS_DIR/bin:$PATH
36+
RUN sudo chown gitpod: /opt \
37+
&& mkdir $GCS_DIR \
38+
&& curl -fsSL https://dl.google.com/dl/cloudsdk/channels/rapid/downloads/google-cloud-sdk-344.0.0-linux-x86_64.tar.gz \
39+
| tar -xzvC /opt \
40+
&& /opt/google-cloud-sdk/install.sh --quiet --usage-reporting=false --bash-completion=true \
41+
--additional-components docker-credential-gcr alpha beta \
42+
# needed for access to our private registries
43+
&& docker-credential-gcr configure-docker
44+
45+
# Install tools for gsutil
46+
RUN sudo install-packages \
47+
gcc \
48+
python-dev \
49+
python-setuptools
50+
51+
RUN bash -c "pip uninstall crcmod; pip install --no-cache-dir -U crcmod"
52+
53+
# Set Application Default Credentials (ADC) based on user-provided env var
54+
RUN echo ". /workspace/vscode/scripts/setup-google-adc.sh" >> ~/.bashrc
55+
56+
ENV LEEWAY_WORKSPACE_ROOT=/workspace/vscode
57+
ENV LEEWAY_REMOTE_CACHE_BUCKET=gitpod-core-leeway-cache-branch

.gitpod.yml

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
image:
2+
file: .gitpod.Dockerfile
3+
ports:
4+
- port: 3000
5+
onOpen: open-browser
6+
tasks:
7+
- init: |
8+
export VSCODE_INIT_BUILD_DIR=$(leeway describe "//:init" -t "/tmp/build/{{ .Metadata.Name }}.{{ .Metadata.Version }}")
9+
leeway build
10+
sudo cp -rup "$VSCODE_INIT_BUILD_DIR/install/." . | true
11+
command: |
12+
gp sync-done init
13+
export NODE_ENV=development
14+
export VSCODE_DEV=1
15+
yarn gulp watch-init
16+
name: watch app
17+
- command: |
18+
export NODE_ENV=development
19+
export VSCODE_DEV=1
20+
gp sync-await init
21+
node out/server.js
22+
name: run app
23+
openMode: split-right
24+
github:
25+
prebuilds:
26+
pullRequestsFromForks: true
27+
vscode:
28+
extensions:
29+
- dbaeumer.vscode-eslint

.leewayignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
/node_modules/
2+
/out/
3+
/.build/
4+
/.git/

.vscode/launch.json

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,21 @@
11
{
22
"version": "0.1.0",
33
"configurations": [
4+
{
5+
"type": "node",
6+
"request": "launch",
7+
"name": "Code Server",
8+
"args": [
9+
"${workspaceFolder}/out/server.js"
10+
],
11+
"outFiles": [
12+
"${workspaceFolder}/out/**/*.js"
13+
],
14+
"env": {
15+
"NODE_ENV": "development",
16+
"VSCODE_DEV": "1"
17+
}
18+
},
419
{
520
"type": "node",
621
"request": "launch",

BUILD.yaml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
packages:
2+
- name: install
3+
type: generic
4+
srcs:
5+
- "**"
6+
config:
7+
commands:
8+
- ["yarn"]
9+
- name: init
10+
type: generic
11+
deps:
12+
- ":install"
13+
config:
14+
commands:
15+
- ["yarn", "--cwd", "./install/build", "compile"]
16+
- ["yarn", "--cwd", "./install", "compile"]
17+
- ["yarn", "--cwd", "./install", "download-builtin-extensions"]

WORKSPACE.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
defaultTarget: "//:init"
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
"use strict";
2+
/*---------------------------------------------------------------------------------------------
3+
* Copyright (c) Microsoft Corporation. All rights reserved.
4+
* Licensed under the MIT License. See License.txt in the project root for license information.
5+
*--------------------------------------------------------------------------------------------*/
6+
Object.defineProperty(exports, "__esModule", { value: true });
7+
const sign_1 = require("./sign");
8+
const path = require("path");
9+
(0, sign_1.main)([
10+
process.env['EsrpCliDllPath'],
11+
'windows',
12+
process.env['ESRPPKI'],
13+
process.env['ESRPAADUsername'],
14+
process.env['ESRPAADPassword'],
15+
path.dirname(process.argv[2]),
16+
path.basename(process.argv[2])
17+
]);

build/azure-pipelines/common/sign.js

Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
"use strict";
2+
/*---------------------------------------------------------------------------------------------
3+
* Copyright (c) Microsoft Corporation. All rights reserved.
4+
* Licensed under the MIT License. See License.txt in the project root for license information.
5+
*--------------------------------------------------------------------------------------------*/
6+
Object.defineProperty(exports, "__esModule", { value: true });
7+
exports.main = void 0;
8+
const cp = require("child_process");
9+
const fs = require("fs");
10+
const tmp = require("tmp");
11+
const crypto = require("crypto");
12+
function getParams(type) {
13+
switch (type) {
14+
case 'windows':
15+
return '[{"keyCode":"CP-230012","operationSetCode":"SigntoolSign","parameters":[{"parameterName":"OpusName","parameterValue":"VS Code"},{"parameterName":"OpusInfo","parameterValue":"https://code.visualstudio.com/"},{"parameterName":"Append","parameterValue":"/as"},{"parameterName":"FileDigest","parameterValue":"/fd \\"SHA256\\""},{"parameterName":"PageHash","parameterValue":"/NPH"},{"parameterName":"TimeStamp","parameterValue":"/tr \\"http://rfc3161.gtm.corp.microsoft.com/TSS/HttpTspServer\\" /td sha256"}],"toolName":"sign","toolVersion":"1.0"},{"keyCode":"CP-230012","operationSetCode":"SigntoolVerify","parameters":[{"parameterName":"VerifyAll","parameterValue":"/all"}],"toolName":"sign","toolVersion":"1.0"}]';
16+
case 'rpm':
17+
return '[{ "keyCode": "CP-450779-Pgp", "operationSetCode": "LinuxSign", "parameters": [], "toolName": "sign", "toolVersion": "1.0" }]';
18+
case 'darwin-sign':
19+
return '[{"keyCode":"CP-401337-Apple","operationSetCode":"MacAppDeveloperSign","parameters":[{"parameterName":"Hardening","parameterValue":"--options=runtime"}],"toolName":"sign","toolVersion":"1.0"}]';
20+
case 'darwin-notarize':
21+
return '[{"keyCode":"CP-401337-Apple","operationSetCode":"MacAppNotarize","parameters":[{"parameterName":"BundleId","parameterValue":"$(BundleIdentifier)"}],"toolName":"sign","toolVersion":"1.0"}]';
22+
default:
23+
throw new Error(`Sign type ${type} not found`);
24+
}
25+
}
26+
function main([esrpCliPath, type, cert, username, password, folderPath, pattern]) {
27+
tmp.setGracefulCleanup();
28+
const patternPath = tmp.tmpNameSync();
29+
fs.writeFileSync(patternPath, pattern);
30+
const paramsPath = tmp.tmpNameSync();
31+
fs.writeFileSync(paramsPath, getParams(type));
32+
const keyFile = tmp.tmpNameSync();
33+
const key = crypto.randomBytes(32);
34+
const iv = crypto.randomBytes(16);
35+
fs.writeFileSync(keyFile, JSON.stringify({ key: key.toString('hex'), iv: iv.toString('hex') }));
36+
const clientkeyPath = tmp.tmpNameSync();
37+
const clientkeyCypher = crypto.createCipheriv('aes-256-cbc', key, iv);
38+
let clientkey = clientkeyCypher.update(password, 'utf8', 'hex');
39+
clientkey += clientkeyCypher.final('hex');
40+
fs.writeFileSync(clientkeyPath, clientkey);
41+
const clientcertPath = tmp.tmpNameSync();
42+
const clientcertCypher = crypto.createCipheriv('aes-256-cbc', key, iv);
43+
let clientcert = clientcertCypher.update(cert, 'utf8', 'hex');
44+
clientcert += clientcertCypher.final('hex');
45+
fs.writeFileSync(clientcertPath, clientcert);
46+
const args = [
47+
esrpCliPath,
48+
'vsts.sign',
49+
'-a', username,
50+
'-k', clientkeyPath,
51+
'-z', clientcertPath,
52+
'-f', folderPath,
53+
'-p', patternPath,
54+
'-u', 'false',
55+
'-x', 'regularSigning',
56+
'-b', 'input.json',
57+
'-l', 'AzSecPack_PublisherPolicyProd.xml',
58+
'-y', 'inlineSignParams',
59+
'-j', paramsPath,
60+
'-c', '9997',
61+
'-t', '120',
62+
'-g', '10',
63+
'-v', 'Tls12',
64+
'-s', 'https://api.esrp.microsoft.com/api/v1',
65+
'-m', '0',
66+
'-o', 'Microsoft',
67+
'-i', 'https://www.microsoft.com',
68+
'-n', '5',
69+
'-r', 'true',
70+
'-e', keyFile,
71+
];
72+
cp.spawnSync('dotnet', args, { stdio: 'inherit' });
73+
}
74+
exports.main = main;
75+
if (require.main === module) {
76+
main(process.argv.slice(2));
77+
}

build/gulpfile.extensions.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -222,7 +222,9 @@ const compileExtensionsBuildTask = task.define('compile-extensions-build', task.
222222
));
223223

224224
gulp.task(compileExtensionsBuildTask);
225-
gulp.task(task.define('extensions-ci', task.series(compileExtensionsBuildTask, compileExtensionMediaBuildTask)));
225+
const compileExtensionsCi = task.series(compileExtensionsBuildTask, compileExtensionMediaBuildTask);
226+
gulp.task(task.define('extensions-ci', compileExtensionsCi));
227+
exports.compileExtensionsCi = compileExtensionsCi;
226228

227229
exports.compileExtensionsBuildTask = compileExtensionsBuildTask;
228230

0 commit comments

Comments
 (0)