Skip to content

Commit fa13074

Browse files
akosyakovmustard-mh
authored andcommitted
gitpod server initial commit
Tool: gitpod/catfood.gitpod.cloud
1 parent 509cc67 commit fa13074

File tree

75 files changed

+10914
-844
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

75 files changed

+10914
-844
lines changed

.gitpod.Dockerfile

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
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/*

.gitpod.yml

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
image:
2+
file: .gitpod.Dockerfile
3+
ports:
4+
- port: 8080
5+
onOpen: open-browser
6+
tasks:
7+
- init: |
8+
npm ci
9+
gp sync-done dependencies
10+
npm run server:init
11+
command: |
12+
gp sync-done init
13+
export NODE_ENV=development
14+
export VSCODE_DEV=1
15+
npm run watch
16+
name: watch app
17+
- command: |
18+
export NODE_ENV=development
19+
export VSCODE_DEV=1
20+
gp sync-await init
21+
./scripts/code-server.sh --without-connection-token
22+
name: run app
23+
openMode: split-right
24+
- name: Local Proxy
25+
command: |
26+
cd gitpod
27+
gp ports await 9888
28+
go run proxy.go
29+
- name: Build Prepare
30+
init: |
31+
gp sync-await dependencies
32+
npm run gulp compile-build-without-mangling
33+
npm run gulp extensions-ci \
34+
&& npm run gulp minify-vscode-reh \
35+
&& npm run gulp vscode-web-min-ci \
36+
&& npm run gulp vscode-reh-linux-x64-min-ci
37+
38+
vscode:
39+
extensions:
40+
- dbaeumer.vscode-eslint
41+
- svelte.svelte-vscode

.vscode/launch.json

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -334,7 +334,15 @@
334334
"presentation": {
335335
"group": "0_vscode",
336336
"order": 2
337-
}
337+
},
338+
"env": {
339+
"VSCODE_DEV": "1",
340+
"NODE_ENV": "development"
341+
},
342+
"args": [
343+
"--host=127.0.0.1",
344+
"--without-connection-token"
345+
]
338346
},
339347
{
340348
"type": "node",

.vscode/settings.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@
101101
"git.branchProtectionPrompt": "alwaysCommitToNewBranch",
102102
"git.branchRandomName.enable": true,
103103
"git.pullBeforeCheckout": true,
104-
"git.mergeEditor": true,
104+
"git.mergeEditor": false,
105105
"remote.extensionKind": {
106106
"msjsdiag.debugger-for-chrome": "workspace"
107107
},

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"]

build/.moduleignore

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -186,3 +186,10 @@ zone.js/dist/**
186186
@xterm/xterm-addon-*/fixtures/**
187187
@xterm/xterm-addon-*/out/**
188188
@xterm/xterm-addon-*/out-test/**
189+
190+
# TODO: Remove this once gitpod-protocol package doesn't ship source code
191+
@gitpod/gitpod-protocol/src/**
192+
@gitpod/gitpod-protocol/data/**
193+
@gitpod/gitpod-protocol/node_modules/**
194+
@gitpod/gitpod-protocol/lib/*.d.ts
195+
@gitpod/gitpod-protocol/lib/*.d.ts.map

build/.webignore

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,3 +57,19 @@ vscode-textmate/webpack.config.js
5757

5858
vsda/**
5959
!vsda/rust/web/**
60+
61+
@improbable-eng/**
62+
!@improbable-eng/grpc-web/dist/grpc-web-client.umd.js
63+
64+
@gitpod/**
65+
!@gitpod/local-app-api-grpcweb/lib/localapp.js
66+
!@gitpod/ide-metrics-api-grpcweb/lib/index.js
67+
68+
browser-headers/**
69+
google-protobuf/**
70+
71+
@zip.js/**
72+
!@zip.js/zip.js/dist/zip-no-worker-deflate.min.js
73+
74+
@jeanp413/analytics-node-umd/**
75+
!@jeanp413/analytics-node-umd/dist/umd/index.js

build/buildfile.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,8 @@ exports.code = [
4747
createModuleDescription('vs/workbench/contrib/webview/browser/pre/service-worker')
4848
];
4949

50-
exports.codeWeb = createModuleDescription('vs/code/browser/workbench/workbench');
50+
// exports.codeWeb = createModuleDescription('vs/code/browser/workbench/workbench');
51+
exports.codeWeb = createModuleDescription('vs/gitpod/browser/workbench/workbench');
5152

5253
exports.codeServer = [
5354
// 'vs/server/node/server.main' is not included here because it gets inlined via ./src/server-main.js

build/checksums/vscode-sysroot.txt

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
1-
3baac81a39b69e0929e4700f4f78f022adefc515010054ec393565657c4fff32 aarch64-linux-gnu-glibc-2.28-gcc-10.5.0.tar.gz
2-
b4fb7a62ee7a474cfb11d5fb2b73accd6a8c875a559db81d6dfccd0b4a3da442 aarch64-linux-gnu-glibc-2.28-gcc-8.5.0.tar.gz
3-
633e88658561ab4643bc5998c88e565a26553b0e97fd07672cb452afb4d9b276 aarch64-linux-musl-gcc-10.3.0.tar.gz
4-
6e251200607ac4c4709ebd08b2dc0d9a353ddcfdb47f43a10c2b4cc4b49920c0 arm-rpi-linux-gnueabihf-glibc-2.28-gcc-10.5.0.tar.gz
5-
f82c8dacbb9dd85819e4801909eb4e842ac12c899632aa75b4839383a18c7501 arm-rpi-linux-gnueabihf-glibc-2.28-gcc-8.5.0.tar.gz
6-
3122af49c493c5c767c2b0772a41119cbdc9803125a705683445b4066dc88b82 x86_64-linux-gnu-glibc-2.28-gcc-10.5.0.tar.gz
7-
84acc5a15566c98ddf80631731d672e0ce9febcf3f2e969101e0dfd7ef2405e3 x86_64-linux-gnu-glibc-2.28-gcc-8.5.0.tar.gz
1+
4aa30f61adde7839ca5616e23cb44625a16b4dd77e5ce38df214d8dfbf4d3596 aarch64-linux-gnu-glibc-2.17.tar.gz
2+
4a00f87f0d109f66698244cf2bca4c237ff5bb84be4953bd2e624df7d46a4ccb aarch64-linux-gnu-glibc-2.28.tar.gz
3+
76226b2a2be87c1d6cbd60371df30b2794d7c9595794786e1be34318be201948 arm-rpi-linux-gnueabihf-glibc-2.17.tar.gz
4+
3625f8b5e36a42615f904fa3c222dcf35e37d4a46c2ea52f81cad36af5d1c07a arm-rpi-linux-gnueabihf-glibc-2.28.tar.gz
5+
2ab8ad5a09270df7562ff79662f07c23d857ca19fa34dbe63999feabf4375bbb x86_64-linux-gnu-glibc-2.17.tar.gz
6+
e655175b6143145f5d5f7d84a894f405e0df597b811a507dced6ead03f773bcb x86_64-linux-gnu-glibc-2.28.tar.gz

build/gulpfile.reh.js

Lines changed: 57 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -93,12 +93,14 @@ const serverResources = [
9393

9494
const serverWithWebResourceIncludes = [
9595
...serverResourceIncludes,
96-
'out-build/vs/code/browser/workbench/*.html',
96+
// 'out-build/vs/code/browser/workbench/*.html',
97+
'out-build/vs/gitpod/browser/workbench/*.html',
9798
...vscodeWebResourceIncludes
9899
];
99100

100101
const serverWithWebResourceExcludes = [
101102
...serverResourceExcludes,
103+
'!out-build/vs/gitpod/**/*-dev.html',
102104
'!out-build/vs/code/**/*-dev.html'
103105
];
104106

@@ -442,7 +444,12 @@ function tweakProductForServerWeb(product) {
442444
...bootstrapEntryPoints
443445
],
444446
resources: type === 'reh' ? serverResources : serverWithWebResources,
445-
fileContentMapper: createVSCodeWebFileContentMapper('.build/extensions', type === 'reh-web' ? tweakProductForServerWeb(product) : product)
447+
fileContentMapper: createVSCodeWebFileContentMapper('.build/extensions', type === 'reh-web' ? tweakProductForServerWeb(product) : product),
448+
header: [
449+
'/*!-----------------------------------------',
450+
' * Copyright (c) Gitpod. All rights reserved.',
451+
' *-----------------------------------------*/'
452+
].join('\n')
446453
}
447454
}
448455
)
@@ -464,11 +471,58 @@ function tweakProductForServerWeb(product) {
464471
const sourceFolderName = `out-vscode-${type}${dashed(minified)}`;
465472
const destinationFolderName = `vscode-${type}${dashed(platform)}${dashed(arch)}`;
466473

474+
/**
475+
* This dummy extension is a mock the for built-in extension called `github-authentication`.
476+
* In Gitpod we don't use the built-in extension (it's implemented inside gitpod-web extension)
477+
* but if this one is missing, it breaks the GitHub Authentication for extensions that depend
478+
* explicitly on `github-authentication` like `github.vscode-pull-request-github`
479+
*/
480+
const createDummyGitHubAuthExtensionTask = task.define('createDummyGitHubAuthExtensionTask', (done) => {
481+
const dir = path.join(BUILD_ROOT, destinationFolderName, 'extensions', 'github-authentication');
482+
483+
if (!fs.existsSync(dir)) {
484+
fs.mkdirSync(dir, { recursive: true });
485+
}
486+
487+
const packageJsonContent = {
488+
name: 'github-authentication',
489+
displayName: 'GitHub Authentication',
490+
description: 'Gitpod Override', // TODO: change
491+
publisher: 'vscode',
492+
license: 'MIT',
493+
version: '0.0.2',
494+
engines: {
495+
vscode: '^1.41.0',
496+
},
497+
categories: ['Other'],
498+
api: 'none',
499+
extensionKind: ['ui', 'workspace'],
500+
activationEvents: [
501+
'onAuthenticationRequest:github',
502+
],
503+
capabilities: {
504+
virtualWorkspaces: true,
505+
untrustedWorkspaces: {
506+
supported: true,
507+
},
508+
},
509+
main: './extension.js',
510+
};
511+
512+
const extensionJsContent = `module.exports = function activate() {}`;
513+
514+
fs.writeFileSync(path.join(dir, 'package.json'), JSON.stringify(packageJsonContent, null, 2));
515+
fs.writeFileSync(path.join(dir, 'extension.js'), extensionJsContent);
516+
517+
done();
518+
});
519+
467520
const serverTaskCI = task.define(`vscode-${type}${dashed(platform)}${dashed(arch)}${dashed(minified)}-ci`, task.series(
468521
compileNativeExtensionsBuildTask,
469522
gulp.task(`node-${platform}-${arch}`),
470523
util.rimraf(path.join(BUILD_ROOT, destinationFolderName)),
471-
packageTask(type, platform, arch, sourceFolderName, destinationFolderName)
524+
packageTask(type, platform, arch, sourceFolderName, destinationFolderName),
525+
createDummyGitHubAuthExtensionTask
472526
));
473527
gulp.task(serverTaskCI);
474528

build/gulpfile.vscode.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,8 +110,10 @@ const vscodeResources = [
110110

111111
// Excludes
112112
'!out-build/vs/code/browser/**',
113+
'!out-build/vs/gitpod/browser/**',
113114
'!out-build/vs/editor/standalone/**',
114115
'!out-build/vs/code/**/*-dev.html',
116+
'!out-build/vs/gitpod/**/*-dev.html',
115117
'!out-build/vs/workbench/contrib/issue/**/*-dev.html',
116118
'!**/test/**'
117119
];

0 commit comments

Comments
 (0)