mirror of
https://github.com/coder/code-server.git
synced 2026-04-14 06:24:32 -05:00
Compare commits
342 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
c041986976 | ||
|
|
ddee4f748c | ||
|
|
cc50e7f72b | ||
|
|
174d9a7b31 | ||
|
|
862c977dc8 | ||
|
|
4ffecd641d | ||
|
|
3339853c26 | ||
|
|
6045fdd3ac | ||
|
|
24f6834f5b | ||
|
|
c31e72fb7b | ||
|
|
f4eba6da46 | ||
|
|
0777d5ea04 | ||
|
|
723a2745f6 | ||
|
|
fc16f7e06d | ||
|
|
a5cf01840a | ||
|
|
7ce9ee0db6 | ||
|
|
c14500849b | ||
|
|
66b6590e36 | ||
|
|
a96e16e593 | ||
|
|
8c2661b946 | ||
|
|
58f4884c85 | ||
|
|
ec9ddd59c8 | ||
|
|
8fe31dfbf8 | ||
|
|
fd042107b2 | ||
|
|
2a5f5e4e18 | ||
|
|
dafa95bfa1 | ||
|
|
72d5a26388 | ||
|
|
3db019d6b9 | ||
|
|
343cec5159 | ||
|
|
632f980bae | ||
|
|
15d256b429 | ||
|
|
8e75d320ff | ||
|
|
66dc4cc0dc | ||
|
|
197bccc7cd | ||
|
|
5181ac6912 | ||
|
|
71a8f9a103 | ||
|
|
00f319e4db | ||
|
|
47afa15ece | ||
|
|
a465af18dc | ||
|
|
9fdf049ecc | ||
|
|
876a800753 | ||
|
|
5471f14c2f | ||
|
|
23b296d550 | ||
|
|
722426856c | ||
|
|
043d5abcaa | ||
|
|
5f4d0713bf | ||
|
|
5141543cd9 | ||
|
|
17816bb3bd | ||
|
|
9dfc72de1d | ||
|
|
ae1839a140 | ||
|
|
60ef5b5cf2 | ||
|
|
3777d569e9 | ||
|
|
0b072e771e | ||
|
|
6f7ae29dc4 | ||
|
|
990414cae1 | ||
|
|
2540b0d02c | ||
|
|
102f8117b7 | ||
|
|
dc39da1638 | ||
|
|
d4accfe806 | ||
|
|
05134e419b | ||
|
|
d2f11b7fcd | ||
|
|
1dfbf9a00b | ||
|
|
a1e5d39919 | ||
|
|
ac4ef818b5 | ||
|
|
c8bcfade7f | ||
|
|
83674c524d | ||
|
|
d29391ae75 | ||
|
|
7ad536b5e9 | ||
|
|
b365830388 | ||
|
|
f3c4dcd074 | ||
|
|
58514c422f | ||
|
|
002fa08222 | ||
|
|
f8a1a1ce02 | ||
|
|
908b2c8502 | ||
|
|
5a6af17725 | ||
|
|
1ff09b814e | ||
|
|
4ca4a26bec | ||
|
|
ad92287d7e | ||
|
|
975dd13d12 | ||
|
|
c0e123a801 | ||
|
|
2ba03c3424 | ||
|
|
2092f82270 | ||
|
|
22a22a8f7a | ||
|
|
c505fc45a8 | ||
|
|
b009ad0633 | ||
|
|
faa896c12c | ||
|
|
4dcf3efeab | ||
|
|
bb1b129a24 | ||
|
|
8695c874ed | ||
|
|
7f12fab3ca | ||
|
|
e9d4f877f9 | ||
|
|
d2f0e1738d | ||
|
|
df814aa39a | ||
|
|
33dbb7b707 | ||
|
|
f194c14e6c | ||
|
|
6dbabc0951 | ||
|
|
f92cbb7470 | ||
|
|
2238d7391e | ||
|
|
43c6ffcb8f | ||
|
|
49c7cc6e8a | ||
|
|
f2fa7701a9 | ||
|
|
da4de439e0 | ||
|
|
49c44818d9 | ||
|
|
add55ecd62 | ||
|
|
ba0364a522 | ||
|
|
4a47ce774d | ||
|
|
4131b3fb05 | ||
|
|
7e32b8fb86 | ||
|
|
e1d291e59c | ||
|
|
6e1455da88 | ||
|
|
b597519ab5 | ||
|
|
be7ea8f3f7 | ||
|
|
df01808d4d | ||
|
|
a7a6d7e22a | ||
|
|
a355012560 | ||
|
|
95536fafa9 | ||
|
|
9042bbae9a | ||
|
|
7912809af1 | ||
|
|
010c1d8f2f | ||
|
|
952aafff57 | ||
|
|
18f90a7832 | ||
|
|
2d467b4fbc | ||
|
|
1b288f91e4 | ||
|
|
3226a53b02 | ||
|
|
02b9489489 | ||
|
|
4b0dd07634 | ||
|
|
d4fe54601b | ||
|
|
fbba8e8b25 | ||
|
|
803dadbfa2 | ||
|
|
f2040b18e6 | ||
|
|
c5f0b1052c | ||
|
|
5b261e13a9 | ||
|
|
9422a4aba7 | ||
|
|
aa08f84aeb | ||
|
|
a51836fca7 | ||
|
|
bee35549f1 | ||
|
|
d9bb1a36eb | ||
|
|
5f7e9b7361 | ||
|
|
ece5de699a | ||
|
|
bf45e7ca15 | ||
|
|
9dae4fec25 | ||
|
|
83701f9f6d | ||
|
|
4e14c11fa4 | ||
|
|
79f372c1a0 | ||
|
|
cbe3192971 | ||
|
|
ddbff58eec | ||
|
|
18c0f32c24 | ||
|
|
b59b3936d0 | ||
|
|
3241a4f521 | ||
|
|
5c9b625acb | ||
|
|
5fae520ebe | ||
|
|
4bb7a8ddb9 | ||
|
|
2c818e3855 | ||
|
|
dbb34ad710 | ||
|
|
fda44240c9 | ||
|
|
9fc9c041ad | ||
|
|
a802a920ac | ||
|
|
54684c0ad2 | ||
|
|
2594aa3e41 | ||
|
|
717eaa6470 | ||
|
|
1e55a648a5 | ||
|
|
3b50bfc17d | ||
|
|
deaa2242ca | ||
|
|
8c2bb61af9 | ||
|
|
531b7c0c25 | ||
|
|
517aaf71c5 | ||
|
|
923761cd78 | ||
|
|
6020480b30 | ||
|
|
409b473c82 | ||
|
|
a14ea39c4a | ||
|
|
7ff4117531 | ||
|
|
ffa5c16e51 | ||
|
|
788b958e20 | ||
|
|
1134780b8b | ||
|
|
91303d4e40 | ||
|
|
0cdbd33b46 | ||
|
|
fcc3f0d951 | ||
|
|
fd3cb6cfa0 | ||
|
|
70197bb2a5 | ||
|
|
51f8341959 | ||
|
|
dc2db5c62d | ||
|
|
fc3326f1f2 | ||
|
|
aaf044728f | ||
|
|
f35120c0a3 | ||
|
|
17be8c5cd3 | ||
|
|
cac667317e | ||
|
|
dd2cb1649a | ||
|
|
d8c3ba6a17 | ||
|
|
4cd0456103 | ||
|
|
38647836bb | ||
|
|
9288b02f0a | ||
|
|
9052a1364a | ||
|
|
3edbd09ddb | ||
|
|
eadd194677 | ||
|
|
1cd736db81 | ||
|
|
8252e4460b | ||
|
|
ecbef27981 | ||
|
|
635170c7ed | ||
|
|
0659a2ea73 | ||
|
|
f37c748471 | ||
|
|
0400a891f7 | ||
|
|
c3dfb90eda | ||
|
|
7b6df50553 | ||
|
|
ca2ff01d68 | ||
|
|
23eacac207 | ||
|
|
f3640610b5 | ||
|
|
aa9fadfb6f | ||
|
|
e97b79f879 | ||
|
|
56abc4a7cb | ||
|
|
8b38314913 | ||
|
|
808daa44e1 | ||
|
|
05197d5213 | ||
|
|
988dc724f9 | ||
|
|
40ef0f23cb | ||
|
|
30a312df29 | ||
|
|
857c62ae1d | ||
|
|
7dfd3676c1 | ||
|
|
e02ecc2c80 | ||
|
|
54aea3f77f | ||
|
|
70b5ae0084 | ||
|
|
546dd9c278 | ||
|
|
58622ccc34 | ||
|
|
c2a8634bcc | ||
|
|
1aabca7df9 | ||
|
|
af9b2bfd3f | ||
|
|
0832df1a3f | ||
|
|
8c7e7819b9 | ||
|
|
1ccf69f731 | ||
|
|
8e92dd62ab | ||
|
|
b9dc2079fe | ||
|
|
0e67ab7b85 | ||
|
|
8ed578b686 | ||
|
|
b1186d7223 | ||
|
|
87cceb7f4c | ||
|
|
45d736a884 | ||
|
|
66cabab578 | ||
|
|
535e9720ef | ||
|
|
8accaf57d6 | ||
|
|
65a01ebe0f | ||
|
|
5c41954417 | ||
|
|
dc81786166 | ||
|
|
b07fa410c7 | ||
|
|
de16f57609 | ||
|
|
8df83acb5f | ||
|
|
6f7e9a37cd | ||
|
|
5c42b7c44b | ||
|
|
374bda17ab | ||
|
|
20874c1833 | ||
|
|
a86c9afae4 | ||
|
|
c6d5da1c9c | ||
|
|
3d9f9221fa | ||
|
|
35f57e5ebb | ||
|
|
ff93932ba2 | ||
|
|
471e4ac72b | ||
|
|
9f3d575973 | ||
|
|
99542e67aa | ||
|
|
cf13e6bf52 | ||
|
|
680a1e27c1 | ||
|
|
72b3fd9df4 | ||
|
|
2d7bc7f675 | ||
|
|
dc2d769161 | ||
|
|
0608e86e3d | ||
|
|
4fc8d98610 | ||
|
|
29292fd33b | ||
|
|
31aac201bf | ||
|
|
a4168e45d7 | ||
|
|
ed0ddeaf3e | ||
|
|
c0342436ff | ||
|
|
604491d333 | ||
|
|
ee78c31b4a | ||
|
|
c1bc464150 | ||
|
|
ac965176ca | ||
|
|
43d72c59bc | ||
|
|
1634349908 | ||
|
|
8f3de91775 | ||
|
|
75e6ab1197 | ||
|
|
1ffca5751c | ||
|
|
9d7ac2aa60 | ||
|
|
6e9e891684 | ||
|
|
5d393b9d91 | ||
|
|
4c77893ce2 | ||
|
|
ec07a03242 | ||
|
|
ef9e09d970 | ||
|
|
ff87ed26e4 | ||
|
|
288c3a2efb | ||
|
|
0d0f0d22d6 | ||
|
|
e983ba9a4b | ||
|
|
b3bd6c3703 | ||
|
|
a3663f54d0 | ||
|
|
2438fb307c | ||
|
|
12b1e484be | ||
|
|
eb82054357 | ||
|
|
1b75734332 | ||
|
|
ade43c02b7 | ||
|
|
9ab5ccf908 | ||
|
|
509d91ddab | ||
|
|
60d71fee6f | ||
|
|
62b5fadd9c | ||
|
|
a7cf990782 | ||
|
|
6f09749b65 | ||
|
|
b49b1796e9 | ||
|
|
36265ddfaf | ||
|
|
5fe76bdecf | ||
|
|
065b141106 | ||
|
|
604194d1b8 | ||
|
|
f5b792706a | ||
|
|
87953ca963 | ||
|
|
f80657d560 | ||
|
|
cf69860aed | ||
|
|
10f512c63a | ||
|
|
7be1ae36a2 | ||
|
|
fc894e47fb | ||
|
|
d2337bcd85 | ||
|
|
46fe77d464 | ||
|
|
d7f1415290 | ||
|
|
2a657ab930 | ||
|
|
a57ee69822 | ||
|
|
adc4463507 | ||
|
|
8e21eb51b3 | ||
|
|
800815f7fd | ||
|
|
0699bd7ead | ||
|
|
e64fd451b3 | ||
|
|
8f82d6e8b9 | ||
|
|
993b93cf28 | ||
|
|
83f266e07d | ||
|
|
416362be31 | ||
|
|
825a40e897 | ||
|
|
82ce9d5adb | ||
|
|
74fbb425f2 | ||
|
|
adc9b57080 | ||
|
|
715e5927bc | ||
|
|
6a4ff9c05c | ||
|
|
fd4ecabc02 | ||
|
|
9e0524a3e7 | ||
|
|
2ae8729ef3 | ||
|
|
f32d8e50e7 | ||
|
|
cc02b5feba | ||
|
|
3cd3490dee | ||
|
|
6d7f329001 | ||
|
|
510ff9c9f8 | ||
|
|
3df771fbc4 | ||
|
|
014d7468f0 |
16
.github/ISSUE_TEMPLATE/release.md
vendored
Normal file
16
.github/ISSUE_TEMPLATE/release.md
vendored
Normal file
@@ -0,0 +1,16 @@
|
||||
---
|
||||
name: Release
|
||||
about: "*For maintainers only*"
|
||||
title: "release: 0.0.0"
|
||||
labels: ""
|
||||
assignees: "@cdr/code-server-reviewers"
|
||||
---
|
||||
|
||||
<!-- Maintainer: fill out the checklist -->
|
||||
|
||||
## Checklist
|
||||
|
||||
- [ ] Assign to next release manager
|
||||
- [ ] Close previous release milestone
|
||||
- [ ] Create next release milestone
|
||||
- [ ] Associate issue with next release milestone
|
||||
@@ -2,9 +2,7 @@
|
||||
Please link to the issue this PR solves.
|
||||
If there is no existing issue, please first create one unless the fix is minor.
|
||||
|
||||
Please make sure the base of your PR is the master branch!
|
||||
Please make sure the base of your PR is the default branch!
|
||||
-->
|
||||
|
||||
## Checklist
|
||||
|
||||
- [ ] updated `CHANGELOG.md`
|
||||
Fixes #
|
||||
@@ -8,11 +8,9 @@ TODO
|
||||
|
||||
## TODOs
|
||||
|
||||
- [ ] test locally
|
||||
- [ ] upload assets to draft release
|
||||
- [ ] test one of the release packages locally
|
||||
- [ ] double-check github release tag is the commit with artifacts (_note gets messed up after uploading assets_)
|
||||
- [ ] publish release
|
||||
- [ ] merge PR
|
||||
- [ ] update the homebrew package
|
||||
Follow "Publishing a release" steps in `ci/README.md`
|
||||
|
||||
<!-- Note some of these steps below are redundant since they're listed in the "Publishing a release" docs -->
|
||||
|
||||
- [ ] publish release and merge PR
|
||||
- [ ] update the AUR package
|
||||
|
||||
21
.github/codecov.yml
vendored
Normal file
21
.github/codecov.yml
vendored
Normal file
@@ -0,0 +1,21 @@
|
||||
codecov:
|
||||
require_ci_to_pass: yes
|
||||
allow_coverage_offsets: True
|
||||
|
||||
coverage:
|
||||
precision: 2
|
||||
round: down
|
||||
range: "70...100"
|
||||
|
||||
parsers:
|
||||
gcov:
|
||||
branch_detection:
|
||||
conditional: yes
|
||||
loop: yes
|
||||
method: no
|
||||
macro: no
|
||||
|
||||
comment:
|
||||
layout: "reach,diff,flags,files,footer"
|
||||
behavior: default
|
||||
require_changes: no
|
||||
7
.github/dependabot.yml
vendored
7
.github/dependabot.yml
vendored
@@ -10,6 +10,7 @@ updates:
|
||||
# release tag, so handle updates manually
|
||||
- dependency-name: "actions/*"
|
||||
- dependency-name: "github/codeql-action/*"
|
||||
- dependency-name: "microsoft/playwright-github-action"
|
||||
|
||||
- package-ecosystem: "npm"
|
||||
directory: "/"
|
||||
@@ -18,10 +19,14 @@ updates:
|
||||
time: "11:00"
|
||||
ignore:
|
||||
- dependency-name: "@types/node"
|
||||
versions: ["15.x", "14.x", "13.x"]
|
||||
update-types: ["version-update:semver-major"]
|
||||
- dependency-name: "xdg-basedir"
|
||||
# 5.0.0 has breaking changes as they switch to named exports
|
||||
# and convert the module to ESM
|
||||
# We can't use it until we switch to ESM across the project
|
||||
# See release notes: https://github.com/sindresorhus/xdg-basedir/releases/tag/v5.0.0
|
||||
versions: ["5.x"]
|
||||
- dependency-name: "limiter"
|
||||
# 2.0.0 has breaking changes
|
||||
# so we can't update yet.
|
||||
versions: ["2.x"]
|
||||
|
||||
117
.github/workflows/ci.yaml
vendored
117
.github/workflows/ci.yaml
vendored
@@ -1,4 +1,4 @@
|
||||
name: ci
|
||||
name: Build
|
||||
|
||||
on:
|
||||
push:
|
||||
@@ -18,16 +18,17 @@ jobs:
|
||||
prebuild:
|
||||
name: Pre-build checks
|
||||
runs-on: ubuntu-latest
|
||||
timeout-minutes: 15
|
||||
env:
|
||||
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
|
||||
steps:
|
||||
- name: Checkout repo
|
||||
uses: actions/checkout@v2
|
||||
|
||||
- name: Install Node.js v12
|
||||
- name: Install Node.js v14
|
||||
uses: actions/setup-node@v2
|
||||
with:
|
||||
node-version: "12"
|
||||
node-version: "14"
|
||||
|
||||
- name: Install helm
|
||||
uses: azure/setup-helm@v1.1
|
||||
@@ -38,6 +39,8 @@ jobs:
|
||||
with:
|
||||
path: "**/node_modules"
|
||||
key: yarn-build-${{ hashFiles('**/yarn.lock') }}
|
||||
restore-keys: |
|
||||
yarn-build-
|
||||
|
||||
- name: Install dependencies
|
||||
if: steps.cache-yarn.outputs.cache-hit != 'true'
|
||||
@@ -63,14 +66,15 @@ jobs:
|
||||
name: Run audit-ci
|
||||
needs: prebuild
|
||||
runs-on: ubuntu-latest
|
||||
timeout-minutes: 5
|
||||
steps:
|
||||
- name: Checkout repo
|
||||
uses: actions/checkout@v2
|
||||
|
||||
- name: Install Node.js v12
|
||||
- name: Install Node.js v14
|
||||
uses: actions/setup-node@v2
|
||||
with:
|
||||
node-version: "12"
|
||||
node-version: "14"
|
||||
|
||||
- name: Fetch dependencies from cache
|
||||
id: cache-yarn
|
||||
@@ -78,6 +82,8 @@ jobs:
|
||||
with:
|
||||
path: "**/node_modules"
|
||||
key: yarn-build-${{ hashFiles('**/yarn.lock') }}
|
||||
restore-keys: |
|
||||
yarn-build-
|
||||
|
||||
- name: Install dependencies
|
||||
if: steps.cache-yarn.outputs.cache-hit != 'true'
|
||||
@@ -91,15 +97,16 @@ jobs:
|
||||
name: Build
|
||||
needs: prebuild
|
||||
runs-on: ubuntu-latest
|
||||
timeout-minutes: 30
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
with:
|
||||
fetch-depth: 0
|
||||
|
||||
- name: Install Node.js v12
|
||||
- name: Install Node.js v14
|
||||
uses: actions/setup-node@v2
|
||||
with:
|
||||
node-version: "12"
|
||||
node-version: "14"
|
||||
|
||||
- name: Fetch dependencies from cache
|
||||
id: cache-yarn
|
||||
@@ -107,6 +114,8 @@ jobs:
|
||||
with:
|
||||
path: "**/node_modules"
|
||||
key: yarn-build-${{ hashFiles('**/yarn.lock') }}
|
||||
restore-keys: |
|
||||
yarn-build-
|
||||
|
||||
- name: Install dependencies
|
||||
if: steps.cache-yarn.outputs.cache-hit != 'true'
|
||||
@@ -164,15 +173,16 @@ jobs:
|
||||
name: x86-64 Linux build
|
||||
needs: build
|
||||
runs-on: ubuntu-latest
|
||||
timeout-minutes: 15
|
||||
container: "centos:7"
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
|
||||
- name: Install Node.js v12
|
||||
- name: Install Node.js v14
|
||||
uses: actions/setup-node@v2
|
||||
with:
|
||||
node-version: "12"
|
||||
node-version: "14"
|
||||
|
||||
- name: Install development tools
|
||||
run: |
|
||||
@@ -234,6 +244,7 @@ jobs:
|
||||
name: Linux ARM64 cross-compile build
|
||||
needs: build
|
||||
runs-on: ubuntu-16.04
|
||||
timeout-minutes: 15
|
||||
env:
|
||||
AR: aarch64-linux-gnu-ar
|
||||
CC: aarch64-linux-gnu-gcc
|
||||
@@ -244,10 +255,10 @@ jobs:
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
|
||||
- name: Install Node.js v12
|
||||
- name: Install Node.js v14
|
||||
uses: actions/setup-node@v2
|
||||
with:
|
||||
node-version: "12"
|
||||
node-version: "14"
|
||||
|
||||
- name: Install nfpm
|
||||
run: |
|
||||
@@ -270,8 +281,8 @@ jobs:
|
||||
|
||||
- name: Replace node with arm64 equivalent
|
||||
run: |
|
||||
wget https://nodejs.org/dist/v12.18.4/node-v12.18.4-linux-arm64.tar.gz
|
||||
tar -xzf node-v12.18.4-linux-arm64.tar.gz node-v12.18.4-linux-arm64/bin/node --strip-components=2
|
||||
wget https://nodejs.org/dist/v14.17.0/node-v14.17.0-linux-arm64.tar.xz
|
||||
tar -xf node-v14.17.0-linux-arm64.tar.xz node-v14.17.0-linux-arm64/bin/node --strip-components=2
|
||||
mv ./node ./release-standalone/lib/node
|
||||
|
||||
- name: Build packages with nfpm
|
||||
@@ -287,13 +298,14 @@ jobs:
|
||||
name: x86-64 macOS build
|
||||
needs: build
|
||||
runs-on: macos-latest
|
||||
timeout-minutes: 15
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
|
||||
- name: Install Node.js v12
|
||||
- name: Install Node.js v14
|
||||
uses: actions/setup-node@v2
|
||||
with:
|
||||
node-version: "12"
|
||||
node-version: "14"
|
||||
|
||||
- name: Install nfpm
|
||||
run: |
|
||||
@@ -327,16 +339,18 @@ jobs:
|
||||
name: End-to-end tests
|
||||
needs: package-linux-amd64
|
||||
runs-on: ubuntu-latest
|
||||
timeout-minutes: 15
|
||||
env:
|
||||
PASSWORD: e45432jklfdsab
|
||||
CODE_SERVER_ADDRESS: http://localhost:8080
|
||||
# Since we build code-server we might as well run tests from the release
|
||||
# since VS Code will load faster due to the bundling.
|
||||
CODE_SERVER_TEST_ENTRY: "./release-packages/code-server-linux-amd64"
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
|
||||
- name: Install Node.js v12
|
||||
- name: Install Node.js v14
|
||||
uses: actions/setup-node@v2
|
||||
with:
|
||||
node-version: "12"
|
||||
node-version: "14"
|
||||
|
||||
- name: Install playwright
|
||||
uses: microsoft/playwright-github-action@v1
|
||||
@@ -347,6 +361,8 @@ jobs:
|
||||
with:
|
||||
path: "**/node_modules"
|
||||
key: yarn-build-${{ hashFiles('**/yarn.lock') }}
|
||||
restore-keys: |
|
||||
yarn-build-
|
||||
|
||||
- name: Download release packages
|
||||
uses: actions/download-artifact@v2
|
||||
@@ -354,9 +370,11 @@ jobs:
|
||||
name: release-packages
|
||||
path: ./release-packages
|
||||
|
||||
- name: Untar code-server file
|
||||
- name: Untar code-server release
|
||||
run: |
|
||||
cd release-packages && tar -xzf code-server*-linux-amd64.tar.gz
|
||||
cd release-packages
|
||||
tar -xzf code-server*-linux-amd64.tar.gz
|
||||
mv code-server*-linux-amd64 code-server-linux-amd64
|
||||
|
||||
- name: Install dependencies
|
||||
if: steps.cache-yarn.outputs.cache-hit != 'true'
|
||||
@@ -372,9 +390,7 @@ jobs:
|
||||
yarn install --check-files
|
||||
|
||||
- name: Run end-to-end tests
|
||||
run: |
|
||||
./release-packages/code-server*-linux-amd64/bin/code-server --log trace &
|
||||
yarn test:e2e
|
||||
run: yarn test:e2e
|
||||
|
||||
- name: Upload test artifacts
|
||||
if: always()
|
||||
@@ -386,9 +402,10 @@ jobs:
|
||||
- name: Remove release packages and test artifacts
|
||||
run: rm -rf ./release-packages ./test/test-results
|
||||
|
||||
docker-amd64:
|
||||
# Builds both amd64 and arm64 images
|
||||
docker-images:
|
||||
runs-on: ubuntu-latest
|
||||
needs: package-linux-amd64
|
||||
needs: [package-linux-amd64, package-linux-arm64]
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
|
||||
@@ -398,34 +415,16 @@ jobs:
|
||||
name: release-packages
|
||||
path: ./release-packages
|
||||
|
||||
- name: Run ./ci/steps/build-docker-image.sh
|
||||
run: ./ci/steps/build-docker-image.sh
|
||||
- name: Set up QEMU
|
||||
uses: docker/setup-qemu-action@v1
|
||||
|
||||
- name: Upload release image
|
||||
uses: actions/upload-artifact@v2
|
||||
with:
|
||||
name: release-images
|
||||
path: ./release-images
|
||||
|
||||
# TODO: this is the last place where we use our self-hosted arm64 runner.
|
||||
# In the future, consider switching to docker buildx + qemu,
|
||||
# thus removing the requirement for us to maintain the runner.
|
||||
docker-arm64:
|
||||
runs-on: ubuntu-arm64-latest
|
||||
needs: package-linux-arm64
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
|
||||
- name: Download release package
|
||||
uses: actions/download-artifact@v2
|
||||
with:
|
||||
name: release-packages
|
||||
path: ./release-packages
|
||||
- name: Set up Docker Buildx
|
||||
uses: docker/setup-buildx-action@v1
|
||||
|
||||
- name: Run ./ci/steps/build-docker-image.sh
|
||||
run: ./ci/steps/build-docker-image.sh
|
||||
|
||||
- name: Upload release image
|
||||
- name: Upload release images
|
||||
uses: actions/upload-artifact@v2
|
||||
with:
|
||||
name: release-images
|
||||
@@ -433,8 +432,10 @@ jobs:
|
||||
|
||||
trivy-scan-image:
|
||||
runs-on: ubuntu-20.04
|
||||
needs: docker-amd64
|
||||
|
||||
needs: docker-images
|
||||
# NOTE@jsjoeio: disabling due to a memory issue upstream
|
||||
# See: https://github.com/github/codeql-action/issues/528
|
||||
if: 1 == 2
|
||||
steps:
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v2
|
||||
@@ -446,8 +447,8 @@ jobs:
|
||||
path: ./release-images
|
||||
|
||||
- name: Run Trivy vulnerability scanner in image mode
|
||||
# Commit SHA for v0.0.14
|
||||
uses: aquasecurity/trivy-action@341f810bd602419f966a081da3f4debedc3e5c8e
|
||||
# Commit SHA for v0.0.17
|
||||
uses: aquasecurity/trivy-action@ac8de07fd168680dd0331bef43681c0e150e9ad1
|
||||
with:
|
||||
input: "./release-images/code-server-amd64-*.tar"
|
||||
scan-type: "image"
|
||||
@@ -457,6 +458,9 @@ jobs:
|
||||
output: "trivy-image-results.sarif"
|
||||
severity: "HIGH,CRITICAL"
|
||||
|
||||
- name: Debug Trivy SARIF file
|
||||
run: cat trivy-image-results.sarif && ls -l trivy-image-results.sarif
|
||||
|
||||
- name: Upload Trivy scan results to GitHub Security tab
|
||||
uses: github/codeql-action/upload-sarif@v1
|
||||
with:
|
||||
@@ -467,14 +471,12 @@ jobs:
|
||||
# codeql/upload-sarif action per job
|
||||
trivy-scan-repo:
|
||||
runs-on: ubuntu-20.04
|
||||
|
||||
steps:
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v2
|
||||
|
||||
- name: Run Trivy vulnerability scanner in repo mode
|
||||
# Commit SHA for v0.0.14
|
||||
uses: aquasecurity/trivy-action@341f810bd602419f966a081da3f4debedc3e5c8e
|
||||
#Commit SHA for v0.0.17
|
||||
uses: aquasecurity/trivy-action@ac8de07fd168680dd0331bef43681c0e150e9ad1
|
||||
with:
|
||||
scan-type: "fs"
|
||||
scan-ref: "."
|
||||
@@ -483,7 +485,6 @@ jobs:
|
||||
template: "@/contrib/sarif.tpl"
|
||||
output: "trivy-repo-results.sarif"
|
||||
severity: "HIGH,CRITICAL"
|
||||
|
||||
- name: Upload Trivy scan results to GitHub Security tab
|
||||
uses: github/codeql-action/upload-sarif@v1
|
||||
with:
|
||||
|
||||
57
.github/workflows/installer.yml
vendored
Normal file
57
.github/workflows/installer.yml
vendored
Normal file
@@ -0,0 +1,57 @@
|
||||
name: Installer integration
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
paths:
|
||||
- "installer.sh"
|
||||
pull_request:
|
||||
branches:
|
||||
- main
|
||||
|
||||
jobs:
|
||||
ubuntu:
|
||||
name: Test installer on Ubuntu
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout repo
|
||||
uses: actions/checkout@v2
|
||||
|
||||
- name: Install code-server
|
||||
run: ./install.sh
|
||||
|
||||
- name: Test code-server
|
||||
run: yarn test:standalone-release code-server
|
||||
|
||||
alpine:
|
||||
name: Test installer on Alpine
|
||||
runs-on: ubuntu-latest
|
||||
container: "alpine:3.14"
|
||||
steps:
|
||||
- name: Checkout repo
|
||||
uses: actions/checkout@v2
|
||||
|
||||
- name: Install curl
|
||||
run: apk add curl
|
||||
|
||||
- name: Add user
|
||||
run: adduser coder --disabled-password
|
||||
|
||||
# Standalone should work without root.
|
||||
- name: Test standalone to a non-existent prefix
|
||||
run: su coder -c "./install.sh --method standalone --prefix /tmp/does/not/yet/exist"
|
||||
|
||||
macos:
|
||||
name: Test installer on macOS
|
||||
runs-on: macos-latest
|
||||
|
||||
steps:
|
||||
- name: Checkout repo
|
||||
uses: actions/checkout@v2
|
||||
|
||||
- name: Install code-server
|
||||
run: ./install.sh
|
||||
|
||||
- name: Test code-server
|
||||
run: yarn test:standalone-release code-server
|
||||
7
.github/workflows/publish.yaml
vendored
7
.github/workflows/publish.yaml
vendored
@@ -42,6 +42,13 @@ jobs:
|
||||
needs: npm
|
||||
runs-on: macos-latest
|
||||
steps:
|
||||
# Ensure things are up to date
|
||||
# Suggested by homebrew maintainers
|
||||
# https://github.com/Homebrew/discussions/discussions/1532#discussioncomment-782633
|
||||
- name: Set up Homebrew
|
||||
id: set-up-homebrew
|
||||
uses: Homebrew/actions/setup-homebrew@master
|
||||
|
||||
- uses: actions/checkout@v2
|
||||
- name: Configure git
|
||||
run: |
|
||||
|
||||
30
.github/workflows/scripts.yml
vendored
Normal file
30
.github/workflows/scripts.yml
vendored
Normal file
@@ -0,0 +1,30 @@
|
||||
name: Script unit tests
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
paths:
|
||||
- "installer.sh"
|
||||
pull_request:
|
||||
branches:
|
||||
- main
|
||||
|
||||
jobs:
|
||||
test:
|
||||
name: Run script unit tests
|
||||
runs-on: ubuntu-latest
|
||||
# This runs on Alpine to make sure we're testing with actual sh.
|
||||
container: "alpine:3.14"
|
||||
steps:
|
||||
- name: Checkout repo
|
||||
uses: actions/checkout@v2
|
||||
|
||||
- name: Install test utilities
|
||||
run: apk add bats checkbashisms
|
||||
|
||||
- name: Check Bashisms
|
||||
run: checkbashisms ./install.sh
|
||||
|
||||
- name: Run script unit tests
|
||||
run: ./ci/dev/test-scripts.sh
|
||||
3
.gitignore
vendored
3
.gitignore
vendored
@@ -1,7 +1,6 @@
|
||||
.tsbuildinfo
|
||||
.cache
|
||||
dist*
|
||||
out*
|
||||
/out*/
|
||||
release/
|
||||
release-npm-package/
|
||||
release-standalone/
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
{
|
||||
"file": "package.json",
|
||||
"line": 31,
|
||||
"description": "## Commands\n\nTo start developing, make sure you have Node 12+ and the [required dependencies](https://github.com/Microsoft/vscode/wiki/How-to-Contribute#prerequisites) installed. Then, run the following commands:\n\n1. Install dependencies:\n>> yarn\n\n3. Start development mode (and watch for changes):\n>> yarn watch"
|
||||
"description": "## Commands\n\nTo start developing, make sure you have Node 14+ and the [required dependencies](https://github.com/Microsoft/vscode/wiki/How-to-Contribute#prerequisites) installed. Then, run the following commands:\n\n1. Install dependencies:\n>> yarn\n\n3. Start development mode (and watch for changes):\n>> yarn watch"
|
||||
},
|
||||
{
|
||||
"file": "src/node/app.ts",
|
||||
|
||||
101
CHANGELOG.md
101
CHANGELOG.md
@@ -1,17 +1,3 @@
|
||||
<!-- START doctoc generated TOC please keep comment here to allow auto update -->
|
||||
<!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE -->
|
||||
# Changelog
|
||||
|
||||
- [Changelog](#changelog)
|
||||
- [3.10.0](#3100)
|
||||
- [New Features](#new-features)
|
||||
- [Bug Fixes](#bug-fixes)
|
||||
- [Documentation](#documentation)
|
||||
- [Development](#development)
|
||||
- [Previous versions](#previous-versions)
|
||||
|
||||
<!-- END doctoc generated TOC please keep comment here to allow auto update -->
|
||||
|
||||
# Changelog
|
||||
|
||||
<!--
|
||||
@@ -25,7 +11,7 @@ We copy from here into the release notes.
|
||||
<!--
|
||||
Add next version above previous version but below this line using the template
|
||||
|
||||
## 0.0.0
|
||||
## Next Version
|
||||
|
||||
VS Code v0.00.0
|
||||
|
||||
@@ -37,19 +23,94 @@ VS Code v0.00.0
|
||||
|
||||
- fix(socket): did this thing #321 @githubuser
|
||||
|
||||
## Documentation
|
||||
### Documentation
|
||||
|
||||
- item
|
||||
|
||||
## Development
|
||||
### Development
|
||||
|
||||
- item
|
||||
|
||||
-->
|
||||
|
||||
## Next Version
|
||||
|
||||
VS Code v0.00.0
|
||||
|
||||
### New Features
|
||||
|
||||
- item
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
- Fix logout when using a base path (#3608)
|
||||
|
||||
### Documentation
|
||||
|
||||
- docs: add Pomerium #3424 @desimone
|
||||
- docs: fix confusing sentence in pull requests section #3460 @shiv-tyagi
|
||||
- docs: remove toc from changelog @oxy @jsjoeio
|
||||
- docs(MAINTAINING): add information about CHANGELOG #3467 @jsjoeio
|
||||
- docs: move release process to MAINTAINING.md #3441 @oxy @Prashant168
|
||||
- docs: format 'Caddy' from guide.md @PisecesPeng
|
||||
|
||||
### Development
|
||||
|
||||
- chore: cross-compile docker images with buildx #3166 @oxy
|
||||
- chore: update node to v14 #3458 @oxy
|
||||
- chore: update .gitignore #3557 @cuining
|
||||
- fix: use sufficient computational effort for password hash #3422 @jsjoeio
|
||||
- docs(CONTRIBUTING): add section on testing #3629 @jsjoeio
|
||||
|
||||
### Development
|
||||
|
||||
- fix(publish): update cdrci fork in brew-bump.sh #3468 @jsjoeio
|
||||
- chore(dev): migrate away from parcel #3578 @jsjoeio
|
||||
|
||||
## 3.10.2
|
||||
|
||||
VS Code v1.56.1
|
||||
|
||||
### New Features
|
||||
|
||||
- feat: support `extraInitContainers` in helm chart values #3393 @strowk
|
||||
- feat: change `extraContainers` to support templating in helm chart #3393 @strowk
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
- fix: use correct command to Open Folder on Welcome page #3437 @jsjoeio
|
||||
|
||||
### Development
|
||||
|
||||
- fix(ci): update brew-bump.sh to update remote first #3438 @jsjoeio
|
||||
|
||||
## 3.10.1
|
||||
|
||||
VS Code v1.56.1
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
- fix: Check the logged user instead of $USER #3330 @videlanicolas
|
||||
- fix: Fix broken node_modules.asar symlink in npm package #3355 @code-asher
|
||||
- fix: Update cloud agent to fix version issue #3342 @oxy
|
||||
|
||||
### Documentation
|
||||
|
||||
- docs(install): add raspberry pi section #3376 @jsjoeio
|
||||
- docs(maintaining): add pull requests section #3378 @jsjoeio
|
||||
- docs(maintaining): add merge strategies section #3379 @jsjoeio
|
||||
- refactor: move default PR template #3375 @jsjoeio
|
||||
- docs(contributing): add commits section #3377 @jsjoeio
|
||||
|
||||
### Development
|
||||
|
||||
- chore: ignore updates to microsoft/playwright-github-action
|
||||
- fix(socket): use xdgBasedir.runtime instead of tmp #3304 @jsjoeio
|
||||
- fix(ci): re-enable trivy-scan-repo #3368 @jsjoeio
|
||||
|
||||
## 3.10.0
|
||||
|
||||
VS Code v1.56
|
||||
VS Code v1.56.0
|
||||
|
||||
### New Features
|
||||
|
||||
@@ -69,7 +130,7 @@ VS Code v1.56
|
||||
- fix: add flag for toggling permessage-deflate #3286 @code-asher
|
||||
- fix: make sure directories exist #3309 @code-asher
|
||||
|
||||
## Documentation
|
||||
### Documentation
|
||||
|
||||
- docs(FAQ): add mention of sysbox #3087 @bpmct
|
||||
- docs: add security policy #3148 @jsjoeio
|
||||
@@ -84,7 +145,7 @@ VS Code v1.56
|
||||
- docs(maintaining): add versioning #3288 @jsjoeio
|
||||
- docs: add changelog #3337 @jsjoeio
|
||||
|
||||
## Development
|
||||
### Development
|
||||
|
||||
- fix(update-vscode): add check/docs for git-subtree #3129 @oxy
|
||||
- refactor(testing): migrate to playwright-test from jest-playwright #3133 @jsjoeio
|
||||
|
||||
77
README.md
77
README.md
@@ -1,77 +0,0 @@
|
||||
# code-server · [](https://github.com/cdr/code-server/discussions) [](https://cdr.co/join-community) [](https://twitter.com/coderhq)
|
||||
|
||||
[](https://codecov.io/gh/cdr/code-server)
|
||||
[](https://github.com/cdr/code-server/tree/v3.10.0/docs)
|
||||
|
||||
Run [VS Code](https://github.com/Microsoft/vscode) on any machine anywhere and access it in the browser.
|
||||
|
||||

|
||||
|
||||
## Highlights
|
||||
|
||||
- Code on any device with a consistent development environment
|
||||
- Use cloud servers to speed up tests, compilations, downloads, and more
|
||||
- Preserve battery life when you're on the go; all intensive tasks run on your server
|
||||
|
||||
## Requirements
|
||||
|
||||
For a good experience, we recommend at least:
|
||||
|
||||
- 1 GB of RAM
|
||||
- 2 cores
|
||||
|
||||
You can use whatever linux distribution floats your boat but in our [guide](./docs/guide.md) we assume Debian on Google Cloud.
|
||||
|
||||
## Getting Started
|
||||
|
||||
There are three ways you can get started:
|
||||
|
||||
1. Using the [install script](./install.sh), which automates most of the process. The script uses the system package manager (if possible)
|
||||
2. Manually installing code-server; see [Installation](./docs/install.md) for instructions applicable to most use cases
|
||||
3. Use our one-click buttons and guides to [deploy code-server to a popular cloud provider](https://github.com/cdr/deploy-code-server) ⚡
|
||||
|
||||
If you choose to use the install script, you can preview what occurs during the install process:
|
||||
|
||||
```bash
|
||||
curl -fsSL https://code-server.dev/install.sh | sh -s -- --dry-run
|
||||
```
|
||||
|
||||
To install, run:
|
||||
|
||||
```bash
|
||||
curl -fsSL https://code-server.dev/install.sh | sh
|
||||
```
|
||||
|
||||
When done, the install script prints out instructions for running and starting code-server.
|
||||
|
||||
We also have an in-depth [setup and configuration](./docs/guide.md) guide.
|
||||
|
||||
### code-server --link
|
||||
|
||||
We're working on a cloud platform that makes deploying and managing code-server easier.
|
||||
Consider running code-server with the beta flag `--link` if you don't want to worry about
|
||||
|
||||
- TLS
|
||||
- Authentication
|
||||
- Port Forwarding
|
||||
|
||||
```bash
|
||||
$ code-server --link
|
||||
Proxying code-server, you can access your IDE at https://valmar-jon.cdr.co
|
||||
```
|
||||
|
||||
## FAQ
|
||||
|
||||
See [./docs/FAQ.md](./docs/FAQ.md).
|
||||
|
||||
## Want to help?
|
||||
|
||||
See [CONTRIBUTING](./docs/CONTRIBUTING.md) for details.
|
||||
|
||||
## Hiring
|
||||
|
||||
Interested in [working at Coder](https://coder.com)? Check out [our open positions](https://jobs.lever.co/coder)!
|
||||
|
||||
## For Organizations
|
||||
|
||||
Visit [our website](https://coder.com) for more information about remote development for your organization or enterprise.
|
||||
30
ci/README.md
30
ci/README.md
@@ -10,32 +10,6 @@ Any file or directory in this subdirectory should be documented here.
|
||||
- [./ci/lib.sh](./lib.sh)
|
||||
- Contains code duplicated across these scripts.
|
||||
|
||||
## Publishing a release
|
||||
|
||||
1. Run `yarn release:prep` and type in the new version i.e. 3.8.1
|
||||
2. GitHub actions will generate the `npm-package`, `release-packages` and `release-images` artifacts.
|
||||
1. You do not have to wait for these.
|
||||
3. Run `yarn release:github-draft` to create a GitHub draft release from the template with
|
||||
the updated version.
|
||||
1. Summarize the major changes in the release notes and link to the relevant issues.
|
||||
2. Change the @ to target the version branch. Example: `v3.9.0 @ Target: v3.9.0`
|
||||
4. Wait for the artifacts in step 2 to build.
|
||||
5. Run `yarn release:github-assets` to download the `release-packages` artifact.
|
||||
- It will upload them to the draft release.
|
||||
6. Run some basic sanity tests on one of the released packages.
|
||||
- Especially make sure the terminal works fine.
|
||||
7. Make sure the github release tag is the commit with the artifacts.
|
||||
8. Publish the release and merge the PR.
|
||||
1. CI will automatically grab the artifacts and then:
|
||||
1. Publish the NPM package from `npm-package`.
|
||||
2. Publish the Docker Hub image from `release-images`.
|
||||
9. Update the AUR package.
|
||||
- Instructions on updating the AUR package are at [cdr/code-server-aur](https://github.com/cdr/code-server-aur).
|
||||
10. Wait for the npm package to be published.
|
||||
11. Update the [homebrew package](https://github.com/Homebrew/homebrew-core/blob/master/Formula/code-server.rb).
|
||||
1. Install [homebrew](https://brew.sh/)
|
||||
2. Run `brew bump-formula-pr --version=3.8.1 code-server` and update the version accordingly. This will bump the version and open a PR. Note: this will only work once the version is published on npm.
|
||||
|
||||
## dev
|
||||
|
||||
This directory contains scripts used for the development of code-server.
|
||||
@@ -104,8 +78,8 @@ You can disable minification by setting `MINIFY=`.
|
||||
|
||||
This directory contains the release docker container image.
|
||||
|
||||
- [./release-image/build.sh](./release-image/build.sh)
|
||||
- Builds the release container with the tag `codercom/code-server-$ARCH:$VERSION`.
|
||||
- [./ci/steps/build-docker-image.sh](./ci/steps/build-docker-image.sh)
|
||||
- Builds the release containers with tags `codercom/code-server-$ARCH:$VERSION` for amd64 and arm64 with `docker buildx`.
|
||||
- Assumes debian releases are ready in `./release-packages`.
|
||||
|
||||
## images
|
||||
|
||||
@@ -3,9 +3,6 @@ set -euo pipefail
|
||||
|
||||
# Builds code-server into out and the frontend into dist.
|
||||
|
||||
# MINIFY controls whether parcel minifies dist.
|
||||
MINIFY=${MINIFY-true}
|
||||
|
||||
main() {
|
||||
cd "$(dirname "${0}")/../.."
|
||||
|
||||
@@ -32,14 +29,9 @@ main() {
|
||||
set -e
|
||||
fi
|
||||
|
||||
parcel build \
|
||||
--public-url "." \
|
||||
--out-dir dist \
|
||||
$([[ $MINIFY ]] || echo --no-minify) \
|
||||
src/browser/register.ts \
|
||||
src/browser/serviceWorker.ts \
|
||||
src/browser/pages/login.ts \
|
||||
src/browser/pages/vscode.ts
|
||||
yarn browserify out/browser/register.js -o out/browser/register.browserified.js
|
||||
yarn browserify out/browser/pages/login.js -o out/browser/pages/login.browserified.js
|
||||
yarn browserify out/browser/pages/vscode.js -o out/browser/pages/vscode.browserified.js
|
||||
}
|
||||
|
||||
main "$@"
|
||||
|
||||
@@ -46,7 +46,7 @@ release_gcp() {
|
||||
# Generates deb and rpm packages.
|
||||
release_nfpm() {
|
||||
local nfpm_config
|
||||
nfpm_config="$(envsubst <./ci/build/nfpm.yaml)"
|
||||
nfpm_config="$(envsubst < ./ci/build/nfpm.yaml)"
|
||||
|
||||
# The underscores are convention for .deb.
|
||||
nfpm pkg -f <(echo "$nfpm_config") --target "release-packages/code-server_${VERSION}_$ARCH.deb"
|
||||
|
||||
@@ -22,19 +22,20 @@ main() {
|
||||
bundle_code_server
|
||||
bundle_vscode
|
||||
|
||||
rsync README.md "$RELEASE_PATH"
|
||||
rsync ./docs/README.md "$RELEASE_PATH"
|
||||
rsync LICENSE.txt "$RELEASE_PATH"
|
||||
rsync ./lib/vscode/ThirdPartyNotices.txt "$RELEASE_PATH"
|
||||
}
|
||||
|
||||
bundle_code_server() {
|
||||
rsync out dist "$RELEASE_PATH"
|
||||
rsync out "$RELEASE_PATH"
|
||||
|
||||
# For source maps and images.
|
||||
mkdir -p "$RELEASE_PATH/src/browser"
|
||||
rsync src/browser/media/ "$RELEASE_PATH/src/browser/media"
|
||||
mkdir -p "$RELEASE_PATH/src/browser/pages"
|
||||
rsync src/browser/pages/*.html "$RELEASE_PATH/src/browser/pages"
|
||||
rsync src/browser/pages/*.css "$RELEASE_PATH/src/browser/pages"
|
||||
rsync src/browser/robots.txt "$RELEASE_PATH/src/browser"
|
||||
|
||||
# Add typings for plugins
|
||||
@@ -43,7 +44,7 @@ bundle_code_server() {
|
||||
|
||||
# Adds the commit to package.json
|
||||
jq --slurp '.[0] * .[1]' package.json <(
|
||||
cat <<EOF
|
||||
cat << EOF
|
||||
{
|
||||
"commit": "$(git rev-parse HEAD)",
|
||||
"scripts": {
|
||||
@@ -51,7 +52,7 @@ bundle_code_server() {
|
||||
}
|
||||
}
|
||||
EOF
|
||||
) >"$RELEASE_PATH/package.json"
|
||||
) > "$RELEASE_PATH/package.json"
|
||||
rsync yarn.lock "$RELEASE_PATH"
|
||||
rsync ci/build/npm-postinstall.sh "$RELEASE_PATH/postinstall.sh"
|
||||
|
||||
@@ -81,20 +82,22 @@ bundle_vscode() {
|
||||
rsync "$VSCODE_SRC_PATH/resources/linux/code.png" "$VSCODE_OUT_PATH/resources/linux/code.png"
|
||||
rsync "$VSCODE_SRC_PATH/resources/web/callback.html" "$VSCODE_OUT_PATH/resources/web/callback.html"
|
||||
|
||||
# Adds the commit and date to product.json
|
||||
# Add the commit and date and enable telemetry. This just makes telemetry
|
||||
# available; telemetry can still be disabled by flag or setting.
|
||||
jq --slurp '.[0] * .[1]' "$VSCODE_SRC_PATH/product.json" <(
|
||||
cat <<EOF
|
||||
cat << EOF
|
||||
{
|
||||
"enableTelemetry": true,
|
||||
"commit": "$(git rev-parse HEAD)",
|
||||
"date": $(jq -n 'now | todate')
|
||||
}
|
||||
EOF
|
||||
) >"$VSCODE_OUT_PATH/product.json"
|
||||
) > "$VSCODE_OUT_PATH/product.json"
|
||||
|
||||
# We remove the scripts field so that later on we can run
|
||||
# yarn to fetch node_modules if necessary without build scripts running.
|
||||
# We cannot use --no-scripts because we still want dependent package scripts to run.
|
||||
jq 'del(.scripts)' <"$VSCODE_SRC_PATH/package.json" >"$VSCODE_OUT_PATH/package.json"
|
||||
jq 'del(.scripts)' < "$VSCODE_SRC_PATH/package.json" > "$VSCODE_OUT_PATH/package.json"
|
||||
|
||||
pushd "$VSCODE_OUT_PATH"
|
||||
symlink_asar
|
||||
|
||||
@@ -1,6 +1,10 @@
|
||||
#!/usr/bin/env bash
|
||||
set -euo pipefail
|
||||
|
||||
# This is due to an upstream issue with RHEL7/CentOS 7 comptability with node-argon2
|
||||
# See: https://github.com/cdr/code-server/pull/3422#pullrequestreview-677765057
|
||||
export npm_config_build_from_source=true
|
||||
|
||||
main() {
|
||||
cd "$(dirname "${0}")/../.."
|
||||
source ./ci/lib.sh
|
||||
@@ -12,7 +16,7 @@ main() {
|
||||
# we use the same version it's using so we instead run a script with yarn that
|
||||
# will print the path to node.
|
||||
local node_path
|
||||
node_path="$(yarn -s node <<<'console.info(process.execPath)')"
|
||||
node_path="$(yarn -s node <<< 'console.info(process.execPath)')"
|
||||
|
||||
mkdir -p "$RELEASE_PATH/bin"
|
||||
rsync ./ci/build/code-server.sh "$RELEASE_PATH/bin/code-server"
|
||||
@@ -23,6 +27,12 @@ main() {
|
||||
|
||||
cd "$RELEASE_PATH"
|
||||
yarn --production --frozen-lockfile
|
||||
|
||||
# HACK: the version of Typescript vscode 1.57 uses in extensions/
|
||||
# leaves a few stray symlinks. Clean them up so nfpm does not fail.
|
||||
# Remove this line when its no longer needed.
|
||||
|
||||
rm -fr "$RELEASE_PATH/lib/vscode/extensions/node_modules/.bin"
|
||||
}
|
||||
|
||||
main "$@"
|
||||
|
||||
@@ -4,29 +4,43 @@ set -eu
|
||||
# Copied from arch() in ci/lib.sh.
|
||||
detect_arch() {
|
||||
case "$(uname -m)" in
|
||||
aarch64)
|
||||
echo arm64
|
||||
;;
|
||||
x86_64 | amd64)
|
||||
echo amd64
|
||||
;;
|
||||
*)
|
||||
# This will cause the download to fail, but is intentional
|
||||
uname -m
|
||||
;;
|
||||
aarch64)
|
||||
echo arm64
|
||||
;;
|
||||
x86_64 | amd64)
|
||||
echo amd64
|
||||
;;
|
||||
*)
|
||||
# This will cause the download to fail, but is intentional
|
||||
uname -m
|
||||
;;
|
||||
esac
|
||||
}
|
||||
|
||||
ARCH="${NPM_CONFIG_ARCH:-$(detect_arch)}"
|
||||
# This is due to an upstream issue with RHEL7/CentOS 7 comptability with node-argon2
|
||||
# See: https://github.com/cdr/code-server/pull/3422#pullrequestreview-677765057
|
||||
export npm_config_build_from_source=true
|
||||
|
||||
main() {
|
||||
# Grabs the major version of node from $npm_config_user_agent which looks like
|
||||
# yarn/1.21.1 npm/? node/v14.2.0 darwin x64
|
||||
major_node_version=$(echo "$npm_config_user_agent" | sed -n 's/.*node\/v\([^.]*\).*/\1/p')
|
||||
if [ "$major_node_version" -lt 12 ]; then
|
||||
echo "code-server currently requires at least node v12"
|
||||
|
||||
if [ -n "${FORCE_NODE_VERSION:-}" ]; then
|
||||
echo "WARNING: Overriding required Node.js version to v$FORCE_NODE_VERSION"
|
||||
echo "This could lead to broken functionality, and is unsupported."
|
||||
echo "USE AT YOUR OWN RISK!"
|
||||
fi
|
||||
|
||||
if [ "$major_node_version" -ne "${FORCE_NODE_VERSION:-14}" ]; then
|
||||
echo "ERROR: code-server currently requires node v14."
|
||||
if [ -n "$FORCE_NODE_VERSION" ]; then
|
||||
echo "However, you have overrided the version check to use v$FORCE_NODE_VERSION."
|
||||
fi
|
||||
echo "We have detected that you are on node v$major_node_version"
|
||||
echo "See https://github.com/cdr/code-server/issues/1633"
|
||||
echo "You can override this version check by setting \$FORCE_NODE_VERSION,"
|
||||
echo "but configurations that do not use the same node version are unsupported."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
@@ -54,20 +68,29 @@ main() {
|
||||
echo "Please see https://github.com/cdr/code-server/blob/master/docs/npm.md"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [ -n "${FORCE_NODE_VERSION:-}" ]; then
|
||||
echo "WARNING: The required Node.js version was overriden to v$FORCE_NODE_VERSION"
|
||||
echo "This could lead to broken functionality, and is unsupported."
|
||||
echo "USE AT YOUR OWN RISK!"
|
||||
fi
|
||||
}
|
||||
|
||||
# This is a copy of symlink_asar in ../lib.sh. Look there for details.
|
||||
symlink_asar() {
|
||||
rm -rf node_modules.asar
|
||||
if [ "${WINDIR-}" ]; then
|
||||
mklink /J node_modules.asar node_modules
|
||||
else
|
||||
ln -s node_modules node_modules.asar
|
||||
fi
|
||||
}
|
||||
|
||||
vscode_yarn() {
|
||||
cd lib/vscode
|
||||
yarn --production --frozen-lockfile
|
||||
|
||||
# This is a copy of symlink_asar in ../lib.sh. Look there for details.
|
||||
if [ ! -e node_modules.asar ]; then
|
||||
if [ "${WINDIR-}" ]; then
|
||||
mklink /J node_modules.asar node_modules
|
||||
else
|
||||
ln -s node_modules node_modules.asar
|
||||
fi
|
||||
fi
|
||||
symlink_asar
|
||||
|
||||
cd extensions
|
||||
yarn --production --frozen-lockfile
|
||||
|
||||
@@ -10,7 +10,7 @@ main() {
|
||||
gh release create "v$VERSION" \
|
||||
--notes-file - \
|
||||
--target "$(git rev-parse HEAD)" \
|
||||
--draft <<EOF
|
||||
--draft << EOF
|
||||
v$VERSION
|
||||
|
||||
VS Code v$(vscode_version)
|
||||
|
||||
@@ -20,7 +20,7 @@ main() {
|
||||
cd "$(dirname "$0")/../.."
|
||||
|
||||
# Check that gh is installed
|
||||
if ! command -v gh &>/dev/null; then
|
||||
if ! command -v gh &> /dev/null; then
|
||||
echo "gh could not be found."
|
||||
echo "We use this with the release-github-draft.sh and release-github-assets.sh scripts."
|
||||
echo -e "See docs here: https://github.com/cli/cli#installation"
|
||||
@@ -28,7 +28,7 @@ main() {
|
||||
fi
|
||||
|
||||
# Check that they have jq installed
|
||||
if ! command -v jq &>/dev/null; then
|
||||
if ! command -v jq &> /dev/null; then
|
||||
echo "jq could not be found."
|
||||
echo "We use this to parse the package.json and grab the current version of code-server."
|
||||
echo -e "See docs here: https://stedolan.github.io/jq/download/"
|
||||
@@ -36,7 +36,7 @@ main() {
|
||||
fi
|
||||
|
||||
# Check that they have rg installed
|
||||
if ! command -v rg &>/dev/null; then
|
||||
if ! command -v rg &> /dev/null; then
|
||||
echo "rg could not be found."
|
||||
echo "We use this when updating files across the codebase."
|
||||
echo -e "See docs here: https://github.com/BurntSushi/ripgrep#installation"
|
||||
@@ -44,7 +44,7 @@ main() {
|
||||
fi
|
||||
|
||||
# Check that they have node installed
|
||||
if ! command -v node &>/dev/null; then
|
||||
if ! command -v node &> /dev/null; then
|
||||
echo "node could not be found."
|
||||
echo "That's surprising..."
|
||||
echo "We use it in this script for getting the package.json version"
|
||||
@@ -53,7 +53,7 @@ main() {
|
||||
fi
|
||||
|
||||
# Check that gh is authenticated
|
||||
if ! gh auth status -h github.com &>/dev/null; then
|
||||
if ! gh auth status -h github.com &> /dev/null; then
|
||||
echo "gh isn't authenticated to github.com."
|
||||
echo "This is needed for our scripts that use gh."
|
||||
echo -e "See docs regarding authentication: https://cli.github.com/manual/gh_auth_login"
|
||||
@@ -81,11 +81,7 @@ main() {
|
||||
read -r -p "What version of code-server do you want to update to?"$'\n' CODE_SERVER_VERSION_TO_UPDATE
|
||||
|
||||
echo -e "Great! We'll prep a PR for updating to $CODE_SERVER_VERSION_TO_UPDATE\n"
|
||||
$CMD rg -g '!yarn.lock' -g '!*.svg' --files-with-matches --fixed-strings "${CODE_SERVER_CURRENT_VERSION}" | $CMD xargs sd "$CODE_SERVER_CURRENT_VERSION" "$CODE_SERVER_VERSION_TO_UPDATE"
|
||||
|
||||
# Ensure the tests are passing and code coverage is up-to-date
|
||||
echo -e "Running unit tests and updating code coverage...\n"
|
||||
$CMD yarn test:unit
|
||||
$CMD rg -g '!yarn.lock' -g '!*.svg' -g '!CHANGELOG.md' --files-with-matches --fixed-strings "${CODE_SERVER_CURRENT_VERSION}" | $CMD xargs sd "$CODE_SERVER_CURRENT_VERSION" "$CODE_SERVER_VERSION_TO_UPDATE"
|
||||
|
||||
$CMD git commit -am "chore(release): bump version to $CODE_SERVER_VERSION_TO_UPDATE"
|
||||
|
||||
@@ -94,7 +90,7 @@ main() {
|
||||
|
||||
echo -e "\nOpening a draft PR on GitHub"
|
||||
# To read about these flags, visit the docs: https://cli.github.com/manual/gh_pr_create
|
||||
$CMD gh pr create --base main --title "release: $CODE_SERVER_VERSION_TO_UPDATE" --body "$RELEASE_TEMPLATE_STRING" --reviewer @cdr/code-server-reviewers --repo cdr/code-server --draft
|
||||
$CMD gh pr create --base main --title "release: $CODE_SERVER_VERSION_TO_UPDATE" --body "$RELEASE_TEMPLATE_STRING" --reviewer @cdr/code-server-reviewers --repo cdr/code-server --draft --assignee "@me"
|
||||
|
||||
# Open PR in browser
|
||||
$CMD gh pr view --web
|
||||
|
||||
@@ -1,7 +1,9 @@
|
||||
#!/usr/bin/env bash
|
||||
set -euo pipefail
|
||||
|
||||
# Makes sure the release works.
|
||||
# Make sure a code-server release works. You can pass in the path otherwise it
|
||||
# will use release-standalone in the current directory.
|
||||
#
|
||||
# This is to make sure we don't have Node version errors or any other
|
||||
# compilation-related errors.
|
||||
main() {
|
||||
@@ -10,12 +12,14 @@ main() {
|
||||
local EXTENSIONS_DIR
|
||||
EXTENSIONS_DIR="$(mktemp -d)"
|
||||
|
||||
echo "Testing standalone release."
|
||||
local path=${1:-./release-standalone/bin/code-server}
|
||||
|
||||
# Note: using a basic theme extension because it doesn't update often and is more reliable for testing
|
||||
./release-standalone/bin/code-server --extensions-dir "$EXTENSIONS_DIR" --install-extension wesbos.theme-cobalt2
|
||||
echo "Testing standalone release in $path."
|
||||
|
||||
# NOTE: using a basic theme extension because it doesn't update often and is more reliable for testing
|
||||
"$path" --extensions-dir "$EXTENSIONS_DIR" --install-extension wesbos.theme-cobalt2
|
||||
local installed_extensions
|
||||
installed_extensions="$(./release-standalone/bin/code-server --extensions-dir "$EXTENSIONS_DIR" --list-extensions 2>&1)"
|
||||
installed_extensions="$("$path" --extensions-dir "$EXTENSIONS_DIR" --list-extensions 2>&1)"
|
||||
# We use grep as wesbos.theme-cobalt2 may have dependency extensions that change.
|
||||
if ! echo "$installed_extensions" | grep -q "wesbos.theme-cobalt2"; then
|
||||
echo "Unexpected output from listing extensions:"
|
||||
|
||||
@@ -22,16 +22,15 @@ main() {
|
||||
git ls-files "${prettierExts[@]}" | grep -v "lib/vscode" | grep -v 'helm-chart'
|
||||
)
|
||||
|
||||
doctoc --title '# FAQ' docs/FAQ.md >/dev/null
|
||||
doctoc --title '# Setup Guide' docs/guide.md >/dev/null
|
||||
doctoc --title '# Install' docs/install.md >/dev/null
|
||||
doctoc --title '# npm Install Requirements' docs/npm.md >/dev/null
|
||||
doctoc --title '# Contributing' docs/CONTRIBUTING.md >/dev/null
|
||||
doctoc --title '# Maintaining' docs/MAINTAINING.md >/dev/null
|
||||
doctoc --title '# Contributor Covenant Code of Conduct' docs/CODE_OF_CONDUCT.md >/dev/null
|
||||
doctoc --title '# iPad' docs/ipad.md >/dev/null
|
||||
doctoc --title '# Termux' docs/termux.md >/dev/null
|
||||
doctoc --title '# Changelog' CHANGELOG.md >/dev/null
|
||||
doctoc --title '# FAQ' docs/FAQ.md > /dev/null
|
||||
doctoc --title '# Setup Guide' docs/guide.md > /dev/null
|
||||
doctoc --title '# Install' docs/install.md > /dev/null
|
||||
doctoc --title '# npm Install Requirements' docs/npm.md > /dev/null
|
||||
doctoc --title '# Contributing' docs/CONTRIBUTING.md > /dev/null
|
||||
doctoc --title '# Maintaining' docs/MAINTAINING.md > /dev/null
|
||||
doctoc --title '# Contributor Covenant Code of Conduct' docs/CODE_OF_CONDUCT.md > /dev/null
|
||||
doctoc --title '# iPad' docs/ipad.md > /dev/null
|
||||
doctoc --title '# Termux' docs/termux.md > /dev/null
|
||||
|
||||
if [[ ${CI-} && $(git ls-files --other --modified --exclude-standard) ]]; then
|
||||
echo "Files need generation or are formatted incorrectly:"
|
||||
|
||||
@@ -35,10 +35,10 @@ main() {
|
||||
# This escapes all newlines so that sed will accept them.
|
||||
favicon_dark_style="$(printf "%s\n" "$favicon_dark_style" | sed -e ':a' -e 'N' -e '$!ba' -e 's/\n/\\n/g')"
|
||||
sed "$(
|
||||
cat -n <<EOF
|
||||
cat -n << EOF
|
||||
s%<rect id="favicon"%$favicon_dark_style<rect id="favicon"%
|
||||
EOF
|
||||
)" favicon.svg >favicon-dark-support.svg
|
||||
)" favicon.svg > favicon-dark-support.svg
|
||||
}
|
||||
|
||||
main "$@"
|
||||
|
||||
@@ -8,7 +8,7 @@ main() {
|
||||
stylelint $(git ls-files "*.css" | grep -v "lib/vscode")
|
||||
tsc --noEmit --skipLibCheck
|
||||
shellcheck -e SC2046,SC2164,SC2154,SC1091,SC1090,SC2002 $(git ls-files "*.sh" | grep -v "lib/vscode")
|
||||
if command -v helm && helm kubeval --help >/dev/null; then
|
||||
if command -v helm && helm kubeval --help > /dev/null; then
|
||||
helm kubeval ci/helm-chart
|
||||
fi
|
||||
|
||||
|
||||
@@ -3,10 +3,35 @@ set -euo pipefail
|
||||
|
||||
main() {
|
||||
cd "$(dirname "$0")/../.."
|
||||
source ./ci/lib.sh
|
||||
|
||||
local dir="$PWD"
|
||||
if [[ ! ${CODE_SERVER_TEST_ENTRY-} ]]; then
|
||||
echo "Set CODE_SERVER_TEST_ENTRY to test another build of code-server"
|
||||
else
|
||||
pushd "$CODE_SERVER_TEST_ENTRY"
|
||||
dir="$PWD"
|
||||
popd
|
||||
fi
|
||||
|
||||
echo "Testing build in '$dir'"
|
||||
|
||||
# Simple sanity checks to see that we've built. There could still be things
|
||||
# wrong (native modules version issues, incomplete build, etc).
|
||||
if [[ ! -d $dir/out ]]; then
|
||||
echo >&2 "No code-server build detected"
|
||||
echo >&2 "You can build it with 'yarn build' or 'yarn watch'"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [[ ! -d $dir/lib/vscode/out ]]; then
|
||||
echo >&2 "No VS Code build detected"
|
||||
echo >&2 "You can build it with 'yarn build:vscode' or 'yarn watch'"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
cd test
|
||||
# We set these environment variables because they're used in the e2e tests
|
||||
# they don't have to be these values, but these are the defaults
|
||||
PASSWORD=e45432jklfdsab CODE_SERVER_ADDRESS=http://localhost:8080 yarn folio --config=config.ts --reporter=list "$@"
|
||||
yarn playwright test "$@"
|
||||
}
|
||||
|
||||
main "$@"
|
||||
|
||||
9
ci/dev/test-scripts.sh
Executable file
9
ci/dev/test-scripts.sh
Executable file
@@ -0,0 +1,9 @@
|
||||
#!/usr/bin/env bash
|
||||
set -euo pipefail
|
||||
|
||||
main() {
|
||||
cd "$(dirname "$0")/../.."
|
||||
bats ./test/scripts
|
||||
}
|
||||
|
||||
main "$@"
|
||||
@@ -33,7 +33,7 @@ main() {
|
||||
|
||||
# Check if the remote exists
|
||||
# if it doesn't, we add it
|
||||
if ! git config remote.vscode.url >/dev/null; then
|
||||
if ! git config remote.vscode.url > /dev/null; then
|
||||
echo "Could not find 'vscode' as a remote"
|
||||
echo "Adding with: git remote add vscode https://github.com/microsoft/vscode.git"
|
||||
git remote add vscode https://github.com/microsoft/vscode.git
|
||||
@@ -52,7 +52,7 @@ main() {
|
||||
fi
|
||||
|
||||
# Check that they have jq installed
|
||||
if ! command -v jq &>/dev/null; then
|
||||
if ! command -v jq &> /dev/null; then
|
||||
echo "jq could not be found."
|
||||
echo "We use this when looking up the exact version to update to in the package.json in VS Code."
|
||||
echo -e "See docs here: https://stedolan.github.io/jq/download/"
|
||||
@@ -62,7 +62,7 @@ main() {
|
||||
# Note: `git subtree` returns 129 when installed, and prints help;
|
||||
# but when uninstalled, returns 1.
|
||||
set +e
|
||||
git subtree &>/dev/null
|
||||
git subtree &> /dev/null
|
||||
if [ $? -ne 129 ]; then
|
||||
echo "git-subtree could not be found."
|
||||
echo "We use this to fetch and update the lib/vscode subtree."
|
||||
@@ -83,7 +83,7 @@ main() {
|
||||
git fetch vscode
|
||||
|
||||
# Check if GitHub CLI is installed
|
||||
if ! command -v gh &>/dev/null; then
|
||||
if ! command -v gh &> /dev/null; then
|
||||
echo "GitHub CLI could not be found."
|
||||
echo "If you install it before you run this script next time, we'll open a draft PR for you!"
|
||||
echo -e "See docs here: https://github.com/cli/cli#installation\n"
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
import browserify from "browserify"
|
||||
import * as cp from "child_process"
|
||||
import Bundler from "parcel-bundler"
|
||||
import * as fs from "fs"
|
||||
import * as path from "path"
|
||||
import { onLine } from "../../src/node/util"
|
||||
|
||||
async function main(): Promise<void> {
|
||||
try {
|
||||
@@ -40,7 +42,6 @@ class Watcher {
|
||||
const plugin = process.env.PLUGIN_DIR
|
||||
? cp.spawn("yarn", ["build", "--watch"], { cwd: process.env.PLUGIN_DIR })
|
||||
: undefined
|
||||
const bundler = this.createBundler()
|
||||
|
||||
const cleanup = (code?: number | null): void => {
|
||||
Watcher.log("killing vs code watcher")
|
||||
@@ -63,7 +64,7 @@ class Watcher {
|
||||
server.kill()
|
||||
}
|
||||
|
||||
Watcher.log("killing bundler")
|
||||
Watcher.log("killing watch")
|
||||
process.exit(code || 0)
|
||||
}
|
||||
|
||||
@@ -84,16 +85,6 @@ class Watcher {
|
||||
cleanup(code)
|
||||
})
|
||||
}
|
||||
const bundle = bundler.bundle().catch(() => {
|
||||
Watcher.log("parcel watcher terminated unexpectedly")
|
||||
cleanup(1)
|
||||
})
|
||||
bundler.on("buildEnd", () => {
|
||||
console.log("[parcel] bundled")
|
||||
})
|
||||
bundler.on("buildError", (error) => {
|
||||
console.error("[parcel]", error)
|
||||
})
|
||||
|
||||
vscode.stderr.on("data", (d) => process.stderr.write(d))
|
||||
tsc.stderr.on("data", (d) => process.stderr.write(d))
|
||||
@@ -101,37 +92,11 @@ class Watcher {
|
||||
plugin.stderr.on("data", (d) => process.stderr.write(d))
|
||||
}
|
||||
|
||||
// From https://github.com/chalk/ansi-regex
|
||||
const pattern = [
|
||||
"[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:[a-zA-Z\\d]*(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?\\u0007)",
|
||||
"(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PR-TZcf-ntqry=><~]))",
|
||||
].join("|")
|
||||
const re = new RegExp(pattern, "g")
|
||||
|
||||
/**
|
||||
* Split stdout on newlines and strip ANSI codes.
|
||||
*/
|
||||
const onLine = (proc: cp.ChildProcess, callback: (strippedLine: string, originalLine: string) => void): void => {
|
||||
let buffer = ""
|
||||
if (!proc.stdout) {
|
||||
throw new Error("no stdout")
|
||||
}
|
||||
proc.stdout.setEncoding("utf8")
|
||||
proc.stdout.on("data", (d) => {
|
||||
const data = buffer + d
|
||||
const split = data.split("\n")
|
||||
const last = split.length - 1
|
||||
|
||||
for (let i = 0; i < last; ++i) {
|
||||
callback(split[i].replace(re, ""), split[i])
|
||||
}
|
||||
|
||||
// The last item will either be an empty string (the data ended with a
|
||||
// newline) or a partial line (did not end with a newline) and we must
|
||||
// wait to parse it until we get a full line.
|
||||
buffer = split[last]
|
||||
})
|
||||
}
|
||||
const browserFiles = [
|
||||
path.join(this.rootPath, "out/browser/register.js"),
|
||||
path.join(this.rootPath, "out/browser/pages/login.js"),
|
||||
path.join(this.rootPath, "out/browser/pages/vscode.js"),
|
||||
]
|
||||
|
||||
let startingVscode = false
|
||||
let startedVscode = false
|
||||
@@ -143,7 +108,7 @@ class Watcher {
|
||||
startingVscode = true
|
||||
} else if (startingVscode && line.includes("Finished compilation")) {
|
||||
if (startedVscode) {
|
||||
bundle.then(restartServer)
|
||||
restartServer()
|
||||
}
|
||||
startedVscode = true
|
||||
}
|
||||
@@ -155,7 +120,8 @@ class Watcher {
|
||||
console.log("[tsc]", original)
|
||||
}
|
||||
if (line.includes("Watching for file changes")) {
|
||||
bundle.then(restartServer)
|
||||
bundleBrowserCode(browserFiles)
|
||||
restartServer()
|
||||
}
|
||||
})
|
||||
|
||||
@@ -166,29 +132,26 @@ class Watcher {
|
||||
console.log("[plugin]", original)
|
||||
}
|
||||
if (line.includes("Watching for file changes")) {
|
||||
bundle.then(restartServer)
|
||||
restartServer()
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private createBundler(out = "dist"): Bundler {
|
||||
return new Bundler(
|
||||
[
|
||||
path.join(this.rootPath, "src/browser/register.ts"),
|
||||
path.join(this.rootPath, "src/browser/serviceWorker.ts"),
|
||||
path.join(this.rootPath, "src/browser/pages/login.ts"),
|
||||
path.join(this.rootPath, "src/browser/pages/vscode.ts"),
|
||||
],
|
||||
{
|
||||
outDir: path.join(this.rootPath, out),
|
||||
cacheDir: path.join(this.rootPath, ".cache"),
|
||||
minify: !!process.env.MINIFY,
|
||||
logLevel: 1,
|
||||
publicUrl: ".",
|
||||
},
|
||||
)
|
||||
}
|
||||
function bundleBrowserCode(inputFiles: string[]) {
|
||||
console.log(`[browser] bundling...`)
|
||||
inputFiles.forEach(async (path: string) => {
|
||||
const outputPath = path.replace(".js", ".browserified.js")
|
||||
browserify()
|
||||
.add(path)
|
||||
.bundle()
|
||||
.on("error", function (error: Error) {
|
||||
console.error(error.toString())
|
||||
})
|
||||
.pipe(fs.createWriteStream(outputPath))
|
||||
})
|
||||
console.log(`[browser] done bundling`)
|
||||
}
|
||||
|
||||
main()
|
||||
|
||||
@@ -20,4 +20,4 @@ version: 1.0.3
|
||||
# This is the version number of the application being deployed. This version number should be
|
||||
# incremented each time you make changes to the application. Versions are not expected to
|
||||
# follow Semantic Versioning. They should reflect the version the application is using.
|
||||
appVersion: 3.10.0
|
||||
appVersion: 3.11.0
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
# code-server
|
||||
|
||||
  
|
||||
  
|
||||
|
||||
[code-server](https://github.com/cdr/code-server) code-server is VS Code running
|
||||
on a remote server, accessible through the browser.
|
||||
@@ -65,6 +65,7 @@ and their default values.
|
||||
| extraArgs | list | `[]` | |
|
||||
| extraConfigmapMounts | list | `[]` | |
|
||||
| extraContainers | string | `""` | |
|
||||
| extraInitContainers | string | `""` | |
|
||||
| extraSecretMounts | list | `[]` | |
|
||||
| extraVars | list | `[]` | |
|
||||
| extraVolumeMounts | list | `[]` | |
|
||||
@@ -72,7 +73,7 @@ and their default values.
|
||||
| hostnameOverride | string | `""` | |
|
||||
| image.pullPolicy | string | `"Always"` | |
|
||||
| image.repository | string | `"codercom/code-server"` | |
|
||||
| image.tag | string | `"3.10.0"` | |
|
||||
| image.tag | string | `"3.11.0"` | |
|
||||
| imagePullSecrets | list | `[]` | |
|
||||
| ingress.enabled | bool | `false` | |
|
||||
| nameOverride | string | `""` | |
|
||||
@@ -115,3 +116,47 @@ $ helm upgrade --install code-server ci/helm-chart -f values.yaml
|
||||
```
|
||||
|
||||
> **Tip**: You can use the default [values.yaml](values.yaml)
|
||||
|
||||
# Extra Containers
|
||||
|
||||
There are two parameters which allow to add more containers to pod.
|
||||
Use `extraContainers` to add regular containers
|
||||
and `extraInitContainers` to add init containers. You can read more
|
||||
about init containers in [k8s documentation](https://kubernetes.io/docs/concepts/workloads/pods/init-containers/).
|
||||
|
||||
Both parameters accept strings and use them as a templates
|
||||
|
||||
Example of using `extraInitContainers`:
|
||||
|
||||
``` yaml
|
||||
extraInitContainers: |
|
||||
- name: customization
|
||||
image: {{ .Values.image.repository }}:{{ .Values.image.tag }}
|
||||
imagePullPolicy: IfNotPresent
|
||||
env:
|
||||
- name: SERVICE_URL
|
||||
value: https://open-vsx.org/vscode/gallery
|
||||
- name: ITEM_URL
|
||||
value: https://open-vsx.org/vscode/item
|
||||
command:
|
||||
- sh
|
||||
- -c
|
||||
- |
|
||||
code-server --install-extension ms-python.python
|
||||
code-server --install-extension golang.Go
|
||||
volumeMounts:
|
||||
- name: data
|
||||
mountPath: /home/coder
|
||||
|
||||
```
|
||||
|
||||
With this yaml in file `init.yaml`, you can execute
|
||||
|
||||
```console
|
||||
$ helm upgrade --install code-server \
|
||||
ci/helm-chart \
|
||||
--values init.yaml
|
||||
```
|
||||
|
||||
to deploy code-server with python and golang extensions preinstalled
|
||||
before main container have started.
|
||||
@@ -43,10 +43,13 @@ spec:
|
||||
volumeMounts:
|
||||
- name: data
|
||||
mountPath: /home/coder
|
||||
{{- if .Values.extraInitContainers }}
|
||||
{{ tpl .Values.extraInitContainers . | indent 6}}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
containers:
|
||||
{{- if .Values.extraContainers }}
|
||||
{{ toYaml .Values.extraContainers | indent 8}}
|
||||
{{ tpl .Values.extraContainers . | indent 8}}
|
||||
{{- end }}
|
||||
- name: {{ .Chart.Name }}
|
||||
image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}"
|
||||
|
||||
@@ -6,7 +6,7 @@ replicaCount: 1
|
||||
|
||||
image:
|
||||
repository: codercom/code-server
|
||||
tag: '3.10.0'
|
||||
tag: '3.11.0'
|
||||
pullPolicy: Always
|
||||
|
||||
imagePullSecrets: []
|
||||
|
||||
50
ci/lib.sh
50
ci/lib.sh
@@ -2,11 +2,11 @@
|
||||
set -euo pipefail
|
||||
|
||||
pushd() {
|
||||
builtin pushd "$@" >/dev/null
|
||||
builtin pushd "$@" > /dev/null
|
||||
}
|
||||
|
||||
popd() {
|
||||
builtin popd >/dev/null
|
||||
builtin popd > /dev/null
|
||||
}
|
||||
|
||||
pkg_json_version() {
|
||||
@@ -35,28 +35,29 @@ os() {
|
||||
}
|
||||
|
||||
arch() {
|
||||
case "$(uname -m)" in
|
||||
aarch64)
|
||||
echo arm64
|
||||
;;
|
||||
x86_64 | amd64)
|
||||
echo amd64
|
||||
;;
|
||||
*)
|
||||
echo "unknown architecture $(uname -a)"
|
||||
exit 1
|
||||
;;
|
||||
cpu="$(uname -m)"
|
||||
case "$cpu" in
|
||||
aarch64)
|
||||
echo arm64
|
||||
;;
|
||||
x86_64 | amd64)
|
||||
echo amd64
|
||||
;;
|
||||
*)
|
||||
echo "$cpu"
|
||||
;;
|
||||
esac
|
||||
}
|
||||
|
||||
# Grabs the most recent ci.yaml github workflow run that was successful and triggered from the same commit being pushd.
|
||||
# Grabs the most recent ci.yaml github workflow run that was triggered from the
|
||||
# pull request of the release branch for this version (regardless of whether
|
||||
# that run succeeded or failed). The release branch name must be in semver
|
||||
# format with a v prepended.
|
||||
# This will contain the artifacts we want.
|
||||
# https://developer.github.com/v3/actions/workflow-runs/#list-workflow-runs
|
||||
get_artifacts_url() {
|
||||
local artifacts_url
|
||||
local workflow_runs_url="repos/:owner/:repo/actions/workflows/ci.yaml/runs?event=pull_request"
|
||||
# For releases, we look for run based on the branch name v$code_server_version
|
||||
# example: v3.10.0
|
||||
local version_branch="v$VERSION"
|
||||
artifacts_url=$(gh api "$workflow_runs_url" | jq -r ".workflow_runs[] | select(.head_branch == \"$version_branch\") | .artifacts_url" | head -n 1)
|
||||
if [[ -z "$artifacts_url" ]]; then
|
||||
@@ -84,7 +85,7 @@ download_artifact() {
|
||||
local tmp_file
|
||||
tmp_file="$(mktemp)"
|
||||
|
||||
gh api "$(get_artifact_url "$artifact_name")" >"$tmp_file"
|
||||
gh api "$(get_artifact_url "$artifact_name")" > "$tmp_file"
|
||||
unzip -q -o "$tmp_file" -d "$dst"
|
||||
rm "$tmp_file"
|
||||
}
|
||||
@@ -112,13 +113,12 @@ RELEASE_PATH="${RELEASE_PATH-release}"
|
||||
# Code itself but also extensions will look specifically in this directory for
|
||||
# files (like the ripgrep binary or the oniguruma wasm).
|
||||
symlink_asar() {
|
||||
if [ ! -L node_modules.asar ]; then
|
||||
if [ "${WINDIR-}" ]; then
|
||||
# mklink takes the link name first.
|
||||
mklink /J node_modules.asar node_modules
|
||||
else
|
||||
# ln takes the link name second.
|
||||
ln -s node_modules node_modules.asar
|
||||
fi
|
||||
rm -rf node_modules.asar
|
||||
if [ "${WINDIR-}" ]; then
|
||||
# mklink takes the link name first.
|
||||
mklink /J node_modules.asar node_modules
|
||||
else
|
||||
# ln takes the link name second.
|
||||
ln -s node_modules node_modules.asar
|
||||
fi
|
||||
}
|
||||
|
||||
@@ -1,11 +0,0 @@
|
||||
#!/usr/bin/env bash
|
||||
set -euo pipefail
|
||||
|
||||
main() {
|
||||
cd "$(dirname "$0")/../.."
|
||||
source ./ci/lib.sh
|
||||
|
||||
docker build -t "codercom/code-server-$ARCH:$VERSION" -f ./ci/release-image/Dockerfile .
|
||||
}
|
||||
|
||||
main "$@"
|
||||
25
ci/release-image/docker-bake.hcl
Normal file
25
ci/release-image/docker-bake.hcl
Normal file
@@ -0,0 +1,25 @@
|
||||
# Use this file from the top of the repo, with `-f ci/release-image/docker-bake.hcl`
|
||||
|
||||
# Uses env var VERSION if set;
|
||||
# normally, this is set by ci/lib.sh
|
||||
variable "VERSION" {
|
||||
default = "latest"
|
||||
}
|
||||
|
||||
group "default" {
|
||||
targets = ["code-server-amd64", "code-server-arm64"]
|
||||
}
|
||||
|
||||
target "code-server-amd64" {
|
||||
dockerfile = "ci/release-image/Dockerfile"
|
||||
tags = ["docker.io/codercom/code-server-amd64:${VERSION}"]
|
||||
platforms = ["linux/amd64"]
|
||||
output = ["type=tar,dest=./release-images/code-server-amd64-${VERSION}.tar"]
|
||||
}
|
||||
|
||||
target "code-server-arm64" {
|
||||
dockerfile = "ci/release-image/Dockerfile"
|
||||
tags = ["docker.io/codercom/code-server-arm64:${VERSION}"]
|
||||
platforms = ["linux/arm64"]
|
||||
output = ["type=tar,dest=./release-images/code-server-arm64-${VERSION}.tar"]
|
||||
}
|
||||
@@ -5,16 +5,17 @@ set -eu
|
||||
# Otherwise the current container UID may not exist in the passwd database.
|
||||
eval "$(fixuid -q)"
|
||||
|
||||
if [ "${DOCKER_USER-}" ] && [ "$DOCKER_USER" != "$USER" ]; then
|
||||
echo "$DOCKER_USER ALL=(ALL) NOPASSWD:ALL" | sudo tee -a /etc/sudoers.d/nopasswd >/dev/null
|
||||
# Unfortunately we cannot change $HOME as we cannot move any bind mounts
|
||||
# nor can we bind mount $HOME into a new home as that requires a privileged container.
|
||||
sudo usermod --login "$DOCKER_USER" coder
|
||||
sudo groupmod -n "$DOCKER_USER" coder
|
||||
|
||||
if [ "${DOCKER_USER-}" ]; then
|
||||
USER="$DOCKER_USER"
|
||||
if [ "$DOCKER_USER" != "$(whoami)" ]; then
|
||||
echo "$DOCKER_USER ALL=(ALL) NOPASSWD:ALL" | sudo tee -a /etc/sudoers.d/nopasswd > /dev/null
|
||||
# Unfortunately we cannot change $HOME as we cannot move any bind mounts
|
||||
# nor can we bind mount $HOME into a new home as that requires a privileged container.
|
||||
sudo usermod --login "$DOCKER_USER" coder
|
||||
sudo groupmod -n "$DOCKER_USER" coder
|
||||
|
||||
sudo sed -i "/coder/d" /etc/sudoers.d/nopasswd
|
||||
sudo sed -i "/coder/d" /etc/sudoers.d/nopasswd
|
||||
fi
|
||||
fi
|
||||
|
||||
dumb-init /usr/bin/code-server "$@"
|
||||
|
||||
@@ -5,9 +5,43 @@ main() {
|
||||
cd "$(dirname "$0")/../.."
|
||||
# Only sourcing this so we get access to $VERSION
|
||||
source ./ci/lib.sh
|
||||
|
||||
# NOTE: we need to make sure cdrci/homebrew-core
|
||||
# is up-to-date
|
||||
# otherwise, brew bump-formula-pr will use an
|
||||
# outdated base
|
||||
echo "Cloning cdrci/homebrew-core"
|
||||
git clone https://github.com/cdrci/homebrew-core.git
|
||||
|
||||
echo "Changing into homebrew-core directory"
|
||||
cd homebrew-core && pwd
|
||||
|
||||
echo "Adding Homebrew/homebrew-core as $(upstream)"
|
||||
git remote add upstream https://github.com/Homebrew/homebrew-core.git
|
||||
|
||||
echo "Fetching upstream commits..."
|
||||
git fetch upstream
|
||||
|
||||
echo "Merging in latest changes"
|
||||
git merge upstream/master
|
||||
|
||||
echo "Pushing changes to cdrci/homebrew-core fork on GitHub"
|
||||
# Source: https://serverfault.com/a/912788
|
||||
# shellcheck disable=SC2016,SC2028
|
||||
echo '#!/bin/sh\nexec echo "$HOMEBREW_GITHUB_API_TOKEN"' > "$HOME"/.git-askpass.sh
|
||||
# Ensure it's executable since we just created it
|
||||
chmod +x "$HOME/.git-askpass.sh"
|
||||
# GIT_ASKPASS lets us use the password when pushing without revealing it in the process list
|
||||
# See: https://serverfault.com/a/912788
|
||||
GIT_ASKPASS="$HOME/.git-askpass.sh" git push https://cdr-oss@github.com/cdr-oss/homebrew-core.git --all
|
||||
|
||||
# Find the docs for bump-formula-pr here
|
||||
# https://github.com/Homebrew/brew/blob/master/Library/Homebrew/dev-cmd/bump-formula-pr.rb#L18
|
||||
brew bump-formula-pr --force --version="${VERSION}" code-server --no-browse --no-audit
|
||||
|
||||
# Clean up and remove homebrew-core
|
||||
cd ..
|
||||
rm -rf homebrew-core
|
||||
}
|
||||
|
||||
main "$@"
|
||||
|
||||
@@ -5,10 +5,8 @@ main() {
|
||||
cd "$(dirname "$0")/../.."
|
||||
source ./ci/lib.sh
|
||||
|
||||
./ci/release-image/build.sh
|
||||
|
||||
mkdir -p release-images
|
||||
docker save "codercom/code-server-$ARCH:$VERSION" >"release-images/code-server-$ARCH-$VERSION.tar"
|
||||
docker buildx bake -f ci/release-image/docker-bake.hcl
|
||||
}
|
||||
|
||||
main "$@"
|
||||
|
||||
@@ -6,7 +6,7 @@ main() {
|
||||
source ./ci/lib.sh
|
||||
|
||||
if [[ ${CI-} ]]; then
|
||||
echo "//registry.npmjs.org/:_authToken=${NPM_TOKEN}" >~/.npmrc
|
||||
echo "//registry.npmjs.org/:_authToken=${NPM_TOKEN}" > ~/.npmrc
|
||||
fi
|
||||
|
||||
download_artifact npm-package ./release-npm-package
|
||||
|
||||
@@ -2,12 +2,16 @@
|
||||
<!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE -->
|
||||
# Contributing
|
||||
|
||||
- [Pull Requests](#pull-requests)
|
||||
- [Requirements](#requirements)
|
||||
- [Development Workflow](#development-workflow)
|
||||
- [Updating VS Code](#updating-vs-code)
|
||||
- [Notes about Changes](#notes-about-changes)
|
||||
- [Build](#build)
|
||||
- [Creating pull requests](#creating-pull-requests)
|
||||
- [Commits and commit history](#commits-and-commit-history)
|
||||
- [Development workflow](#development-workflow)
|
||||
- [Updates to VS Code](#updates-to-vs-code)
|
||||
- [Build](#build)
|
||||
- [Test](#test)
|
||||
- [Unit tests](#unit-tests)
|
||||
- [Integration tests](#integration-tests)
|
||||
- [End-to-end tests](#end-to-end-tests)
|
||||
- [Structure](#structure)
|
||||
- [Modifications to VS Code](#modifications-to-vs-code)
|
||||
- [Currently Known Issues](#currently-known-issues)
|
||||
@@ -16,40 +20,51 @@
|
||||
|
||||
- [Detailed CI and build process docs](../ci)
|
||||
|
||||
## Pull Requests
|
||||
|
||||
Please create a [GitHub Issue](https://github.com/cdr/code-server/issues) for each issue
|
||||
you'd like to address unless the proposed fix is minor.
|
||||
|
||||
In your Pull Requests (PR), link to the issue that the PR solves.
|
||||
|
||||
Please ensure that the base of your PR is the **master** branch. (Note: The default
|
||||
GitHub branch is the latest release branch, though you should point all of your changes to be merged into
|
||||
master).
|
||||
|
||||
## Requirements
|
||||
|
||||
The prerequisites for contributing to code-server are almost the same as those for
|
||||
[VS Code](https://github.com/Microsoft/vscode/wiki/How-to-Contribute#prerequisites).
|
||||
There are several differences, however. Here is what is needed:
|
||||
The prerequisites for contributing to code-server are almost the same as those
|
||||
for [VS
|
||||
Code](https://github.com/Microsoft/vscode/wiki/How-to-Contribute#prerequisites).
|
||||
Here is what is needed:
|
||||
|
||||
- `node` v12.x or greater
|
||||
- `node` v14.x
|
||||
- `git` v2.x or greater
|
||||
- [`yarn`](https://classic.yarnpkg.com/en/)
|
||||
- used to install JS packages and run scripts
|
||||
- Used to install JS packages and run scripts
|
||||
- [`nfpm`](https://classic.yarnpkg.com/en/)
|
||||
- used to build `.deb` and `.rpm` packages
|
||||
- Used to build `.deb` and `.rpm` packages
|
||||
- [`jq`](https://stedolan.github.io/jq/)
|
||||
- used to build code-server releases
|
||||
- Used to build code-server releases
|
||||
- [`gnupg`](https://gnupg.org/index.html)
|
||||
- all commits must be signed an verified
|
||||
- see GitHub's ["Managing commit signature verification"](https://docs.github.com/en/github/authenticating-to-github/managing-commit-signature-verification) or follow [this tutorial](https://joeprevite.com/verify-commits-on-github)
|
||||
- `build-essential` (Linux)
|
||||
- `apt-get install -y build-essential` - used by VS Code
|
||||
- All commits must be signed and verified; see GitHub's [Managing commit
|
||||
signature
|
||||
verification](https://docs.github.com/en/github/authenticating-to-github/managing-commit-signature-verification)
|
||||
or follow [this tutorial](https://joeprevite.com/verify-commits-on-github)
|
||||
- `build-essential` (Linux only - used by VS Code)
|
||||
- Get this by running `apt-get install -y build-essential`
|
||||
- `rsync` and `unzip`
|
||||
- used for code-server releases
|
||||
- Used for code-server releases
|
||||
- `bats`
|
||||
- Used to run script unit tests
|
||||
|
||||
## Development Workflow
|
||||
## Creating pull requests
|
||||
|
||||
Please create a [GitHub Issue](https://github.com/cdr/code-server/issues) that
|
||||
includes context for issues that you see. You can skip this if the proposed fix
|
||||
is minor.
|
||||
|
||||
In your pull requests (PR), link to the issue that the PR solves.
|
||||
|
||||
Please ensure that the base of your PR is the **main** branch.
|
||||
|
||||
### Commits and commit history
|
||||
|
||||
We prefer a clean commit history. This means you should squash all fixups and
|
||||
fixup-type commits before asking for a review (e.g., clean up, squash, then force
|
||||
push). If you need help with this, feel free to leave a comment in your PR, and
|
||||
we'll guide you.
|
||||
|
||||
## Development workflow
|
||||
|
||||
```shell
|
||||
yarn
|
||||
@@ -59,27 +74,30 @@ yarn watch
|
||||
|
||||
`yarn watch` will live reload changes to the source.
|
||||
|
||||
### Updating VS Code
|
||||
### Updates to VS Code
|
||||
|
||||
Updating VS Code requires `git subtree`. On some rpm-based Linux distros, `git subtree` is not included by default, and needs to be installed separately.
|
||||
To install, run `dnf install git-subtree` or `yum install git-subtree` as necessary.
|
||||
Updating VS Code requires `git subtree`. On some RPM-based Linux distros, `git subtree` is not included by default and needs to be installed separately. To
|
||||
install, run `dnf install git-subtree` or `yum install git-subtree`.
|
||||
|
||||
To update VS Code, follow these steps:
|
||||
To update VS Code:
|
||||
|
||||
1. Run `yarn update:vscode`.
|
||||
2. Enter a version. Ex. 1.53
|
||||
3. This will open a draft PR for you.
|
||||
4. There will be merge conflicts. First commit them.
|
||||
1. We do this because if we don't, it will be impossible to review your PR.
|
||||
5. Once they're all fixed, test code-server locally and make sure it all works.
|
||||
2. Enter a version (e.g., `1.53`)
|
||||
3. This will open a draft pull request for you.
|
||||
4. There will be merge conflicts. Commit them first, since it will be impossible
|
||||
for us to review your PR if you don't.
|
||||
5. Fix the conflicts. Then, test code-server locally to make sure everything
|
||||
works.
|
||||
6. Check the Node.js version that's used by Electron (which is shipped with VS
|
||||
Code. If necessary, update your version of Node.js to match.
|
||||
|
||||
#### Notes about Changes
|
||||
> Watch for updates to
|
||||
> `lib/vscode/src/vs/code/browser/workbench/workbench.html`. You may need to
|
||||
> make changes to `src/browser/pages/vscode.html`.
|
||||
|
||||
- watch out for updates to `lib/vscode/src/vs/code/browser/workbench/workbench.html`. You may need to make changes to `src/browser/pages/vscode.html`
|
||||
### Build
|
||||
|
||||
## Build
|
||||
|
||||
You can build using:
|
||||
You can build as follows:
|
||||
|
||||
```shell
|
||||
yarn build
|
||||
@@ -87,7 +105,7 @@ yarn build:vscode
|
||||
yarn release
|
||||
```
|
||||
|
||||
Run your build with:
|
||||
Run your build:
|
||||
|
||||
```shell
|
||||
cd release
|
||||
@@ -104,42 +122,140 @@ yarn test:standalone-release
|
||||
yarn package
|
||||
```
|
||||
|
||||
NOTE: On Linux, the currently running distro will become the minimum supported version.
|
||||
In our GitHub Actions CI, we use CentOS 7 for maximum compatibility.
|
||||
If you need your builds to support older distros, run the build commands
|
||||
inside a Docker container with all the build requirements installed.
|
||||
> On Linux, the currently running distro will become the minimum supported
|
||||
> version. In our GitHub Actions CI, we use CentOS 7 for maximum compatibility.
|
||||
> If you need your builds to support older distros, run the build commands
|
||||
> inside a Docker container with all the build requirements installed.
|
||||
|
||||
### Test
|
||||
|
||||
There are three kinds of tests in code-server:
|
||||
|
||||
1. Unit tests
|
||||
2. Integration tests
|
||||
3. End-to-end tests
|
||||
|
||||
### Unit tests
|
||||
|
||||
Our unit tests are written in TypeScript and run using
|
||||
[Jest](https://jestjs.io/), the testing framework].
|
||||
|
||||
These live under [test/unit](../test/unit).
|
||||
|
||||
We use unit tests for functions and things that can be tested in isolation.
|
||||
|
||||
### Integration tests
|
||||
|
||||
These are a work in progress. We build code-server and run a script called
|
||||
[test-standalone-release.sh](../ci/build/test-standalone-release.sh), which
|
||||
ensures that code-server's CLI is working.
|
||||
|
||||
Our integration tests look at components that rely on one another. For example,
|
||||
testing the CLI requires us to build and package code-server.
|
||||
|
||||
### End-to-end tests
|
||||
|
||||
The end-to-end (e2e) tests are written in TypeScript and run using
|
||||
[Playwright](https://playwright.dev/).
|
||||
|
||||
These live under [test/e2e](../test/e2e).
|
||||
|
||||
Before the e2e tests run, we run `globalSetup`, which eliminates the need to log
|
||||
in before each test by preserving the authentication state.
|
||||
|
||||
Take a look at `codeServer.test.ts` to see how you would use it (see
|
||||
`test.use`).
|
||||
|
||||
We also have a model where you can create helpers to use within tests. See
|
||||
[models/CodeServer.ts](../test/e2e/models/CodeServer.ts) for an example.
|
||||
|
||||
Generally speaking, e2e means testing code-server while running in the browser
|
||||
and interacting with it in a way that's similar to how a user would interact
|
||||
with it. When running these tests with `yarn test:e2e`, you must have
|
||||
code-server running locally. In CI, this is taken care of for you.
|
||||
|
||||
## Structure
|
||||
|
||||
The `code-server` script serves an HTTP API for login and starting a remote VS Code process.
|
||||
The `code-server` script serves as an HTTP API for login and starting a remote VS
|
||||
Code process.
|
||||
|
||||
The CLI code is in [src/node](../src/node) and the HTTP routes are implemented in
|
||||
[src/node/routes](../src/node/routes).
|
||||
The CLI code is in [src/node](../src/node) and the HTTP routes are implemented
|
||||
in [src/node/routes](../src/node/routes).
|
||||
|
||||
Most of the meaty parts are in the VS Code portion of the codebase under [lib/vscode](../lib/vscode), which we described next.
|
||||
Most of the meaty parts are in the VS Code portion of the codebase under
|
||||
[lib/vscode](../lib/vscode), which we describe next.
|
||||
|
||||
### Modifications to VS Code
|
||||
|
||||
In v1 of code-server, we had a patch of VS Code that split the codebase into a front-end
|
||||
and a server. The front-end consisted of all UI code, while the server ran the extensions
|
||||
and exposed an API to the front-end for file access and all UI needs.
|
||||
In v1 of code-server, we had a patch of VS Code that split the codebase into a
|
||||
front-end and a server. The front-end consisted of the UI code, while the server
|
||||
ran the extensions and exposed an API to the front-end for file access and all
|
||||
UI needs.
|
||||
|
||||
Over time, Microsoft added support to VS Code to run it on the web. They have made
|
||||
the front-end open source, but not the server. As such, code-server v2 (and later) uses
|
||||
the VS Code front-end and implements the server. We do this by using a git subtree to fork and modify VS Code. This code lives under [lib/vscode](../lib/vscode).
|
||||
Over time, Microsoft added support to VS Code to run it on the web. They have
|
||||
made the front-end open source, but not the server. As such, code-server v2 (and
|
||||
later) uses the VS Code front-end and implements the server. We do this by using
|
||||
a Git subtree to fork and modify VS Code. This code lives under
|
||||
[lib/vscode](../lib/vscode).
|
||||
|
||||
Some noteworthy changes in our version of VS Code:
|
||||
Some noteworthy changes in our version of VS Code include:
|
||||
|
||||
- Adding our build file, which includes our code and VS Code's web code
|
||||
- Allowing multiple extension directories (both user and built-in)
|
||||
- Modifying the loader, websocket, webview, service worker, and asset requests to
|
||||
use the URL of the page as a base (and TLS, if necessary for the websocket)
|
||||
- Sending client-side telemetry through the server
|
||||
- Allowing modification of the display language
|
||||
- Making it possible for us to load code on the client
|
||||
- Making it possible to install extensions of any kind
|
||||
- Fixing issue with getting disconnected when your machine sleeps or hibernates
|
||||
- Adding connection type to web socket query parameters
|
||||
- Adding our build file, [`lib/vscode/coder.js`](../lib/vscode/coder.js), which includes build steps specific to code-server
|
||||
- Node.js version detection changes in [`build/lib/node.ts`](../lib/vscode/build/lib/node.ts) and [`build/lib/util.ts`](../lib/vscode/build/lib/util.ts)
|
||||
- Allowing extra extension directories
|
||||
- Added extra arguments to [`src/vs/platform/environment/common/argv.ts`](../lib/vscode/src/vs/platform/environment/common/argv.ts) and to [`src/vs/platform/environment/node/argv.ts`](../lib/vscode/src/vs/platform/environment/node/argv.ts)
|
||||
- Added extra environment state to [`src/vs/platform/environment/common/environment.ts`](../lib/vscode/src/vs/platform/environment/common/environment.ts);
|
||||
- Added extra getters to [`src/vs/platform/environment/common/environmentService.ts`](../lib/vscode/src/vs/platform/environment/common/environmentService.ts)
|
||||
- Added extra scanning paths to [`src/vs/platform/extensionManagement/node/extensionsScanner.ts`](../lib/vscode/src/vs/platform/extensionManagement/node/extensionsScanner.ts)
|
||||
- Additions/removals from [`package.json`](../lib/vscode/package.json):
|
||||
- Removing `electron`, `keytar` and `native-keymap` to avoid pulling in desktop dependencies during build on Linux
|
||||
- Removing `gulp-azure-storage` and `gulp-tar` (unsued in our build process, may pull in outdated dependencies)
|
||||
- Adding `proxy-agent`, `proxy-from-env` (for proxying) and `rimraf` (used during build/install steps)
|
||||
- Adding our branding/custom URLs/version:
|
||||
- [`product.json`](../lib/vscode/product.json)
|
||||
- [`src/vs/base/common/product.ts`](../lib/vscode/src/vs/base/common/product.ts)
|
||||
- [`src/vs/workbench/browser/parts/dialogs/dialogHandler.ts`](../lib/vscode/src/vs/workbench/browser/parts/dialogs/dialogHandler.ts)
|
||||
- [`src/vs/workbench/contrib/welcome/page/browser/vs_code_welcome_page.ts`](../lib/vscode/src/vs/workbench/contrib/welcome/page/browser/vs_code_welcome_page.ts)
|
||||
- [`src/vs/workbench/contrib/welcome/page/browser/welcomePage.ts`](../lib/vscode/src/vs/workbench/contrib/welcome/page/browser/welcomePage.ts)
|
||||
- Removing azure/macOS signing related dependencies from [`build/package.json`](../lib/vscode/build/package.json)
|
||||
- Modifying `.gitignore` to allow us to add files to `src/vs/server` and modifying `.eslintignore` to ignore lint on the shared files below (we use different formatter settings than VS Code).
|
||||
- Sharing some files with our codebase via symlinks:
|
||||
- [`src/vs/base/common/ipc.d.ts`](../lib/vscode/src/vs/base/common/ipc.d.ts) points to [`typings/ipc.d.ts`](../typings/ipc.d.ts)
|
||||
- [`src/vs/base/common/util.ts`](../lib/vscode/src/vs/base/common/util.ts) points to [`src/common/util.ts`](../src/common/util.ts)
|
||||
- [`src/vs/base/node/proxy_agent.ts`](../lib/vscode/src/vs/base/node/proxy_agent.ts) points to [`src/node/proxy_agent.ts`](../src/node/proxy_agent.ts)
|
||||
- Allowing socket changes by adding `setSocket` in [`src/vs/base/parts/ipc/common/ipc.net.ts`](../lib/vscode/src/vs/base/parts/ipc/common/ipc.net.ts)
|
||||
- We use this for connection persistence in our server-side code.
|
||||
- Added our server-side Node.JS code to `src/vs/server`.
|
||||
- This code includes the logic to spawn the various services (extension host, terminal, etc.) and some glue
|
||||
- Added [`src/vs/workbench/browser/client.ts`](../lib/vscode/src/vs/workbench/browser/client.ts) to hold some server customizations.
|
||||
- Includes the functionality for the Log Out command and menu item
|
||||
- Also, imported and called `initialize` from the main web file, [`src/vs/workbench/browser/web.main.ts`](../lib/vscode/src/vs/workbench/browser/web.main.ts)
|
||||
- Added a (hopefully temporary) hotfix to [`src/vs/workbench/common/resources.ts`](../lib/vscode/src/vs/workbench/common/resources.ts) to get context menu actions working for the Git integration.
|
||||
- Added connection type to WebSocket query parameters in [`src/vs/platform/remote/common/remoteAgentConnection.ts`](../lib/vscode/src/vs/platform/remote/common/remoteAgentConnection.ts)
|
||||
- Added `CODE_SERVER*` variables to the sanitization list in [`src/vs/base/common/processes.ts`](../lib/vscode/src/vs/base/common/processes.ts)
|
||||
- Fix localization support:
|
||||
- Added file [`src/vs/workbench/services/localizations/browser/localizationsService.ts`](../lib/vscode/src/vs/workbench/services/localizations/browser/localizationsService.ts).
|
||||
- Modified file [`src/vs/base/common/platform.ts`](../lib/vscode/src/vs/base/common/platform.ts)
|
||||
- Modified file [`src/vs/base/node/languagePacks.js`](../lib/vscode/src/vs/base/node/languagePacks.js)
|
||||
- Added code to allow server to inject settings to [`src/vs/platform/product/common/product.ts`](../lib/vscode/src/vs/platform/product/common/product.ts)
|
||||
- Extension fixes:
|
||||
- Avoid disabling extensions by extensionKind in [`src/vs/workbench/services/extensionManagement/browser/extensionEnablementService.ts`](../lib/vscode/src/vs/workbench/services/extensionManagement/browser/extensionEnablementService.ts) (Needed for vscode-icons)
|
||||
- Remove broken symlinks in [`extensions/postinstall.js`](../lib/vscode/extensions/postinstall.js)
|
||||
- Add tip about extension gallery in [`src/vs/workbench/contrib/extensions/browser/extensionsViewlet.ts`](../lib/vscode/src/vs/workbench/contrib/extensions/browser/extensionsViewlet.ts)
|
||||
- Use our own server for GitHub authentication in [`extensions/github-authentication/src/githubServer.ts`](../lib/vscode/extensions/github-authentication/src/githubServer.ts)
|
||||
- Settings persistence on the server in [`src/vs/workbench/services/environment/browser/environmentService.ts`](../lib/vscode/src/vs/workbench/services/environment/browser/environmentService.ts)
|
||||
- Add extension install fallback in [`src/vs/workbench/services/extensionManagement/common/extensionManagementService.ts`](../lib/vscode/src/vs/workbench/services/extensionManagement/common/extensionManagementService.ts)
|
||||
- Add proxy-agent monkeypatch and keep extension host indefinitely running in [`src/vs/workbench/services/extensions/node/extensionHostProcessSetup.ts`](../lib/vscode/src/vs/workbench/services/extensions/node/extensionHostProcessSetup.ts)
|
||||
- Patch build system to avoid removing extension dependencies for `yarn global add` users in [`build/lib/extensions.ts`](../lib/vscode/build/lib/extensions.ts)
|
||||
- Allow all extensions to use proposed APIs in [`src/vs/workbench/services/environment/browser/environmentService.ts`](../lib/vscode/src/vs/workbench/services/environment/browser/environmentService.ts)
|
||||
- Make storage writes async to allow extensions to wait for them to complete in [`src/vs/platform/storage/common/storage.ts`](../lib/vscode/src/vs/platform/storage/common/storage.ts)
|
||||
- Specify webview path in [`src/vs/code/browser/workbench/workbench.ts`](../lib/vscode/src/vs/code/browser/workbench/workbench.ts)
|
||||
- URL readability improvements for folder/workspace in [`src/vs/code/browser/workbench/workbench.ts`](../lib/vscode/src/vs/code/browser/workbench/workbench.ts)
|
||||
- Socket/Authority-related fixes (for remote proxying etc.):
|
||||
- [`src/vs/code/browser/workbench/workbench.ts`](../lib/vscode/src/vs/code/browser/workbench/workbench.ts)
|
||||
- [`src/vs/platform/remote/browser/browserSocketFactory.ts`](../lib/vscode/src/vs/platform/remote/browser/browserSocketFactory.ts)
|
||||
- [`src/vs/base/common/network.ts`](../lib/vscode/src/vs/base/common/network.ts)
|
||||
- Added code to write out IPC path in [`src/vs/workbench/api/node/extHostCLIServer.ts`](../lib/vscode/src/vs/workbench/api/node/extHostCLIServer.ts)
|
||||
|
||||
As the web portion of VS Code matures, we'll be able to shrink and possibly
|
||||
eliminate our modifications. In the meantime, upgrading the VS Code version requires
|
||||
@@ -147,7 +263,7 @@ us to ensure that our changes are still applied and work as intended. In the fut
|
||||
we'd like to run VS Code unit tests against our builds to ensure that features
|
||||
work as expected.
|
||||
|
||||
**Note**: We have [extension docs](../ci/README.md) on the CI and build system.
|
||||
> We have [extension docs](../ci/README.md) on the CI and build system.
|
||||
|
||||
If the functionality you're working on does NOT depend on code from VS Code, please
|
||||
move it out and into code-server.
|
||||
|
||||
682
docs/FAQ.md
682
docs/FAQ.md
@@ -3,159 +3,139 @@
|
||||
# FAQ
|
||||
|
||||
- [Questions?](#questions)
|
||||
- [iPad Status?](#ipad-status)
|
||||
- [Community Projects (awesome-code-server)](#community-projects-awesome-code-server)
|
||||
- [How can I reuse my VS Code configuration?](#how-can-i-reuse-my-vs-code-configuration)
|
||||
- [Differences compared to VS Code?](#differences-compared-to-vs-code)
|
||||
- [Installing an extension](#installing-an-extension)
|
||||
- [How can I request a missing extension?](#how-can-i-request-a-missing-extension)
|
||||
- [Installing an extension manually](#installing-an-extension-manually)
|
||||
- [How do I configure the marketplace URL?](#how-do-i-configure-the-marketplace-url)
|
||||
- [Where are extensions stored?](#where-are-extensions-stored)
|
||||
- [How is this different from VS Code Codespaces?](#how-is-this-different-from-vs-code-codespaces)
|
||||
- [How should I expose code-server to the internet?](#how-should-i-expose-code-server-to-the-internet)
|
||||
- [Can I store my password hashed?](#can-i-store-my-password-hashed)
|
||||
- [How do I securely access web services?](#how-do-i-securely-access-web-services)
|
||||
- [Sub-paths](#sub-paths)
|
||||
- [Sub-domains](#sub-domains)
|
||||
- [Why does the code-server proxy strip `/proxy/<port>` from the request path?](#why-does-the-code-server-proxy-strip-proxyport-from-the-request-path)
|
||||
- [Proxying to Create React App](#proxying-to-create-react-app)
|
||||
- [Multi-tenancy](#multi-tenancy)
|
||||
- [Docker in code-server container?](#docker-in-code-server-container)
|
||||
- [How can I disable telemetry?](#how-can-i-disable-telemetry)
|
||||
- [How does code-server decide what workspace or folder to open?](#how-does-code-server-decide-what-workspace-or-folder-to-open)
|
||||
- [How do I debug issues with code-server?](#how-do-i-debug-issues-with-code-server)
|
||||
- [Heartbeat File](#heartbeat-file)
|
||||
- [Healthz endpoint](#healthz-endpoint)
|
||||
- [Can I use code-server on the iPad?](#can-i-use-code-server-on-the-ipad)
|
||||
- [How does the config file work?](#how-does-the-config-file-work)
|
||||
- [Isn't an install script piped into sh insecure?](#isnt-an-install-script-piped-into-sh-insecure)
|
||||
- [How do I make my keyboard shortcuts work?](#how-do-i-make-my-keyboard-shortcuts-work)
|
||||
- [How do I access my Documents/Downloads/Desktop folders in code-server on OSX?](#how-do-i-access-my-documentsdownloadsdesktop-folders-in-code-server-on-osx)
|
||||
- [Differences compared to Theia?](#differences-compared-to-theia)
|
||||
- [`$HTTP_PROXY`, `$HTTPS_PROXY`, `$NO_PROXY`](#http_proxy-https_proxy-no_proxy)
|
||||
- [Why can't code-server use Microsoft's extension marketplace?](#why-cant-code-server-use-microsofts-extension-marketplace)
|
||||
- [How can I request an extension that's missing from the marketplace?](#how-can-i-request-an-extension-thats-missing-from-the-marketplace)
|
||||
- [How do I install an extension?](#how-do-i-install-an-extension)
|
||||
- [How do I install an extension manually?](#how-do-i-install-an-extension-manually)
|
||||
- [How do I use my own extensions marketplace?](#how-do-i-use-my-own-extensions-marketplace)
|
||||
- [Where are extensions stored?](#where-are-extensions-stored)
|
||||
- [How can I reuse my VS Code configuration?](#how-can-i-reuse-my-vs-code-configuration)
|
||||
- [How does code-server decide what workspace or folder to open?](#how-does-code-server-decide-what-workspace-or-folder-to-open)
|
||||
- [How do I access my Documents/Downloads/Desktop folders in code-server on macOS?](#how-do-i-access-my-documentsdownloadsdesktop-folders-in-code-server-on-macos)
|
||||
- [How do I direct server-side requests through a proxy?](#how-do-i-direct-server-side-requests-through-a-proxy)
|
||||
- [How do I debug issues with code-server?](#how-do-i-debug-issues-with-code-server)
|
||||
- [What is the healthz endpoint?](#what-is-the-healthz-endpoint)
|
||||
- [What is the heartbeat file?](#what-is-the-heartbeat-file)
|
||||
- [How do I change the password?](#how-do-i-change-the-password)
|
||||
- [Can I store my password hashed?](#can-i-store-my-password-hashed)
|
||||
- [Is multi-tenancy possible?](#is-multi-tenancy-possible)
|
||||
- [Can I use Docker in a code-server container?](#can-i-use-docker-in-a-code-server-container)
|
||||
- [How do I disable telemetry?](#how-do-i-disable-telemetry)
|
||||
- [What's the difference between code-server and Theia?](#whats-the-difference-between-code-server-and-theia)
|
||||
- [What's the difference between code-server and VS Code Codespaces?](#whats-the-difference-between-code-server-and-vs-code-codespaces)
|
||||
- [Does code-server have any security login validation?](#does-code-server-have-any-security-login-validation)
|
||||
- [Enterprise](#enterprise)
|
||||
- [Are there community projects involving code-server?](#are-there-community-projects-involving-code-server)
|
||||
|
||||
<!-- END doctoc generated TOC please keep comment here to allow auto update -->
|
||||
|
||||
## Questions?
|
||||
|
||||
Please file all questions and support requests at <https://github.com/cdr/code-server/discussions>.
|
||||
Please file all questions and support requests at
|
||||
<https://github.com/cdr/code-server/discussions>.
|
||||
|
||||
## iPad Status?
|
||||
## How should I expose code-server to the internet?
|
||||
|
||||
Please see [./ipad.md](./ipad.md).
|
||||
Please see [our instructions on exposing code-server safely to the
|
||||
internet](./guide.md).
|
||||
|
||||
## Community Projects (awesome-code-server)
|
||||
## Can I use code-server on the iPad?
|
||||
|
||||
Visit the [awesome-code-server](https://github.com/cdr/awesome-code-server) repository to view community projects and guides with code-server! Feel free to add your own!
|
||||
See [iPad](./ipad.md) for information on using code-server on the iPad.
|
||||
|
||||
## How can I reuse my VS Code configuration?
|
||||
## How does the config file work?
|
||||
|
||||
The very popular [Settings Sync](https://marketplace.visualstudio.com/items?itemName=Shan.code-settings-sync) extension works.
|
||||
When `code-server` starts up, it creates a default config file in `~/.config/code-server/config.yaml`:
|
||||
|
||||
You can also pass `--user-data-dir ~/.vscode` to reuse your existing VS Code extensions and configuration.
|
||||
```yaml
|
||||
bind-addr: 127.0.0.1:8080
|
||||
auth: password
|
||||
password: mew...22 # Randomly generated for each config.yaml
|
||||
cert: false
|
||||
```
|
||||
|
||||
Or copy `~/.vscode` into `~/.local/share/code-server`.
|
||||
The default config defines the following behavior:
|
||||
|
||||
## Differences compared to VS Code?
|
||||
- Listen on the loopback IP port 8080
|
||||
- Enable password authorization
|
||||
- Do not use TLS
|
||||
|
||||
`code-server` takes the open source core of VS Code and allows you to run it in the browser.
|
||||
However, it is not entirely equivalent to Microsoft's VS Code.
|
||||
Each key in the file maps directly to a `code-server` flag (run `code-server --help` to see a listing of all the flags). Any flags passed to `code-server`
|
||||
will take priority over the config file.
|
||||
|
||||
While the core of VS Code is open source, the marketplace and many published Microsoft extensions are not.
|
||||
You can change the config file's location using the `--config` flag or
|
||||
`$CODE_SERVER_CONFIG` environment variable.
|
||||
|
||||
Furthermore, Microsoft prohibits the use of any non-Microsoft VS Code from accessing their marketplace.
|
||||
The default location respects `$XDG_CONFIG_HOME`.
|
||||
|
||||
See the [TOS](https://cdn.vsassets.io/v/M146_20190123.39/_content/Microsoft-Visual-Studio-Marketplace-Terms-of-Use.pdf).
|
||||
## How do I make my keyboard shortcuts work?
|
||||
|
||||
> Marketplace Offerings are intended for use only with Visual Studio Products and Services
|
||||
> and you may only install and use Marketplace Offerings with Visual Studio Products and Services.
|
||||
Many shortcuts will not work by default, since they'll be "caught" by the browser.
|
||||
|
||||
As a result, we cannot offer any extensions on the Microsoft marketplace. Instead,
|
||||
we have created our own marketplace for open source extensions.
|
||||
It works by scraping GitHub for VS Code extensions and building them. It's not perfect but getting
|
||||
better by the day with more and more extensions.
|
||||
If you use Chrome, you can work around this by installing the progressive web
|
||||
app (PWA):
|
||||
|
||||
These are the closed source extensions presently unavailable:
|
||||
1. Start the editor
|
||||
2. Click the **plus** icon in the URL toolbar to install the PWA
|
||||
|
||||
1. [Live Share](https://visualstudio.microsoft.com/services/live-share)
|
||||
- We may implement something similar, see [#33](https://github.com/cdr/code-server/issues/33)
|
||||
1. [Remote Extensions (SSH, Containers, WSL)](https://github.com/microsoft/vscode-remote-release)
|
||||
- We may reimplement these at some point, see [#1315](https://github.com/cdr/code-server/issues/1315)
|
||||
For other browsers, you'll have to remap keybindings for shortcuts to work.
|
||||
|
||||
For more about the closed source parts of VS Code, see [vscodium/vscodium](https://github.com/VSCodium/vscodium#why-does-this-exist).
|
||||
## Why can't code-server use Microsoft's extension marketplace?
|
||||
|
||||
### Installing an extension
|
||||
Though code-server takes the open-source core of VS Code and allows you to run
|
||||
it in the browser, it is not entirely equivalent to Microsoft's VS Code.
|
||||
|
||||
Extensions can be installed from the marketplace using the extensions sidebar in
|
||||
One major difference is in regards to extensions and the marketplace. The core
|
||||
of VS code is open source, while the marketplace and many published Microsoft
|
||||
extensions are not. Furthermore, Microsoft prohibits the use of any
|
||||
non-Microsoft VS Code from accessing their marketplace. Per the [Terms of
|
||||
Service](https://cdn.vsassets.io/v/M146_20190123.39/_content/Microsoft-Visual-Studio-Marketplace-Terms-of-Use.pdf):
|
||||
|
||||
> Marketplace Offerings are intended for use only with Visual Studio Products
|
||||
> and Services, and you may only install and use Marketplace Offerings with
|
||||
> Visual Studio Products and Services.
|
||||
|
||||
Because of this, we can't offer any extensions on Microsoft's marketplace.
|
||||
Instead, we've created a marketplace offering open-source extensions. The
|
||||
marketplace works by scraping GitHub for VS Code extensions and building them.
|
||||
|
||||
These are the closed-source extensions that are presently unavailable:
|
||||
|
||||
1. [Live Share](https://visualstudio.microsoft.com/services/live-share). We may
|
||||
implement something similar (see
|
||||
[#33](https://github.com/cdr/code-server/issues/33))
|
||||
1. [Remote Extensions (SSH, Containers,
|
||||
WSL)](https://github.com/microsoft/vscode-remote-release). We may implement
|
||||
these again at some point, see
|
||||
([#1315](https://github.com/cdr/code-server/issues/1315)).
|
||||
|
||||
For more about the closed source portions of VS Code, see [vscodium/vscodium](https://github.com/VSCodium/vscodium#why-does-this-exist).
|
||||
|
||||
## How can I request an extension that's missing from the marketplace?
|
||||
|
||||
We are in the process of transitioning to [Open VSX](https://open-vsx.org/).
|
||||
Once we've [implemented Open
|
||||
VSX](https://github.com/eclipse/openvsx/issues/249), we can finalize this
|
||||
transition. As such, we are not currently accepting new extension requests.
|
||||
|
||||
In the meantime, we suggest:
|
||||
|
||||
- [Switching to Open VSX](#how-do-i-configure-the-marketplace-url) now
|
||||
- Downloading and [installing the extension manually](#installing-an-extension-manually)
|
||||
|
||||
## How do I install an extension?
|
||||
|
||||
You can install extensions from the marketplace using the extensions sidebar in
|
||||
code-server or from the command line:
|
||||
|
||||
```shell
|
||||
```console
|
||||
code-server --install-extension <extension id>
|
||||
# example: code-server --install-extension wesbos.theme-cobalt2
|
||||
```
|
||||
|
||||
## How can I request a missing extension?
|
||||
|
||||
We are currently in the process of transitioning to [Open VSX](https://open-vsx.org/).
|
||||
Once <https://github.com/eclipse/openvsx/issues/249>
|
||||
is implemented, we can fully make this transition. Therefore, we are no longer
|
||||
accepting new requests for extension requests.
|
||||
|
||||
Instead, we suggest one of the following:
|
||||
|
||||
- [Switch to Open VSX](#how-do-i-configure-the-marketplace-url) now
|
||||
- Download and [install the extension manually](#installing-an-extension-manually)
|
||||
|
||||
## Installing an extension manually
|
||||
|
||||
If an extension is not available from the marketplace or does not work, you can
|
||||
grab its VSIX from its GitHub releases or build it yourself.
|
||||
|
||||
Once you have downloaded the VSIX to the remote machine you can either:
|
||||
|
||||
- Run the `Extensions: Install from VSIX` command in the Command Palette.
|
||||
- Use `code-server --install-extension <path to vsix>`
|
||||
|
||||
You can also download extensions from the command line. For instance, downloading off OpenVSX can be done like this:
|
||||
|
||||
```shell
|
||||
SERVICE_URL=https://open-vsx.org/vscode/gallery ITEM_URL=https://open-vsx.org/vscode/item code-server --install-extension <extension id>
|
||||
```
|
||||
|
||||
## How do I configure the marketplace URL?
|
||||
|
||||
If you have your own marketplace that implements the VS Code Extension Gallery API, it is possible to
|
||||
point code-server to it by setting `$SERVICE_URL` and `$ITEM_URL`. These correspond directly
|
||||
to `serviceUrl` and `itemUrl` in VS Code's `product.json`.
|
||||
|
||||
e.g. to use [open-vsx.org](https://open-vsx.org):
|
||||
|
||||
```bash
|
||||
export SERVICE_URL=https://open-vsx.org/vscode/gallery
|
||||
export ITEM_URL=https://open-vsx.org/vscode/item
|
||||
```
|
||||
|
||||
While you can technically use Microsoft's marketplace with these, please do not do so as it
|
||||
is against their terms of use. See [above](#differences-compared-to-vs-code) and this
|
||||
discussion regarding the use of the Microsoft URLs in forks:
|
||||
|
||||
<https://github.com/microsoft/vscode/issues/31168#issue-244533026>
|
||||
|
||||
See also [VSCodium's docs](https://github.com/VSCodium/vscodium/blob/master/DOCS.md#extensions--marketplace).
|
||||
|
||||
These variables are most valuable to our enterprise customers for whom we have a self hosted marketplace product.
|
||||
|
||||
## Where are extensions stored?
|
||||
|
||||
Defaults to `~/.local/share/code-server/extensions`.
|
||||
|
||||
If the `XDG_DATA_HOME` environment variable is set the data directory will be
|
||||
`$XDG_DATA_HOME/code-server/extensions`. In general we try to follow the XDG directory spec.
|
||||
|
||||
You can install an extension on the CLI with:
|
||||
|
||||
```bash
|
||||
# From the Coder extension marketplace
|
||||
code-server --install-extension ms-python.python
|
||||
|
||||
@@ -163,280 +143,101 @@ code-server --install-extension ms-python.python
|
||||
code-server --install-extension downloaded-ms-python.python.vsix
|
||||
```
|
||||
|
||||
## How is this different from VS Code Codespaces?
|
||||
## How do I install an extension manually?
|
||||
|
||||
VS Code Codespaces is a closed source and paid service by Microsoft. It also allows you to access
|
||||
VS Code via the browser.
|
||||
If there's an extension unavailable in the marketplace or an extension that
|
||||
doesn't work, you can download the VSIX from its GitHub releases or build it
|
||||
yourself.
|
||||
|
||||
However, code-server is free, open source and can be run on any machine without any limitations.
|
||||
Once you have downloaded the VSIX to the remote machine, you can either:
|
||||
|
||||
While you can self host environments with VS Code Codespaces, you still need an Azure billing
|
||||
account and you have to access VS Code via the Codespaces web dashboard instead of directly
|
||||
connecting to your instance.
|
||||
- Run the **Extensions: Install from VSIX** command in the Command Palette.
|
||||
- Run `code-server --install-extension <path to vsix>` in the terminal
|
||||
|
||||
## How should I expose code-server to the internet?
|
||||
You can also download extensions using the command line. For instance,
|
||||
downloading from OpenVSX can be done like this:
|
||||
|
||||
Please follow [./guide.md](./guide.md) for our recommendations on setting up and using code-server.
|
||||
|
||||
code-server only supports password authentication natively.
|
||||
|
||||
**note**: code-server will rate limit password authentication attempts at 2 a minute and 12 an hour.
|
||||
|
||||
If you want to use external authentication (i.e sign in with Google) you should handle this
|
||||
with a reverse proxy using something like [oauth2_proxy](https://github.com/pusher/oauth2_proxy)
|
||||
or [Cloudflare Access](https://teams.cloudflare.com/access).
|
||||
|
||||
For HTTPS, you can use a self signed certificate by passing in just `--cert` or
|
||||
pass in an existing certificate by providing the path to `--cert` and the path to
|
||||
the key with `--cert-key`.
|
||||
|
||||
The self signed certificate will be generated into
|
||||
`~/.local/share/code-server/self-signed.crt`.
|
||||
|
||||
If `code-server` has been passed a certificate it will also respond to HTTPS
|
||||
requests and will redirect all HTTP requests to HTTPS.
|
||||
|
||||
You can use [Let's Encrypt](https://letsencrypt.org/) to get a TLS certificate
|
||||
for free.
|
||||
|
||||
Again, please follow [./guide.md](./guide.md) for our recommendations on setting up and using code-server.
|
||||
|
||||
## Can I store my password hashed?
|
||||
|
||||
Yes you can! Set the value of `hashed-password` instead of `password`. Generate the hash with:
|
||||
|
||||
```
|
||||
printf "thisismypassword" | sha256sum | cut -d' ' -f1
|
||||
```shell
|
||||
SERVICE_URL=https://open-vsx.org/vscode/gallery ITEM_URL=https://open-vsx.org/vscode/item code-server --install-extension <extension id>
|
||||
```
|
||||
|
||||
Of course replace `thisismypassword` with your actual password.
|
||||
## How do I use my own extensions marketplace?
|
||||
|
||||
Example:
|
||||
If you own a marketplace that implements the VS Code Extension Gallery API, you
|
||||
can point code-server to it by setting `$SERVICE_URL` and `$ITEM_URL`. These correspond directly
|
||||
to `serviceUrl` and `itemUrl` in VS Code's `product.json`.
|
||||
|
||||
```yaml
|
||||
auth: password
|
||||
hashed-password: 1da9133ab9dbd11d2937ec8d312e1e2569857059e73cc72df92e670928983ab5 # You got this from the command above
|
||||
For example, to use [open-vsx.org](https://open-vsx.org), run:
|
||||
|
||||
```bash
|
||||
export SERVICE_URL=https://open-vsx.org/vscode/gallery
|
||||
export ITEM_URL=https://open-vsx.org/vscode/item
|
||||
```
|
||||
|
||||
## How do I securely access web services?
|
||||
Though you can technically use Microsoft's marketplace in this manner, we
|
||||
strongly discourage you from doing so since this is [against their Terms of Use](#why-cant-code-server-use-microsofts-extension-marketplace).
|
||||
|
||||
code-server is capable of proxying to any port using either a subdomain or a
|
||||
subpath which means you can securely access these services using code-server's
|
||||
built-in authentication.
|
||||
For further information, see [this
|
||||
discussion](https://github.com/microsoft/vscode/issues/31168#issue-244533026)
|
||||
regarding the use of the Microsoft URLs in forks, as well as [VSCodium's
|
||||
docs](https://github.com/VSCodium/vscodium/blob/master/DOCS.md#extensions--marketplace).
|
||||
|
||||
### Sub-paths
|
||||
## Where are extensions stored?
|
||||
|
||||
Just browse to `/proxy/<port>/`.
|
||||
Extensions are store, by default, to `~/.local/share/code-server/extensions`.
|
||||
|
||||
### Sub-domains
|
||||
If you set the `XDG_DATA_HOME` environment variable, the data directory will be
|
||||
`$XDG_DATA_HOME/code-server/extensions`. In general, we try to follow the XDG directory spec.
|
||||
|
||||
You will need a DNS entry that points to your server for each port you want to
|
||||
access. You can either set up a wildcard DNS entry for `*.<domain>` if your domain
|
||||
name registrar supports it or you can create one for every port you want to
|
||||
access (`3000.<domain>`, `8080.<domain>`, etc).
|
||||
## How can I reuse my VS Code configuration?
|
||||
|
||||
You should also set up TLS certificates for these subdomains, either using a
|
||||
wildcard certificate for `*.<domain>` or individual certificates for each port.
|
||||
You can use the [Settings
|
||||
Sync](https://marketplace.visualstudio.com/items?itemName=Shan.code-settings-sync)
|
||||
extension for this purpose.
|
||||
|
||||
Start code-server with the `--proxy-domain` flag set to your domain.
|
||||
|
||||
```
|
||||
code-server --proxy-domain <domain>
|
||||
```
|
||||
|
||||
Now you can browse to `<port>.<domain>`. Note that this uses the host header so
|
||||
ensure your reverse proxy forwards that information if you are using one.
|
||||
|
||||
## Why does the code-server proxy strip `/proxy/<port>` from the request path?
|
||||
|
||||
HTTP servers should strive to use relative URLs to avoid needed to be coupled to the
|
||||
absolute path at which they are served. This means you must use trailing slashes on all
|
||||
paths with subpaths. See <https://blog.cdivilly.com/2019/02/28/uri-trailing-slashes>
|
||||
|
||||
This is really the "correct" way things work and why the striping of the base path is the
|
||||
default. If your application uses relative URLs and does not assume the absolute path at
|
||||
which it is being served, it will just work no matter what port you decide to serve it off
|
||||
or if you put it in behind code-server or any other proxy!
|
||||
|
||||
However many people prefer the cleaner aesthetic of no trailing slashes. This couples you
|
||||
to the base path as you cannot use relative redirects correctly anymore. See the above
|
||||
link.
|
||||
|
||||
For users who are ok with this tradeoff, use `/absproxy` instead and the path will be
|
||||
passed as is. e.g. `/absproxy/3000/my-app-path`
|
||||
|
||||
### Proxying to Create React App
|
||||
|
||||
You must use `/absproxy/<port>` with create-react-app.
|
||||
See [#2565](https://github.com/cdr/code-server/issues/2565) and
|
||||
[#2222](https://github.com/cdr/code-server/issues/2222). You will need to inform
|
||||
create-react-app of the path at which you are serving via `$PUBLIC_URL` and webpack
|
||||
via `$WDS_SOCKET_PATH`.
|
||||
|
||||
e.g.
|
||||
|
||||
```sh
|
||||
PUBLIC_URL=/absproxy/3000 \
|
||||
WDS_SOCKET_PATH=$PUBLIC_URL/sockjs-node \
|
||||
BROWSER=none yarn start
|
||||
```
|
||||
|
||||
Then visit `https://my-code-server-address.io/absproxy/3000` to see your app exposed through
|
||||
code-server!
|
||||
|
||||
Highly recommend using the subdomain approach instead to avoid this class of issue.
|
||||
|
||||
## Multi-tenancy
|
||||
|
||||
If you want to run multiple code-servers on shared infrastructure, we recommend using virtual
|
||||
machines with a VM per user. This will easily allow users to run a docker daemon. If you want
|
||||
to use kubernetes, you'll definitely want to use [kubevirt](https://kubevirt.io) or [sysbox](https://github.com/nestybox/sysbox) to give each
|
||||
user a VM-like experience instead of just a container.
|
||||
|
||||
## Docker in code-server container?
|
||||
|
||||
If you'd like to access docker inside of code-server, mount the docker socket in from `/var/run/docker.sock`.
|
||||
Install the docker CLI in the code-server container and you should be able to access the daemon!
|
||||
|
||||
You can even make volume mounts work. Lets say you want to run a container and mount in
|
||||
`/home/coder/myproject` into it from inside the `code-server` container. You need to make sure
|
||||
the docker daemon's `/home/coder/myproject` is the same as the one mounted inside the `code-server`
|
||||
container and the mount will just work.
|
||||
|
||||
## How can I disable telemetry?
|
||||
|
||||
Use the `--disable-telemetry` flag to completely disable telemetry. We use the
|
||||
data collected only to improve code-server.
|
||||
Alternatively, you can also pass `--user-data-dir ~/.vscode` or copy `~/.vscode`
|
||||
into `~/.local/share/code-server` to reuse your existing VS Code extensions and
|
||||
configuration.
|
||||
|
||||
## How does code-server decide what workspace or folder to open?
|
||||
|
||||
code-server tries the following in order:
|
||||
code-server tries the following in this order:
|
||||
|
||||
1. The `workspace` query parameter.
|
||||
2. The `folder` query parameter.
|
||||
3. The workspace or directory passed on the command line.
|
||||
4. The last opened workspace or directory.
|
||||
1. The `workspace` query parameter
|
||||
2. The `folder` query parameter
|
||||
3. The workspace or directory passed via the command line
|
||||
4. The last opened workspace or directory
|
||||
|
||||
## How do I debug issues with code-server?
|
||||
## How do I access my Documents/Downloads/Desktop folders in code-server on macOS?
|
||||
|
||||
First run code-server with at least `debug` logging (or `trace` to be really
|
||||
thorough) by setting the `--log` flag or the `LOG_LEVEL` environment variable.
|
||||
`-vvv` and `--verbose` are aliases for `--log trace`.
|
||||
Newer versions of macOS require permission through a non-UNIX mechanism for
|
||||
code-server to access the Desktop, Documents, Pictures, Downloads, and other folders.
|
||||
|
||||
```
|
||||
code-server --log debug
|
||||
```
|
||||
You may have to give Node.js full disk access, since it doesn't implement any of the macOS permission request features natively:
|
||||
|
||||
Once this is done, replicate the issue you're having then collect logging
|
||||
information from the following places:
|
||||
|
||||
1. The most recent files from `~/.local/share/code-server/coder-logs`.
|
||||
2. The browser console.
|
||||
3. The browser network tab.
|
||||
|
||||
Additionally, collecting core dumps (you may need to enable them first) if
|
||||
code-server crashes can be helpful.
|
||||
|
||||
## Heartbeat File
|
||||
|
||||
`code-server` touches `~/.local/share/code-server/heartbeat` once a minute as long
|
||||
as there is an active browser connection.
|
||||
|
||||
If you want to shutdown `code-server` if there hasn't been an active connection in X minutes
|
||||
you can do so by continuously checking the last modified time on the heartbeat file and if it is
|
||||
older than X minutes, kill `code-server`.
|
||||
|
||||
[#1636](https://github.com/cdr/code-server/issues/1636) will make the experience here better.
|
||||
|
||||
## Healthz endpoint
|
||||
|
||||
`code-server` exposes an endpoint at `/healthz` which can be used to check
|
||||
whether `code-server` is up without triggering a heartbeat. The response will
|
||||
include a status (`alive` or `expired`) and a timestamp for the last heartbeat
|
||||
(defaults to `0`). This endpoint does not require authentication.
|
||||
|
||||
```json
|
||||
{
|
||||
"status": "alive",
|
||||
"lastHeartbeat": 1599166210566
|
||||
}
|
||||
```
|
||||
|
||||
## How does the config file work?
|
||||
|
||||
When `code-server` starts up, it creates a default config file in `~/.config/code-server/config.yaml` that looks
|
||||
like this:
|
||||
|
||||
```yaml
|
||||
bind-addr: 127.0.0.1:8080
|
||||
auth: password
|
||||
password: mewkmdasosafuio3422 # This is randomly generated for each config.yaml
|
||||
cert: false
|
||||
```
|
||||
|
||||
Each key in the file maps directly to a `code-server` flag. Run `code-server --help` to see
|
||||
a listing of all the flags.
|
||||
|
||||
The default config here says to listen on the loopback IP port 8080, enable password authorization
|
||||
and no TLS. Any flags passed to `code-server` will take priority over the config file.
|
||||
|
||||
The `--config` flag or `$CODE_SERVER_CONFIG` can be used to change the config file's location.
|
||||
|
||||
The default location also respects `$XDG_CONFIG_HOME`.
|
||||
|
||||
## Isn't an install script piped into sh insecure?
|
||||
|
||||
Please give
|
||||
[this wonderful blogpost](https://sandstorm.io/news/2015-09-24-is-curl-bash-insecure-pgp-verified-install) by
|
||||
[sandstorm.io](https://sandstorm.io) a read.
|
||||
|
||||
## How do I make my keyboard shortcuts work?
|
||||
|
||||
Many shortcuts will not work by default as they'll be caught by the browser.
|
||||
|
||||
If you use Chrome you can get around this by installing the PWA.
|
||||
|
||||
Once you've entered the editor, click the "plus" icon present in the URL toolbar area.
|
||||
This will install a Chrome PWA and now all keybindings will work!
|
||||
|
||||
For other browsers you'll have to remap keybindings unfortunately.
|
||||
|
||||
## How do I access my Documents/Downloads/Desktop folders in code-server on OSX?
|
||||
|
||||
Newer versions of macOS require permission through a non-UNIX mechanism for access to the Desktop, Documents, Pictures, Downloads, and other folders.
|
||||
|
||||
You may have to give Node "full disk access" since it doesn't implement any of the macOS permission request stuff natively.
|
||||
|
||||
1. Find where Node is installed on your machine
|
||||
1. Find where Node.js is installed on your machine
|
||||
|
||||
```console
|
||||
➜ ~ which node
|
||||
$ which node
|
||||
/usr/local/bin/node
|
||||
```
|
||||
|
||||
1. Grant Node Full Disk Access:
|
||||
2. Grant Node.js full disk access. Open **System Preferences** > **Security &
|
||||
Privacy** > **Privacy** > **Full Disk Access**. Then, click the 🔒 to unlock,
|
||||
click **+**, and select the Node.js binary you located in the previous step.
|
||||
|
||||
Open System Preferences > Security & Privacy > Privacy (horizontal) tab > Full Disk Access (vertical) tab > Click the 🔒 to unlock > Click + and select the Node binary you located.
|
||||
See [#2794](https://github.com/cdr/code-server/issues/2794) for additional context.
|
||||
|
||||
See [#2794](https://github.com/cdr/code-server/issues/2794) for context on this.
|
||||
## How do I direct server-side requests through a proxy?
|
||||
|
||||
## Differences compared to Theia?
|
||||
> code-server proxies only server-side requests.
|
||||
|
||||
[Theia](https://github.com/eclipse-theia/theia) is a browser IDE loosely based on VS Code. It uses the same
|
||||
text editor library named [Monaco](https://github.com/Microsoft/monaco-editor) and the same
|
||||
extension API but everything else is very different. It also uses [open-vsx.org](https://open-vsx.org)
|
||||
for extensions which has an order of magnitude less extensions than our marketplace.
|
||||
See [#1473](https://github.com/cdr/code-server/issues/1473).
|
||||
To direct server-side requests through a proxy, code-server supports the
|
||||
following environment variables:
|
||||
|
||||
You can't just use your VS Code config in Theia like you can with code-server.
|
||||
|
||||
To summarize, code-server is a patched fork of VS Code to run in the browser whereas
|
||||
Theia takes some parts of VS Code but is an entirely different editor.
|
||||
|
||||
## `$HTTP_PROXY`, `$HTTPS_PROXY`, `$NO_PROXY`
|
||||
|
||||
code-server supports the standard environment variables to allow directing
|
||||
server side requests through a proxy.
|
||||
- `$HTTP_PROXY`
|
||||
- `$HTTPS_PROXY`
|
||||
- `$NO_PROXY`
|
||||
|
||||
```sh
|
||||
export HTTP_PROXY=https://134.8.5.4
|
||||
@@ -446,18 +247,163 @@ export HTTPS_PROXY=https://134.8.5.4
|
||||
code-server
|
||||
```
|
||||
|
||||
- See [proxy-from-env](https://www.npmjs.com/package/proxy-from-env#environment-variables)
|
||||
for a detailed reference on the various environment variables and their syntax.
|
||||
- code-server only uses the `http` and `https` protocols.
|
||||
- See [proxy-agent](https://www.npmjs.com/package/proxy-agent) for the various supported
|
||||
proxy protocols.
|
||||
- See
|
||||
[proxy-from-env](https://www.npmjs.com/package/proxy-from-env#environment-variables)
|
||||
for a detailed reference on these environment variables and their syntax (note
|
||||
that code-server only uses the `http` and `https` protocols).
|
||||
- See [proxy-agent](https://www.npmjs.com/package/proxy-agent) for information
|
||||
on on the supported proxy protocols.
|
||||
|
||||
**note**: Only server side requests will be proxied! This includes fetching extensions,
|
||||
requests made from extensions etc. To proxy requests from your browser you need to
|
||||
configure your browser separately. Browser requests would cover exploring the extension
|
||||
marketplace.
|
||||
## How do I debug issues with code-server?
|
||||
|
||||
First, run code-server with the `debug` logging (or `trace` to be really
|
||||
thorough) by setting the `--log` flag or the `LOG_LEVEL` environment variable.
|
||||
`-vvv` and `--verbose` are aliases for `--log trace`.
|
||||
|
||||
First, run code-server with `debug` logging (or `trace` logging for more
|
||||
thorough messages) by setting the `--log` flag or the `LOG_LEVEL` environment
|
||||
variable.
|
||||
|
||||
```text
|
||||
code-server --log debug
|
||||
```
|
||||
|
||||
> Note that the `-vvv` and `--verbose` flags are aliases for `--log trace`.
|
||||
|
||||
Next, replicate the issue you're having so that you can collect logging
|
||||
information from the following places:
|
||||
|
||||
1. The most recent files from `~/.local/share/code-server/coder-logs`
|
||||
2. The browser console
|
||||
3. The browser network tab
|
||||
|
||||
Additionally, collecting core dumps (you may need to enable them first) if
|
||||
code-server crashes can be helpful.
|
||||
|
||||
## What is the healthz endpoint?
|
||||
|
||||
You can use the `/healthz` endpoint exposed by code-server to check whether
|
||||
code-server is running without triggering a heartbeat. The response includes a
|
||||
status (e.g., `alive` or `expired`) and a timestamp for the last heartbeat
|
||||
(the default is `0`).
|
||||
|
||||
```json
|
||||
{
|
||||
"status": "alive",
|
||||
"lastHeartbeat": 1599166210566
|
||||
}
|
||||
```
|
||||
|
||||
This endpoint doesn't require authentication.
|
||||
|
||||
## What is the heartbeat file?
|
||||
|
||||
As long as there is an active browser connection, code-server touches
|
||||
`~/.local/share/code-server/heartbeat` once a minute.
|
||||
|
||||
If you want to shutdown code-server if there hasn't been an active connection
|
||||
after a predetermined amount of time, you can do so by checking continuously for
|
||||
the last modified time on the heartbeat file. If it is older than X minutes (or
|
||||
whatever amount of time you'd like), you can kill code-server.
|
||||
|
||||
Eventually, [#1636](https://github.com/cdr/code-server/issues/1636) will make
|
||||
this process better.
|
||||
|
||||
## How do I change the password?
|
||||
|
||||
Edit the `password` field in the code-server config file at
|
||||
`~/.config/code-server/config.yaml`, then restart code-server:
|
||||
|
||||
```bash
|
||||
sudo systemctl restart code-server@$USER
|
||||
```
|
||||
|
||||
## Can I store my password hashed?
|
||||
|
||||
Yes, you can do so by setting the value of `hashed-password` instead of `password`. Generate the hash with:
|
||||
|
||||
```shell
|
||||
echo -n "thisismypassword" | npx argon2-cli -e
|
||||
$argon2i$v=19$m=4096,t=3,p=1$wst5qhbgk2lu1ih4dmuxvg$ls1alrvdiwtvzhwnzcm1dugg+5dto3dt1d5v9xtlws4
|
||||
```
|
||||
|
||||
Replace `thisismypassword` with your actual password and **remember to put it
|
||||
inside quotes**! For example:
|
||||
|
||||
```yaml
|
||||
auth: password
|
||||
hashed-password: "$argon2i$v=19$m=4096,t=3,p=1$wST5QhBgk2lu1ih4DMuxvg$LS1alrVdIWtvZHwnzCM1DUGg+5DTO3Dt1d5v9XtLws4"
|
||||
```
|
||||
|
||||
The `hashed-password` field takes precedence over `password`.
|
||||
|
||||
## Is multi-tenancy possible?
|
||||
|
||||
If you want to run multiple code-servers on shared infrastructure, we recommend
|
||||
using virtual machines (provide one VM per user). This will easily allow users
|
||||
to run a Docker daemon. If you want to use Kubernetes, you'll want to
|
||||
use [kubevirt](https://kubevirt.io) or
|
||||
[sysbox](https://github.com/nestybox/sysbox) to give each user a VM-like
|
||||
experience instead of just a container.
|
||||
|
||||
## Can I use Docker in a code-server container?
|
||||
|
||||
If you'd like to access Docker inside of code-server, mount the Docker socket in
|
||||
from `/var/run/docker.sock`. Then, install the Docker CLI in the code-server
|
||||
container, and you should be able to access the daemon.
|
||||
|
||||
You can even make volume mounts work. Let's say you want to run a container and
|
||||
mount into `/home/coder/myproject` from inside the `code-server` container. You
|
||||
need to make sure the Docker daemon's `/home/coder/myproject` is the same as the
|
||||
one mounted inside the `code-server` container, and the mount will work.
|
||||
|
||||
## How do I disable telemetry?
|
||||
|
||||
Use the `--disable-telemetry` flag to disable telemetry.
|
||||
|
||||
> We use the data collected only to improve code-server.
|
||||
|
||||
## What's the difference between code-server and Theia?
|
||||
|
||||
At a high level, code-server is a patched fork of VS Code that runs in the
|
||||
browser whereas Theia takes some parts of VS Code but is an entirely different
|
||||
editor.
|
||||
|
||||
[Theia](https://github.com/eclipse-theia/theia) is a browser IDE loosely based
|
||||
on VS Code. It uses the same text editor library
|
||||
([Monaco](https://github.com/Microsoft/monaco-editor)) and extension API, but
|
||||
everything else is different. Theia also uses [Open VSX](https://open-vsx.org)
|
||||
for extensions.
|
||||
|
||||
Theia doesn't allow you to reuse your existing VS Code config.
|
||||
|
||||
## What's the difference between code-server and VS Code Codespaces?
|
||||
|
||||
Both code-server and VS Code Codespaces allow you to access VS Code via a
|
||||
browser.
|
||||
|
||||
VS Code Codespaces, however, is a closed-source, paid service offered by
|
||||
Microsoft. While you can self-host environments with VS Code Codespaces, you
|
||||
still need an Azure billing account, and you must access VS Code via the
|
||||
Codespaces web dashboard instead of connecting directly to it.
|
||||
|
||||
On the other hand, code-server is free, open-source, and can be run on any
|
||||
machine with few limitations.
|
||||
|
||||
<<<<<<< HEAD
|
||||
|
||||
## Does code-server have any security login validation?
|
||||
|
||||
code-server only supports a single password and limits logins to two per minute plus twelve per hour.
|
||||
|
||||
## Enterprise
|
||||
|
||||
Visit [our enterprise page](https://coder.com) for more information about our
|
||||
enterprise offerings.
|
||||
=======
|
||||
|
||||
## Are there community projects involving code-server?
|
||||
|
||||
> > > > > > > Edit code-server docs
|
||||
|
||||
Visit the [awesome-code-server](https://github.com/cdr/awesome-code-server)
|
||||
repository to view community projects and guides with code-server! Feel free to
|
||||
add your own!
|
||||
|
||||
@@ -2,64 +2,157 @@
|
||||
<!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE -->
|
||||
# Maintaining
|
||||
|
||||
- [Maintaining](#maintaining)
|
||||
- [Workflow](#workflow)
|
||||
- [Milestones](#milestones)
|
||||
- [Triage](#triage)
|
||||
- [Project Boards](#project-boards)
|
||||
- [Versioning](#versioning)
|
||||
- [Workflow](#workflow)
|
||||
- [Milestones](#milestones)
|
||||
- [Triage](#triage)
|
||||
- [Project boards](#project-boards)
|
||||
- [Versioning](#versioning)
|
||||
- [Pull requests](#pull-requests)
|
||||
- [Merge strategies](#merge-strategies)
|
||||
- [Changelog](#changelog)
|
||||
- [Releases](#releases)
|
||||
- [Publishing a release](#publishing-a-release)
|
||||
|
||||
<!-- END doctoc generated TOC please keep comment here to allow auto update -->
|
||||
|
||||
# Maintaining
|
||||
|
||||
Current maintainers:
|
||||
|
||||
- @code-asher
|
||||
- @oxy
|
||||
- @jsjoeio
|
||||
|
||||
This document is meant to serve current and future maintainers of code-server, but also share openly our workflow for maintaining the project.
|
||||
This document is meant to serve current and future maintainers of code-server,
|
||||
as well as share our workflow for maintaining the project.
|
||||
|
||||
## Workflow
|
||||
|
||||
The workflow used by code-server maintainers is one that aims to be easy to understood by the community and easy enough for new maintainers to jump in and start contributing on day one.
|
||||
The workflow used by code-server maintainers aims to be easy to understood by
|
||||
the community and easy enough for new maintainers to jump in and start
|
||||
contributing on day one.
|
||||
|
||||
### Milestones
|
||||
|
||||
We operate mainly using [milestones](https://github.com/cdr/code-server/milestones). This was heavily inspired by our friends over at [vscode](https://github.com/microsoft/vscode).
|
||||
We operate mainly using
|
||||
[milestones](https://github.com/cdr/code-server/milestones). This was heavily
|
||||
inspired by our friends over at [vscode](https://github.com/microsoft/vscode).
|
||||
|
||||
Here are the milestones we use and how we use them:
|
||||
|
||||
- "Backlog" -> Work not yet planned for a specific release.
|
||||
- "On Deck" -> Work under consideration for upcoming milestones.
|
||||
- "Backlog Candidates" -> Work that is not yet accepted for the backlog. We wait for the community to weigh in.
|
||||
- "<0.0.0>" -> Work to be done for that version.
|
||||
- "Backlog Candidates" -> Work that is not yet accepted for the backlog. We wait
|
||||
for the community to weigh in.
|
||||
- "<0.0.0>" -> Work to be done for a specific version.
|
||||
|
||||
With this flow, any un-assigned issues are essentially in triage state and once triaged are either "Backlog" or "Backlog Candidates". They will eventually move to "On Deck" (or be closed). Lastly, they will end up on a version milestone where they will be worked on.
|
||||
With this flow, any un-assigned issues are essentially in triage state. Once
|
||||
triaged, issues are either "Backlog" or "Backlog Candidates". They will
|
||||
eventually move to "On Deck" (or be closed). Lastly, they will end up on a
|
||||
version milestone where they will be worked on.
|
||||
|
||||
### Triage
|
||||
|
||||
We use the following process for triaging GitHub issues:
|
||||
|
||||
1. a submitter creates an issue
|
||||
1. add appropriate labels
|
||||
1. if we need to look into it further, add "needs-investigation"
|
||||
1. add to milestone
|
||||
1. if it should be fixed soon, add to version milestone or "On Deck"
|
||||
1. if not urgent, add to "Backlog"
|
||||
1. otherwise, add to "Backlog Candidate" if it should be considered
|
||||
1. Create an issue
|
||||
1. Add appropriate labels to the issue (including "needs-investigation" if we
|
||||
should look into it further)
|
||||
1. Add the issue to a milestone
|
||||
1. If it should be fixed soon, add to version milestone or "On Deck"
|
||||
2. If not urgent, add to "Backlog"
|
||||
3. Otherwise, add to "Backlog Candidate" for future consideration
|
||||
|
||||
### Project Boards
|
||||
### Project boards
|
||||
|
||||
We use project boards for projects or goals that span multiple milestones.
|
||||
|
||||
Think of this as a place to put miscellaneous things (like testing, clean up stuff, etc). As a maintainer, random todos may come up here and there. This gives you a place to add notes temporarily before opening a new issue. Given that our release milestones function off of issues, we believe tasks should have dedicated issues.
|
||||
Think of this as a place to put miscellaneous things (like testing, clean up
|
||||
stuff, etc). As a maintainer, random tasks may come up here and there. The
|
||||
project boards give you places to add temporary notes before opening a new
|
||||
issue. Given that our release milestones function off of issues, we believe
|
||||
tasks should have dedicated issues.
|
||||
|
||||
It also gives us a way to separate the issue triage from bigger-picture, long-term work.
|
||||
Project boards also give us a way to separate the issue triage from
|
||||
bigger-picture, long-term work.
|
||||
|
||||
## Versioning
|
||||
|
||||
`<major.minor.patch>`
|
||||
|
||||
The code-server project follows traditional [semantic versioning](ttps://semver.org/), with the objective of minimizing major changes that break backward compatibility. We increment the patch level for all releases, except when the upstream Visual Studio Code project increments its minor version or we change the plugin API in a backward-compatible manner. In those cases, we increment the minor version rather than the patch level.
|
||||
The code-server project follows traditional [semantic
|
||||
versioning](https://semver.org/), with the objective of minimizing major changes
|
||||
that break backward compatibility. We increment the patch level for all
|
||||
releases, except when the upstream Visual Studio Code project increments its
|
||||
minor version or we change the plugin API in a backward-compatible manner. In
|
||||
those cases, we increment the minor version rather than the patch level.
|
||||
|
||||
## Pull requests
|
||||
|
||||
Ideally, every PR should fix an issue. If it doesn't, make sure it's associated
|
||||
with a version milestone.
|
||||
|
||||
If a PR does fix an issue, don't add it to the version milestone. Otherwise, the
|
||||
version milestone will have duplicate information: the issue and the PR fixing
|
||||
the issue.
|
||||
|
||||
### Merge strategies
|
||||
|
||||
For most things, we recommend the **squash and merge** strategy. If you're
|
||||
updating `lib/vscode`, we suggest using the **rebase and merge** strategy. There
|
||||
may be times where **creating a merge commit** makes sense as well. Use your
|
||||
best judgment. If you're unsure, you can always discuss in the PR with the team.
|
||||
|
||||
### Changelog
|
||||
|
||||
To save time when creating a new release for code-server, we keep a running
|
||||
changelog at `CHANGELOG.md`.
|
||||
|
||||
If either the author or reviewer of a PR believes the change should be mentioned
|
||||
in the changelog, then it should be added.
|
||||
|
||||
If there is not a **Next Version** when you modify `CHANGELOG.md`, please add it
|
||||
using the template you see near the top of the changelog.
|
||||
|
||||
When writing your changelog item, ask yourself:
|
||||
|
||||
1. How do these changes affect code-server users?
|
||||
2. What actions do they need to take (if any)?
|
||||
|
||||
If you need inspiration, we suggest looking at the [Emacs
|
||||
changelog](https://github.com/emacs-mirror/emacs/blob/master/etc/NEWS).
|
||||
|
||||
## Releases
|
||||
|
||||
With each release, we rotate the role of release manager to ensure every
|
||||
maintainer goes through the process. This helps us keep documentation up-to-date
|
||||
and encourages us to continually review and improve the flow.
|
||||
|
||||
If you're the current release manager, follow these steps:
|
||||
|
||||
1. Create a [release issue](../.github/ISSUE_TEMPLATE/release.md)
|
||||
1. Fill out checklist
|
||||
1. Publish the release
|
||||
1. After release is published, close release milestone
|
||||
|
||||
### Publishing a release
|
||||
|
||||
1. Run `yarn release:prep` and type in the new version (e.g., `3.8.1`)
|
||||
1. GitHub Actions will generate the `npm-package`, `release-packages` and
|
||||
`release-images` artifacts. You do not have to wait for this step to complete
|
||||
before proceeding.
|
||||
1. Run `yarn release:github-draft` to create a GitHub draft release from the
|
||||
template with the updated version.
|
||||
1. Summarize the major changes in the release notes and link to the relevant
|
||||
issues.
|
||||
1. Change the @ to target the version branch. Example: `v3.9.0 @ Target: v3.9.0`
|
||||
1. Wait for the `npm-package`, `release-packages` and `release-images` artifacts
|
||||
to build.
|
||||
1. Run `yarn release:github-assets` to download the `release-packages` artifact.
|
||||
They will upload them to the draft release.
|
||||
1. Run some basic sanity tests on one of the released packages (pay special
|
||||
attention to making sure the terminal works).
|
||||
1. Publish the release and merge the PR. CI will automatically grab the
|
||||
artifacts, publish the NPM package from `npm-package`, and publish the Docker
|
||||
Hub image from `release-images`.
|
||||
1. Update the AUR package. Instructions for updating the AUR package are at
|
||||
[cdr/code-server-aur](https://github.com/cdr/code-server-aur).
|
||||
1. Wait for the npm package to be published.
|
||||
|
||||
89
docs/README.md
Normal file
89
docs/README.md
Normal file
@@ -0,0 +1,89 @@
|
||||
# code-server
|
||||
|
||||
[](https://github.com/cdr/code-server/discussions) [](https://cdr.co/join-community) [](https://twitter.com/coderhq) [](https://codecov.io/gh/cdr/code-server) [](https://github.com/cdr/code-server/tree/v3.11.0/docs)
|
||||
|
||||
Run [VS Code](https://github.com/Microsoft/vscode) on any machine anywhere and
|
||||
access it in the browser.
|
||||
|
||||

|
||||
|
||||
## Highlights
|
||||
|
||||
- Code on any device with a consistent development environment
|
||||
- Use cloud servers to speed up tests, compilations, downloads, and more
|
||||
- Preserve battery life when you're on the go; all intensive tasks run on your
|
||||
server
|
||||
|
||||
## Requirements
|
||||
|
||||
See [requirements](requirements.md) for minimum specs, as well as instructions
|
||||
on how to set up a Google VM on which you can install code-server.
|
||||
|
||||
**TL;DR:** Linux machine with WebSockets enabled, 1 GB RAM, and 2 CPUs
|
||||
|
||||
## Getting started
|
||||
|
||||
There are three ways to get started:
|
||||
|
||||
1. Using the [install
|
||||
script](https://github.com/cdr/code-server/blob/main/install.sh), which
|
||||
automates most of the process. The script uses the system package manager if
|
||||
possible.
|
||||
2. Manually [installing
|
||||
code-server](https://coder.com/docs/code-server/v3.11.0/install)
|
||||
3. Using our one-click buttons and guides to [deploy code-server to a cloud
|
||||
provider](https://github.com/cdr/deploy-code-server) ⚡
|
||||
|
||||
If you use the install script, you can preview what occurs during the install
|
||||
process:
|
||||
|
||||
```bash
|
||||
curl -fsSL https://code-server.dev/install.sh | sh -s -- --dry-run
|
||||
```
|
||||
|
||||
To install, run:
|
||||
|
||||
```bash
|
||||
curl -fsSL https://code-server.dev/install.sh | sh
|
||||
```
|
||||
|
||||
When done, the install script prints out instructions for running and starting
|
||||
code-server.
|
||||
|
||||
We also have an in-depth [setup and
|
||||
configuration](https://coder.com/docs/code-server/v3.11.0/guide) guide.
|
||||
|
||||
### code-server --link
|
||||
|
||||
We're working on a cloud platform that makes deploying and managing code-server
|
||||
easier. Consider running code-server with the beta flag `--link` if you don't
|
||||
want to worry about:
|
||||
|
||||
- TLS
|
||||
- Authentication
|
||||
- Port forwarding
|
||||
|
||||
```bash
|
||||
$ code-server --link
|
||||
Proxying code-server, you can access your IDE at https://example.cdr.co
|
||||
```
|
||||
|
||||
## Questions?
|
||||
|
||||
See answers to [frequently asked
|
||||
questions](https://coder.com/docs/code-server/v3.11.0/FAQ).
|
||||
|
||||
## Want to help?
|
||||
|
||||
See [Contributing](https://coder.com/docs/code-server/v3.11.0/CONTRIBUTING) for
|
||||
details.
|
||||
|
||||
## Hiring
|
||||
|
||||
Interested in [working at Coder](https://coder.com/careers)? Check out [our open
|
||||
positions](https://coder.com/careers#openings)!
|
||||
|
||||
## For Organizations
|
||||
|
||||
Want remote development for your organization or enterprise? Visit [our
|
||||
website](https://coder.com) to learn more about Coder.
|
||||
@@ -1,24 +1,30 @@
|
||||
# Security Policy
|
||||
|
||||
The code-server team (and Coder, the organization) care a lot about keeping the project secure and safe for end-users.
|
||||
Coder and the code-server team want to keep the code-server project secure and safe for end-users.
|
||||
|
||||
## Tools
|
||||
|
||||
We use a combination of tools to help us stay on top of vulnerabilities.
|
||||
We use the following tools to help us stay on top of vulnerability mitigation.
|
||||
|
||||
- [dependabot](https://dependabot.com/)
|
||||
- Submits pull requests to upgrade dependencies. We use dependabot's version upgrades as well as security updates.
|
||||
- Submits pull requests to upgrade dependencies. We use dependabot's version
|
||||
upgrades as well as security updates.
|
||||
- code-scanning
|
||||
- [CodeQL](https://securitylab.github.com/tools/codeql/)
|
||||
- Semantic code analysis engine that runs on a regular schedule (see `codeql-analysis.yml`)
|
||||
- Semantic code analysis engine that runs on a regular schedule (see
|
||||
`codeql-analysis.yml`)
|
||||
- [trivy](https://github.com/aquasecurity/trivy)
|
||||
- Comprehensive vulnerability scanner that runs on PRs into the default branch and scans both our container image and repository code (see `trivy-scan-repo` and `trivy-scan-image` jobs in `ci.yaml`)
|
||||
- Comprehensive vulnerability scanner that runs on PRs into the default
|
||||
branch and scans both our container image and repository code (see
|
||||
`trivy-scan-repo` and `trivy-scan-image` jobs in `ci.yaml`)
|
||||
- [`audit-ci`](https://github.com/IBM/audit-ci)
|
||||
- Audits npm and Yarn dependencies in CI (see "Audit for vulnerabilities" step in `ci.yaml`) on PRs into the default branch and fails CI if moderate or higher vulnerabilities(see the `audit.sh` script) are present.
|
||||
- Audits npm and Yarn dependencies in CI (see `Audit for vulnerabilities` step
|
||||
in `ci.yaml`) on PRs into the default branch and fails CI if moderate or
|
||||
higher vulnerabilities (see the `audit.sh` script) are present.
|
||||
|
||||
## Supported Versions
|
||||
|
||||
Coder sponsors development and maintenance of the code-server project. We will fix security issues within 90 days of receiving a report, and publish the fix in a subsequent release. The code-server project does not provide backports or patch releases for security issues at this time.
|
||||
Coder sponsors the development and maintenance of the code-server project. We will fix security issues within 90 days of receiving a report and publish the fix in a subsequent release. The code-server project does not provide backports or patch releases for security issues at this time.
|
||||
|
||||
| Version | Supported |
|
||||
| ----------------------------------------------------- | ------------------ |
|
||||
@@ -26,4 +32,4 @@ Coder sponsors development and maintenance of the code-server project. We will f
|
||||
|
||||
## Reporting a Vulnerability
|
||||
|
||||
To report a vulnerability, please send an email to security[@]coder.com and our security team will respond to you.
|
||||
To report a vulnerability, please send an email to security[@]coder.com, and our security team will respond to you.
|
||||
|
||||
511
docs/guide.md
511
docs/guide.md
@@ -2,184 +2,124 @@
|
||||
<!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE -->
|
||||
# Setup Guide
|
||||
|
||||
- [1. Acquire a remote machine](#1-acquire-a-remote-machine)
|
||||
- [Requirements](#requirements)
|
||||
- [Google Cloud](#google-cloud)
|
||||
- [2. Install code-server](#2-install-code-server)
|
||||
- [3. Expose code-server](#3-expose-code-server)
|
||||
- [SSH forwarding](#ssh-forwarding)
|
||||
- [Let's Encrypt](#lets-encrypt)
|
||||
- [NGINX](#nginx)
|
||||
- [Expose code-server](#expose-code-server)
|
||||
- [Port forwarding via SSH](#port-forwarding-via-ssh)
|
||||
- [Using Let's Encrypt with Caddy](#using-lets-encrypt-with-caddy)
|
||||
- [Using Let's Encrypt with NGINX](#using-lets-encrypt-with-nginx)
|
||||
- [Using a self-signed certificate](#using-a-self-signed-certificate)
|
||||
- [External authentication](#external-authentication)
|
||||
- [HTTPS](#https)
|
||||
- [Self Signed Certificate](#self-signed-certificate)
|
||||
- [Change the password?](#change-the-password)
|
||||
- [How do I securely access development web services?](#how-do-i-securely-access-development-web-services)
|
||||
- [Using a subdomain](#using-a-subdomain)
|
||||
- [Using a subpath](#using-a-subpath)
|
||||
- [Stripping `/proxy/<port>` from the request path](#stripping-proxyport-from-the-request-path)
|
||||
- [Proxying to create a React app](#proxying-to-create-a-react-app)
|
||||
|
||||
<!-- END doctoc generated TOC please keep comment here to allow auto update -->
|
||||
|
||||
This guide demonstrates how to setup and use `code-server`.
|
||||
To reiterate, `code-server` lets you run VS Code on a remote server and then access it via a browser.
|
||||
This article will walk you through exposing code-server securely once you've
|
||||
completed the [installation process](install.md).
|
||||
|
||||
Further docs are at:
|
||||
## Expose code-server
|
||||
|
||||
- [README](../README.md) for a general overview
|
||||
- [INSTALL](../docs/install.md) for installation
|
||||
- [FAQ](./FAQ.md) for common questions.
|
||||
- [CONTRIBUTING](../docs/CONTRIBUTING.md) for development docs
|
||||
**Never** expose code-server directly to the internet without some form of
|
||||
authentication and encryption, otherwise someone can take over your machine via
|
||||
the terminal.
|
||||
|
||||
We highly recommend reading the [FAQ](./FAQ.md) on the [Differences compared to VS Code](./FAQ.md#differences-compared-to-vs-code) before beginning.
|
||||
By default, code-server uses password authentication. As such, you must copy the
|
||||
password from code-server's config file to log in. To avoid exposing itself
|
||||
unnecessarily, code-server listens on `localhost`; this practice is fine for
|
||||
testing, but it doesn't work if you want to access code-server from a different
|
||||
machine.
|
||||
|
||||
We'll walk you through acquiring a remote machine to run `code-server` on
|
||||
and then exposing `code-server` so you can securely access it.
|
||||
> **Rate limits:** code-server rate limits password authentication attempts to
|
||||
> two per minute and twelve per hour.
|
||||
|
||||
## 1. Acquire a remote machine
|
||||
There are several approaches to operating and exposing code-server securely:
|
||||
|
||||
First, you need a machine to run `code-server` on. You can use a physical
|
||||
machine you have lying around or use a VM on GCP/AWS.
|
||||
- Port forwarding via SSH
|
||||
- Using Let's Encrypt with Caddy
|
||||
- Using Let's Encrypt with NGINX
|
||||
- Using a self-signed certificate
|
||||
|
||||
### Requirements
|
||||
### Port forwarding via SSH
|
||||
|
||||
For a good experience, we recommend at least:
|
||||
We highly recommend using [port forwarding via
|
||||
SSH](https://help.ubuntu.com/community/SSH/OpenSSH/PortForwarding) to access
|
||||
code-server. If you have an SSH server on your remote machine, this approach
|
||||
doesn't required additional setup.
|
||||
|
||||
- 1 GB of RAM
|
||||
- 2 cores
|
||||
The downside to SSH forwarding, however, is that you can't access code-server
|
||||
when using machines without SSH clients (such as iPads). If this applies to you,
|
||||
we recommend using another method, such as [Let's Encrypt](#let-encrypt) instead.
|
||||
|
||||
You can use whatever linux distribution floats your boat but in this guide we assume Debian on Google Cloud.
|
||||
> To work properly, your environment should have WebSockets enabled, which
|
||||
> code-server uses to communicate between the browser and server.
|
||||
|
||||
### Google Cloud
|
||||
1. SSH into your instance and edit the code-server config file to disable
|
||||
password authentication:
|
||||
|
||||
For demonstration purposes, this guide assumes you're using a VM on GCP but you should be
|
||||
able to easily use any machine or VM provider.
|
||||
```console
|
||||
# Replaces "auth: password" with "auth: none" in the code-server config.
|
||||
sed -i.bak 's/auth: password/auth: none/' ~/.config/code-server/config.yaml
|
||||
```
|
||||
|
||||
You can sign up at https://console.cloud.google.com/getting-started. You'll get a 12 month \$300
|
||||
free trial.
|
||||
2. Restart code-server:
|
||||
|
||||
Once you've signed up and created a GCP project, create a new Compute Engine VM Instance.
|
||||
```console
|
||||
sudo systemctl restart code-server@$USER
|
||||
```
|
||||
|
||||
1. Navigate to `Compute Engine -> VM Instances` on the sidebar.
|
||||
2. Now click `Create Instance` to create a new instance.
|
||||
3. Name it whatever you want.
|
||||
4. Choose the region closest to you based on [gcping.com](http://www.gcping.com).
|
||||
5. Any zone is fine.
|
||||
6. We'd recommend a `E2` series instance from the General-purpose family.
|
||||
- Change the type to custom and set at least 2 cores and 2 GB of ram.
|
||||
- Add more vCPUs and memory as you prefer, you can edit after creating the instance as well.
|
||||
- https://cloud.google.com/compute/docs/machine-types#general_purpose
|
||||
7. We highly recommend switching the persistent disk to an SSD of at least 32 GB.
|
||||
- Click `Change` under `Boot Disk` and change the type to `SSD Persistent Disk` and the size
|
||||
to `32`.
|
||||
- You can always grow your disk later.
|
||||
8. Navigate to `Networking -> Network interfaces` and edit the existing interface
|
||||
to use a static external IP.
|
||||
- Click done to save network interface changes.
|
||||
9. If you do not have a [project wide SSH key](https://cloud.google.com/compute/docs/instances/adding-removing-ssh-keys#project-wide), navigate to `Security -> SSH Keys` and add your public key there.
|
||||
10. Click create!
|
||||
3. Forward local port `8080` to `127.0.0.1:8080` on the remote instance by running the following command on your local machine:
|
||||
|
||||
Remember, you can shutdown your server when not in use to lower costs.
|
||||
```console
|
||||
# -N disables executing a remote shell
|
||||
ssh -N -L 8080:127.0.0.1:8080 [user]@<instance-ip>
|
||||
```
|
||||
|
||||
We highly recommend learning to use the [`gcloud`](https://cloud.google.com/sdk/gcloud) cli
|
||||
to avoid the slow dashboard.
|
||||
4. At this point, you can access code-server by pointing your web browser to `http://127.0.0.1:8080`.
|
||||
|
||||
## 2. Install code-server
|
||||
5. If you'd like to make the port forwarding via SSH persistent, we recommend
|
||||
using [mutagen](https://mutagen.io/documentation/introduction/installation)
|
||||
to do so. Once you've installed mutagen, you can port forward as follows:
|
||||
|
||||
We have a [script](../install.sh) to install `code-server` for Linux, macOS and FreeBSD.
|
||||
```console
|
||||
# This is the same as the above SSH command, but it runs in the background
|
||||
# continuously. Be sure to add `mutagen daemon start` to your ~/.bashrc to
|
||||
# start the mutagen daemon when you open a shell.
|
||||
|
||||
mutagen forward create --name=code-server tcp:127.0.0.1:8080 < instance-ip > :tcp:127.0.0.1:8080
|
||||
```
|
||||
|
||||
It tries to use the system package manager if possible.
|
||||
6. Optional, but highly recommended: add the following to `~/.ssh/config` so
|
||||
that you can detect bricked SSH connections:
|
||||
|
||||
First run to print out the install process:
|
||||
```bash
|
||||
Host *
|
||||
ServerAliveInterval 5
|
||||
ExitOnForwardFailure yes
|
||||
```
|
||||
|
||||
```bash
|
||||
curl -fsSL https://code-server.dev/install.sh | sh -s -- --dry-run
|
||||
```
|
||||
> You can [forward your
|
||||
> SSH](https://developer.github.com/v3/guides/using-ssh-agent-forwarding/) and
|
||||
> [GPG agent](https://wiki.gnupg.org/AgentForwarding) to the instance to
|
||||
> securely access GitHub and sign commits without having to copy your keys.
|
||||
|
||||
Now to actually install:
|
||||
### Using Let's Encrypt with Caddy
|
||||
|
||||
```bash
|
||||
curl -fsSL https://code-server.dev/install.sh | sh
|
||||
```
|
||||
Using [Let's Encrypt](https://letsencrypt.org) is an option if you want to
|
||||
access code-server on an iPad or do not want to use SSH port forwarding.
|
||||
|
||||
The install script will print out how to run and start using `code-server`.
|
||||
1. This option requires that the remote machine be exposed to the internet. Make sure that your instance allows HTTP/HTTP traffic.
|
||||
|
||||
Docs on the install script, manual installation and docker image are at [./install.md](./install.md).
|
||||
1. You'll need a domain name (if you don't have one, you can purchase one from
|
||||
[Google Domains](https://domains.google.com) or the domain service of your
|
||||
choice)). Once you have a domain name, add an A record to your domain that contains your
|
||||
instance's IP address.
|
||||
|
||||
## 3. Expose code-server
|
||||
1. Install [Caddy](https://caddyserver.com/docs/download#debian-ubuntu-raspbian):
|
||||
|
||||
**Never**, **ever** expose `code-server` directly to the internet without some form of authentication
|
||||
and encryption as someone can completely takeover your machine with the terminal.
|
||||
|
||||
By default, `code-server` will enable password authentication which will require you to copy the
|
||||
password from the`code-server`config file to login. It will listen on`localhost` to avoid exposing
|
||||
itself to the world. This is fine for testing but will not work if you want to access `code-server`
|
||||
from a different machine.
|
||||
|
||||
There are several approaches to securely operating and exposing `code-server`.
|
||||
|
||||
**tip**: You can list the full set of `code-server` options with `code-server --help`
|
||||
|
||||
### SSH forwarding
|
||||
|
||||
We highly recommend this approach for not requiring any additional setup, you just need an
|
||||
SSH server on your remote machine. The downside is you won't be able to access `code-server`
|
||||
on any machine without an SSH client like on iPad. If that's important to you, skip to [Let's Encrypt](#lets-encrypt).
|
||||
|
||||
First, ssh into your instance and edit your `code-server` config file to disable password authentication.
|
||||
|
||||
```bash
|
||||
# Replaces "auth: password" with "auth: none" in the code-server config.
|
||||
sed -i.bak 's/auth: password/auth: none/' ~/.config/code-server/config.yaml
|
||||
```
|
||||
|
||||
Restart `code-server` with (assuming you followed the guide):
|
||||
|
||||
```bash
|
||||
sudo systemctl restart code-server@$USER
|
||||
```
|
||||
|
||||
Now forward local port 8080 to `127.0.0.1:8080` on the remote instance by running the following command on your local machine.
|
||||
|
||||
Recommended reading: https://help.ubuntu.com/community/SSH/OpenSSH/PortForwarding.
|
||||
|
||||
```bash
|
||||
# -N disables executing a remote shell
|
||||
ssh -N -L 8080:127.0.0.1:8080 [user]@<instance-ip>
|
||||
```
|
||||
|
||||
Now if you access http://127.0.0.1:8080 locally, you should see `code-server`!
|
||||
|
||||
If you want to make the SSH port forwarding persistent we recommend using
|
||||
[mutagen](https://mutagen.io/documentation/introduction/installation).
|
||||
|
||||
```
|
||||
# Same as the above SSH command but runs in the background continuously.
|
||||
# Add `mutagen daemon start` to your ~/.bashrc to start the mutagen daemon when you open a shell.
|
||||
mutagen forward create --name=code-server tcp:127.0.0.1:8080 <instance-ip>:tcp:127.0.0.1:8080
|
||||
```
|
||||
|
||||
We also recommend adding the following lines to your `~/.ssh/config` to quickly detect bricked SSH connections:
|
||||
|
||||
```bash
|
||||
Host *
|
||||
ServerAliveInterval 5
|
||||
ExitOnForwardFailure yes
|
||||
```
|
||||
|
||||
You can also forward your SSH and GPG agent to the instance to securely access GitHub
|
||||
and sign commits without copying your keys.
|
||||
|
||||
1. https://developer.github.com/v3/guides/using-ssh-agent-forwarding/
|
||||
2. https://wiki.gnupg.org/AgentForwarding
|
||||
|
||||
### Let's Encrypt
|
||||
|
||||
[Let's Encrypt](https://letsencrypt.org) is a great option if you want to access `code-server` on an iPad
|
||||
or do not want to use SSH forwarding. This does require that the remote machine be exposed to the internet.
|
||||
|
||||
Assuming you have been following the guide, edit your instance and checkmark the allow HTTP/HTTPS traffic options.
|
||||
|
||||
1. You'll need to buy a domain name. We recommend [Google Domains](https://domains.google.com).
|
||||
2. Add an A record to your domain with your instance's IP.
|
||||
3. Install caddy https://caddyserver.com/docs/download#debian-ubuntu-raspbian.
|
||||
|
||||
```bash
|
||||
```console
|
||||
sudo apt install -y debian-keyring debian-archive-keyring apt-transport-https
|
||||
curl -1sLf 'https://dl.cloudsmith.io/public/caddy/stable/cfg/gpg/gpg.155B6D79CA56EA34.key' | sudo apt-key add -
|
||||
curl -1sLf 'https://dl.cloudsmith.io/public/caddy/stable/cfg/setup/config.deb.txt?distro=debian&version=any-version' | sudo tee -a /etc/apt/sources.list.d/caddy-stable.list
|
||||
@@ -187,131 +127,224 @@ sudo apt update
|
||||
sudo apt install caddy
|
||||
```
|
||||
|
||||
4. Replace `/etc/caddy/Caddyfile` with sudo to look like this:
|
||||
1. Replace `/etc/caddy/Caddyfile` using `sudo` so that the file looks like this:
|
||||
|
||||
```
|
||||
mydomain.com
|
||||
```text
|
||||
mydomain.com
|
||||
|
||||
reverse_proxy 127.0.0.1:8080
|
||||
```
|
||||
reverse_proxy 127.0.0.1:8080
|
||||
```
|
||||
|
||||
If you want to serve `code-server` from a sub-path, below is sample configuration for Caddy:
|
||||
If you want to serve code-server from a sub-path, you can do so as follows:
|
||||
|
||||
```
|
||||
mydomain.com/code/* {
|
||||
uri strip_prefix /code
|
||||
reverse_proxy 127.0.0.1:8080
|
||||
}
|
||||
```
|
||||
```text
|
||||
mydomain.com/code/* {
|
||||
uri strip_prefix /code
|
||||
reverse_proxy 127.0.0.1:8080
|
||||
}
|
||||
```
|
||||
|
||||
Remember to replace `mydomain.com` with your domain name!
|
||||
Remember to replace `mydomain.com` with your domain name!
|
||||
|
||||
5. Reload caddy with:
|
||||
1. Reload Caddy:
|
||||
|
||||
```bash
|
||||
sudo systemctl reload caddy
|
||||
```
|
||||
```console
|
||||
sudo systemctl reload caddy
|
||||
```
|
||||
|
||||
Visit `https://<your-domain-name>` to access `code-server`. Congratulations!
|
||||
At this point, you should be able to access code-server via
|
||||
`https://mydomain.com`.
|
||||
|
||||
In a future release we plan to integrate Let's Encrypt directly with `code-server` to avoid
|
||||
the dependency on caddy.
|
||||
### Using Let's Encrypt with NGINX
|
||||
|
||||
#### NGINX
|
||||
1. This option requires that the remote machine be exposed to the internet. Make sure that your instance allows HTTP/HTTP traffic.
|
||||
|
||||
If you prefer to use NGINX instead of Caddy then please follow steps 1-2 above and then:
|
||||
1. You'll need a domain name (if you don't have one, you can purchase one from
|
||||
[Google Domains](https://domains.google.com) or the domain service of your
|
||||
choice)). Once you have a domain name, add an A record to your domain that contains your
|
||||
instance's IP address.
|
||||
|
||||
3. Install `nginx`:
|
||||
1. Install NGINX:
|
||||
|
||||
```bash
|
||||
sudo apt update
|
||||
sudo apt install -y nginx certbot python3-certbot-nginx
|
||||
```
|
||||
```bash
|
||||
sudo apt update
|
||||
sudo apt install -y nginx certbot python3-certbot-nginx
|
||||
```
|
||||
|
||||
4. Put the following config into `/etc/nginx/sites-available/code-server` with sudo:
|
||||
1. Update `/etc/nginx/sites-available/code-server` using sudo with the following
|
||||
configuration:
|
||||
|
||||
```nginx
|
||||
server {
|
||||
listen 80;
|
||||
listen [::]:80;
|
||||
server_name mydomain.com;
|
||||
```text
|
||||
server {
|
||||
listen 80;
|
||||
listen [::]:80;
|
||||
server_name mydomain.com;
|
||||
|
||||
location / {
|
||||
proxy_pass http://localhost:8080/;
|
||||
proxy_set_header Host $host;
|
||||
proxy_set_header Upgrade $http_upgrade;
|
||||
proxy_set_header Connection upgrade;
|
||||
proxy_set_header Accept-Encoding gzip;
|
||||
}
|
||||
}
|
||||
```
|
||||
location / {
|
||||
proxy_pass http://localhost:8080/;
|
||||
proxy_set_header Host $host;
|
||||
proxy_set_header Upgrade $http_upgrade;
|
||||
proxy_set_header Connection upgrade;
|
||||
proxy_set_header Accept-Encoding gzip;
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
Remember to replace `mydomain.com` with your domain name!
|
||||
Be sure to replace `mydomain.com` with your domain name!
|
||||
|
||||
5. Enable the config:
|
||||
1. Enable the config:
|
||||
|
||||
```bash
|
||||
sudo ln -s ../sites-available/code-server /etc/nginx/sites-enabled/code-server
|
||||
sudo certbot --non-interactive --redirect --agree-tos --nginx -d mydomain.com -m me@example.com
|
||||
```
|
||||
```console
|
||||
sudo ln -s ../sites-available/code-server /etc/nginx/sites-enabled/code-server
|
||||
sudo certbot --non-interactive --redirect --agree-tos --nginx -d mydomain.com -m me@example.com
|
||||
```
|
||||
|
||||
Make sure to substitute `me@example.com` with your actual email.
|
||||
Be sure to replace `me@example.com` with your actual email.
|
||||
|
||||
Visit `https://<your-domain-name>` to access `code-server`. Congratulations!
|
||||
At this point, you should be able to access code-server via
|
||||
`https://mydomain.com`.
|
||||
|
||||
### Using a self-signed certificate
|
||||
|
||||
> Self signed certificates do not work with iPad; see [./ipad.md](./ipad.md) for
|
||||
> more information.
|
||||
|
||||
Before proceeding, we recommend familiarizing yourself with the [risks of
|
||||
self-signing a certificate for
|
||||
SSL](https://security.stackexchange.com/questions/8110).
|
||||
|
||||
We recommend self-signed certificates as a last resort, since self-signed
|
||||
certificates do not work with iPads and may cause unexpected issues with
|
||||
code-server. You should only proceed with this option if:
|
||||
|
||||
- You do not want to buy a domain or you cannot expose the remote machine to
|
||||
the internet
|
||||
- You do not want to use port forwarding via SSH
|
||||
|
||||
To use a self-signed certificate:
|
||||
|
||||
1. This option requires that the remote machine be exposed to the internet. Make
|
||||
sure that your instance allows HTTP/HTTP traffic.
|
||||
|
||||
1. SSH into your instance and edit your code-server config file to use a
|
||||
randomly generated self-signed certificate:
|
||||
|
||||
```console
|
||||
# Replaces "cert: false" with "cert: true" in the code-server config.
|
||||
sed -i.bak 's/cert: false/cert: true/' ~/.config/code-server/config.yaml
|
||||
# Replaces "bind-addr: 127.0.0.1:8080" with "bind-addr: 0.0.0.0:443" in the code-server config.
|
||||
sed -i.bak 's/bind-addr: 127.0.0.1:8080/bind-addr: 0.0.0.0:443/' ~/.config/code-server/config.yaml
|
||||
# Allows code-server to listen on port 443.
|
||||
sudo setcap cap_net_bind_service=+ep /usr/lib/code-server/lib/node
|
||||
```
|
||||
|
||||
1. Restart code-server:
|
||||
|
||||
```console
|
||||
sudo systemctl restart code-server@$USER
|
||||
```
|
||||
|
||||
At this point, you should be able to access code-server via
|
||||
`https://<your-instance-ip>`.
|
||||
|
||||
If you'd like to avoid the warnings displayed by code-server when using a
|
||||
self-signed certificate, you can use [mkcert](https://mkcert.dev) to create a
|
||||
self-signed certificate that's trusted by your operating system, then pass the
|
||||
certificate to code-server via the `cert` and `cert-key` config fields.
|
||||
|
||||
## External authentication
|
||||
|
||||
If you want to use external authentication mechanism (e.g., Sign in with
|
||||
Google), you can do this with a reverse proxy such as:
|
||||
|
||||
- [Pomerium](https://www.pomerium.io/guides/code-server.html)
|
||||
- [oauth2_proxy](https://github.com/pusher/oauth2_proxy)
|
||||
- [Cloudflare Access](https://teams.cloudflare.com/access)
|
||||
|
||||
## HTTPS
|
||||
|
||||
For HTTPS, you can use a self-signed certificate by:
|
||||
|
||||
- Passing in `--cert`
|
||||
- Passing in an existing certificate by providing the path to `--cert` and the
|
||||
path to the key with `--cert-key`
|
||||
|
||||
The self signed certificate will be generated to
|
||||
`~/.local/share/code-server/self-signed.crt`.
|
||||
|
||||
If you pass a certificate to code-server, it will respond to HTTPS requests and
|
||||
redirect all HTTP requests to HTTPS.
|
||||
|
||||
> You can use [Let's Encrypt](https://letsencrypt.org/) to get a TLS certificate
|
||||
> for free.
|
||||
|
||||
Note: if you set `proxy_set_header Host $host;` in your reverse proxy config, it will change the address displayed in the green section of code-server in the bottom left to show the correct address.
|
||||
|
||||
### Self Signed Certificate
|
||||
|
||||
**note:** Self signed certificates do not work with iPad normally. See [./ipad.md](./ipad.md) for details.
|
||||
If you're working on a web service and want to access it locally, code-server
|
||||
can proxy to any port using either a subdomain or a subpath, allowing you to
|
||||
securely access these services using code-server's built-in authentication.
|
||||
|
||||
Recommended reading: https://security.stackexchange.com/a/8112.
|
||||
### Using a subdomain
|
||||
|
||||
We recommend this as a last resort because self signed certificates do not work with iPads and can
|
||||
cause other bizarre issues. Not to mention all the warnings when you access `code-server`.
|
||||
Only use this if:
|
||||
You will need a DNS entry that points to your server for each port you want to
|
||||
access. You can either set up a wildcard DNS entry for `*.<domain>` if your
|
||||
domain name registrar supports it, or you can create one for every port you want
|
||||
to access (`3000.<domain>`, `8080.<domain>`, etc).
|
||||
|
||||
1. You do not want to buy a domain or you cannot expose the remote machine to the internet.
|
||||
2. You do not want to use SSH forwarding.
|
||||
You should also set up TLS certificates for these subdomains, either using a
|
||||
wildcard certificate for `*.<domain>` or individual certificates for each port.
|
||||
|
||||
ssh into your instance and edit your code-server config file to use a randomly generated self signed certificate:
|
||||
To set your domain, start code-server with the `--proxy-domain` flag:
|
||||
|
||||
```bash
|
||||
# Replaces "cert: false" with "cert: true" in the code-server config.
|
||||
sed -i.bak 's/cert: false/cert: true/' ~/.config/code-server/config.yaml
|
||||
# Replaces "bind-addr: 127.0.0.1:8080" with "bind-addr: 0.0.0.0:443" in the code-server config.
|
||||
sed -i.bak 's/bind-addr: 127.0.0.1:8080/bind-addr: 0.0.0.0:443/' ~/.config/code-server/config.yaml
|
||||
# Allows code-server to listen on port 443.
|
||||
sudo setcap cap_net_bind_service=+ep /usr/lib/code-server/lib/node
|
||||
```console
|
||||
code-server --proxy-domain <domain>
|
||||
```
|
||||
|
||||
Assuming you have been following the guide, restart `code-server` with:
|
||||
Now you can browse to `<port>.<domain>`. Note that this uses the host header, so
|
||||
ensure your reverse proxy (if you're using one) forwards that information.
|
||||
|
||||
```bash
|
||||
sudo systemctl restart code-server@$USER
|
||||
### Using a subpath
|
||||
|
||||
Simply browse to `/proxy/<port>/`.
|
||||
|
||||
### Stripping `/proxy/<port>` from the request path
|
||||
|
||||
You may notice that the code-server proxy strips `/proxy/<port>` from the
|
||||
request path.
|
||||
|
||||
HTTP servers should use relative URLs to avoid the need to be coupled to the
|
||||
absolute path at which they are served. This means you must [use trailing
|
||||
slashes on all paths with
|
||||
subpaths](https://blog.cdivilly.com/2019/02/28/uri-trailing-slashes).
|
||||
|
||||
This reasoning is why the default behavior is to strip `/proxy/<port>` from the
|
||||
base path. If your application uses relative URLs and does not assume the
|
||||
absolute path at which it is being served, it will just work no matter what port
|
||||
you decide to serve it off or if you put it in behind code-server or any other
|
||||
proxy.
|
||||
|
||||
However, some prefer the cleaner aesthetic of no trailing slashes. Omitting the
|
||||
trailing slashes couples you to the base path, since you cannot use relative
|
||||
redirects correctly anymore. If you're okay with this tradeoff, use `/absproxy`
|
||||
instead and the path will be passed as is (e.g., `/absproxy/3000/my-app-path`).
|
||||
|
||||
### Proxying to create a React app
|
||||
|
||||
You must use `/absproxy/<port>` with `create-react-app` (see
|
||||
[#2565](https://github.com/cdr/code-server/issues/2565) and
|
||||
[#2222](https://github.com/cdr/code-server/issues/2222) for more information).
|
||||
You will need to inform `create-react-app` of the path at which you are serving
|
||||
via `$PUBLIC_URL` and webpack via `$WDS_SOCKET_PATH`:
|
||||
|
||||
```sh
|
||||
PUBLIC_URL=/absproxy/3000 \
|
||||
WDS_SOCKET_PATH=$PUBLIC_URL/sockjs-node \
|
||||
BROWSER=none yarn start
|
||||
```
|
||||
|
||||
Edit your instance and checkmark the allow HTTPS traffic option.
|
||||
You should then be able to visit `https://my-code-server-address.io/absproxy/3000` to see your app exposed through
|
||||
code-server!
|
||||
|
||||
Visit `https://<your-instance-ip>` to access `code-server`.
|
||||
You'll get a warning when accessing but if you click through you should be good.
|
||||
|
||||
To avoid the warnings, you can use [mkcert](https://mkcert.dev) to create a self signed certificate
|
||||
trusted by your OS and then pass it into `code-server` via the `cert` and `cert-key` config
|
||||
fields.
|
||||
|
||||
### Change the password?
|
||||
|
||||
Edit the `password` field in the `code-server` config file at `~/.config/code-server/config.yaml`
|
||||
and then restart `code-server` with:
|
||||
|
||||
```bash
|
||||
sudo systemctl restart code-server@$USER
|
||||
```
|
||||
|
||||
Alternatively, you can specify the SHA-256 of your password at the `hashed-password` field in the config file.
|
||||
The `hashed-password` field takes precedence over `password`.
|
||||
|
||||
### How do I securely access development web services?
|
||||
|
||||
If you're working on a web service and want to access it locally, `code-server` can proxy it for you.
|
||||
|
||||
See the [FAQ](./FAQ.md#how-do-i-securely-access-web-services).
|
||||
> We highly recommend using the subdomain approach instead to avoid this class of issue.
|
||||
|
||||
297
docs/install.md
297
docs/install.md
@@ -2,148 +2,112 @@
|
||||
<!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE -->
|
||||
# Install
|
||||
|
||||
- [Upgrading](#upgrading)
|
||||
- [install.sh](#installsh)
|
||||
- [Flags](#flags)
|
||||
- [Detection Reference](#detection-reference)
|
||||
- [Detection reference](#detection-reference)
|
||||
- [yarn, npm](#yarn-npm)
|
||||
- [Standalone releases](#standalone-releases)
|
||||
- [Debian, Ubuntu](#debian-ubuntu)
|
||||
- [Fedora, CentOS, RHEL, SUSE](#fedora-centos-rhel-suse)
|
||||
- [Arch Linux](#arch-linux)
|
||||
- [Termux](#termux)
|
||||
- [yarn, npm](#yarn-npm)
|
||||
- [macOS](#macos)
|
||||
- [Standalone Releases](#standalone-releases)
|
||||
- [Docker](#docker)
|
||||
- [helm](#helm)
|
||||
- [Cloud Providers](#cloud-providers)
|
||||
- [Helm](#helm)
|
||||
- [Raspberry Pi](#raspberry-pi)
|
||||
- [Termux](#termux)
|
||||
- [Cloud providers](#cloud-providers)
|
||||
|
||||
<!-- END doctoc generated TOC please keep comment here to allow auto update -->
|
||||
|
||||
This document demonstrates how to install `code-server` on
|
||||
various distros and operating systems.
|
||||
|
||||
## Upgrading
|
||||
|
||||
When upgrading you can just install the new version over the old one. code-server
|
||||
maintains all user data in `~/.local/share/code-server` so that it is preserved in between
|
||||
installations.
|
||||
This document demonstrates how to install `code-server` on various distros and
|
||||
operating systems.
|
||||
|
||||
## install.sh
|
||||
|
||||
We have a [script](../install.sh) to install code-server for Linux, macOS and FreeBSD.
|
||||
The easiest way to install code-server is to use our [install
|
||||
script](../install.sh) for Linux, macOS and FreeBSD. The install script
|
||||
[attempts to use the system package manager](#detection-reference) if possible.
|
||||
|
||||
It tries to use the system package manager if possible.
|
||||
|
||||
First run to print out the install process:
|
||||
You can preview what occurs during the install process:
|
||||
|
||||
```bash
|
||||
curl -fsSL https://code-server.dev/install.sh | sh -s -- --dry-run
|
||||
```
|
||||
|
||||
Now to actually install:
|
||||
To install, run:
|
||||
|
||||
```bash
|
||||
curl -fsSL https://code-server.dev/install.sh | sh
|
||||
```
|
||||
|
||||
The script will print out how to run and start using code-server.
|
||||
You can modify the installation process by including one or more of the
|
||||
following flags:
|
||||
|
||||
If you believe an install script used with `curl | sh` is insecure, please give
|
||||
[this wonderful blogpost](https://sandstorm.io/news/2015-09-24-is-curl-bash-insecure-pgp-verified-install) by
|
||||
[sandstorm.io](https://sandstorm.io) a read.
|
||||
- `--dry-run`: echo the commands for the install process without running them.
|
||||
- `--method`: choose the installation method.
|
||||
- `--method=detect`: detect the package manager but fallback to
|
||||
`--method=standalone`.
|
||||
- `--method=standalone`: install a standalone release archive into `~/.local`.
|
||||
- `--prefix=/usr/local`: install a standalone release archive system-wide.
|
||||
- `--version=X.X.X`: install version `X.X.X` instead of latest version.
|
||||
- `--help`: see usage docs.
|
||||
|
||||
If you'd still prefer manual installation despite the below [detection reference](#detection-reference) and `--dry-run`
|
||||
then continue on for docs on manual installation. The [`install.sh`](../install.sh) script runs the _exact_ same
|
||||
commands presented in the rest of this document.
|
||||
When done, the install script prints out instructions for running and starting
|
||||
code-server.
|
||||
|
||||
### Flags
|
||||
> If you're concerned about the install script's use of `curl | sh` and the
|
||||
> security implications, please see [this blog
|
||||
> post](https://sandstorm.io/news/2015-09-24-is-curl-bash-insecure-pgp-verified-install)
|
||||
> by [sandstorm.io](https://sandstorm.io).
|
||||
|
||||
- `--dry-run` to echo the commands for the install process without running them.
|
||||
- `--method` to choose the installation method.
|
||||
- `--method=detect` to detect the package manager but fallback to `--method=standalone`.
|
||||
- `--method=standalone` to install a standalone release archive into `~/.local`.
|
||||
- `--prefix=/usr/local` to install a standalone release archive system wide.
|
||||
- `--version=X.X.X` to install version `X.X.X` instead of latest.
|
||||
- `--help` to see full usage docs.
|
||||
If you prefer to install code-server manually, despite the [detection
|
||||
references](#detection-reference) and `--dry-run` feature, then continue on for
|
||||
information on how to do this. The [`install.sh`](../install.sh) script runs the
|
||||
_exact_ same commands presented in the rest of this document.
|
||||
|
||||
### Detection Reference
|
||||
### Detection reference
|
||||
|
||||
- For Debian, Ubuntu and Raspbian it will install the latest deb package.
|
||||
- For Fedora, CentOS, RHEL and openSUSE it will install the latest rpm package.
|
||||
- For Arch Linux it will install the AUR package.
|
||||
- For any unrecognized Linux operating system it will install the latest standalone release into `~/.local`.
|
||||
- For Debian and Ubuntu, code-server will install the latest deb package.
|
||||
- For Fedora, CentOS, RHEL and openSUSE, code-server will install the latest RPM
|
||||
package.
|
||||
- For Arch Linux, code-server will install the AUR package.
|
||||
- For any unrecognized Linux operating system, code-server will install the
|
||||
latest standalone release into `~/.local`.
|
||||
|
||||
- Add `~/.local/bin` to your `$PATH` to run code-server.
|
||||
- Ensure that you add `~/.local/bin` to your `$PATH` to run code-server.
|
||||
|
||||
- For macOS it will install the Homebrew package.
|
||||
- For macOS, code-server will install the Homebrew package (if you don't have
|
||||
Homebrew installed, code-server will install the latest standalone release
|
||||
into `~/.local`).
|
||||
|
||||
- If Homebrew is not installed it will install the latest standalone release into `~/.local`.
|
||||
- Add `~/.local/bin` to your `$PATH` to run code-server.
|
||||
- Ensure that you add `~/.local/bin` to your `$PATH` to run code-server.
|
||||
|
||||
- For FreeBSD, it will install the [npm package](#yarn-npm) with `yarn` or `npm`.
|
||||
- For FreeBSD, code-server will install the [npm package](#yarn-npm) with `yarn`
|
||||
or `npm`.
|
||||
|
||||
- If ran on an architecture with no releases, it will install the [npm package](#yarn-npm) with `yarn` or `npm`.
|
||||
- We only have releases for amd64 and arm64 presently.
|
||||
- The [npm package](#yarn-npm) builds the native modules on postinstall.
|
||||
|
||||
## Debian, Ubuntu
|
||||
|
||||
NOTE: The standalone arm64 .deb does not support Ubuntu <16.04.
|
||||
Please upgrade or [build with yarn](#yarn-npm).
|
||||
|
||||
```bash
|
||||
curl -fOL https://github.com/cdr/code-server/releases/download/v3.10.0/code-server_3.10.0_amd64.deb
|
||||
sudo dpkg -i code-server_3.10.0_amd64.deb
|
||||
sudo systemctl enable --now code-server@$USER
|
||||
# Now visit http://127.0.0.1:8080. Your password is in ~/.config/code-server/config.yaml
|
||||
```
|
||||
|
||||
## Fedora, CentOS, RHEL, SUSE
|
||||
|
||||
NOTE: The standalone arm64 .rpm does not support CentOS 7.
|
||||
Please upgrade or [build with yarn](#yarn-npm).
|
||||
|
||||
```bash
|
||||
curl -fOL https://github.com/cdr/code-server/releases/download/v3.10.0/code-server-3.10.0-amd64.rpm
|
||||
sudo rpm -i code-server-3.10.0-amd64.rpm
|
||||
sudo systemctl enable --now code-server@$USER
|
||||
# Now visit http://127.0.0.1:8080. Your password is in ~/.config/code-server/config.yaml
|
||||
```
|
||||
|
||||
## Arch Linux
|
||||
|
||||
```bash
|
||||
# Installs code-server from the AUR using yay.
|
||||
yay -S code-server
|
||||
sudo systemctl enable --now code-server@$USER
|
||||
# Now visit http://127.0.0.1:8080. Your password is in ~/.config/code-server/config.yaml
|
||||
```
|
||||
|
||||
```bash
|
||||
# Installs code-server from the AUR with plain makepkg.
|
||||
git clone https://aur.archlinux.org/code-server.git
|
||||
cd code-server
|
||||
makepkg -si
|
||||
sudo systemctl enable --now code-server@$USER
|
||||
# Now visit http://127.0.0.1:8080. Your password is in ~/.config/code-server/config.yaml
|
||||
```
|
||||
|
||||
## Termux
|
||||
|
||||
Please see "Installation" in the [Termux docs](./termux.md#installation)
|
||||
- If you're installing code-server onto architecture with no releases,
|
||||
code-server will install the [npm package](#yarn-npm) with `yarn` or `npm`
|
||||
- We currently offer releases for amd64 and arm64.
|
||||
- The [npm package](#yarn-npm) builds the native modules on post-install.
|
||||
|
||||
## yarn, npm
|
||||
|
||||
We recommend installing with `yarn` or `npm` when:
|
||||
|
||||
1. You aren't on `amd64` or `arm64`.
|
||||
2. If you're on Linux with glibc < v2.17 or glibcxx < v3.4.18 on amd64, or glibc < v2.23 or glibcxx < v3.4.21 on arm64.
|
||||
3. You're running Alpine Linux, or are using a non-glibc libc. See [#1430](https://github.com/cdr/code-server/issues/1430#issuecomment-629883198)
|
||||
1. You aren't using a machine with `amd64` or `arm64`.
|
||||
2. You're on Linux with `glibc` < v2.17, `glibcxx` < v3.4.18 on `amd64`, `glibc`
|
||||
< v2.23, or `glibcxx` < v3.4.21 on `arm64`.
|
||||
3. You're running Alpine Linux or are using a non-glibc libc. See
|
||||
[#1430](https://github.com/cdr/code-server/issues/1430#issuecomment-629883198)
|
||||
for more information.
|
||||
|
||||
**note:** Installing via `yarn` or `npm` builds native modules on install and so requires C dependencies.
|
||||
See [./npm.md](./npm.md) for installing these dependencies.
|
||||
Installing code-server with `yarn` or `npm` builds native modules on install.
|
||||
This process requires C dependencies; see our guide on [installing these
|
||||
dependencies][./npm.md](./npm.md) for more information.
|
||||
|
||||
You will need at least node v12 installed. See [#1633](https://github.com/cdr/code-server/issues/1633).
|
||||
You must have Node.js v12 (or later) installed. See
|
||||
[#1633](https://github.com/cdr/code-server/issues/1633).
|
||||
|
||||
To install:
|
||||
|
||||
```bash
|
||||
yarn global add code-server
|
||||
@@ -152,6 +116,85 @@ code-server
|
||||
# Now visit http://127.0.0.1:8080. Your password is in ~/.config/code-server/config.yaml
|
||||
```
|
||||
|
||||
## Standalone releases
|
||||
|
||||
We publish self-contained `.tar.gz` archives for every release on
|
||||
[GitHub](https://github.com/cdr/code-server/releases). The archives bundle the
|
||||
node binary and node modules.
|
||||
|
||||
We create the standalone releases using the [npm package](#yarn-npm), and we
|
||||
then create the remaining releases using the standalone version.
|
||||
|
||||
The only requirement to use the standalone release is `glibc` >= 2.17 and
|
||||
`glibcxx` >= v3.4.18 on Linux (for macOS, there is no minimum system
|
||||
requirement).
|
||||
|
||||
To use a standalone release:
|
||||
|
||||
1. Download the latest release archive for your system from
|
||||
[GitHub](https://github.com/cdr/code-server/releases).
|
||||
2. Unpack the release.
|
||||
3. Run code-server by executing `./bin/code-server`.
|
||||
|
||||
You can add `./bin/code-server` to your `$PATH` so that you can execute
|
||||
`code-server` without providing full path each time.
|
||||
|
||||
Here is a sample script for installing and using a standalone code-server
|
||||
release on Linux:
|
||||
|
||||
```bash
|
||||
mkdir -p ~/.local/lib ~/.local/bin
|
||||
curl -fL https://github.com/cdr/code-server/releases/download/v$VERSION/code-server-$VERSION-linux-amd64.tar.gz \
|
||||
| tar -C ~/.local/lib -xz
|
||||
mv ~/.local/lib/code-server-$VERSION-linux-amd64 ~/.local/lib/code-server-$VERSION
|
||||
ln -s ~/.local/lib/code-server-$VERSION/bin/code-server ~/.local/bin/code-server
|
||||
PATH="~/.local/bin:$PATH"
|
||||
code-server
|
||||
# Now visit http://127.0.0.1:8080. Your password is in ~/.config/code-server/config.yaml
|
||||
```
|
||||
|
||||
## Debian, Ubuntu
|
||||
|
||||
> The standalone arm64 .deb does not support Ubuntu 16.04 or earlier. Please
|
||||
> upgrade or [build with yarn](#yarn-npm).
|
||||
|
||||
```bash
|
||||
curl -fOL https://github.com/cdr/code-server/releases/download/v$VERSION/code-server_$VERSION_amd64.deb
|
||||
sudo dpkg -i code-server_$VERSION_amd64.deb
|
||||
sudo systemctl enable --now code-server@$USER
|
||||
# Now visit http://127.0.0.1:8080. Your password is in ~/.config/code-server/config.yaml
|
||||
```
|
||||
|
||||
## Fedora, CentOS, RHEL, SUSE
|
||||
|
||||
> The standalone arm64 .rpm does not support CentOS 7. Please upgrade or [build
|
||||
> with yarn](#yarn-npm).
|
||||
|
||||
```bash
|
||||
curl -fOL https://github.com/cdr/code-server/releases/download/v$VERSION/code-server-$VERSION-amd64.rpm
|
||||
sudo rpm -i code-server-$VERSION-amd64.rpm
|
||||
sudo systemctl enable --now code-server@$USER
|
||||
# Now visit http://127.0.0.1:8080. Your password is in ~/.config/code-server/config.yaml
|
||||
```
|
||||
|
||||
## Arch Linux
|
||||
|
||||
```bash
|
||||
# Install code-server from the AUR using yay.
|
||||
yay -S code-server
|
||||
sudo systemctl enable --now code-server@$USER
|
||||
# Now visit http://127.0.0.1:8080. Your password is in ~/.config/code-server/config.yaml
|
||||
```
|
||||
|
||||
```bash
|
||||
# Install code-server from the AUR with plain makepkg.
|
||||
git clone https://aur.archlinux.org/code-server.git
|
||||
cd code-server
|
||||
makepkg -si
|
||||
sudo systemctl enable --now code-server@$USER
|
||||
# Now visit http://127.0.0.1:8080. Your password is in ~/.config/code-server/config.yaml
|
||||
```
|
||||
|
||||
## macOS
|
||||
|
||||
```bash
|
||||
@@ -160,34 +203,6 @@ brew services start code-server
|
||||
# Now visit http://127.0.0.1:8080. Your password is in ~/.config/code-server/config.yaml
|
||||
```
|
||||
|
||||
## Standalone Releases
|
||||
|
||||
We publish self contained `.tar.gz` archives for every release on [github](https://github.com/cdr/code-server/releases).
|
||||
They bundle the node binary and `node_modules`.
|
||||
|
||||
These are created from the [npm package](#yarn-npm) and the rest of the releases are created from these.
|
||||
Only requirement is glibc >= 2.17 && glibcxx >= v3.4.18 on Linux and for macOS there is no minimum system requirement.
|
||||
|
||||
1. Download the latest release archive for your system from [github](https://github.com/cdr/code-server/releases).
|
||||
2. Unpack the release.
|
||||
3. You can run code-server by executing `./bin/code-server`.
|
||||
|
||||
You can add the code-server `bin` directory to your `$PATH` to easily execute `code-server`
|
||||
without the full path every time.
|
||||
|
||||
Here is an example script for installing and using a standalone `code-server` release on Linux:
|
||||
|
||||
```bash
|
||||
mkdir -p ~/.local/lib ~/.local/bin
|
||||
curl -fL https://github.com/cdr/code-server/releases/download/v3.10.0/code-server-3.10.0-linux-amd64.tar.gz \
|
||||
| tar -C ~/.local/lib -xz
|
||||
mv ~/.local/lib/code-server-3.10.0-linux-amd64 ~/.local/lib/code-server-3.10.0
|
||||
ln -s ~/.local/lib/code-server-3.10.0/bin/code-server ~/.local/bin/code-server
|
||||
PATH="~/.local/bin:$PATH"
|
||||
code-server
|
||||
# Now visit http://127.0.0.1:8080. Your password is in ~/.config/code-server/config.yaml
|
||||
```
|
||||
|
||||
## Docker
|
||||
|
||||
```bash
|
||||
@@ -208,18 +223,26 @@ docker run -it --name code-server -p 127.0.0.1:8080:8080 \
|
||||
codercom/code-server:latest
|
||||
```
|
||||
|
||||
Our official image supports `amd64` and `arm64`.
|
||||
Our official image supports `amd64` and `arm64`. For `arm32` support, you can
|
||||
use a [community-maintained code-server
|
||||
alternative](https://hub.docker.com/r/linuxserver/code-server).
|
||||
|
||||
For `arm32` support there is a popular community maintained alternative:
|
||||
## Helm
|
||||
|
||||
https://hub.docker.com/r/linuxserver/code-server
|
||||
You can install code-server via [Helm](../ci/helm-chart/README.md).
|
||||
|
||||
## helm
|
||||
## Raspberry Pi
|
||||
|
||||
See [the chart](../ci/helm-chart).
|
||||
We recommend installing code-server onto Raspberry Pi with [`yarn` or
|
||||
`npm`](#yarn-npm).
|
||||
|
||||
## Cloud Providers
|
||||
## Termux
|
||||
|
||||
We maintain one-click apps and install scripts for different cloud providers such as DigitalOcean, Railway, Heroku, Azure, etc. Check out the repository:
|
||||
Please see code-server's [Termux docs](./termux.md#installation) for more
|
||||
information.
|
||||
|
||||
https://github.com/cdr/deploy-code-server
|
||||
## Cloud providers
|
||||
|
||||
We maintain [one-click apps and install scripts for cloud
|
||||
providers](https://github.com/cdr/deploy-code-server) such as DigitalOcean,
|
||||
Railway, Heroku, and Azure.
|
||||
|
||||
276
docs/ipad.md
276
docs/ipad.md
@@ -2,162 +2,200 @@
|
||||
<!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE -->
|
||||
# iPad
|
||||
|
||||
- [Known Issues](#known-issues)
|
||||
- [How to install PWA](#how-to-install-pwa)
|
||||
- [How to access code-server with a self signed certificate on iPad?](#how-to-access-code-server-with-a-self-signed-certificate-on-ipad)
|
||||
- [Servediter iPad App](#servediter-ipad-app)
|
||||
- [Raspberry Pi USB-C Network](#raspberry-pi-usb-c-network)
|
||||
- [Ctrl C Workaround](#ctrl-c-workaround)
|
||||
- [Using the code-server progressive web app (PWA)](#using-the-code-server-progressive-web-app-pwa)
|
||||
- [Access code-server with a self-signed certificate on an iPad](#access-code-server-with-a-self-signed-certificate-on-an-ipad)
|
||||
- [Certificate requirements](#certificate-requirements)
|
||||
- [Sharing a self-signed certificate with an iPad](#sharing-a-self-signed-certificate-with-an-ipad)
|
||||
- [Access code-server using Servediter](#access-code-server-using-servediter)
|
||||
- [Raspberry Pi USB-C network](#raspberry-pi-usb-c-network)
|
||||
- [Recommendations](#recommendations)
|
||||
- [By 2022 iPad coding more desirable on Arm Macs](#by-2022-ipad-coding-more-desirable-on-arm-macs)
|
||||
- [Known issues](#known-issues)
|
||||
- [Workaround for issue with `ctrl+c` not stopping a running process in the terminal](#workaround-for-issue-with-ctrlc-not-stopping-a-running-process-in-the-terminal)
|
||||
|
||||
<!-- END doctoc generated TOC please keep comment here to allow auto update -->
|
||||
|
||||
## Known Issues
|
||||
Once you've installed code-server, you can access it from an iPad.
|
||||
|
||||
- Getting self signed certificates certificates to work is involved, see below.
|
||||
- Keyboard issues
|
||||
- May disappear sometimes [#1313](https://github.com/cdr/code-server/issues/1313), [#979](https://github.com/cdr/code-server/issues/979)
|
||||
- Some short cuts expectations may not be met
|
||||
- `command + n` opens new browser window instead of new file and difficult to even set to another quick key
|
||||
- In general it's just note worthy you most likely will need to edit keyboard shortcuts
|
||||
- No escape key by default on Magic Keyboard but everyone sets the globe key to be an escape key
|
||||
- Opinion: It's actually an awesome joy having the escape key at bottom of keyboard
|
||||
- Trackpad scrolling does not work [#1455](https://github.com/cdr/code-server/issues/1455)
|
||||
- [Bug tracking of a WebKit fix here](https://bugs.webkit.org/show_bug.cgi?id=210071#c13)
|
||||
- [tracking of WebKit patch](https://trac.webkit.org/changeset/270712/webkit)
|
||||
- Alternative: Install line-jump extension and use keyboard to nav by jumping large amount of lines
|
||||
- Alternative: Just use touch scrolling
|
||||
- See [issues tagged with the iPad label](https://github.com/cdr/code-server/issues?q=is%3Aopen+is%3Aissue+label%3AiPad) for more.
|
||||
- `ctrl+c` does not stop a long-running process in the browser
|
||||
- Tracking upstream issue here: [#114009](https://github.com/microsoft/vscode/issues/114009)
|
||||
- See [workaround](#ctrl-c-workaround)
|
||||
## Using the code-server progressive web app (PWA)
|
||||
|
||||
## How to install PWA
|
||||
To use code-server on an iPad, we recommend installing the code-server
|
||||
progressive web app (PWA):
|
||||
|
||||
To install the code-server PWA, follow these steps:
|
||||
1. Open code-server in Safari.
|
||||
2. Click the **Share** icon.
|
||||
3. Click **Add to Home Screen**.
|
||||
|
||||
1. Open code-server in Safari
|
||||
2. Click the Share icon
|
||||
3. Click "Add to Home Screen"
|
||||
You can now open code-server from the Home screen, and when you do, you'll be
|
||||
using the PWA. Running code-server as a PWA gets you more screen real estate and
|
||||
access to top-level keyboard shortcuts since its running like a native app.
|
||||
|
||||
Now when you open code-server from the home screen, you will be using the PWA.
|
||||
The advantages of this are more screen real estate and access to top-level keyboard shortcuts because it's running like an app.
|
||||
An example shortcut is the `cmd+w` to close an active file in the workbench. You can add this to your `keybindings.json` by doing the following:
|
||||
For example, you can use `cmd+w` to close an active file in the workbench. You
|
||||
can add this to `keybindings.json`:
|
||||
|
||||
1. Open up code-serer
|
||||
2. `Command Palette > Open Keyboard Shortcuts (JSON)`
|
||||
3. Add the following to your `keybindings.json`
|
||||
1. Open code-server
|
||||
2. Go to **Command Palette** > **Open Keyboard Shortcuts (JSON)**
|
||||
3. Add the following to `keybindings.json`
|
||||
|
||||
```json
|
||||
{
|
||||
"key": "cmd+w",
|
||||
"command": "workbench.action.closeActiveEditor"
|
||||
}
|
||||
```
|
||||
```json
|
||||
{
|
||||
"key": "cmd+w",
|
||||
"command": "workbench.action.closeActiveEditor"
|
||||
}
|
||||
```
|
||||
|
||||
Test out command by hitting `cmd+w` to close an active file
|
||||
4. Test the command by using `cmd+w` to close an active file.
|
||||
|
||||
## How to access code-server with a self signed certificate on iPad?
|
||||
## Access code-server with a self-signed certificate on an iPad
|
||||
|
||||
Accessing a self signed certificate on iPad isn't as easy as accepting through all
|
||||
the security warnings. Safari will prevent WebSocket connections unless the certificate
|
||||
is installed as a profile on the device.
|
||||
If you've installed code-server and are [running it with a self-signed
|
||||
certificate](./guide.md#using-a-self-signed-certificate), you may see multiple
|
||||
security warnings from Safari. To fix this, you'll need to install the
|
||||
self-signed certificate generated by code-server as a profile on your device (you'll also need to do this to
|
||||
enable WebSocket connections).
|
||||
|
||||
The below assumes you are using the self signed certificate that code-server
|
||||
generates for you. If not, that's fine but you'll have to make sure your certificate
|
||||
abides by the following guidelines from Apple: https://support.apple.com/en-us/HT210176
|
||||
### Certificate requirements
|
||||
|
||||
**note**: Another undocumented requirement we noticed is that the certificate has to have `basicConstraints=CA:true`.
|
||||
- We're assuming that you're using the self-signed certificate code-server
|
||||
generates for you (if not, make sure that your certificate [abides by the
|
||||
guidelines issued by Apple](https://support.apple.com/en-us/HT210176)).
|
||||
- We've noticed that the certificate has to include `basicConstraints=CA:true`.
|
||||
- Your certificate must have a subject alt name that matches the hostname you'll
|
||||
use to access code-server from the iPad. You can pass this name to code-server
|
||||
so that it generates the certificate correctly using `--cert-host`.
|
||||
|
||||
The following instructions assume you have code-server installed and running
|
||||
with a self signed certificate. If not, please first go through [./guide.md](./guide.md)!
|
||||
### Sharing a self-signed certificate with an iPad
|
||||
|
||||
To share a self-signed certificate with an iPad:
|
||||
|
||||
1. Get the location of the certificate code-server generated; code-server prints
|
||||
the certificate's location in its logs:
|
||||
|
||||
```console
|
||||
[2020-10-30T08:55:45.139Z] info - Using generated certificate and key for HTTPS: ~/.local/share/code-server/mymbp_local.crt
|
||||
```
|
||||
|
||||
2. Send the certificate to the iPad, either by emailing it to yourself or using
|
||||
Apple's Airdrop feature.
|
||||
|
||||
3. Open the `*.crt` file so that you're prompted to go into Settings to install.
|
||||
|
||||
4. Go to **Settings** > **General** > **Profile**, and select the profile. Tap **Install**.
|
||||
|
||||
5. Go to **Settings** > **About** > **Certificate Trust Settings** and [enable
|
||||
full trust for your certificate](https://support.apple.com/en-us/HT204477).
|
||||
|
||||
You should be able to access code-server without all of Safari's warnings now.
|
||||
|
||||
**warning**: Your iPad must access code-server via a domain name. It could be local
|
||||
DNS like `mymacbookpro.local` but it must be a domain name. Otherwise Safari will
|
||||
refuse to allow WebSockets to connect.
|
||||
DNS like `mymacbookpro.local`, but it must be a domain name. Otherwise, Safari will
|
||||
not allow WebSockets connections.
|
||||
|
||||
1. Your certificate **must** have a subject alt name that matches the hostname
|
||||
at which you will access code-server from your iPad. You can pass this to code-server
|
||||
so that it generates the certificate correctly with `--cert-host`.
|
||||
2. Share your self signed certificate with the iPad.
|
||||
- code-server will print the location of the certificate it has generated in the logs.
|
||||
## Access code-server using Servediter
|
||||
|
||||
```
|
||||
[2020-10-30T08:55:45.139Z] info - Using generated certificate and key for HTTPS: ~/.local/share/code-server/mymbp_local.crt
|
||||
```
|
||||
If you are unable to get the self-signed certificate working, or you do not have a domain
|
||||
name to use, you can use [Servediter for code-server](https://apps.apple.com/us/app/servediter-for-code-server/id1504491325).
|
||||
|
||||
- You can mail it to yourself or if you have a Mac, it's easiest to just Airdrop to the iPad.
|
||||
> Servediter for code-server is **not** officially supported by the code-server team!
|
||||
|
||||
3. When opening the `*.crt` file, you'll be prompted to go into settings to install.
|
||||
4. Go to `Settings -> General -> Profile`, select the profile and then hit `Install`.
|
||||
- It should say the profile is verified.
|
||||
5. Go to `Settings -> About -> Certificate Trust Settings` and enable full trust for
|
||||
the certificate. [more apple support here](https://support.apple.com/en-us/HT204477)
|
||||
6. Now you can access code-server! 🍻
|
||||
To use Servediter:
|
||||
|
||||
### Servediter iPad App
|
||||
1. Download the app from the App Store.
|
||||
2. When prompted, provide your server information. If you are running a local
|
||||
server or a [Raspberry Pi connected via USB-C](#raspberry-pi-usb-c-network), you will input your settings
|
||||
into **Self Hosted Server**.
|
||||
|
||||
If you are unable to get the self signed certificate working or you do not have a domain
|
||||
name to use, you can use the Servediter iPad App instead!
|
||||
## Raspberry Pi USB-C network
|
||||
|
||||
**note**: This is not an officially supported app by the code-server team!
|
||||
We've heard of users having great success using code-server on an iPad connected
|
||||
to a Raspberry Pi via USB-C (the Raspberry Pi provides both power and direct
|
||||
network access). Setting this up requires you to turn on **Network over USB-C**
|
||||
on the Raspberry Pi, then continuing with code-server as usual on the iPad.
|
||||
|
||||
Download [Serveediter](https://apps.apple.com/us/app/servediter-for-code-server/id1504491325) from the
|
||||
App Store and then input your server information. If you are running a local server or mabye a usb-c
|
||||
connected Raspberry Pi, you will input your settings into "Self Hosted Server".
|
||||
For more information, see:
|
||||
|
||||
## Raspberry Pi USB-C Network
|
||||
|
||||
It is a bit out of scope for this project, however, great success is being reported using iPad on the go with just a single USB-C cable connected to a Raspberry Pi both powering and supplying direct network access. Many support articles already exist but the key steps boil down to turning on Network over USB-C on the Raspberry Pi itself and the rest of the steps are just like getting Code Server running any where else.
|
||||
|
||||
Resources worthy of review:
|
||||
|
||||
- [General intro to Pi as an iPad accessory](https://www.youtube.com/watch?v=IR6sDcKo3V8)
|
||||
- [General introduction to Pi as an iPad
|
||||
accessory](https://www.youtube.com/watch?v=IR6sDcKo3V8)
|
||||
- [iPad with Pi FAQ](https://www.youtube.com/watch?v=SPSlyqo5Q2Q)
|
||||
- [Technical guide to perform the steps](https://www.geeky-gadgets.com/connect-a-raspberry-pi-4-to-an-ipad-pro-21-01-2020/)
|
||||
- [Technical guide to connecting a Raspberry Pi to an
|
||||
iPad](https://www.geeky-gadgets.com/connect-a-raspberry-pi-4-to-an-ipad-pro-21-01-2020/)
|
||||
|
||||
> Here are my keys to success. I bought a 4" touch screen with fan included that attaches as a case to the Pi. I use the touch screen for anytime I have connection issues, otherwise I turn off the Pi screen. I gave my Pi a network name so I can easily connect at home on wifi or when on go with 1 usb-c cable that supplys both power and network connectivity. Lastly, not all usb-c cables are equal and not all will work so try different usb-c cables if you are going mad (confirm over wifi first then move to cable).
|
||||
>
|
||||
> -- <cite>[Acker Apple](http://github.com/ackerapple/)</cite>
|
||||
You may also find the following tips from [Acker
|
||||
Apple](http://github.com/ackerapple/) helpful:
|
||||
|
||||
## Ctrl C Workaround
|
||||
|
||||
There is currently an issue with `ctrl+c` not stopping a running process in the integrated terminal. We have filed an issue upstream and are tracking [here](https://github.com/microsoft/vscode/issues/114009). As a temporary workaround, it works if you manually define the shortcut like so:
|
||||
|
||||
1. Open Command Palette
|
||||
2. Look for "Preferences: Open Keyboard Shortcuts (JSON)"
|
||||
3. Add this:
|
||||
|
||||
```json
|
||||
{
|
||||
"key": "ctrl+c",
|
||||
"command": "workbench.action.terminal.sendSequence",
|
||||
"args": {
|
||||
"text": "\u0003"
|
||||
},
|
||||
"when": "terminalFocus"
|
||||
}
|
||||
```
|
||||
|
||||
Source: [StackOverflow](https://stackoverflow.com/a/52735954/3015595)
|
||||
> Here are my keys to success. I bought a 4" touch screen with fan included that
|
||||
> attaches as a case to the Pi. I use the touch screen for anytime I have
|
||||
> connection issues, otherwise I turn off the Pi screen. I gave my Pi a network
|
||||
> name so I can easily connect at home on wifi or when on go with 1 usb-c cable
|
||||
> that supplys both power and network connectivity. Lastly, not all usb-c cables
|
||||
> are equal and not all will work so try different usb-c cables if you are going
|
||||
> mad (confirm over wifi first then move to cable).
|
||||
|
||||
## Recommendations
|
||||
|
||||
Once you have code-server accessible to your iPad a few things could help save you time:
|
||||
Once you can access code-server on your iPad, you may find the following tips
|
||||
and tricks helpful:
|
||||
|
||||
- Use multi task mode to make code changes and see browser at the same time
|
||||
- Prevents iOs background dropping an App's state if you are full screen switching between code-server and browser
|
||||
- Be sure you are using the debug/terminal that is built into VS Code so that you don’t need another terminal app running
|
||||
- Again, prevents switching between full screen app and losing your view to iOs background app memory management
|
||||
- You should be of a mindset willing to deal and adapt with differences in having an imperfect experience, for the perceived joyful benefits of interacting with your computer in more intuitive ways
|
||||
- Use multi-task mode to make code changes and see the browser at the same time
|
||||
- This prevents the iOS background from dropping an app's state if you are
|
||||
switching between code-server and browser (with both in full-screen)
|
||||
- Be sure you are using the debug/terminal that is built into VS Code so that
|
||||
you don’t need another terminal app running
|
||||
- This also prevents switching between full screen apps and losing your view
|
||||
due to iOS' background app memory management
|
||||
|
||||
## By 2022 iPad coding more desirable on Arm Macs
|
||||
## Known issues
|
||||
|
||||
> This section is generalized opinions intended to inform fellow Apple product consumers of perceived over time changes coming down the line
|
||||
- Getting self-signed certificates to work [is an involved
|
||||
process](#access-code-server-with-a-self-signed-certificate-on-an-ipad)
|
||||
- Keyboard issues:
|
||||
- The keyboard disappear sometimes
|
||||
[#1313](https://github.com/cdr/code-server/issues/1313),
|
||||
[#979](https://github.com/cdr/code-server/issues/979)
|
||||
- Some expectations regarding shortcuts may not be met:
|
||||
- `cmd + n` opens new browser window instead of new file, and it's difficult
|
||||
to set alternative as a workaround
|
||||
- In general, expect to edit your keyboard shortcuts
|
||||
- There's no escape key by default on the Magic Keyboard, so most users set
|
||||
the globe key to be an escape key
|
||||
- Trackpad scrolling does not work
|
||||
([#1455](https://github.com/cdr/code-server/issues/1455))
|
||||
- Bug tracking of a WebKit fix
|
||||
[here](https://bugs.webkit.org/show_bug.cgi?id=210071#c13)
|
||||
- Tracking of [WebKit patch](https://trac.webkit.org/changeset/270712/webkit)
|
||||
- Alternatives:
|
||||
- Install line-jump extension and use keyboard to navigate by jumping large
|
||||
amount of lines
|
||||
- Use touch scrolling
|
||||
- `ctrl+c` does not stop a long-running process in the browser
|
||||
- Tracking upstream issue here:
|
||||
[#114009](https://github.com/microsoft/vscode/issues/114009)
|
||||
- See [workaround](#ctrl-c-workaround)
|
||||
|
||||
The general feeling from overall Apple movements recently, is that the Mac arm processors are in fact helping support the direction of having Macs with touch screens. Many great YouTube videos of interest call out highly suggestive evidence. In the past Apple has hard declared reasons of body fatigue and such as why not to encourage nor further developments on the iPad touch experience mixed with a keyboard/mouse/trackpad. Regardless, products and software have been released further supporting just that very experience.
|
||||
Additionally, see [issues in the code-server repo that are tagged with the iPad
|
||||
label](https://github.com/cdr/code-server/issues?q=is%3Aopen+is%3Aissue+label%3AiPad)
|
||||
for more information.
|
||||
|
||||
The iPad coding experience has been a joy for some of us that are willing to trade an imperfect experience for a uniquely effective focus driven experience. Note worthy, some of us think it's a trashy waste of time. This experience is undoubtably going to get better just by the work that can be seen by all parties, even in our own code-server attempt to make it better.
|
||||
### Workaround for issue with `ctrl+c` not stopping a running process in the terminal
|
||||
|
||||
Lastly, it is note worthy that if you have decided to incorporate a Raspberry Pi into you iPad coding experience, they are Arm processors. You are perfectly lined up with the future of Macs as well.
|
||||
This's currently an issue with `ctrl+c` not stopping a running process in the
|
||||
integrated terminal. We have filed an issue upstream and are tracking
|
||||
[here](https://github.com/microsoft/vscode/issues/114009).
|
||||
|
||||
In the meantime, you can manually define a shortcut as a workaround:
|
||||
|
||||
1. Open the Command Palette
|
||||
2. Look for **Preferences: Open Keyboard Shortcuts (JSON)**
|
||||
3. Add the following snippet:
|
||||
|
||||
```json
|
||||
{
|
||||
"key": "ctrl+c",
|
||||
"command": "workbench.action.terminal.sendSequence",
|
||||
"args": {
|
||||
"text": "\u0003"
|
||||
},
|
||||
"when": "terminalFocus"
|
||||
}
|
||||
```
|
||||
|
||||
_Source: [StackOverflow](https://stackoverflow.com/a/52735954/3015595)_
|
||||
|
||||
38
docs/npm.md
38
docs/npm.md
@@ -2,23 +2,28 @@
|
||||
<!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE -->
|
||||
# npm Install Requirements
|
||||
|
||||
- [Node.js version](#nodejs-version)
|
||||
- [Ubuntu, Debian](#ubuntu-debian)
|
||||
- [Fedora, CentOS, RHEL](#fedora-centos-rhel)
|
||||
- [Alpine](#alpine)
|
||||
- [macOS](#macos)
|
||||
- [FreeBSD](#freebsd)
|
||||
- [Issues with Node.js after version upgrades](#issues-with-nodejs-after-version-upgrades)
|
||||
|
||||
<!-- END doctoc generated TOC please keep comment here to allow auto update -->
|
||||
|
||||
If you're installing the npm module you'll need certain dependencies to build the native modules used by VS Code.
|
||||
If you're installing code-server via `npm`, you'll need to install additional
|
||||
dependencies required to build the native modules used by VS Code. This article
|
||||
includes installing instructions based on your operating system.
|
||||
|
||||
- Node.js: version `>= 12`, `<= 14`
|
||||
## Node.js version
|
||||
|
||||
_Note: the Node.js version requirements are based on the VS Code Node.js requirements. See [here](https://github.com/microsoft/vscode/wiki/How-to-Contribute#prerequisites)._
|
||||
We use the same major version of Node.js shipped with VSCode's Electron,
|
||||
which is currently `14.x`. VS Code also [lists Node.js
|
||||
requirements](https://github.com/microsoft/vscode/wiki/How-to-Contribute#prerequisites).
|
||||
|
||||
Related:
|
||||
|
||||
- [#1633](https://github.com/cdr/code-server/issues/1633)
|
||||
Using other versions of Node.js [may lead to unexpected
|
||||
behavior](https://github.com/cdr/code-server/issues/1633).
|
||||
|
||||
## Ubuntu, Debian
|
||||
|
||||
@@ -55,6 +60,25 @@ xcode-select --install
|
||||
## FreeBSD
|
||||
|
||||
```sh
|
||||
pkg install -y git python npm-node12 yarn-node12 pkgconf
|
||||
pkg install -y git python npm-node14 yarn-node14 pkgconf
|
||||
pkg install -y libinotify
|
||||
```
|
||||
|
||||
## Issues with Node.js after version upgrades
|
||||
|
||||
Occasionally, you may run into issues with Node.js.
|
||||
|
||||
If you install code-server using `yarn` or `npm`, and you upgrade your Node.js
|
||||
version, you may need to reinstall code-server to recompile native modules.
|
||||
Sometimes, you can get around this by navigating into code-server's `lib/vscode`
|
||||
directory and running `npm rebuild` to recompile the modules.
|
||||
|
||||
A step-by-step example of how you might do this is:
|
||||
|
||||
1. Install code-server: `brew install code-server`
|
||||
2. Navigate into the directory: `cd /usr/local/Cellar/code-server/<version>/libexec/lib/vscode/`
|
||||
3. Recompile the native modules: `npm rebuild`
|
||||
4. Restart code-server
|
||||
|
||||
If you need further assistance, post on our [GitHub Discussions
|
||||
page](https://github.com/cdr/code-server/discussions).
|
||||
|
||||
55
docs/requirements.md
Normal file
55
docs/requirements.md
Normal file
@@ -0,0 +1,55 @@
|
||||
# Requirements
|
||||
|
||||
You'll need a machine on which you can run code-server. You can use a physical
|
||||
machine you have, or you can use a VM on GCP/AWS.
|
||||
|
||||
At the minimum, we recommend:
|
||||
|
||||
- 1 GB of RAM
|
||||
- 2 CPU cores
|
||||
|
||||
You can use any Linux distribution, but [our
|
||||
docs](https://coder.com/docs/code-server/v3.11.0/guide) assume that you're using
|
||||
Debian hosted by Google Cloud (see the following section for instructions on
|
||||
setting this up).
|
||||
|
||||
Your environment must have WebSockets enabled, since code-server uses WebSockets
|
||||
for communication between the browser and the server.
|
||||
|
||||
## Set up a VM on Google Cloud
|
||||
|
||||
The following steps walk you through setting up a VM running Debian using Google
|
||||
Cloud (though you are welcome to use any machine or VM provider).
|
||||
|
||||
If you're [signing up with Google](https://console.cloud.google.com/getting-started) for the first time, you should get a 12-month trial with
|
||||
$300 of credits.
|
||||
|
||||
After you sign up and create a new Google Cloud Provider (GCP) project, create a
|
||||
new Compute Engine VM instance:
|
||||
|
||||
1. Using the sidebar, navigate to **Compute Engine** > **VM Instances**.
|
||||
2. Click **Create Instance**.
|
||||
3. Provide a **name** for new instance.
|
||||
4. Choose the **region** that's closest to you based on [GCP
|
||||
ping](https://gcping.com/).
|
||||
5. Choose a **zone** (any option is fine).
|
||||
6. We recommend choose an **E2 series instance** from the [general-purpose
|
||||
family](https://cloud.google.com/compute/docs/machine-types#general_purpose).
|
||||
7. Change the instance type to **custom** and set at least **2 cores** and **2
|
||||
GB of RAM**. You can add more resources if desired, though you can also edit
|
||||
your instance at a later point.
|
||||
8. Though optional, we highly recommend switching the persistent disk to an SSD
|
||||
with at least 32 GB. To do so, click **change** under **Boot Disk**. Then,
|
||||
change the type to **SSD Persistent Disk**, and set the size to **32**. (You
|
||||
can also grow your disk at a later date).
|
||||
9. Go to **Networking** > **Networking Interfaces** and edit the existing
|
||||
interface to use a static internal IP. Click **Done** to save.
|
||||
10. If you don't have a [project-wide SSH
|
||||
key](https://cloud.google.com/compute/docs/instances/adding-removing-ssh-keys#project-wide),
|
||||
go to **Security** > **SSH Keys** to add your public key.
|
||||
11. Click **Create** to proceed.
|
||||
|
||||
Notes:
|
||||
|
||||
- To lower costs, you can shut down your server when you're not using it.
|
||||
- We recommend using the `gcloud cli` to avoid using the GCP Dashboard if possible.
|
||||
@@ -2,60 +2,70 @@
|
||||
<!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE -->
|
||||
# Termux
|
||||
|
||||
- [Termux](#termux)
|
||||
- [Installation](#installation)
|
||||
- [Upgrading](#upgrading)
|
||||
- [Known Issues](#known-issues)
|
||||
- [Search issue](#search-issue)
|
||||
- [Backspace not working](#backspace-not-working)
|
||||
- [Install](#install)
|
||||
- [Upgrade](#upgrade)
|
||||
- [Known Issues](#known-issues)
|
||||
- [Search doesn't work](#search-doesnt-work)
|
||||
- [Backspace doesn't work](#backspace-doesnt-work)
|
||||
|
||||
<!-- END doctoc generated TOC please keep comment here to allow auto update -->
|
||||
|
||||
# Termux
|
||||
Termux is a terminal application and Linux environment that you can also use to
|
||||
run code-server from your Android phone.
|
||||
|
||||
Termux is an Android terminal application and Linux environment, which can also run code-server from your phone.
|
||||
## Install
|
||||
|
||||
## Installation
|
||||
1. Install Termux from [F-Droid](https://f-droid.org/en/packages/com.termux/).
|
||||
1. Make sure it's up-to-date: `apt update && apt upgrade`
|
||||
1. Install required packages: `apt install build-essential python git nodejs yarn`
|
||||
1. Install code-server: `yarn global add code-server`
|
||||
1. Run code-server: `code-server` and navigate to localhost:8080 in your browser
|
||||
|
||||
1. Install Termux from the [Google Play Store](https://play.google.com/store/apps/details?id=com.termux)
|
||||
2. Make sure it's up-to-date by running `apt update && apt upgrade`
|
||||
3. Install required packages: `apt install build-essential python git nodejs yarn`
|
||||
4. Install code-server: `yarn global add code-server`
|
||||
5. Run code-server: `code-server` and navigate to localhost:8080 in your browser
|
||||
|
||||
## Upgrading
|
||||
## Upgrade
|
||||
|
||||
To upgrade run: `yarn global upgrade code-server --latest`
|
||||
|
||||
## Known Issues
|
||||
|
||||
### Search issue
|
||||
The following details known issues and suggested workarounds for using
|
||||
code-server with Termux.
|
||||
|
||||
There is a known issue with search not working on Android because it's missing `bin/rg`. To fix:
|
||||
### Search doesn't work
|
||||
|
||||
There is a known issue with search not working on Android because it's missing
|
||||
`bin/rg` ([context](https://github.com/cdr/code-server/issues/1730#issuecomment-721515979)). To fix this:
|
||||
|
||||
1. Install `ripgrep` with `pkg`
|
||||
|
||||
```sh
|
||||
pkg install ripgrep
|
||||
```
|
||||
2. Make a soft link using `ln -s`
|
||||
|
||||
```sh
|
||||
# run this command inside the code-server directory
|
||||
ln -s $PREFIX/bin/rg ./lib/vscode/node_modules/vscode-ripgrep/bin/rg
|
||||
```
|
||||
1. Make a soft link using `ln -s`
|
||||
|
||||
For more context, see [comment](https://github.com/cdr/code-server/issues/1730#issuecomment-721515979).
|
||||
```sh
|
||||
# run this command inside the code-server directory
|
||||
ln -s $PREFIX/bin/rg ./lib/vscode/node_modules/vscode-ripgrep/bin/rg
|
||||
```
|
||||
|
||||
### Backspace not working
|
||||
### Backspace doesn't work
|
||||
|
||||
There is a known issue with the backspace key not working correctly when using the on-screen keyboard on Android. This is due to an upstream issue. Read more:
|
||||
When using Android's on-screen keyboard, the backspace key doesn't work
|
||||
properly. This is a known upstream issue:
|
||||
|
||||
- [Issues with Backspace in Codespaces on Android (Surface Duo)](https://github.com/microsoft/vscode/issues/107602)
|
||||
- [Issues with backspace in Codespaces on Android (Surface Duo)](https://github.com/microsoft/vscode/issues/107602)
|
||||
- [Support mobile platforms](https://github.com/xtermjs/xterm.js/issues/1101)
|
||||
|
||||
Workaround: use a Bluetooth keyboard.
|
||||
There are two workarounds.
|
||||
|
||||
For more context, see issues:
|
||||
**Option 1:** Modify keyboard dispatch settings
|
||||
|
||||
- [500 error: 3.9.2 not working on Android + Termux](https://github.com/cdr/code-server/issues/3036)
|
||||
- [Document Android backspace issue](https://github.com/cdr/code-server/issues/3079)
|
||||
1. Open the Command Palette
|
||||
2. Search for **Preferences: Open Settings (JSON)**
|
||||
3. Add `"keyboard.dispatch": "keyCode"`
|
||||
|
||||
The backspace button should work at this point.
|
||||
|
||||
_Thanks to @Nefomemes for the [suggestion](https://github.com/cdr/code-server/issues/1141#issuecomment-789463707)!_
|
||||
|
||||
**Option 2:** Use a Bluetooth keyboard.
|
||||
|
||||
@@ -1,37 +1,35 @@
|
||||
# Triage
|
||||
|
||||
## Filter
|
||||
|
||||
Triaging code-server issues is done with the following issue filter:
|
||||
|
||||
```
|
||||
```text
|
||||
is:issue is:open no:project sort:created-asc -label:blocked -label:upstream -label:waiting-for-info -label:extension-request
|
||||
```
|
||||
|
||||
This will show issues that:
|
||||
|
||||
1. Are open.
|
||||
2. Have no assigned project.
|
||||
3. Are not `blocked` or tagged for work by `upstream` (VS Code core team)
|
||||
- If an upstream issue is detrimental to the code-server experience we may fix it in
|
||||
our patch instead of waiting for the VS Code team to fix it.
|
||||
- Someone should periodically go through these issues to see if they can be unblocked
|
||||
though!
|
||||
4. Are not in `waiting-for-info`.
|
||||
5. Are not extension requests.
|
||||
1. Have no assigned project.
|
||||
1. Are not `blocked` or tagged for work by `upstream` (the VS Code core team).
|
||||
If an upstream issue is detrimental to the code-server experience we may fix
|
||||
it in our patch instead of waiting for the VS Code team to fix it. Someone
|
||||
should periodically go through these issues to see if they can be unblocked!
|
||||
1. Are not labeled `waiting-for-info`.
|
||||
1. Are not extension requests.
|
||||
|
||||
## Process
|
||||
## Triage process
|
||||
|
||||
1. If an issue is a question/discussion it should be converted into a GitHub discussion.
|
||||
2. Next, give the issue the appropriate labels and feel free to create new ones if
|
||||
necessary.
|
||||
- There are no hard and set rules for labels. We don't have many so look through and
|
||||
see how they've been used throughout the repository. They all also have descriptions.
|
||||
3. If more information is required, please ask the submitter and tag as
|
||||
1. If an issue is a question/discussion, it should be converted into a GitHub
|
||||
discussion.
|
||||
1. Otherwise, give the issue the appropriate labels (feel free to create new
|
||||
ones if necessary). There are no hard and set rules for labels. We don't have
|
||||
many so look through and see how they've been used throughout the repository.
|
||||
They all also have descriptions.
|
||||
1. If more information is required, please ask the submitter and tag as
|
||||
`waiting-for-info` and wait.
|
||||
4. Finally, the issue should be moved into the
|
||||
[code-server](https://github.com/cdr/code-server/projects/1) project where we pick
|
||||
out issues to fix and track their progress.
|
||||
1. Finally, the issue should be moved into the
|
||||
[code-server](https://github.com/cdr/code-server/projects/1) project where we
|
||||
pick out issues to fix and track their progress.
|
||||
|
||||
We also use [milestones](https://github.com/cdr/code-server/milestones) to track what
|
||||
issues are planned/or were closed for what release.
|
||||
We also use [milestones](https://github.com/cdr/code-server/milestones) to track
|
||||
what issues are planned/or were closed for what release.
|
||||
|
||||
5
docs/upgrade.md
Normal file
5
docs/upgrade.md
Normal file
@@ -0,0 +1,5 @@
|
||||
# Upgrade
|
||||
|
||||
To upgrade code-server, install the new version over the old version. All user
|
||||
data is in `~/.local/share/code-server`, so they are preserved between
|
||||
installations.
|
||||
454
install.sh
454
install.sh
@@ -2,7 +2,7 @@
|
||||
set -eu
|
||||
|
||||
# code-server's automatic install script.
|
||||
# See https://github.com/cdr/code-server/blob/main/docs/install.md
|
||||
# See https://coder.com/docs/code-server/v3.11.0/install
|
||||
|
||||
usage() {
|
||||
arg0="$0"
|
||||
@@ -13,8 +13,8 @@ usage() {
|
||||
"
|
||||
fi
|
||||
|
||||
cath <<EOF
|
||||
Installs code-server for Linux, macOS and FreeBSD.
|
||||
cath << EOF
|
||||
Installs code-server.
|
||||
It tries to use the system package manager if possible.
|
||||
After successful installation it explains how to start using code-server.
|
||||
|
||||
@@ -48,26 +48,25 @@ Usage:
|
||||
--rsh <bin>
|
||||
Specifies the remote shell for remote installation. Defaults to ssh.
|
||||
|
||||
- For Debian, Ubuntu and Raspbian it will install the latest deb package.
|
||||
- For Fedora, CentOS, RHEL and openSUSE it will install the latest rpm package.
|
||||
- For Arch Linux it will install the AUR package.
|
||||
- For any unrecognized Linux operating system it will install the latest standalone
|
||||
release into ~/.local
|
||||
The detection method works as follows:
|
||||
- Debian, Ubuntu, Raspbian: install the deb package from GitHub.
|
||||
- Fedora, CentOS, RHEL, openSUSE: install the rpm package from GitHub.
|
||||
- Arch Linux: install from the AUR (which pulls releases from GitHub).
|
||||
- FreeBSD, Alpine: install from yarn/npm.
|
||||
- macOS: install using Homebrew if installed otherwise install from GitHub.
|
||||
- All others: install the release from GitHub.
|
||||
|
||||
- For macOS it will install the Homebrew package.
|
||||
- If Homebrew is not installed it will install the latest standalone release
|
||||
into ~/.local
|
||||
We only build releases on GitHub for amd64 and arm64 on Linux and amd64 for
|
||||
macOS. When the detection method tries to pull a release from GitHub it will
|
||||
fall back to installing from npm when there is no matching release for the
|
||||
system's operating system and architecture.
|
||||
|
||||
- For FreeBSD, it will install the npm package with yarn or npm.
|
||||
The standalone method will force installion using GitHub releases. It will not
|
||||
fall back to npm so on architectures without pre-built releases this will error.
|
||||
|
||||
- If ran on an architecture with no releases, it will install the
|
||||
npm package with yarn or npm.
|
||||
- We only have releases for amd64 and arm64 presently.
|
||||
- The npm package builds the native modules on postinstall.
|
||||
The installer will cache all downloaded assets into ~/.cache/code-server
|
||||
|
||||
It will cache all downloaded assets into ~/.cache/code-server
|
||||
|
||||
More installation docs are at https://github.com/cdr/code-server/blob/main/docs/install.md
|
||||
More installation docs are at https://coder.com/docs/code-server/v3.11.0/install
|
||||
EOF
|
||||
}
|
||||
|
||||
@@ -81,29 +80,43 @@ echo_latest_version() {
|
||||
|
||||
echo_npm_postinstall() {
|
||||
echoh
|
||||
cath <<EOF
|
||||
The npm package has been installed successfully!
|
||||
Please extend your path to use code-server:
|
||||
cath << EOF
|
||||
npm package has been installed.
|
||||
|
||||
Extend your path to use code-server:
|
||||
PATH="$NPM_BIN_DIR:\$PATH"
|
||||
Please run with:
|
||||
Then run with:
|
||||
code-server
|
||||
EOF
|
||||
}
|
||||
|
||||
echo_standalone_postinstall() {
|
||||
echoh
|
||||
cath <<EOF
|
||||
cath << EOF
|
||||
Standalone release has been installed into $STANDALONE_INSTALL_PREFIX/lib/code-server-$VERSION
|
||||
Please extend your path to use code-server:
|
||||
|
||||
Extend your path to use code-server:
|
||||
PATH="$STANDALONE_INSTALL_PREFIX/bin:\$PATH"
|
||||
Then you can run:
|
||||
Then run with:
|
||||
code-server
|
||||
EOF
|
||||
}
|
||||
|
||||
echo_brew_postinstall() {
|
||||
echoh
|
||||
cath << EOF
|
||||
Brew release has been installed.
|
||||
|
||||
Run with:
|
||||
code-server
|
||||
EOF
|
||||
}
|
||||
|
||||
echo_systemd_postinstall() {
|
||||
echoh
|
||||
cath <<EOF
|
||||
cath << EOF
|
||||
$1 package has been installed.
|
||||
|
||||
To have systemd start code-server now and restart on boot:
|
||||
sudo systemctl enable --now code-server@\$USER
|
||||
Or, if you don't want/need a background service you can run:
|
||||
@@ -119,8 +132,6 @@ main() {
|
||||
unset \
|
||||
DRY_RUN \
|
||||
METHOD \
|
||||
STANDALONE_INSTALL_PREFIX \
|
||||
VERSION \
|
||||
OPTIONAL \
|
||||
ALL_FLAGS \
|
||||
RSH_ARGS \
|
||||
@@ -129,63 +140,63 @@ main() {
|
||||
ALL_FLAGS=""
|
||||
while [ "$#" -gt 0 ]; do
|
||||
case "$1" in
|
||||
-*)
|
||||
ALL_FLAGS="${ALL_FLAGS} $1"
|
||||
;;
|
||||
-*)
|
||||
ALL_FLAGS="${ALL_FLAGS} $1"
|
||||
;;
|
||||
esac
|
||||
|
||||
case "$1" in
|
||||
--dry-run)
|
||||
DRY_RUN=1
|
||||
;;
|
||||
--method)
|
||||
METHOD="$(parse_arg "$@")"
|
||||
shift
|
||||
;;
|
||||
--method=*)
|
||||
METHOD="$(parse_arg "$@")"
|
||||
;;
|
||||
--prefix)
|
||||
STANDALONE_INSTALL_PREFIX="$(parse_arg "$@")"
|
||||
shift
|
||||
;;
|
||||
--prefix=*)
|
||||
STANDALONE_INSTALL_PREFIX="$(parse_arg "$@")"
|
||||
;;
|
||||
--version)
|
||||
VERSION="$(parse_arg "$@")"
|
||||
shift
|
||||
;;
|
||||
--version=*)
|
||||
VERSION="$(parse_arg "$@")"
|
||||
;;
|
||||
--rsh)
|
||||
RSH="$(parse_arg "$@")"
|
||||
shift
|
||||
;;
|
||||
--rsh=*)
|
||||
RSH="$(parse_arg "$@")"
|
||||
;;
|
||||
-h | --h | -help | --help)
|
||||
usage
|
||||
exit 0
|
||||
;;
|
||||
--)
|
||||
shift
|
||||
# We remove the -- added above.
|
||||
ALL_FLAGS="${ALL_FLAGS% --}"
|
||||
RSH_ARGS="$*"
|
||||
break
|
||||
;;
|
||||
-*)
|
||||
echoerr "Unknown flag $1"
|
||||
echoerr "Run with --help to see usage."
|
||||
exit 1
|
||||
;;
|
||||
*)
|
||||
RSH_ARGS="$*"
|
||||
break
|
||||
;;
|
||||
--dry-run)
|
||||
DRY_RUN=1
|
||||
;;
|
||||
--method)
|
||||
METHOD="$(parse_arg "$@")"
|
||||
shift
|
||||
;;
|
||||
--method=*)
|
||||
METHOD="$(parse_arg "$@")"
|
||||
;;
|
||||
--prefix)
|
||||
STANDALONE_INSTALL_PREFIX="$(parse_arg "$@")"
|
||||
shift
|
||||
;;
|
||||
--prefix=*)
|
||||
STANDALONE_INSTALL_PREFIX="$(parse_arg "$@")"
|
||||
;;
|
||||
--version)
|
||||
VERSION="$(parse_arg "$@")"
|
||||
shift
|
||||
;;
|
||||
--version=*)
|
||||
VERSION="$(parse_arg "$@")"
|
||||
;;
|
||||
--rsh)
|
||||
RSH="$(parse_arg "$@")"
|
||||
shift
|
||||
;;
|
||||
--rsh=*)
|
||||
RSH="$(parse_arg "$@")"
|
||||
;;
|
||||
-h | --h | -help | --help)
|
||||
usage
|
||||
exit 0
|
||||
;;
|
||||
--)
|
||||
shift
|
||||
# We remove the -- added above.
|
||||
ALL_FLAGS="${ALL_FLAGS% --}"
|
||||
RSH_ARGS="$*"
|
||||
break
|
||||
;;
|
||||
-*)
|
||||
echoerr "Unknown flag $1"
|
||||
echoerr "Run with --help to see usage."
|
||||
exit 1
|
||||
;;
|
||||
*)
|
||||
RSH_ARGS="$*"
|
||||
break
|
||||
;;
|
||||
esac
|
||||
|
||||
shift
|
||||
@@ -198,102 +209,103 @@ main() {
|
||||
return
|
||||
fi
|
||||
|
||||
VERSION="${VERSION-$(echo_latest_version)}"
|
||||
METHOD="${METHOD-detect}"
|
||||
if [ "$METHOD" != detect ] && [ "$METHOD" != standalone ]; then
|
||||
echoerr "Unknown install method \"$METHOD\""
|
||||
echoerr "Run with --help to see usage."
|
||||
exit 1
|
||||
fi
|
||||
STANDALONE_INSTALL_PREFIX="${STANDALONE_INSTALL_PREFIX-$HOME/.local}"
|
||||
|
||||
OS="$(os)"
|
||||
if [ ! "$OS" ]; then
|
||||
echoerr "Unsupported OS $(uname)."
|
||||
exit 1
|
||||
fi
|
||||
# These are used by the various install_* functions that make use of GitHub
|
||||
# releases in order to download and unpack the right release.
|
||||
CACHE_DIR=$(echo_cache_dir)
|
||||
STANDALONE_INSTALL_PREFIX=${STANDALONE_INSTALL_PREFIX:-$HOME/.local}
|
||||
VERSION=${VERSION:-$(echo_latest_version)}
|
||||
# These can be overridden for testing but shouldn't normally be used as it can
|
||||
# result in a broken code-server.
|
||||
OS=${OS:-$(os)}
|
||||
ARCH=${ARCH:-$(arch)}
|
||||
|
||||
distro_name
|
||||
|
||||
ARCH="$(arch)"
|
||||
if [ ! "$ARCH" ]; then
|
||||
if [ "$METHOD" = standalone ]; then
|
||||
echoerr "No precompiled releases for $(uname -m)."
|
||||
echoerr 'Please rerun without the "--method standalone" flag to install from npm.'
|
||||
exit 1
|
||||
fi
|
||||
echoh "No precompiled releases for $(uname -m)."
|
||||
install_npm
|
||||
return
|
||||
fi
|
||||
|
||||
if [ "$OS" = "freebsd" ]; then
|
||||
if [ "$METHOD" = standalone ]; then
|
||||
echoerr "No precompiled releases available for $OS."
|
||||
echoerr 'Please rerun without the "--method standalone" flag to install from npm.'
|
||||
exit 1
|
||||
fi
|
||||
echoh "No precompiled releases available for $OS."
|
||||
install_npm
|
||||
return
|
||||
fi
|
||||
|
||||
CACHE_DIR="$(echo_cache_dir)"
|
||||
|
||||
# Standalone installs by pulling pre-built releases from GitHub.
|
||||
if [ "$METHOD" = standalone ]; then
|
||||
install_standalone
|
||||
return
|
||||
if has_standalone; then
|
||||
install_standalone
|
||||
exit 0
|
||||
else
|
||||
echoerr "There are no standalone releases for $ARCH"
|
||||
echoerr "Please try again without '--method standalone'"
|
||||
exit 1
|
||||
fi
|
||||
fi
|
||||
|
||||
case "$(distro)" in
|
||||
macos)
|
||||
install_macos
|
||||
;;
|
||||
debian)
|
||||
install_deb
|
||||
;;
|
||||
fedora | opensuse)
|
||||
install_rpm
|
||||
;;
|
||||
arch)
|
||||
install_aur
|
||||
;;
|
||||
*)
|
||||
echoh "Unsupported package manager."
|
||||
install_standalone
|
||||
;;
|
||||
# DISTRO can be overridden for testing but shouldn't normally be used as it
|
||||
# can result in a broken code-server.
|
||||
DISTRO=${DISTRO:-$(distro)}
|
||||
|
||||
case $DISTRO in
|
||||
# macOS uses brew when available and falls back to standalone. We only have
|
||||
# amd64 for macOS so for anything else use npm.
|
||||
macos)
|
||||
BREW_PATH="${BREW_PATH-brew}"
|
||||
if command_exists "$BREW_PATH"; then
|
||||
install_brew
|
||||
else
|
||||
echoh "Homebrew not installed."
|
||||
echoh "Falling back to standalone installation."
|
||||
npm_fallback install_standalone
|
||||
fi
|
||||
;;
|
||||
# The .deb and .rpm files are pulled from GitHub and we only have amd64 and
|
||||
# arm64 there and need to fall back to npm otherwise.
|
||||
debian) npm_fallback install_deb ;;
|
||||
fedora | opensuse) npm_fallback install_rpm ;;
|
||||
# Arch uses the AUR package which only supports amd64 and arm64 since it
|
||||
# pulls releases from GitHub so we need to fall back to npm.
|
||||
arch) npm_fallback install_aur ;;
|
||||
# We don't have GitHub releases that work on Alpine or FreeBSD so we have no
|
||||
# choice but to use npm here.
|
||||
alpine | freebsd) install_npm ;;
|
||||
# For anything else we'll try to install standalone but fall back to npm if
|
||||
# we don't have releases for the architecture.
|
||||
*)
|
||||
echoh "Unsupported package manager."
|
||||
echoh "Falling back to standalone installation."
|
||||
npm_fallback install_standalone
|
||||
;;
|
||||
esac
|
||||
}
|
||||
|
||||
parse_arg() {
|
||||
case "$1" in
|
||||
*=*)
|
||||
# Remove everything after first equal sign.
|
||||
opt="${1%%=*}"
|
||||
# Remove everything before first equal sign.
|
||||
optarg="${1#*=}"
|
||||
if [ ! "$optarg" ] && [ ! "${OPTIONAL-}" ]; then
|
||||
echoerr "$opt requires an argument"
|
||||
echoerr "Run with --help to see usage."
|
||||
exit 1
|
||||
fi
|
||||
echo "$optarg"
|
||||
return
|
||||
;;
|
||||
*=*)
|
||||
# Remove everything after first equal sign.
|
||||
opt="${1%%=*}"
|
||||
# Remove everything before first equal sign.
|
||||
optarg="${1#*=}"
|
||||
if [ ! "$optarg" ] && [ ! "${OPTIONAL-}" ]; then
|
||||
echoerr "$opt requires an argument"
|
||||
echoerr "Run with --help to see usage."
|
||||
exit 1
|
||||
fi
|
||||
echo "$optarg"
|
||||
return
|
||||
;;
|
||||
esac
|
||||
|
||||
case "${2-}" in
|
||||
"" | -*)
|
||||
if [ ! "${OPTIONAL-}" ]; then
|
||||
echoerr "$1 requires an argument"
|
||||
echoerr "Run with --help to see usage."
|
||||
exit 1
|
||||
fi
|
||||
;;
|
||||
*)
|
||||
echo "$2"
|
||||
return
|
||||
;;
|
||||
"" | -*)
|
||||
if [ ! "${OPTIONAL-}" ]; then
|
||||
echoerr "$1 requires an argument"
|
||||
echoerr "Run with --help to see usage."
|
||||
exit 1
|
||||
fi
|
||||
;;
|
||||
*)
|
||||
echo "$2"
|
||||
return
|
||||
;;
|
||||
esac
|
||||
}
|
||||
|
||||
@@ -315,45 +327,39 @@ fetch() {
|
||||
sh_c mv "$FILE.incomplete" "$FILE"
|
||||
}
|
||||
|
||||
install_macos() {
|
||||
if command_exists brew; then
|
||||
echoh "Installing from Homebrew."
|
||||
echoh
|
||||
install_brew() {
|
||||
echoh "Installing latest from Homebrew."
|
||||
echoh
|
||||
|
||||
sh_c brew install code-server
|
||||
sh_c "$BREW_PATH" install code-server
|
||||
|
||||
return
|
||||
fi
|
||||
|
||||
echoh "Homebrew not installed."
|
||||
|
||||
install_standalone
|
||||
echo_brew_postinstall
|
||||
}
|
||||
|
||||
install_deb() {
|
||||
echoh "Installing v$VERSION deb package from GitHub releases."
|
||||
echoh "Installing v$VERSION of the $ARCH deb package from GitHub."
|
||||
echoh
|
||||
|
||||
fetch "https://github.com/cdr/code-server/releases/download/v$VERSION/code-server_${VERSION}_$ARCH.deb" \
|
||||
"$CACHE_DIR/code-server_${VERSION}_$ARCH.deb"
|
||||
sudo_sh_c dpkg -i "$CACHE_DIR/code-server_${VERSION}_$ARCH.deb"
|
||||
|
||||
echo_systemd_postinstall
|
||||
echo_systemd_postinstall deb
|
||||
}
|
||||
|
||||
install_rpm() {
|
||||
echoh "Installing v$VERSION rpm package from GitHub releases."
|
||||
echoh "Installing v$VERSION of the $ARCH rpm package from GitHub."
|
||||
echoh
|
||||
|
||||
fetch "https://github.com/cdr/code-server/releases/download/v$VERSION/code-server-$VERSION-$ARCH.rpm" \
|
||||
"$CACHE_DIR/code-server-$VERSION-$ARCH.rpm"
|
||||
sudo_sh_c rpm -i "$CACHE_DIR/code-server-$VERSION-$ARCH.rpm"
|
||||
|
||||
echo_systemd_postinstall
|
||||
echo_systemd_postinstall rpm
|
||||
}
|
||||
|
||||
install_aur() {
|
||||
echoh "Installing from the AUR."
|
||||
echoh "Installing latest from the AUR."
|
||||
echoh
|
||||
|
||||
sh_c mkdir -p "$CACHE_DIR/code-server-aur"
|
||||
@@ -364,16 +370,20 @@ install_aur() {
|
||||
fi
|
||||
sh_c makepkg -si
|
||||
|
||||
echo_systemd_postinstall
|
||||
echo_systemd_postinstall AUR
|
||||
}
|
||||
|
||||
install_standalone() {
|
||||
echoh "Installing standalone release archive v$VERSION from GitHub releases."
|
||||
echoh "Installing v$VERSION of the $ARCH release from GitHub."
|
||||
echoh
|
||||
|
||||
fetch "https://github.com/cdr/code-server/releases/download/v$VERSION/code-server-$VERSION-$OS-$ARCH.tar.gz" \
|
||||
"$CACHE_DIR/code-server-$VERSION-$OS-$ARCH.tar.gz"
|
||||
|
||||
# -w only works if the directory exists so try creating it first. If this
|
||||
# fails we can ignore the error as the -w check will then swap us to sudo.
|
||||
sh_c mkdir -p "$STANDALONE_INSTALL_PREFIX" 2> /dev/null || true
|
||||
|
||||
sh_c="sh_c"
|
||||
if [ ! -w "$STANDALONE_INSTALL_PREFIX" ]; then
|
||||
sh_c="sudo_sh_c"
|
||||
@@ -395,50 +405,74 @@ install_standalone() {
|
||||
}
|
||||
|
||||
install_npm() {
|
||||
if command_exists yarn; then
|
||||
echoh "Installing latest from npm."
|
||||
echoh
|
||||
|
||||
YARN_PATH="${YARN_PATH-yarn}"
|
||||
NPM_PATH="${YARN_PATH-npm}"
|
||||
if command_exists "$YARN_PATH"; then
|
||||
sh_c="sh_c"
|
||||
if [ ! -w "$(yarn global bin)" ]; then
|
||||
if [ ! "${DRY_RUN-}" ] && [ ! -w "$($YARN_PATH global bin)" ]; then
|
||||
sh_c="sudo_sh_c"
|
||||
fi
|
||||
echoh "Installing with yarn."
|
||||
echoh
|
||||
"$sh_c" yarn global add code-server --unsafe-perm
|
||||
NPM_BIN_DIR="$(yarn global bin)" echo_npm_postinstall
|
||||
"$sh_c" "$YARN_PATH" global add code-server --unsafe-perm
|
||||
NPM_BIN_DIR="\$($YARN_PATH global bin)" echo_npm_postinstall
|
||||
return
|
||||
elif command_exists npm; then
|
||||
elif command_exists "$NPM_PATH"; then
|
||||
sh_c="sh_c"
|
||||
if [ ! -w "$(npm config get prefix)" ]; then
|
||||
if [ ! "${DRY_RUN-}" ] && [ ! -w "$(NPM_PATH config get prefix)" ]; then
|
||||
sh_c="sudo_sh_c"
|
||||
fi
|
||||
echoh "Installing with npm."
|
||||
echoh
|
||||
"$sh_c" npm install -g code-server --unsafe-perm
|
||||
NPM_BIN_DIR="$(npm bin -g)" echo_npm_postinstall
|
||||
"$sh_c" "$NPM_PATH" install -g code-server --unsafe-perm
|
||||
NPM_BIN_DIR="\$($NPM_PATH bin -g)" echo_npm_postinstall
|
||||
return
|
||||
fi
|
||||
echoh
|
||||
echoerr "Please install npm or yarn to install code-server!"
|
||||
echoerr "You will need at least node v12 and a few C dependencies."
|
||||
echoerr "See the docs https://github.com/cdr/code-server/blob/v3.10.0/docs/install.md#yarn-npm"
|
||||
echoerr "See the docs https://coder.com/docs/code-server/v3.11.0/install#yarn-npm"
|
||||
|
||||
exit 1
|
||||
}
|
||||
|
||||
os() {
|
||||
case "$(uname)" in
|
||||
Linux)
|
||||
echo linux
|
||||
;;
|
||||
Darwin)
|
||||
echo macos
|
||||
;;
|
||||
FreeBSD)
|
||||
echo freebsd
|
||||
;;
|
||||
# Run $1 if we have a standalone otherwise run install_npm.
|
||||
npm_fallback() {
|
||||
if has_standalone; then
|
||||
$1
|
||||
else
|
||||
echoh "No standalone releases for $ARCH."
|
||||
echoh "Falling back to installation from npm."
|
||||
install_npm
|
||||
fi
|
||||
}
|
||||
|
||||
# Determine if we have standalone releases on GitHub for the system's arch.
|
||||
has_standalone() {
|
||||
case $ARCH in
|
||||
amd64) return 0 ;;
|
||||
# We only have amd64 for macOS.
|
||||
arm64)
|
||||
[ "$(distro)" != macos ]
|
||||
return
|
||||
;;
|
||||
*) return 1 ;;
|
||||
esac
|
||||
}
|
||||
|
||||
# distro prints the detected operating system including linux distros.
|
||||
# Also parses ID_LIKE for common distro bases.
|
||||
os() {
|
||||
uname="$(uname)"
|
||||
case $uname in
|
||||
Linux) echo linux ;;
|
||||
Darwin) echo macos ;;
|
||||
FreeBSD) echo freebsd ;;
|
||||
*) echo "$uname" ;;
|
||||
esac
|
||||
}
|
||||
|
||||
# Print the detected Linux distro, otherwise print the OS name.
|
||||
#
|
||||
# Example outputs:
|
||||
# - macos -> macos
|
||||
@@ -475,7 +509,7 @@ distro() {
|
||||
fi
|
||||
}
|
||||
|
||||
# os_name prints a pretty human readable name for the OS/Distro.
|
||||
# Print a human-readable name for the OS/distro.
|
||||
distro_name() {
|
||||
if [ "$(uname)" = "Darwin" ]; then
|
||||
echo "macOS v$(sw_vers -productVersion)"
|
||||
@@ -495,21 +529,17 @@ distro_name() {
|
||||
}
|
||||
|
||||
arch() {
|
||||
case "$(uname -m)" in
|
||||
aarch64)
|
||||
echo arm64
|
||||
;;
|
||||
x86_64)
|
||||
echo amd64
|
||||
;;
|
||||
amd64) # FreeBSD.
|
||||
echo amd64
|
||||
;;
|
||||
uname_m=$(uname -m)
|
||||
case $uname_m in
|
||||
aarch64) echo arm64 ;;
|
||||
x86_64) echo amd64 ;;
|
||||
*) echo "$uname_m" ;;
|
||||
esac
|
||||
}
|
||||
|
||||
command_exists() {
|
||||
command -v "$@" >/dev/null
|
||||
if [ ! "$1" ]; then return 1; fi
|
||||
command -v "$@" > /dev/null
|
||||
}
|
||||
|
||||
sh_c() {
|
||||
@@ -571,7 +601,7 @@ prefix() {
|
||||
fifo="$(mktemp -d)/fifo"
|
||||
mkfifo "$fifo"
|
||||
sed -e "s#^#$PREFIX: #" "$fifo" &
|
||||
"$@" >"$fifo" 2>&1
|
||||
"$@" > "$fifo" 2>&1
|
||||
}
|
||||
|
||||
main "$@"
|
||||
|
||||
@@ -1,14 +1,14 @@
|
||||
# Code - OSS Development Container
|
||||
|
||||
This repository includes configuration for a development container for working with Code - OSS in an isolated local container or using [GitHub Codespaces](https://github.com/features/codespaces).
|
||||
This repository includes configuration for a development container for working with Code - OSS in a local container or using [GitHub Codespaces](https://github.com/features/codespaces).
|
||||
|
||||
> **Tip:** The default VNC password is `vscode`. The VNC server runs on port `5901` with a web client at `6080`. For better performance, we recommend using a [VNC Viewer](https://www.realvnc.com/en/connect/download/viewer/). Applications like the macOS Screen Sharing app will not perform as well.
|
||||
> **Tip:** The default VNC password is `vscode`. The VNC server runs on port `5901` and a web client is available on port `6080`.
|
||||
|
||||
## Quick start - local
|
||||
|
||||
1. Install Docker Desktop or Docker for Linux on your local machine. (See [docs](https://aka.ms/vscode-remote/containers/getting-started) for additional details.)
|
||||
|
||||
2. **Important**: Docker needs at least **4 Cores and 6 GB of RAM (8 GB recommended)** to run full build. If you on macOS, or using the old Hyper-V engine for Windows, update these values for Docker Desktop by right-clicking on the Docker status bar item, going to **Preferences/Settings > Resources > Advanced**.
|
||||
2. **Important**: Docker needs at least **4 Cores and 6 GB of RAM (8 GB recommended)** to run a full build. If you are on macOS, or are using the old Hyper-V engine for Windows, update these values for Docker Desktop by right-clicking on the Docker status bar item and going to **Preferences/Settings > Resources > Advanced**.
|
||||
|
||||
> **Note:** The [Resource Monitor](https://marketplace.visualstudio.com/items?itemName=mutantdino.resourcemonitor) extension is included in the container so you can keep an eye on CPU/Memory in the status bar.
|
||||
|
||||
@@ -16,53 +16,56 @@ This repository includes configuration for a development container for working w
|
||||
|
||||

|
||||
|
||||
> Note that the Remote - Containers extension requires the Visual Studio Code distribution of Code - OSS. See the [FAQ](https://aka.ms/vscode-remote/faq/license) for details.
|
||||
> **Note:** The Remote - Containers extension requires the Visual Studio Code distribution of Code - OSS. See the [FAQ](https://aka.ms/vscode-remote/faq/license) for details.
|
||||
|
||||
4. Press <kbd>Ctrl/Cmd</kbd> + <kbd>Shift</kbd> + <kbd>P</kbd> and select **Remote-Containers: Clone Repository in Container Volume...**.
|
||||
4. Press <kbd>Ctrl/Cmd</kbd> + <kbd>Shift</kbd> + <kbd>P</kbd> or <kbd>F1</kbd> and select **Remote-Containers: Clone Repository in Container Volume...**.
|
||||
|
||||
> **Tip:** While you can use your local source tree instead, operations like `yarn install` can be slow on macOS or using the Hyper-V engine on Windows. We recommend the "clone repository in container" approach instead since it uses "named volume" rather than the local filesystem.
|
||||
> **Tip:** While you can use your local source tree instead, operations like `yarn install` can be slow on macOS or when using the Hyper-V engine on Windows. We recommend the "clone repository in container" approach instead since it uses "named volume" rather than the local filesystem.
|
||||
|
||||
5. Type `https://github.com/microsoft/vscode` (or a branch or PR URL) in the input box and press <kbd>Enter</kbd>.
|
||||
|
||||
6. After the container is running, open a web browser and go to [http://localhost:6080](http://localhost:6080) or use a [VNC Viewer](https://www.realvnc.com/en/connect/download/viewer/) to connect to `localhost:5901` and enter `vscode` as the password.
|
||||
6. After the container is running, open a web browser and go to [http://localhost:6080](http://localhost:6080), or use a [VNC Viewer](https://www.realvnc.com/en/connect/download/viewer/) to connect to `localhost:5901` and enter `vscode` as the password.
|
||||
|
||||
Anything you start in VS Code or the integrated terminal will appear here.
|
||||
Anything you start in VS Code, or the integrated terminal, will appear here.
|
||||
|
||||
Next: **[Try it out!](#try-it)**
|
||||
|
||||
## Quick start - GitHub Codespaces
|
||||
|
||||
> **IMPORTANT:** You need to use a "Standard" sized codespace or larger (4-core, 8GB) since VS Code needs 6GB of RAM to compile. This is now the default for GitHub Codespaces, but do not downgrade to "Basic" unless you do not intend to compile.
|
||||
1. From the [microsoft/vscode GitHub repository](https://github.com/microsoft/vscode), click on the **Code** dropdown, select **Open with Codespaces**, and then click on **New codespace**. If prompted, select the **Standard** machine size (which is also the default).
|
||||
|
||||
1. From the [microsoft/vscode GitHub repository](https://github.com/microsoft/vscode), click on the **Code** dropdown, select **Open with Codespaces**, and the **New codespace**
|
||||
> **Note:** You will not see these options within GitHub if you are not in the Codespaces beta.
|
||||
|
||||
> Note that you will not see these options if you are not in the beta yet.
|
||||
2. After the codespace is up and running in your browser, press <kbd>Ctrl/Cmd</kbd> + <kbd>Shift</kbd> + <kbd>P</kbd> or <kbd>F1</kbd> and select **Ports: Focus on Ports View**.
|
||||
|
||||
2. After the codespace is up and running in your browser, press <kbd>F1</kbd> and select **Ports: Focus on Ports View**.
|
||||
3. You should see **VNC web client (6080)** under in the list of ports. Select the line and click on the globe icon to open it in a browser tab.
|
||||
|
||||
3. You should see port `6080` under **Forwarded Ports**. Select the line and click on the globe icon to open it in a browser tab.
|
||||
|
||||
> If you do not see port `6080`, press <kbd>F1</kbd>, select **Forward a Port** and enter port `6080`.
|
||||
> **Tip:** If you do not see the port, <kbd>Ctrl/Cmd</kbd> + <kbd>Shift</kbd> + <kbd>P</kbd> or <kbd>F1</kbd>, select **Forward a Port** and enter port `6080`.
|
||||
|
||||
4. In the new tab, you should see noVNC. Click **Connect** and enter `vscode` as the password.
|
||||
|
||||
Anything you start in VS Code or the integrated terminal will appear here.
|
||||
Anything you start in VS Code, or the integrated terminal, will appear here.
|
||||
|
||||
Next: **[Try it out!](#try-it)**
|
||||
|
||||
### Using VS Code with GitHub Codespaces
|
||||
|
||||
You will likely see better performance when accessing the codespace you created from VS Code since you can use a[VNC Viewer](https://www.realvnc.com/en/connect/download/viewer/). Here's how to do it.
|
||||
You may see improved VNC responsiveness when accessing a codespace from VS Code client since you can use a [VNC Viewer](https://www.realvnc.com/en/connect/download/viewer/). Here's how to do it.
|
||||
|
||||
1. [Create a codespace](#quick-start---github-codespaces) if you have not already.
|
||||
1. Install [Visual Studio Code Stable](https://code.visualstudio.com/) or [Insiders](https://code.visualstudio.com/insiders/) and the the [GitHub Codespaces extension](https://marketplace.visualstudio.com/items?itemName=GitHub.codespaces).
|
||||
|
||||
2. Set up [VS Code for use with GitHub Codespaces](https://docs.github.com/github/developing-online-with-codespaces/using-codespaces-in-visual-studio-code)
|
||||
> **Note:** The GitHub Codespaces extension requires the Visual Studio Code distribution of Code - OSS.
|
||||
|
||||
3. After the VS Code is up and running, press <kbd>F1</kbd>, choose **Codespaces: Connect to Codespace**, and select the codespace you created.
|
||||
2. After the VS Code is up and running, press <kbd>Ctrl/Cmd</kbd> + <kbd>Shift</kbd> + <kbd>P</kbd> or <kbd>F1</kbd>, choose **Codespaces: Create New Codespace**, and use the following settings:
|
||||
- `microsoft/vscode` for the repository.
|
||||
- Select any branch (e.g. **main**) - you select a different one later.
|
||||
- Choose **Standard** (4-core, 8GB) as the size.
|
||||
|
||||
4. After you've connected to the codespace, use a [VNC Viewer](https://www.realvnc.com/en/connect/download/viewer/) to connect to `localhost:5901` and enter `vscode` as the password.
|
||||
4. After you have connected to the codespace, you can use a [VNC Viewer](https://www.realvnc.com/en/connect/download/viewer/) to connect to `localhost:5901` and enter `vscode` as the password.
|
||||
|
||||
5. Anything you start in VS Code or the integrated terminal will appear here.
|
||||
> **Tip:** You may also need change your VNC client's **Picture Quaility** setting to **High** to get a full color desktop.
|
||||
|
||||
5. Anything you start in VS Code, or the integrated terminal, will appear here.
|
||||
|
||||
Next: **[Try it out!](#try-it)**
|
||||
|
||||
@@ -70,20 +73,18 @@ Next: **[Try it out!](#try-it)**
|
||||
|
||||
This container uses the [Fluxbox](http://fluxbox.org/) window manager to keep things lean. **Right-click on the desktop** to see menu options. It works with GNOME and GTK applications, so other tools can be installed if needed.
|
||||
|
||||
Note you can also set the resolution from the command line by typing `set-resolution`.
|
||||
> **Note:** You can also set the resolution from the command line by typing `set-resolution`.
|
||||
|
||||
To start working with Code - OSS, follow these steps:
|
||||
|
||||
1. In your local VS Code, open a terminal (<kbd>Ctrl/Cmd</kbd> + <kbd>Shift</kbd> + <kbd>\`</kbd>) and type the following commands:
|
||||
1. In your local VS Code client, open a terminal (<kbd>Ctrl/Cmd</kbd> + <kbd>Shift</kbd> + <kbd>\`</kbd>) and type the following commands:
|
||||
|
||||
```bash
|
||||
yarn install
|
||||
bash scripts/code.sh
|
||||
```
|
||||
|
||||
Note that a previous run of `yarn install` will already be cached, so this step should simply pick up any recent differences.
|
||||
|
||||
2. After the build is complete, open a web browser or a [VNC Viewer](https://www.realvnc.com/en/connect/download/viewer/) to the desktop environnement as described in the quick start and enter `vscode` as the password.
|
||||
2. After the build is complete, open a web browser or a [VNC Viewer](https://www.realvnc.com/en/connect/download/viewer/) to connect to the desktop environment as described in the quick start and enter `vscode` as the password.
|
||||
|
||||
3. You should now see Code - OSS!
|
||||
|
||||
@@ -91,7 +92,7 @@ Next, let's try debugging.
|
||||
|
||||
1. Shut down Code - OSS by clicking the box in the upper right corner of the Code - OSS window through your browser or VNC viewer.
|
||||
|
||||
2. Go to your local VS Code client, and use Run / Debug view to launch the **VS Code** configuration. (Typically the default, so you can likely just press <kbd>F5</kbd>).
|
||||
2. Go to your local VS Code client, and use the **Run / Debug** view to launch the **VS Code** configuration. (Typically the default, so you can likely just press <kbd>F5</kbd>).
|
||||
|
||||
> **Note:** If launching times out, you can increase the value of `timeout` in the "VS Code", "Attach Main Process", "Attach Extension Host", and "Attach to Shared Process" configurations in [launch.json](../.vscode/launch.json). However, running `scripts/code.sh` first will set up Electron which will usually solve timeout issues.
|
||||
|
||||
|
||||
@@ -3,20 +3,26 @@
|
||||
|
||||
// Image contents: https://github.com/microsoft/vscode-dev-containers/blob/master/repository-containers/images/github.com/microsoft/vscode/.devcontainer/base.Dockerfile
|
||||
"image": "mcr.microsoft.com/vscode/devcontainers/repos/microsoft/vscode:branch-main",
|
||||
|
||||
"workspaceMount": "source=${localWorkspaceFolder},target=/home/node/workspace/vscode,type=bind,consistency=cached",
|
||||
"workspaceFolder": "/home/node/workspace/vscode",
|
||||
"overrideCommand": false,
|
||||
"runArgs": [ "--init", "--security-opt", "seccomp=unconfined"],
|
||||
|
||||
"settings": {
|
||||
"terminal.integrated.shell.linux": "/bin/bash",
|
||||
"resmon.show.battery": false,
|
||||
"resmon.show.cpufreq": false
|
||||
},
|
||||
|
||||
// noVNC, VNC, debug ports
|
||||
"forwardPorts": [6080, 5901, 9222],
|
||||
// noVNC, VNC
|
||||
"forwardPorts": [6080, 5901],
|
||||
"portsAttributes": {
|
||||
"6080": {
|
||||
"label": "VNC web client (noVNC)",
|
||||
"onAutoForward": "silent"
|
||||
},
|
||||
"5901": {
|
||||
"label": "VNC TCP port",
|
||||
"onAutoForward": "silent"
|
||||
}
|
||||
},
|
||||
|
||||
"extensions": [
|
||||
"dbaeumer.vscode-eslint",
|
||||
|
||||
@@ -17,6 +17,7 @@
|
||||
**/extensions/typescript-basics/test/colorize-fixtures/**
|
||||
**/extensions/**/dist/**
|
||||
# These are code-server code symlinks.
|
||||
src/vs/base/common/util.ts
|
||||
src/vs/base/common/ipc.d.ts
|
||||
src/vs/base/node/proxy_agent.ts
|
||||
src/vs/ipc.d.ts
|
||||
src/vs/server/common/util.ts
|
||||
src/vs/server/uriTransformer.ts
|
||||
|
||||
@@ -62,7 +62,7 @@
|
||||
"code-no-standalone-editor": "warn",
|
||||
"code-no-unexternalized-strings": "warn",
|
||||
"code-layering": [
|
||||
"off",
|
||||
"warn",
|
||||
{
|
||||
"common": [],
|
||||
"node": [
|
||||
@@ -88,7 +88,7 @@
|
||||
}
|
||||
],
|
||||
"code-import-patterns": [
|
||||
"off",
|
||||
"warn",
|
||||
// !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
||||
// !!! Do not relax these rules !!!
|
||||
// !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
||||
@@ -501,7 +501,7 @@
|
||||
"**/vs/platform/**",
|
||||
"**/vs/editor/**",
|
||||
"**/vs/workbench/{common,browser,node,electron-sandbox,electron-browser}/**",
|
||||
"vs/workbench/contrib/files/common/editors/fileEditorInput",
|
||||
"vs/workbench/contrib/files/browser/editors/fileEditorInput",
|
||||
"**/vs/workbench/services/**",
|
||||
"**/vs/workbench/test/**",
|
||||
"*" // node modules
|
||||
@@ -807,6 +807,7 @@
|
||||
"**/vs/platform/**/{common,node}/**",
|
||||
"**/vs/workbench/**/{common,node}/**",
|
||||
"**/vs/server/**",
|
||||
"@coder/logger", // NOTE@coder: add logger
|
||||
"*" // node modules
|
||||
]
|
||||
},
|
||||
|
||||
11
lib/vscode/.github/ISSUE_TEMPLATE/bug_report.md
vendored
11
lib/vscode/.github/ISSUE_TEMPLATE/bug_report.md
vendored
@@ -8,6 +8,11 @@ about: Create a report to help us improve
|
||||
<!-- 🔎 Search existing issues to avoid creating duplicates. -->
|
||||
<!-- 🧪 Test using the latest Insiders build to see if your issue has already been fixed: https://code.visualstudio.com/insiders/ -->
|
||||
<!-- 💡 Instead of creating your report here, use 'Report Issue' from the 'Help' menu in VS Code to pre-fill useful information. -->
|
||||
<!-- 🔧 Launch with `code --disable-extensions` to check. -->
|
||||
Does this issue occur when all extensions are disabled?: Yes/No
|
||||
|
||||
<!-- 🪓 If you answered No above, use 'Help: Start Extension Bisect' from Command Palette to try to identify the cause. -->
|
||||
<!-- 📣 Issues caused by an extension need to be reported directly to the extension publisher. The 'Help > Report Issue' dialog can assist with this. -->
|
||||
- VS Code Version:
|
||||
- OS Version:
|
||||
|
||||
@@ -15,9 +20,3 @@ Steps to Reproduce:
|
||||
|
||||
1.
|
||||
2.
|
||||
|
||||
<!-- 🔧 Launch with `code --disable-extensions` to check. -->
|
||||
Does this issue occur when all extensions are disabled?: Yes/No
|
||||
|
||||
<!-- 🪓 If you answered No above, use 'Help: Start Extension Bisect' from Command Palette to try to identify the cause. -->
|
||||
<!-- 📣 Issues caused by an extension need to be reported directly to the extension publisher. The 'Help > Report Issue' dialog can assist with this. -->
|
||||
|
||||
21
lib/vscode/.github/classifier.json
vendored
21
lib/vscode/.github/classifier.json
vendored
@@ -1,16 +1,17 @@
|
||||
{
|
||||
"$schema": "https://raw.githubusercontent.com/microsoft/vscode-github-triage-actions/master/classifier-deep/apply/apply-labels/deep-classifier-config.schema.json",
|
||||
"vacation": [],
|
||||
"vacation": ["RMacfarlane"],
|
||||
"assignees": {
|
||||
"JacksonKearl": {"accuracy": 0.5}
|
||||
},
|
||||
"labels": {
|
||||
"L10N": {"assign": []},
|
||||
"VIM": {"assign": []},
|
||||
"accessibility": { "assign": ["isidorn"]},
|
||||
"api": {"assign": ["jrieken"]},
|
||||
"api-finalization": {"assign": []},
|
||||
"api-proposal": {"assign": ["jrieken"]},
|
||||
"authentication": {"assign": ["RMacfarlane"]},
|
||||
"authentication": {"assign": ["TylerLeonhardt"]},
|
||||
"breadcrumbs": {"assign": ["jrieken"]},
|
||||
"callhierarchy": {"assign": ["jrieken"]},
|
||||
"code-lens": {"assign": ["jrieken"]},
|
||||
@@ -20,8 +21,7 @@
|
||||
"context-keys": {"assign": []},
|
||||
"css-less-scss": {"assign": ["aeschli"]},
|
||||
"custom-editors": {"assign": ["mjbvz"]},
|
||||
"debug": {"assign": ["isidorn"]},
|
||||
"debug-console": {"assign": ["isidorn"]},
|
||||
"debug": {"assign": ["weinand"]},
|
||||
"dialogs": {"assign": ["sbatten"]},
|
||||
"diff-editor": {"assign": []},
|
||||
"dropdown": {"assign": []},
|
||||
@@ -81,14 +81,15 @@
|
||||
"icon-brand": {"assign": []},
|
||||
"icons-product": {"assign": ["misolori"]},
|
||||
"install-update": {"assign": []},
|
||||
"integrated-terminal": {"assign": ["meganrogge"]},
|
||||
"integrated-terminal-conpty": {"assign": ["meganrogge"]},
|
||||
"integrated-terminal-links": {"assign": ["meganrogge"]},
|
||||
"terminal": {"assign": ["meganrogge"]},
|
||||
"terminal-conpty": {"assign": ["meganrogge"]},
|
||||
"terminal-links": {"assign": ["meganrogge"]},
|
||||
"terminal-external": {"assign": ["meganrogge"]},
|
||||
"integration-test": {"assign": []},
|
||||
"intellisense-config": {"assign": []},
|
||||
"ipc": {"assign": ["joaomoreno"]},
|
||||
"issue-bot": {"assign": ["chrmarti"]},
|
||||
"issue-reporter": {"assign": ["RMacfarlane"]},
|
||||
"issue-reporter": {"assign": ["TylerLeonhardt"]},
|
||||
"javascript": {"assign": ["mjbvz"]},
|
||||
"json": {"assign": ["aeschli"]},
|
||||
"keybindings": {"assign": []},
|
||||
@@ -113,7 +114,7 @@
|
||||
"php": {"assign": ["roblourens"]},
|
||||
"portable-mode": {"assign": ["joaomoreno"]},
|
||||
"proxy": {"assign": []},
|
||||
"quick-pick": {"assign": ["chrmarti"]},
|
||||
"quick-pick": {"assign": ["TylerLeonhardt"]},
|
||||
"references-viewlet": {"assign": ["jrieken"]},
|
||||
"release-notes": {"assign": []},
|
||||
"remote": {"assign": []},
|
||||
@@ -152,7 +153,7 @@
|
||||
"web": {"assign": ["bpasero"]},
|
||||
"webview": {"assign": ["mjbvz"]},
|
||||
"workbench-cli": {"assign": []},
|
||||
"workbench-diagnostics": {"assign": ["RMacfarlane"]},
|
||||
"workbench-diagnostics": {"assign": ["Tyriar"]},
|
||||
"workbench-dnd": {"assign": ["bpasero"]},
|
||||
"workbench-editor-grid": {"assign": ["sbatten"]},
|
||||
"workbench-editors": {"assign": ["bpasero"]},
|
||||
|
||||
14
lib/vscode/.github/commands.json
vendored
14
lib/vscode/.github/commands.json
vendored
@@ -90,7 +90,7 @@
|
||||
"@author"
|
||||
],
|
||||
"action": "updateLabels",
|
||||
"addLabel": "z-author-verified",
|
||||
"addLabel": "verified",
|
||||
"removeLabel": "author-verification-requested",
|
||||
"requireLabel": "author-verification-requested",
|
||||
"disallowLabel": "unreleased"
|
||||
@@ -133,6 +133,18 @@
|
||||
"action": "updateLabels",
|
||||
"addLabel": "~needs more info"
|
||||
},
|
||||
{
|
||||
"type": "comment",
|
||||
"name": "needsPerfInfo",
|
||||
"allowUsers": [
|
||||
"cleidigh",
|
||||
"usernamehw",
|
||||
"gjsjohnmurray",
|
||||
"IllusionMH"
|
||||
],
|
||||
"addLabel": "needs more info",
|
||||
"comment": "Thanks for creating this issue regarding performance! Please follow this guide to help us diagnose performance issues: https://github.com/microsoft/vscode/wiki/Performance-Issues \n\nHappy Coding!"
|
||||
},
|
||||
{
|
||||
"type": "comment",
|
||||
"name": "jsDebugLogs",
|
||||
|
||||
3
lib/vscode/.github/subscribers.json
vendored
3
lib/vscode/.github/subscribers.json
vendored
@@ -4,6 +4,7 @@
|
||||
"rchiodo",
|
||||
"greazer",
|
||||
"donjayamanne",
|
||||
"jilljac"
|
||||
"jilljac",
|
||||
"IanMatthewHuff"
|
||||
]
|
||||
}
|
||||
|
||||
3
lib/vscode/.github/workflows/ci.yml
vendored
3
lib/vscode/.github/workflows/ci.yml
vendored
@@ -244,6 +244,9 @@ jobs:
|
||||
- name: Run Valid Layers Checks
|
||||
run: yarn valid-layers-check
|
||||
|
||||
- name: Compile /build/
|
||||
run: yarn --cwd build compile
|
||||
|
||||
- name: Run Monaco Editor Checks
|
||||
run: yarn monaco-compile-check
|
||||
|
||||
|
||||
3
lib/vscode/.gitignore
vendored
3
lib/vscode/.gitignore
vendored
@@ -7,7 +7,8 @@ node_modules/
|
||||
extensions/**/dist/
|
||||
/out*/
|
||||
/extensions/**/out/
|
||||
# src/vs/server NOTE@coder: So our code isn't ignored.
|
||||
# NOTE@coder: remove to provide our own server
|
||||
# src/vs/server
|
||||
resources/server
|
||||
build/node_modules
|
||||
coverage/
|
||||
|
||||
18
lib/vscode/.vscode/notebooks/api.github-issues
vendored
18
lib/vscode/.vscode/notebooks/api.github-issues
vendored
@@ -2,37 +2,31 @@
|
||||
{
|
||||
"kind": 1,
|
||||
"language": "markdown",
|
||||
"value": "#### Config",
|
||||
"editable": true
|
||||
"value": "#### Config"
|
||||
},
|
||||
{
|
||||
"kind": 2,
|
||||
"language": "github-issues",
|
||||
"value": "$repo=repo:microsoft/vscode\n$milestone=milestone:\"April 2021\"",
|
||||
"editable": true
|
||||
"value": "$repo=repo:microsoft/vscode\n$milestone=milestone:\"May 2021\""
|
||||
},
|
||||
{
|
||||
"kind": 1,
|
||||
"language": "markdown",
|
||||
"value": "### Finalization",
|
||||
"editable": true
|
||||
"value": "### Finalization"
|
||||
},
|
||||
{
|
||||
"kind": 2,
|
||||
"language": "github-issues",
|
||||
"value": "$repo $milestone label:api-finalization",
|
||||
"editable": true
|
||||
"value": "$repo $milestone label:api-finalization"
|
||||
},
|
||||
{
|
||||
"kind": 1,
|
||||
"language": "markdown",
|
||||
"value": "### Proposals",
|
||||
"editable": true
|
||||
"value": "### Proposals"
|
||||
},
|
||||
{
|
||||
"kind": 2,
|
||||
"language": "github-issues",
|
||||
"value": "$repo $milestone is:open label:api-proposal ",
|
||||
"editable": true
|
||||
"value": "$repo $milestone is:open label:api-proposal "
|
||||
}
|
||||
]
|
||||
@@ -7,7 +7,7 @@
|
||||
{
|
||||
"kind": 2,
|
||||
"language": "github-issues",
|
||||
"value": "$REPOS=repo:microsoft/vscode repo:microsoft/vscode-internalbacklog repo:microsoft/vscode-js-debug repo:microsoft/vscode-remote-release repo:microsoft/vscode-pull-request-github repo:microsoft/vscode-settings-sync-server repo:microsoft/vscode-emmet-helper repo:microsoft/vscode-remotehub\n\n$MILESTONE=milestone:\"April 2021\""
|
||||
"value": "$REPOS=repo:microsoft/vscode repo:microsoft/vscode-internalbacklog repo:microsoft/vscode-js-debug repo:microsoft/vscode-remote-release repo:microsoft/vscode-pull-request-github repo:microsoft/vscode-settings-sync-server repo:microsoft/vscode-emmet-helper repo:microsoft/vscode-remotehub\n\n$MILESTONE=milestone:\"May 2021\""
|
||||
},
|
||||
{
|
||||
"kind": 1,
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
{
|
||||
"kind": 2,
|
||||
"language": "github-issues",
|
||||
"value": "$REPOS=repo:microsoft/vscode repo:microsoft/vscode-internalbacklog repo:microsoft/vscode-js-debug repo:microsoft/vscode-remote-release repo:microsoft/vscode-pull-request-github repo:microsoft/vscode-settings-sync-server repo:microsoft/vscode-remotehub\n\n$MILESTONE=milestone:\"April 2021\"\n\n$MINE=assignee:@me"
|
||||
"value": "$REPOS=repo:microsoft/vscode repo:microsoft/vscode-internalbacklog repo:microsoft/vscode-js-debug repo:microsoft/vscode-remote-release repo:microsoft/vscode-pull-request-github repo:microsoft/vscode-settings-sync-server repo:microsoft/vscode-remotehub\n\n$MILESTONE=milestone:\"May 2021\"\n\n$MINE=assignee:@me"
|
||||
},
|
||||
{
|
||||
"kind": 1,
|
||||
@@ -157,7 +157,7 @@
|
||||
{
|
||||
"kind": 2,
|
||||
"language": "github-issues",
|
||||
"value": "$REPOS $MILESTONE -$MINE is:issue is:closed sort:updated-asc label:bug -label:verified -label:z-author-verified -label:on-testplan -label:*duplicate -label:duplicate -label:invalid -label:*as-designed -label:error-telemetry -label:verification-steps-needed -label:verification-found -author:aeschli -author:alexdima -author:alexr00 -author:AmandaSilver -author:bamurtaugh -author:bpasero -author:btholt -author:chrisdias -author:chrmarti -author:Chuxel -author:connor4312 -author:dbaeumer -author:deepak1556 -author:devinvalenciano -author:digitarald -author:eamodio -author:egamma -author:fiveisprime -author:gregvanl -author:isidorn -author:ItalyPaleAle -author:JacksonKearl -author:joaomoreno -author:jrieken -author:kieferrm -author:lszomoru -author:meganrogge -author:misolori -author:mjbvz -author:ornellaalt -author:orta -author:rebornix -author:RMacfarlane -author:roblourens -author:rzhao271 -author:sana-ajani -author:sandy081 -author:sbatten -author:stevencl -author:Tyriar -author:weinand -author:TylerLeonhardt -author:lramos15"
|
||||
"value": "$REPOS $MILESTONE -$MINE is:issue is:closed sort:updated-asc label:bug -label:verified -label:z-author-verified -label:on-testplan -label:*duplicate -label:duplicate -label:invalid -label:*as-designed -label:error-telemetry -label:verification-steps-needed -label:verification-found -author:aeschli -author:alexdima -author:alexr00 -author:AmandaSilver -author:bamurtaugh -author:bpasero -author:btholt -author:chrisdias -author:chrmarti -author:Chuxel -author:connor4312 -author:dbaeumer -author:deepak1556 -author:devinvalenciano -author:digitarald -author:eamodio -author:egamma -author:fiveisprime -author:gregvanl -author:isidorn -author:ItalyPaleAle -author:JacksonKearl -author:joaomoreno -author:jrieken -author:kieferrm -author:lszomoru -author:meganrogge -author:misolori -author:mjbvz -author:ornellaalt -author:orta -author:rebornix -author:RMacfarlane -author:roblourens -author:rzhao271 -author:sana-ajani -author:sandy081 -author:sbatten -author:stevencl -author:Tyriar -author:weinand -author:TylerLeonhardt -author:lramos15 -author:hediet"
|
||||
},
|
||||
{
|
||||
"kind": 1,
|
||||
|
||||
@@ -2,115 +2,96 @@
|
||||
{
|
||||
"kind": 1,
|
||||
"language": "markdown",
|
||||
"value": "##### `Config`: This should be changed every month/milestone",
|
||||
"editable": true
|
||||
"value": "##### `Config`: This should be changed every month/milestone"
|
||||
},
|
||||
{
|
||||
"kind": 2,
|
||||
"language": "github-issues",
|
||||
"value": "// list of repos we work in\n$repos=repo:microsoft/vscode repo:microsoft/vscode-remote-release repo:microsoft/vscode-js-debug repo:microsoft/vscode-pull-request-github repo:microsoft/vscode-github-issue-notebooks repo:microsoft/vscode-internalbacklog\n\n// current milestone name\n$milestone=milestone:\"April 2021\"",
|
||||
"editable": true
|
||||
"value": "// list of repos we work in\n$repos=repo:microsoft/vscode repo:microsoft/vscode-remote-release repo:microsoft/vscode-js-debug repo:microsoft/vscode-pull-request-github repo:microsoft/vscode-github-issue-notebooks repo:microsoft/vscode-internalbacklog\n\n// current milestone name\n$milestone=milestone:\"May 2021\""
|
||||
},
|
||||
{
|
||||
"kind": 1,
|
||||
"language": "github-issues",
|
||||
"value": "## Milestone Work",
|
||||
"editable": true
|
||||
"value": "## Milestone Work"
|
||||
},
|
||||
{
|
||||
"kind": 2,
|
||||
"language": "github-issues",
|
||||
"value": "$repos $milestone assignee:@me is:open",
|
||||
"editable": true
|
||||
"value": "$repos $milestone assignee:@me is:open"
|
||||
},
|
||||
{
|
||||
"kind": 1,
|
||||
"language": "github-issues",
|
||||
"value": "## Bugs, Debt, Features...",
|
||||
"editable": true
|
||||
"value": "## Bugs, Debt, Features..."
|
||||
},
|
||||
{
|
||||
"kind": 1,
|
||||
"language": "markdown",
|
||||
"value": "#### My Bugs",
|
||||
"editable": true
|
||||
"value": "#### My Bugs"
|
||||
},
|
||||
{
|
||||
"kind": 2,
|
||||
"language": "github-issues",
|
||||
"value": "$repos assignee:@me is:open label:bug",
|
||||
"editable": true
|
||||
"value": "$repos assignee:@me is:open label:bug"
|
||||
},
|
||||
{
|
||||
"kind": 1,
|
||||
"language": "markdown",
|
||||
"value": "#### Debt & Engineering",
|
||||
"editable": true
|
||||
"value": "#### Debt & Engineering"
|
||||
},
|
||||
{
|
||||
"kind": 2,
|
||||
"language": "github-issues",
|
||||
"value": "$repos assignee:@me is:open label:debt OR $repos assignee:@me is:open label:engineering",
|
||||
"editable": true
|
||||
"value": "$repos assignee:@me is:open label:debt OR $repos assignee:@me is:open label:engineering"
|
||||
},
|
||||
{
|
||||
"kind": 1,
|
||||
"language": "markdown",
|
||||
"value": "#### Performance 🐌 🔜 🏎",
|
||||
"editable": true
|
||||
"value": "#### Performance 🐌 🔜 🏎"
|
||||
},
|
||||
{
|
||||
"kind": 2,
|
||||
"language": "github-issues",
|
||||
"value": "$repos assignee:@me is:open label:perf OR $repos assignee:@me is:open label:perf-startup OR $repos assignee:@me is:open label:perf-bloat OR $repos assignee:@me is:open label:freeze-slow-crash-leak",
|
||||
"editable": true
|
||||
"value": "$repos assignee:@me is:open label:perf OR $repos assignee:@me is:open label:perf-startup OR $repos assignee:@me is:open label:perf-bloat OR $repos assignee:@me is:open label:freeze-slow-crash-leak"
|
||||
},
|
||||
{
|
||||
"kind": 1,
|
||||
"language": "markdown",
|
||||
"value": "#### Feature Requests",
|
||||
"editable": true
|
||||
"value": "#### Feature Requests"
|
||||
},
|
||||
{
|
||||
"kind": 2,
|
||||
"language": "github-issues",
|
||||
"value": "$repos assignee:@me is:open label:feature-request milestone:Backlog sort:reactions-+1-desc",
|
||||
"editable": true
|
||||
"value": "$repos assignee:@me is:open label:feature-request milestone:Backlog sort:reactions-+1-desc"
|
||||
},
|
||||
{
|
||||
"kind": 2,
|
||||
"language": "github-issues",
|
||||
"value": "$repos assignee:@me is:open milestone:\"Backlog Candidates\"",
|
||||
"editable": true
|
||||
"value": "$repos assignee:@me is:open milestone:\"Backlog Candidates\""
|
||||
},
|
||||
{
|
||||
"kind": 1,
|
||||
"language": "markdown",
|
||||
"value": "### Personal Inbox\n",
|
||||
"editable": true
|
||||
"value": "### Personal Inbox\n"
|
||||
},
|
||||
{
|
||||
"kind": 1,
|
||||
"language": "markdown",
|
||||
"value": "\n#### Missing Type label",
|
||||
"editable": true
|
||||
"value": "\n#### Missing Type label"
|
||||
},
|
||||
{
|
||||
"kind": 2,
|
||||
"language": "github-issues",
|
||||
"value": "$repos assignee:@me is:open type:issue -label:bug -label:\"needs more info\" -label:feature-request -label:under-discussion -label:debt -label:plan-item -label:upstream",
|
||||
"editable": true
|
||||
"value": "$repos assignee:@me is:open type:issue -label:bug -label:\"needs more info\" -label:feature-request -label:under-discussion -label:debt -label:plan-item -label:upstream"
|
||||
},
|
||||
{
|
||||
"kind": 1,
|
||||
"language": "markdown",
|
||||
"value": "#### Not Actionable",
|
||||
"editable": true
|
||||
"value": "#### Not Actionable"
|
||||
},
|
||||
{
|
||||
"kind": 2,
|
||||
"language": "github-issues",
|
||||
"value": "$repos assignee:@me is:open label:\"needs more info\"",
|
||||
"editable": true
|
||||
"value": "$repos assignee:@me is:open label:\"needs more info\""
|
||||
}
|
||||
]
|
||||
53
lib/vscode/.vscode/tasks.json
vendored
53
lib/vscode/.vscode/tasks.json
vendored
@@ -55,39 +55,11 @@
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"type": "npm",
|
||||
"script": "watch-extension-mediad",
|
||||
"label": "Ext Media - Build",
|
||||
"isBackground": true,
|
||||
"presentation": {
|
||||
"reveal": "never",
|
||||
"group": "buildWatchers"
|
||||
},
|
||||
"problemMatcher": {
|
||||
"owner": "typescript",
|
||||
"applyTo": "closedDocuments",
|
||||
"fileLocation": [
|
||||
"absolute"
|
||||
],
|
||||
"pattern": {
|
||||
"regexp": "Error: ([^(]+)\\((\\d+|\\d+,\\d+|\\d+,\\d+,\\d+,\\d+)\\): (.*)$",
|
||||
"file": 1,
|
||||
"location": 2,
|
||||
"message": 3
|
||||
},
|
||||
"background": {
|
||||
"beginsPattern": "Starting compilation",
|
||||
"endsPattern": "Finished compilation"
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"label": "VS Code - Build",
|
||||
"dependsOn": [
|
||||
"Core - Build",
|
||||
"Ext - Build",
|
||||
"Ext Media - Build",
|
||||
"Ext - Build"
|
||||
],
|
||||
"group": {
|
||||
"kind": "build",
|
||||
@@ -102,7 +74,8 @@
|
||||
"group": "build",
|
||||
"presentation": {
|
||||
"reveal": "never",
|
||||
"group": "buildKillers"
|
||||
"group": "buildKillers",
|
||||
"close": true
|
||||
},
|
||||
"problemMatcher": "$tsc"
|
||||
},
|
||||
@@ -113,18 +86,8 @@
|
||||
"group": "build",
|
||||
"presentation": {
|
||||
"reveal": "never",
|
||||
"group": "buildKillers"
|
||||
},
|
||||
"problemMatcher": "$tsc"
|
||||
},
|
||||
{
|
||||
"type": "npm",
|
||||
"script": "kill-watch-extension-mediad",
|
||||
"label": "Kill Ext Media - Build",
|
||||
"group": "build",
|
||||
"presentation": {
|
||||
"reveal": "never",
|
||||
"group": "buildKillers"
|
||||
"group": "buildKillers",
|
||||
"close": true
|
||||
},
|
||||
"problemMatcher": "$tsc"
|
||||
},
|
||||
@@ -132,8 +95,7 @@
|
||||
"label": "Kill VS Code - Build",
|
||||
"dependsOn": [
|
||||
"Kill Core - Build",
|
||||
"Kill Ext - Build",
|
||||
"Kill Ext Media - Build",
|
||||
"Kill Ext - Build"
|
||||
],
|
||||
"group": "build",
|
||||
"problemMatcher": []
|
||||
@@ -238,7 +200,8 @@
|
||||
"command": "node build/lib/preLaunch.js",
|
||||
"label": "Ensure Prelaunch Dependencies",
|
||||
"presentation": {
|
||||
"reveal": "silent"
|
||||
"reveal": "silent",
|
||||
"close": true
|
||||
}
|
||||
},
|
||||
{
|
||||
|
||||
@@ -1,3 +0,0 @@
|
||||
disturl "https://electronjs.org/headers"
|
||||
target "12.0.4"
|
||||
runtime "electron"
|
||||
@@ -10,7 +10,7 @@ This repository ("`Code - OSS`") is where we (Microsoft) develop the [Visual Stu
|
||||
## Visual Studio Code
|
||||
|
||||
<p align="center">
|
||||
<img alt="VS Code in action" src="https://user-images.githubusercontent.com/1487073/58344409-70473b80-7e0a-11e9-8570-b2efc6f8fa44.png">
|
||||
<img alt="VS Code in action" src="https://user-images.githubusercontent.com/35271042/118224532-3842c400-b438-11eb-923d-a5f66fa6785a.png">
|
||||
</p>
|
||||
|
||||
[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/).
|
||||
@@ -21,11 +21,11 @@ Visual Studio Code is updated monthly with new features and bug fixes. You can d
|
||||
|
||||
## Contributing
|
||||
|
||||
There are many ways in which you can participate in the project, for example:
|
||||
There are many ways in which you can participate in this project, for example:
|
||||
|
||||
* [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 new content
|
||||
* 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:
|
||||
@@ -57,10 +57,10 @@ VS Code includes a set of built-in extensions located in the [extensions](extens
|
||||
|
||||
## Development Container
|
||||
|
||||
This repository includes a Visual Studio Code Remote - Containers / Codespaces development container.
|
||||
This repository includes a Visual Studio Code Remote - Containers / GitHub Codespaces development container.
|
||||
|
||||
- For [Remote - Containers](https://aka.ms/vscode-remote/download/containers), use the **Remote-Containers: Open Repository in Container...** command which creates a Docker volume for better disk I/O on macOS and Windows.
|
||||
- For Codespaces, install the [Visual Studio Codespaces](https://aka.ms/vscs-ext-vscode) extension in VS Code, and use the **Codespaces: Create New Codespace** command.
|
||||
- For [Remote - Containers](https://aka.ms/vscode-remote/download/containers), use the **Remote-Containers: Clone Repository in Container Volume...** command which creates a Docker volume for better disk I/O on macOS and Windows.
|
||||
- For Codespaces, install the [Github Codespaces](https://marketplace.visualstudio.com/items?itemName=GitHub.codespacese) 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.
|
||||
|
||||
|
||||
@@ -5,17 +5,17 @@ Do Not Translate or Localize
|
||||
|
||||
This project incorporates components from the projects listed below. The original copyright notices and the licenses under which Microsoft received such components are set forth below. Microsoft reserves all rights not expressly granted herein, whether by implication, estoppel or otherwise.
|
||||
|
||||
1. JuliaEditorSupport/atom-language-julia version 0.21.0 (https://github.com/JuliaEditorSupport/atom-language-julia)
|
||||
2. atom/language-clojure version 0.22.7 (https://github.com/atom/language-clojure)
|
||||
3. atom/language-coffee-script version 0.49.3 (https://github.com/atom/language-coffee-script)
|
||||
4. atom/language-css version 0.44.4 (https://github.com/atom/language-css)
|
||||
5. atom/language-java version 0.32.1 (https://github.com/atom/language-java)
|
||||
6. atom/language-sass version 0.61.4 (https://github.com/atom/language-sass)
|
||||
7. atom/language-shellscript version 0.26.0 (https://github.com/atom/language-shellscript)
|
||||
8. atom/language-xml version 0.35.2 (https://github.com/atom/language-xml)
|
||||
9. better-go-syntax version 1.0.0 (https://github.com/jeff-hykin/better-go-syntax/ )
|
||||
10. Colorsublime-Themes version 0.1.0 (https://github.com/Colorsublime/Colorsublime-Themes)
|
||||
11. daaain/Handlebars version 1.8.0 (https://github.com/daaain/Handlebars)
|
||||
1. atom/language-clojure version 0.22.7 (https://github.com/atom/language-clojure)
|
||||
2. atom/language-coffee-script version 0.49.3 (https://github.com/atom/language-coffee-script)
|
||||
3. atom/language-css version 0.44.4 (https://github.com/atom/language-css)
|
||||
4. atom/language-java version 0.32.1 (https://github.com/atom/language-java)
|
||||
5. atom/language-sass version 0.62.1 (https://github.com/atom/language-sass)
|
||||
6. atom/language-shellscript version 0.26.0 (https://github.com/atom/language-shellscript)
|
||||
7. atom/language-xml version 0.35.2 (https://github.com/atom/language-xml)
|
||||
8. better-go-syntax version 1.0.0 (https://github.com/jeff-hykin/better-go-syntax/ )
|
||||
9. Colorsublime-Themes version 0.1.0 (https://github.com/Colorsublime/Colorsublime-Themes)
|
||||
10. daaain/Handlebars version 1.8.0 (https://github.com/daaain/Handlebars)
|
||||
11. dart-lang/dart-syntax-highlight (https://github.com/dart-lang/dart-syntax-highlight)
|
||||
12. davidrios/pug-tmbundle (https://github.com/davidrios/pug-tmbundle)
|
||||
13. definitelytyped (https://github.com/DefinitelyTyped/DefinitelyTyped)
|
||||
14. demyte/language-cshtml version 0.3.0 (https://github.com/demyte/language-cshtml)
|
||||
@@ -32,72 +32,46 @@ This project incorporates components from the projects listed below. The origina
|
||||
25. jeff-hykin/cpp-textmate-grammar version 1.12.11 (https://github.com/jeff-hykin/cpp-textmate-grammar)
|
||||
26. jeff-hykin/cpp-textmate-grammar version 1.15.5 (https://github.com/jeff-hykin/cpp-textmate-grammar)
|
||||
27. js-beautify version 1.6.8 (https://github.com/beautify-web/js-beautify)
|
||||
28. Jxck/assert version 1.0.0 (https://github.com/Jxck/assert)
|
||||
29. language-docker (https://github.com/moby/moby)
|
||||
30. language-less version 0.34.2 (https://github.com/atom/language-less)
|
||||
31. language-php version 0.46.0 (https://github.com/atom/language-php)
|
||||
32. MagicStack/MagicPython version 1.1.1 (https://github.com/MagicStack/MagicPython)
|
||||
33. marked version 1.1.0 (https://github.com/markedjs/marked)
|
||||
34. mdn-data version 1.1.12 (https://github.com/mdn/data)
|
||||
35. microsoft/TypeScript-TmLanguage version 0.0.1 (https://github.com/microsoft/TypeScript-TmLanguage)
|
||||
36. microsoft/vscode-JSON.tmLanguage (https://github.com/microsoft/vscode-JSON.tmLanguage)
|
||||
37. microsoft/vscode-markdown-tm-grammar version 1.0.0 (https://github.com/microsoft/vscode-markdown-tm-grammar)
|
||||
38. microsoft/vscode-mssql version 1.9.0 (https://github.com/microsoft/vscode-mssql)
|
||||
39. mmims/language-batchfile version 0.7.5 (https://github.com/mmims/language-batchfile)
|
||||
40. NVIDIA/cuda-cpp-grammar (https://github.com/NVIDIA/cuda-cpp-grammar)
|
||||
41. PowerShell/EditorSyntax version 1.0.0 (https://github.com/PowerShell/EditorSyntax)
|
||||
42. rust-syntax version 0.4.3 (https://github.com/dustypomerleau/rust-syntax)
|
||||
43. seti-ui version 0.1.0 (https://github.com/jesseweed/seti-ui)
|
||||
44. shaders-tmLanguage version 0.1.0 (https://github.com/tgjones/shaders-tmLanguage)
|
||||
45. textmate/asp.vb.net.tmbundle (https://github.com/textmate/asp.vb.net.tmbundle)
|
||||
46. textmate/c.tmbundle (https://github.com/textmate/c.tmbundle)
|
||||
47. textmate/diff.tmbundle (https://github.com/textmate/diff.tmbundle)
|
||||
48. textmate/git.tmbundle (https://github.com/textmate/git.tmbundle)
|
||||
49. textmate/groovy.tmbundle (https://github.com/textmate/groovy.tmbundle)
|
||||
50. textmate/html.tmbundle (https://github.com/textmate/html.tmbundle)
|
||||
51. textmate/ini.tmbundle (https://github.com/textmate/ini.tmbundle)
|
||||
52. textmate/javascript.tmbundle (https://github.com/textmate/javascript.tmbundle)
|
||||
53. textmate/lua.tmbundle (https://github.com/textmate/lua.tmbundle)
|
||||
54. textmate/markdown.tmbundle (https://github.com/textmate/markdown.tmbundle)
|
||||
55. textmate/perl.tmbundle (https://github.com/textmate/perl.tmbundle)
|
||||
56. textmate/ruby.tmbundle (https://github.com/textmate/ruby.tmbundle)
|
||||
57. textmate/yaml.tmbundle (https://github.com/textmate/yaml.tmbundle)
|
||||
58. TypeScript-TmLanguage version 0.1.8 (https://github.com/microsoft/TypeScript-TmLanguage)
|
||||
59. TypeScript-TmLanguage version 1.0.0 (https://github.com/microsoft/TypeScript-TmLanguage)
|
||||
60. Unicode version 12.0.0 (https://home.unicode.org/)
|
||||
61. vscode-codicons version 0.0.14 (https://github.com/microsoft/vscode-codicons)
|
||||
62. vscode-logfile-highlighter version 2.11.0 (https://github.com/emilast/vscode-logfile-highlighter)
|
||||
63. vscode-swift version 0.0.1 (https://github.com/owensd/vscode-swift)
|
||||
64. Web Background Synchronization (https://github.com/WICG/background-sync)
|
||||
28. JuliaEditorSupport/atom-language-julia version 0.21.0 (https://github.com/JuliaEditorSupport/atom-language-julia)
|
||||
29. Jxck/assert version 1.0.0 (https://github.com/Jxck/assert)
|
||||
30. language-docker (https://github.com/moby/moby)
|
||||
31. language-less version 0.34.2 (https://github.com/atom/language-less)
|
||||
32. language-php version 0.46.2 (https://github.com/atom/language-php)
|
||||
33. MagicStack/MagicPython version 1.1.1 (https://github.com/MagicStack/MagicPython)
|
||||
34. marked version 1.1.0 (https://github.com/markedjs/marked)
|
||||
35. mdn-data version 1.1.12 (https://github.com/mdn/data)
|
||||
36. microsoft/TypeScript-TmLanguage version 0.0.1 (https://github.com/microsoft/TypeScript-TmLanguage)
|
||||
37. microsoft/vscode-JSON.tmLanguage (https://github.com/microsoft/vscode-JSON.tmLanguage)
|
||||
38. microsoft/vscode-markdown-tm-grammar version 1.0.0 (https://github.com/microsoft/vscode-markdown-tm-grammar)
|
||||
39. microsoft/vscode-mssql version 1.9.0 (https://github.com/microsoft/vscode-mssql)
|
||||
40. mmims/language-batchfile version 0.7.6 (https://github.com/mmims/language-batchfile)
|
||||
41. NVIDIA/cuda-cpp-grammar (https://github.com/NVIDIA/cuda-cpp-grammar)
|
||||
42. PowerShell/EditorSyntax version 1.0.0 (https://github.com/PowerShell/EditorSyntax)
|
||||
43. rust-syntax version 0.4.3 (https://github.com/dustypomerleau/rust-syntax)
|
||||
44. seti-ui version 0.1.0 (https://github.com/jesseweed/seti-ui)
|
||||
45. shaders-tmLanguage version 0.1.0 (https://github.com/tgjones/shaders-tmLanguage)
|
||||
46. textmate/asp.vb.net.tmbundle (https://github.com/textmate/asp.vb.net.tmbundle)
|
||||
47. textmate/c.tmbundle (https://github.com/textmate/c.tmbundle)
|
||||
48. textmate/diff.tmbundle (https://github.com/textmate/diff.tmbundle)
|
||||
49. textmate/git.tmbundle (https://github.com/textmate/git.tmbundle)
|
||||
50. textmate/groovy.tmbundle (https://github.com/textmate/groovy.tmbundle)
|
||||
51. textmate/html.tmbundle (https://github.com/textmate/html.tmbundle)
|
||||
52. textmate/ini.tmbundle (https://github.com/textmate/ini.tmbundle)
|
||||
53. textmate/javascript.tmbundle (https://github.com/textmate/javascript.tmbundle)
|
||||
54. textmate/lua.tmbundle (https://github.com/textmate/lua.tmbundle)
|
||||
55. textmate/markdown.tmbundle (https://github.com/textmate/markdown.tmbundle)
|
||||
56. textmate/perl.tmbundle (https://github.com/textmate/perl.tmbundle)
|
||||
57. textmate/ruby.tmbundle (https://github.com/textmate/ruby.tmbundle)
|
||||
58. textmate/yaml.tmbundle (https://github.com/textmate/yaml.tmbundle)
|
||||
59. TypeScript-TmLanguage version 0.1.8 (https://github.com/microsoft/TypeScript-TmLanguage)
|
||||
60. TypeScript-TmLanguage version 1.0.0 (https://github.com/microsoft/TypeScript-TmLanguage)
|
||||
61. Unicode version 12.0.0 (https://home.unicode.org/)
|
||||
62. vscode-codicons version 0.0.14 (https://github.com/microsoft/vscode-codicons)
|
||||
63. vscode-logfile-highlighter version 2.11.0 (https://github.com/emilast/vscode-logfile-highlighter)
|
||||
64. vscode-swift version 0.0.1 (https://github.com/owensd/vscode-swift)
|
||||
65. Web Background Synchronization (https://github.com/WICG/background-sync)
|
||||
|
||||
|
||||
%% JuliaEditorSupport/atom-language-julia NOTICES AND INFORMATION BEGIN HERE
|
||||
=========================================
|
||||
The atom-language-julia package is licensed under the MIT "Expat" License:
|
||||
|
||||
> Copyright (c) 2015
|
||||
>
|
||||
> Permission is hereby granted, free of charge, to any person obtaining
|
||||
> a copy of this software and associated documentation files (the
|
||||
> "Software"), to deal in the Software without restriction, including
|
||||
> without limitation the rights to use, copy, modify, merge, publish,
|
||||
> distribute, sublicense, and/or sell copies of the Software, and to
|
||||
> permit persons to whom the Software is furnished to do so, subject to
|
||||
> the following conditions:
|
||||
>
|
||||
> The above copyright notice and this permission notice shall be
|
||||
> included in all copies or substantial portions of the Software.
|
||||
>
|
||||
> THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||
> EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||
> MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
||||
> IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
|
||||
> CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
|
||||
> TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
||||
> SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
=========================================
|
||||
END OF JuliaEditorSupport/atom-language-julia NOTICES AND INFORMATION
|
||||
|
||||
%% atom/language-clojure NOTICES AND INFORMATION BEGIN HERE
|
||||
=========================================
|
||||
Copyright (c) 2014 GitHub Inc.
|
||||
@@ -477,6 +451,38 @@ THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
|
||||
=========================================
|
||||
END OF daaain/Handlebars NOTICES AND INFORMATION
|
||||
|
||||
%% dart-lang/dart-syntax-highlight NOTICES AND INFORMATION BEGIN HERE
|
||||
=========================================
|
||||
Copyright 2020, the Dart project authors.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions are
|
||||
met:
|
||||
|
||||
* Redistributions of source code must retain the above copyright
|
||||
notice, this list of conditions and the following disclaimer.
|
||||
* Redistributions in binary form must reproduce the above
|
||||
copyright notice, this list of conditions and the following
|
||||
disclaimer in the documentation and/or other materials provided
|
||||
with the distribution.
|
||||
* Neither the name of Google LLC nor the names of its
|
||||
contributors may be used to endorse or promote products derived
|
||||
from this software without specific prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
||||
OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
=========================================
|
||||
END OF dart-lang/dart-syntax-highlight NOTICES AND INFORMATION
|
||||
|
||||
%% davidrios/pug-tmbundle NOTICES AND INFORMATION BEGIN HERE
|
||||
=========================================
|
||||
The MIT License (MIT)
|
||||
@@ -855,6 +861,33 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
|
||||
=========================================
|
||||
END OF js-beautify NOTICES AND INFORMATION
|
||||
|
||||
%% JuliaEditorSupport/atom-language-julia NOTICES AND INFORMATION BEGIN HERE
|
||||
=========================================
|
||||
The atom-language-julia package is licensed under the MIT "Expat" License:
|
||||
|
||||
> Copyright (c) 2015
|
||||
>
|
||||
> Permission is hereby granted, free of charge, to any person obtaining
|
||||
> a copy of this software and associated documentation files (the
|
||||
> "Software"), to deal in the Software without restriction, including
|
||||
> without limitation the rights to use, copy, modify, merge, publish,
|
||||
> distribute, sublicense, and/or sell copies of the Software, and to
|
||||
> permit persons to whom the Software is furnished to do so, subject to
|
||||
> the following conditions:
|
||||
>
|
||||
> The above copyright notice and this permission notice shall be
|
||||
> included in all copies or substantial portions of the Software.
|
||||
>
|
||||
> THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||
> EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||
> MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
||||
> IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
|
||||
> CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
|
||||
> TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
||||
> SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
=========================================
|
||||
END OF JuliaEditorSupport/atom-language-julia NOTICES AND INFORMATION
|
||||
|
||||
%% Jxck/assert NOTICES AND INFORMATION BEGIN HERE
|
||||
=========================================
|
||||
The MIT License (MIT)
|
||||
|
||||
@@ -5,15 +5,101 @@
|
||||
'use strict';
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
const fs = require("fs");
|
||||
const url = require("url");
|
||||
const crypto = require("crypto");
|
||||
const azure = require("azure-storage");
|
||||
const mime = require("mime");
|
||||
const cosmos_1 = require("@azure/cosmos");
|
||||
const retry_1 = require("./retry");
|
||||
if (process.argv.length !== 6) {
|
||||
console.error('Usage: node createAsset.js PLATFORM TYPE NAME FILE');
|
||||
if (process.argv.length !== 8) {
|
||||
console.error('Usage: node createAsset.js PRODUCT OS ARCH TYPE NAME FILE');
|
||||
process.exit(-1);
|
||||
}
|
||||
// Contains all of the logic for mapping details to our actual product names in CosmosDB
|
||||
function getPlatform(product, os, arch, type) {
|
||||
switch (os) {
|
||||
case 'win32':
|
||||
switch (product) {
|
||||
case 'client':
|
||||
const asset = arch === 'ia32' ? 'win32' : `win32-${arch}`;
|
||||
switch (type) {
|
||||
case 'archive':
|
||||
return `${asset}-archive`;
|
||||
case 'setup':
|
||||
return asset;
|
||||
case 'user-setup':
|
||||
return `${asset}-user`;
|
||||
default:
|
||||
throw `Unrecognized: ${product} ${os} ${arch} ${type}`;
|
||||
}
|
||||
case 'server':
|
||||
if (arch === 'arm64') {
|
||||
throw `Unrecognized: ${product} ${os} ${arch} ${type}`;
|
||||
}
|
||||
return arch === 'ia32' ? 'server-win32' : `server-win32-${arch}`;
|
||||
case 'web':
|
||||
if (arch === 'arm64') {
|
||||
throw `Unrecognized: ${product} ${os} ${arch} ${type}`;
|
||||
}
|
||||
return arch === 'ia32' ? 'server-win32-web' : `server-win32-${arch}-web`;
|
||||
default:
|
||||
throw `Unrecognized: ${product} ${os} ${arch} ${type}`;
|
||||
}
|
||||
case 'linux':
|
||||
switch (type) {
|
||||
case 'snap':
|
||||
return `linux-snap-${arch}`;
|
||||
case 'archive-unsigned':
|
||||
switch (product) {
|
||||
case 'client':
|
||||
return `linux-${arch}`;
|
||||
case 'server':
|
||||
return `server-linux-${arch}`;
|
||||
case 'web':
|
||||
return arch === 'standalone' ? 'web-standalone' : `server-linux-${arch}-web`;
|
||||
default:
|
||||
throw `Unrecognized: ${product} ${os} ${arch} ${type}`;
|
||||
}
|
||||
case 'deb-package':
|
||||
return `linux-deb-${arch}`;
|
||||
case 'rpm-package':
|
||||
return `linux-rpm-${arch}`;
|
||||
default:
|
||||
throw `Unrecognized: ${product} ${os} ${arch} ${type}`;
|
||||
}
|
||||
case 'darwin':
|
||||
switch (product) {
|
||||
case 'client':
|
||||
if (arch === 'x64') {
|
||||
return 'darwin';
|
||||
}
|
||||
return `darwin-${arch}`;
|
||||
case 'server':
|
||||
return 'server-darwin';
|
||||
case 'web':
|
||||
if (arch !== 'x64') {
|
||||
throw `What should the platform be?: ${product} ${os} ${arch} ${type}`;
|
||||
}
|
||||
return 'server-darwin-web';
|
||||
default:
|
||||
throw `Unrecognized: ${product} ${os} ${arch} ${type}`;
|
||||
}
|
||||
default:
|
||||
throw `Unrecognized: ${product} ${os} ${arch} ${type}`;
|
||||
}
|
||||
}
|
||||
// Contains all of the logic for mapping types to our actual types in CosmosDB
|
||||
function getRealType(type) {
|
||||
switch (type) {
|
||||
case 'user-setup':
|
||||
return 'setup';
|
||||
case 'deb-package':
|
||||
case 'rpm-package':
|
||||
return 'package';
|
||||
default:
|
||||
return type;
|
||||
}
|
||||
}
|
||||
function hashStream(hashName, stream) {
|
||||
return new Promise((c, e) => {
|
||||
const shasum = crypto.createHash(hashName);
|
||||
@@ -45,7 +131,10 @@ function getEnv(name) {
|
||||
return result;
|
||||
}
|
||||
async function main() {
|
||||
const [, , platform, type, fileName, filePath] = process.argv;
|
||||
const [, , product, os, arch, unprocessedType, fileName, filePath] = process.argv;
|
||||
// getPlatform needs the unprocessedType
|
||||
const platform = getPlatform(product, os, arch, unprocessedType);
|
||||
const type = getRealType(unprocessedType);
|
||||
const quality = getEnv('VSCODE_QUALITY');
|
||||
const commit = getEnv('BUILD_SOURCEVERSION');
|
||||
console.log('Creating asset...');
|
||||
@@ -65,14 +154,27 @@ async function main() {
|
||||
console.log(`Blob ${quality}, ${blobName} already exists, not publishing again.`);
|
||||
return;
|
||||
}
|
||||
console.log('Uploading blobs to Azure storage...');
|
||||
await uploadBlob(blobService, quality, blobName, filePath, fileName);
|
||||
const mooncakeBlobService = azure.createBlobService(storageAccount, process.env['MOONCAKE_STORAGE_ACCESS_KEY'], `${storageAccount}.blob.core.chinacloudapi.cn`)
|
||||
.withFilter(new azure.ExponentialRetryPolicyFilter(20));
|
||||
// mooncake is fussy and far away, this is needed!
|
||||
blobService.defaultClientRequestTimeoutInMs = 10 * 60 * 1000;
|
||||
mooncakeBlobService.defaultClientRequestTimeoutInMs = 10 * 60 * 1000;
|
||||
console.log('Uploading blobs to Azure storage and Mooncake Azure storage...');
|
||||
await retry_1.retry(() => Promise.all([
|
||||
uploadBlob(blobService, quality, blobName, filePath, fileName),
|
||||
uploadBlob(mooncakeBlobService, quality, blobName, filePath, fileName)
|
||||
]));
|
||||
console.log('Blobs successfully uploaded.');
|
||||
// TODO: Understand if blobName and blobPath are the same and replace blobPath with blobName if so.
|
||||
const assetUrl = `${process.env['AZURE_CDN_URL']}/${quality}/${blobName}`;
|
||||
const blobPath = url.parse(assetUrl).path;
|
||||
const mooncakeUrl = `${process.env['MOONCAKE_CDN_URL']}${blobPath}`;
|
||||
const asset = {
|
||||
platform,
|
||||
type,
|
||||
url: `${process.env['AZURE_CDN_URL']}/${quality}/${blobName}`,
|
||||
url: assetUrl,
|
||||
hash: sha1hash,
|
||||
mooncakeUrl,
|
||||
sha256hash,
|
||||
size
|
||||
};
|
||||
@@ -84,6 +186,7 @@ async function main() {
|
||||
const client = new cosmos_1.CosmosClient({ endpoint: process.env['AZURE_DOCUMENTDB_ENDPOINT'], key: process.env['AZURE_DOCUMENTDB_MASTERKEY'] });
|
||||
const scripts = client.database('builds').container(quality).scripts;
|
||||
await retry_1.retry(() => scripts.storedProcedure('createAsset').execute('', [commit, asset, true]));
|
||||
console.log(` Done ✔️`);
|
||||
}
|
||||
main().then(() => {
|
||||
console.log('Asset successfully created');
|
||||
|
||||
@@ -6,6 +6,7 @@
|
||||
'use strict';
|
||||
|
||||
import * as fs from 'fs';
|
||||
import * as url from 'url';
|
||||
import { Readable } from 'stream';
|
||||
import * as crypto from 'crypto';
|
||||
import * as azure from 'azure-storage';
|
||||
@@ -24,11 +25,98 @@ interface Asset {
|
||||
supportsFastUpdate?: boolean;
|
||||
}
|
||||
|
||||
if (process.argv.length !== 6) {
|
||||
console.error('Usage: node createAsset.js PLATFORM TYPE NAME FILE');
|
||||
if (process.argv.length !== 8) {
|
||||
console.error('Usage: node createAsset.js PRODUCT OS ARCH TYPE NAME FILE');
|
||||
process.exit(-1);
|
||||
}
|
||||
|
||||
// Contains all of the logic for mapping details to our actual product names in CosmosDB
|
||||
function getPlatform(product: string, os: string, arch: string, type: string): string {
|
||||
switch (os) {
|
||||
case 'win32':
|
||||
switch (product) {
|
||||
case 'client':
|
||||
const asset = arch === 'ia32' ? 'win32' : `win32-${arch}`;
|
||||
switch (type) {
|
||||
case 'archive':
|
||||
return `${asset}-archive`;
|
||||
case 'setup':
|
||||
return asset;
|
||||
case 'user-setup':
|
||||
return `${asset}-user`;
|
||||
default:
|
||||
throw `Unrecognized: ${product} ${os} ${arch} ${type}`;
|
||||
}
|
||||
case 'server':
|
||||
if (arch === 'arm64') {
|
||||
throw `Unrecognized: ${product} ${os} ${arch} ${type}`;
|
||||
}
|
||||
return arch === 'ia32' ? 'server-win32' : `server-win32-${arch}`;
|
||||
case 'web':
|
||||
if (arch === 'arm64') {
|
||||
throw `Unrecognized: ${product} ${os} ${arch} ${type}`;
|
||||
}
|
||||
return arch === 'ia32' ? 'server-win32-web' : `server-win32-${arch}-web`;
|
||||
default:
|
||||
throw `Unrecognized: ${product} ${os} ${arch} ${type}`;
|
||||
}
|
||||
case 'linux':
|
||||
switch (type) {
|
||||
case 'snap':
|
||||
return `linux-snap-${arch}`;
|
||||
case 'archive-unsigned':
|
||||
switch (product) {
|
||||
case 'client':
|
||||
return `linux-${arch}`;
|
||||
case 'server':
|
||||
return `server-linux-${arch}`;
|
||||
case 'web':
|
||||
return arch === 'standalone' ? 'web-standalone' : `server-linux-${arch}-web`;
|
||||
default:
|
||||
throw `Unrecognized: ${product} ${os} ${arch} ${type}`;
|
||||
}
|
||||
case 'deb-package':
|
||||
return `linux-deb-${arch}`;
|
||||
case 'rpm-package':
|
||||
return `linux-rpm-${arch}`;
|
||||
default:
|
||||
throw `Unrecognized: ${product} ${os} ${arch} ${type}`;
|
||||
}
|
||||
case 'darwin':
|
||||
switch (product) {
|
||||
case 'client':
|
||||
if (arch === 'x64') {
|
||||
return 'darwin';
|
||||
}
|
||||
return `darwin-${arch}`;
|
||||
case 'server':
|
||||
return 'server-darwin';
|
||||
case 'web':
|
||||
if (arch !== 'x64') {
|
||||
throw `What should the platform be?: ${product} ${os} ${arch} ${type}`;
|
||||
}
|
||||
return 'server-darwin-web';
|
||||
default:
|
||||
throw `Unrecognized: ${product} ${os} ${arch} ${type}`;
|
||||
}
|
||||
default:
|
||||
throw `Unrecognized: ${product} ${os} ${arch} ${type}`;
|
||||
}
|
||||
}
|
||||
|
||||
// Contains all of the logic for mapping types to our actual types in CosmosDB
|
||||
function getRealType(type: string) {
|
||||
switch (type) {
|
||||
case 'user-setup':
|
||||
return 'setup';
|
||||
case 'deb-package':
|
||||
case 'rpm-package':
|
||||
return 'package';
|
||||
default:
|
||||
return type;
|
||||
}
|
||||
}
|
||||
|
||||
function hashStream(hashName: string, stream: Readable): Promise<string> {
|
||||
return new Promise<string>((c, e) => {
|
||||
const shasum = crypto.createHash(hashName);
|
||||
@@ -68,7 +156,10 @@ function getEnv(name: string): string {
|
||||
}
|
||||
|
||||
async function main(): Promise<void> {
|
||||
const [, , platform, type, fileName, filePath] = process.argv;
|
||||
const [, , product, os, arch, unprocessedType, fileName, filePath] = process.argv;
|
||||
// getPlatform needs the unprocessedType
|
||||
const platform = getPlatform(product, os, arch, unprocessedType);
|
||||
const type = getRealType(unprocessedType);
|
||||
const quality = getEnv('VSCODE_QUALITY');
|
||||
const commit = getEnv('BUILD_SOURCEVERSION');
|
||||
|
||||
@@ -98,17 +189,33 @@ async function main(): Promise<void> {
|
||||
return;
|
||||
}
|
||||
|
||||
console.log('Uploading blobs to Azure storage...');
|
||||
const mooncakeBlobService = azure.createBlobService(storageAccount, process.env['MOONCAKE_STORAGE_ACCESS_KEY']!, `${storageAccount}.blob.core.chinacloudapi.cn`)
|
||||
.withFilter(new azure.ExponentialRetryPolicyFilter(20));
|
||||
|
||||
await uploadBlob(blobService, quality, blobName, filePath, fileName);
|
||||
// mooncake is fussy and far away, this is needed!
|
||||
blobService.defaultClientRequestTimeoutInMs = 10 * 60 * 1000;
|
||||
mooncakeBlobService.defaultClientRequestTimeoutInMs = 10 * 60 * 1000;
|
||||
|
||||
console.log('Uploading blobs to Azure storage and Mooncake Azure storage...');
|
||||
|
||||
await retry(() => Promise.all([
|
||||
uploadBlob(blobService, quality, blobName, filePath, fileName),
|
||||
uploadBlob(mooncakeBlobService, quality, blobName, filePath, fileName)
|
||||
]));
|
||||
|
||||
console.log('Blobs successfully uploaded.');
|
||||
|
||||
// TODO: Understand if blobName and blobPath are the same and replace blobPath with blobName if so.
|
||||
const assetUrl = `${process.env['AZURE_CDN_URL']}/${quality}/${blobName}`;
|
||||
const blobPath = url.parse(assetUrl).path;
|
||||
const mooncakeUrl = `${process.env['MOONCAKE_CDN_URL']}${blobPath}`;
|
||||
|
||||
const asset: Asset = {
|
||||
platform,
|
||||
type,
|
||||
url: `${process.env['AZURE_CDN_URL']}/${quality}/${blobName}`,
|
||||
url: assetUrl,
|
||||
hash: sha1hash,
|
||||
mooncakeUrl,
|
||||
sha256hash,
|
||||
size
|
||||
};
|
||||
@@ -123,6 +230,8 @@ async function main(): Promise<void> {
|
||||
const client = new CosmosClient({ endpoint: process.env['AZURE_DOCUMENTDB_ENDPOINT']!, key: process.env['AZURE_DOCUMENTDB_MASTERKEY'] });
|
||||
const scripts = client.database('builds').container(quality).scripts;
|
||||
await retry(() => scripts.storedProcedure('createAsset').execute('', [commit, asset, true]));
|
||||
|
||||
console.log(` Done ✔️`);
|
||||
}
|
||||
|
||||
main().then(() => {
|
||||
|
||||
@@ -1,87 +0,0 @@
|
||||
/*---------------------------------------------------------------------------------------------
|
||||
* Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
* Licensed under the MIT License. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
'use strict';
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
const url = require("url");
|
||||
const azure = require("azure-storage");
|
||||
const mime = require("mime");
|
||||
const cosmos_1 = require("@azure/cosmos");
|
||||
const retry_1 = require("./retry");
|
||||
function log(...args) {
|
||||
console.log(...[`[${new Date().toISOString()}]`, ...args]);
|
||||
}
|
||||
function error(...args) {
|
||||
console.error(...[`[${new Date().toISOString()}]`, ...args]);
|
||||
}
|
||||
if (process.argv.length < 3) {
|
||||
error('Usage: node sync-mooncake.js <quality>');
|
||||
process.exit(-1);
|
||||
}
|
||||
async function sync(commit, quality) {
|
||||
log(`Synchronizing Mooncake assets for ${quality}, ${commit}...`);
|
||||
const client = new cosmos_1.CosmosClient({ endpoint: process.env['AZURE_DOCUMENTDB_ENDPOINT'], key: process.env['AZURE_DOCUMENTDB_MASTERKEY'] });
|
||||
const container = client.database('builds').container(quality);
|
||||
const query = `SELECT TOP 1 * FROM c WHERE c.id = "${commit}"`;
|
||||
const res = await container.items.query(query, {}).fetchAll();
|
||||
if (res.resources.length !== 1) {
|
||||
throw new Error(`No builds found for ${commit}`);
|
||||
}
|
||||
const build = res.resources[0];
|
||||
log(`Found build for ${commit}, with ${build.assets.length} assets`);
|
||||
const storageAccount = process.env['AZURE_STORAGE_ACCOUNT_2'];
|
||||
const blobService = azure.createBlobService(storageAccount, process.env['AZURE_STORAGE_ACCESS_KEY_2'])
|
||||
.withFilter(new azure.ExponentialRetryPolicyFilter(20));
|
||||
const mooncakeBlobService = azure.createBlobService(storageAccount, process.env['MOONCAKE_STORAGE_ACCESS_KEY'], `${storageAccount}.blob.core.chinacloudapi.cn`)
|
||||
.withFilter(new azure.ExponentialRetryPolicyFilter(20));
|
||||
// mooncake is fussy and far away, this is needed!
|
||||
blobService.defaultClientRequestTimeoutInMs = 10 * 60 * 1000;
|
||||
mooncakeBlobService.defaultClientRequestTimeoutInMs = 10 * 60 * 1000;
|
||||
for (const asset of build.assets) {
|
||||
try {
|
||||
const blobPath = url.parse(asset.url).path;
|
||||
if (!blobPath) {
|
||||
throw new Error(`Failed to parse URL: ${asset.url}`);
|
||||
}
|
||||
const blobName = blobPath.replace(/^\/\w+\//, '');
|
||||
log(`Found ${blobName}`);
|
||||
if (asset.mooncakeUrl) {
|
||||
log(` Already in Mooncake ✔️`);
|
||||
continue;
|
||||
}
|
||||
const readStream = blobService.createReadStream(quality, blobName, undefined);
|
||||
const blobOptions = {
|
||||
contentSettings: {
|
||||
contentType: mime.lookup(blobPath),
|
||||
cacheControl: 'max-age=31536000, public'
|
||||
}
|
||||
};
|
||||
const writeStream = mooncakeBlobService.createWriteStreamToBlockBlob(quality, blobName, blobOptions, undefined);
|
||||
log(` Uploading to Mooncake...`);
|
||||
await new Promise((c, e) => readStream.pipe(writeStream).on('finish', c).on('error', e));
|
||||
log(` Updating build in DB...`);
|
||||
const mooncakeUrl = `${process.env['MOONCAKE_CDN_URL']}${blobPath}`;
|
||||
await retry_1.retry(() => container.scripts.storedProcedure('setAssetMooncakeUrl')
|
||||
.execute('', [commit, asset.platform, asset.type, mooncakeUrl]));
|
||||
log(` Done ✔️`);
|
||||
}
|
||||
catch (err) {
|
||||
error(err);
|
||||
}
|
||||
}
|
||||
log(`All done ✔️`);
|
||||
}
|
||||
function main() {
|
||||
const commit = process.env['BUILD_SOURCEVERSION'];
|
||||
if (!commit) {
|
||||
error('Skipping publish due to missing BUILD_SOURCEVERSION');
|
||||
return;
|
||||
}
|
||||
const quality = process.argv[2];
|
||||
sync(commit, quality).catch(err => {
|
||||
error(err);
|
||||
process.exit(1);
|
||||
});
|
||||
}
|
||||
main();
|
||||
@@ -1,131 +0,0 @@
|
||||
/*---------------------------------------------------------------------------------------------
|
||||
* Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
* Licensed under the MIT License. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
|
||||
'use strict';
|
||||
|
||||
import * as url from 'url';
|
||||
import * as azure from 'azure-storage';
|
||||
import * as mime from 'mime';
|
||||
import { CosmosClient } from '@azure/cosmos';
|
||||
import { retry } from './retry';
|
||||
|
||||
function log(...args: any[]) {
|
||||
console.log(...[`[${new Date().toISOString()}]`, ...args]);
|
||||
}
|
||||
|
||||
function error(...args: any[]) {
|
||||
console.error(...[`[${new Date().toISOString()}]`, ...args]);
|
||||
}
|
||||
|
||||
if (process.argv.length < 3) {
|
||||
error('Usage: node sync-mooncake.js <quality>');
|
||||
process.exit(-1);
|
||||
}
|
||||
|
||||
interface Build {
|
||||
assets: Asset[];
|
||||
}
|
||||
|
||||
interface Asset {
|
||||
platform: string;
|
||||
type: string;
|
||||
url: string;
|
||||
mooncakeUrl: string;
|
||||
hash: string;
|
||||
sha256hash: string;
|
||||
size: number;
|
||||
supportsFastUpdate?: boolean;
|
||||
}
|
||||
|
||||
async function sync(commit: string, quality: string): Promise<void> {
|
||||
log(`Synchronizing Mooncake assets for ${quality}, ${commit}...`);
|
||||
|
||||
const client = new CosmosClient({ endpoint: process.env['AZURE_DOCUMENTDB_ENDPOINT']!, key: process.env['AZURE_DOCUMENTDB_MASTERKEY'] });
|
||||
const container = client.database('builds').container(quality);
|
||||
|
||||
const query = `SELECT TOP 1 * FROM c WHERE c.id = "${commit}"`;
|
||||
const res = await container.items.query<Build>(query, {}).fetchAll();
|
||||
|
||||
if (res.resources.length !== 1) {
|
||||
throw new Error(`No builds found for ${commit}`);
|
||||
}
|
||||
|
||||
const build = res.resources[0];
|
||||
|
||||
log(`Found build for ${commit}, with ${build.assets.length} assets`);
|
||||
|
||||
const storageAccount = process.env['AZURE_STORAGE_ACCOUNT_2']!;
|
||||
|
||||
const blobService = azure.createBlobService(storageAccount, process.env['AZURE_STORAGE_ACCESS_KEY_2']!)
|
||||
.withFilter(new azure.ExponentialRetryPolicyFilter(20));
|
||||
|
||||
const mooncakeBlobService = azure.createBlobService(storageAccount, process.env['MOONCAKE_STORAGE_ACCESS_KEY']!, `${storageAccount}.blob.core.chinacloudapi.cn`)
|
||||
.withFilter(new azure.ExponentialRetryPolicyFilter(20));
|
||||
|
||||
// mooncake is fussy and far away, this is needed!
|
||||
blobService.defaultClientRequestTimeoutInMs = 10 * 60 * 1000;
|
||||
mooncakeBlobService.defaultClientRequestTimeoutInMs = 10 * 60 * 1000;
|
||||
|
||||
for (const asset of build.assets) {
|
||||
try {
|
||||
const blobPath = url.parse(asset.url).path;
|
||||
|
||||
if (!blobPath) {
|
||||
throw new Error(`Failed to parse URL: ${asset.url}`);
|
||||
}
|
||||
|
||||
const blobName = blobPath.replace(/^\/\w+\//, '');
|
||||
|
||||
log(`Found ${blobName}`);
|
||||
|
||||
if (asset.mooncakeUrl) {
|
||||
log(` Already in Mooncake ✔️`);
|
||||
continue;
|
||||
}
|
||||
|
||||
const readStream = blobService.createReadStream(quality, blobName, undefined!);
|
||||
const blobOptions: azure.BlobService.CreateBlockBlobRequestOptions = {
|
||||
contentSettings: {
|
||||
contentType: mime.lookup(blobPath),
|
||||
cacheControl: 'max-age=31536000, public'
|
||||
}
|
||||
};
|
||||
|
||||
const writeStream = mooncakeBlobService.createWriteStreamToBlockBlob(quality, blobName, blobOptions, undefined);
|
||||
|
||||
log(` Uploading to Mooncake...`);
|
||||
await new Promise((c, e) => readStream.pipe(writeStream).on('finish', c).on('error', e));
|
||||
|
||||
log(` Updating build in DB...`);
|
||||
const mooncakeUrl = `${process.env['MOONCAKE_CDN_URL']}${blobPath}`;
|
||||
await retry(() => container.scripts.storedProcedure('setAssetMooncakeUrl')
|
||||
.execute('', [commit, asset.platform, asset.type, mooncakeUrl]));
|
||||
|
||||
log(` Done ✔️`);
|
||||
} catch (err) {
|
||||
error(err);
|
||||
}
|
||||
}
|
||||
|
||||
log(`All done ✔️`);
|
||||
}
|
||||
|
||||
function main(): void {
|
||||
const commit = process.env['BUILD_SOURCEVERSION'];
|
||||
|
||||
if (!commit) {
|
||||
error('Skipping publish due to missing BUILD_SOURCEVERSION');
|
||||
return;
|
||||
}
|
||||
|
||||
const quality = process.argv[2];
|
||||
|
||||
sync(commit, quality).catch(err => {
|
||||
error(err);
|
||||
process.exit(1);
|
||||
});
|
||||
}
|
||||
|
||||
main();
|
||||
@@ -35,13 +35,13 @@ steps:
|
||||
displayName: Restore modules for just build folder and compile it
|
||||
|
||||
- download: current
|
||||
artifact: vscode-darwin-$(VSCODE_ARCH)
|
||||
artifact: unsigned_vscode_client_darwin_$(VSCODE_ARCH)_archive
|
||||
displayName: Download $(VSCODE_ARCH) artifact
|
||||
|
||||
- script: |
|
||||
set -e
|
||||
unzip $(Pipeline.Workspace)/vscode-darwin-$(VSCODE_ARCH)/VSCode-darwin-$(VSCODE_ARCH).zip -d $(agent.builddirectory)/VSCode-darwin-$(VSCODE_ARCH)
|
||||
mv $(Pipeline.Workspace)/vscode-darwin-$(VSCODE_ARCH)/VSCode-darwin-$(VSCODE_ARCH).zip $(agent.builddirectory)/VSCode-darwin-$(VSCODE_ARCH).zip
|
||||
unzip $(Pipeline.Workspace)/unsigned_vscode_client_darwin_$(VSCODE_ARCH)_archive/VSCode-darwin-$(VSCODE_ARCH).zip -d $(agent.builddirectory)/VSCode-darwin-$(VSCODE_ARCH)
|
||||
mv $(Pipeline.Workspace)/unsigned_vscode_client_darwin_$(VSCODE_ARCH)_archive/VSCode-darwin-$(VSCODE_ARCH).zip $(agent.builddirectory)/VSCode-darwin-$(VSCODE_ARCH).zip
|
||||
displayName: Unzip & move
|
||||
|
||||
- task: SFP.build-tasks.custom-build-task-1.EsrpCodeSigning@1
|
||||
@@ -108,22 +108,18 @@ steps:
|
||||
condition: and(succeeded(), ne(variables['VSCODE_ARCH'], 'arm64'))
|
||||
|
||||
- script: |
|
||||
set -e
|
||||
|
||||
# For legacy purposes, arch for x64 is just 'darwin'
|
||||
case $VSCODE_ARCH in
|
||||
x64) ASSET_ID="darwin" ;;
|
||||
arm64) ASSET_ID="darwin-arm64" ;;
|
||||
universal) ASSET_ID="darwin-universal" ;;
|
||||
esac
|
||||
echo "##vso[task.setvariable variable=ASSET_ID]$ASSET_ID"
|
||||
displayName: Set asset id variable
|
||||
|
||||
VSCODE_MIXIN_PASSWORD="$(github-distro-mixin-password)" \
|
||||
AZURE_DOCUMENTDB_MASTERKEY="$(builds-docdb-key-readwrite)" \
|
||||
AZURE_STORAGE_ACCESS_KEY="$(ticino-storage-key)" \
|
||||
AZURE_STORAGE_ACCESS_KEY_2="$(vscode-storage-key)" \
|
||||
node build/azure-pipelines/common/createAsset.js \
|
||||
"$ASSET_ID" \
|
||||
archive \
|
||||
"VSCode-$ASSET_ID.zip" \
|
||||
../VSCode-darwin-$(VSCODE_ARCH).zip
|
||||
displayName: Publish Clients
|
||||
- script: mv $(agent.builddirectory)/VSCode-darwin-x64.zip $(agent.builddirectory)/VSCode-darwin.zip
|
||||
displayName: Rename x64 build to it's legacy name
|
||||
condition: and(succeeded(), eq(variables['VSCODE_ARCH'], 'x64'))
|
||||
|
||||
- publish: $(Agent.BuildDirectory)/VSCode-$(ASSET_ID).zip
|
||||
artifact: vscode_client_darwin_$(VSCODE_ARCH)_archive
|
||||
|
||||
@@ -138,19 +138,19 @@ steps:
|
||||
condition: and(succeeded(), ne(variables['VSCODE_ARCH'], 'universal'), eq(variables['VSCODE_STEP_ON_IT'], 'false'))
|
||||
|
||||
- download: current
|
||||
artifact: vscode-darwin-x64
|
||||
artifact: unsigned_vscode_client_darwin_x64_archive
|
||||
displayName: Download x64 artifact
|
||||
condition: and(succeeded(), eq(variables['VSCODE_ARCH'], 'universal'))
|
||||
|
||||
- download: current
|
||||
artifact: vscode-darwin-arm64
|
||||
artifact: unsigned_vscode_client_darwin_arm64_archive
|
||||
displayName: Download arm64 artifact
|
||||
condition: and(succeeded(), eq(variables['VSCODE_ARCH'], 'universal'))
|
||||
|
||||
- script: |
|
||||
set -e
|
||||
cp $(Pipeline.Workspace)/vscode-darwin-x64/VSCode-darwin-x64.zip $(agent.builddirectory)/VSCode-darwin-x64.zip
|
||||
cp $(Pipeline.Workspace)/vscode-darwin-arm64/VSCode-darwin-arm64.zip $(agent.builddirectory)/VSCode-darwin-arm64.zip
|
||||
cp $(Pipeline.Workspace)/unsigned_vscode_client_darwin_x64_archive/VSCode-darwin-x64.zip $(agent.builddirectory)/VSCode-darwin-x64.zip
|
||||
cp $(Pipeline.Workspace)/unsigned_vscode_client_darwin_arm64_archive/VSCode-darwin-arm64.zip $(agent.builddirectory)/VSCode-darwin-arm64.zip
|
||||
unzip $(agent.builddirectory)/VSCode-darwin-x64.zip -d $(agent.builddirectory)/VSCode-darwin-x64
|
||||
unzip $(agent.builddirectory)/VSCode-darwin-arm64.zip -d $(agent.builddirectory)/VSCode-darwin-arm64
|
||||
DEBUG=* node build/darwin/create-universal-app.js
|
||||
@@ -280,26 +280,27 @@ steps:
|
||||
|
||||
- script: |
|
||||
set -e
|
||||
VSCODE_MIXIN_PASSWORD="$(github-distro-mixin-password)" \
|
||||
AZURE_DOCUMENTDB_MASTERKEY="$(builds-docdb-key-readwrite)" \
|
||||
AZURE_STORAGE_ACCESS_KEY="$(ticino-storage-key)" \
|
||||
AZURE_STORAGE_ACCESS_KEY_2="$(vscode-storage-key)" \
|
||||
VSCODE_ARCH="$(VSCODE_ARCH)" ./build/azure-pipelines/darwin/publish-server.sh
|
||||
displayName: Publish Servers
|
||||
|
||||
# package Remote Extension Host
|
||||
pushd .. && mv vscode-reh-darwin vscode-server-darwin && zip -Xry vscode-server-darwin.zip vscode-server-darwin && popd
|
||||
|
||||
# package Remote Extension Host (Web)
|
||||
pushd .. && mv vscode-reh-web-darwin vscode-server-darwin-web && zip -Xry vscode-server-darwin-web.zip vscode-server-darwin-web && popd
|
||||
displayName: Prepare to publish servers
|
||||
condition: and(succeeded(), eq(variables['VSCODE_ARCH'], 'x64'), ne(variables['VSCODE_PUBLISH'], 'false'))
|
||||
|
||||
- publish: $(Agent.BuildDirectory)/VSCode-darwin-$(VSCODE_ARCH).zip
|
||||
artifact: vscode-darwin-$(VSCODE_ARCH)
|
||||
artifact: unsigned_vscode_client_darwin_$(VSCODE_ARCH)_archive
|
||||
displayName: Publish client archive
|
||||
condition: and(succeeded(), ne(variables['VSCODE_PUBLISH'], 'false'))
|
||||
|
||||
- publish: $(Agent.BuildDirectory)/vscode-server-darwin.zip
|
||||
artifact: vscode-server-darwin-$(VSCODE_ARCH)
|
||||
artifact: vscode_server_darwin_$(VSCODE_ARCH)_archive-unsigned
|
||||
displayName: Publish server archive
|
||||
condition: and(succeeded(), eq(variables['VSCODE_ARCH'], 'x64'), ne(variables['VSCODE_PUBLISH'], 'false'))
|
||||
|
||||
- publish: $(Agent.BuildDirectory)/vscode-server-darwin-web.zip
|
||||
artifact: vscode-server-darwin-$(VSCODE_ARCH)-web
|
||||
artifact: vscode_web_darwin_$(VSCODE_ARCH)_archive-unsigned
|
||||
displayName: Publish web server archive
|
||||
condition: and(succeeded(), eq(variables['VSCODE_ARCH'], 'x64'), ne(variables['VSCODE_PUBLISH'], 'false'))
|
||||
|
||||
@@ -308,5 +309,5 @@ steps:
|
||||
VSCODE_ARCH="$(VSCODE_ARCH)" \
|
||||
yarn gulp upload-vscode-configuration
|
||||
displayName: Upload configuration (for Bing settings search)
|
||||
condition: and(succeeded(), eq(variables['VSCODE_ARCH'], 'x64'))
|
||||
condition: and(succeeded(), eq(variables['VSCODE_ARCH'], 'x64'), ne(variables['VSCODE_PUBLISH'], 'false'))
|
||||
continueOnError: true
|
||||
|
||||
@@ -1,14 +0,0 @@
|
||||
#!/usr/bin/env bash
|
||||
set -e
|
||||
|
||||
if [ "$VSCODE_ARCH" == "x64" ]; then
|
||||
# package Remote Extension Host
|
||||
pushd .. && mv vscode-reh-darwin vscode-server-darwin && zip -Xry vscode-server-darwin.zip vscode-server-darwin && popd
|
||||
|
||||
# publish Remote Extension Host
|
||||
node build/azure-pipelines/common/createAsset.js \
|
||||
server-darwin \
|
||||
archive-unsigned \
|
||||
"vscode-server-darwin.zip" \
|
||||
../vscode-server-darwin.zip
|
||||
fi
|
||||
@@ -1,28 +0,0 @@
|
||||
#!/usr/bin/env bash
|
||||
set -e
|
||||
REPO="$(pwd)"
|
||||
ROOT="$REPO/.."
|
||||
|
||||
PLATFORM_LINUX="linux-alpine"
|
||||
|
||||
# Publish Remote Extension Host
|
||||
LEGACY_SERVER_BUILD_NAME="vscode-reh-$PLATFORM_LINUX"
|
||||
SERVER_BUILD_NAME="vscode-server-$PLATFORM_LINUX"
|
||||
SERVER_TARBALL_FILENAME="vscode-server-$PLATFORM_LINUX.tar.gz"
|
||||
SERVER_TARBALL_PATH="$ROOT/$SERVER_TARBALL_FILENAME"
|
||||
|
||||
rm -rf $ROOT/vscode-server-*.tar.*
|
||||
(cd $ROOT && mv $LEGACY_SERVER_BUILD_NAME $SERVER_BUILD_NAME && tar --owner=0 --group=0 -czf $SERVER_TARBALL_PATH $SERVER_BUILD_NAME)
|
||||
|
||||
node build/azure-pipelines/common/createAsset.js "server-$PLATFORM_LINUX" archive-unsigned "$SERVER_TARBALL_FILENAME" "$SERVER_TARBALL_PATH"
|
||||
|
||||
# Publish Remote Extension Host (Web)
|
||||
LEGACY_SERVER_BUILD_NAME="vscode-reh-web-$PLATFORM_LINUX"
|
||||
SERVER_BUILD_NAME="vscode-server-$PLATFORM_LINUX-web"
|
||||
SERVER_TARBALL_FILENAME="vscode-server-$PLATFORM_LINUX-web.tar.gz"
|
||||
SERVER_TARBALL_PATH="$ROOT/$SERVER_TARBALL_FILENAME"
|
||||
|
||||
rm -rf $ROOT/vscode-server-*-web.tar.*
|
||||
(cd $ROOT && mv $LEGACY_SERVER_BUILD_NAME $SERVER_BUILD_NAME && tar --owner=0 --group=0 -czf $SERVER_TARBALL_PATH $SERVER_BUILD_NAME)
|
||||
|
||||
node build/azure-pipelines/common/createAsset.js "server-$PLATFORM_LINUX-web" archive-unsigned "$SERVER_TARBALL_FILENAME" "$SERVER_TARBALL_PATH"
|
||||
@@ -13,8 +13,6 @@ TARBALL_PATH="$ROOT/$TARBALL_FILENAME"
|
||||
rm -rf $ROOT/code-*.tar.*
|
||||
(cd $ROOT && tar -czf $TARBALL_PATH $BUILDNAME)
|
||||
|
||||
node build/azure-pipelines/common/createAsset.js "$PLATFORM_LINUX" archive-unsigned "$TARBALL_FILENAME" "$TARBALL_PATH"
|
||||
|
||||
# Publish Remote Extension Host
|
||||
LEGACY_SERVER_BUILD_NAME="vscode-reh-$PLATFORM_LINUX"
|
||||
SERVER_BUILD_NAME="vscode-server-$PLATFORM_LINUX"
|
||||
@@ -24,8 +22,6 @@ SERVER_TARBALL_PATH="$ROOT/$SERVER_TARBALL_FILENAME"
|
||||
rm -rf $ROOT/vscode-server-*.tar.*
|
||||
(cd $ROOT && mv $LEGACY_SERVER_BUILD_NAME $SERVER_BUILD_NAME && tar --owner=0 --group=0 -czf $SERVER_TARBALL_PATH $SERVER_BUILD_NAME)
|
||||
|
||||
node build/azure-pipelines/common/createAsset.js "server-$PLATFORM_LINUX" archive-unsigned "$SERVER_TARBALL_FILENAME" "$SERVER_TARBALL_PATH"
|
||||
|
||||
# Publish Remote Extension Host (Web)
|
||||
LEGACY_SERVER_BUILD_NAME="vscode-reh-web-$PLATFORM_LINUX"
|
||||
SERVER_BUILD_NAME="vscode-server-$PLATFORM_LINUX-web"
|
||||
@@ -35,8 +31,6 @@ SERVER_TARBALL_PATH="$ROOT/$SERVER_TARBALL_FILENAME"
|
||||
rm -rf $ROOT/vscode-server-*-web.tar.*
|
||||
(cd $ROOT && mv $LEGACY_SERVER_BUILD_NAME $SERVER_BUILD_NAME && tar --owner=0 --group=0 -czf $SERVER_TARBALL_PATH $SERVER_BUILD_NAME)
|
||||
|
||||
node build/azure-pipelines/common/createAsset.js "server-$PLATFORM_LINUX-web" archive-unsigned "$SERVER_TARBALL_FILENAME" "$SERVER_TARBALL_PATH"
|
||||
|
||||
# Publish DEB
|
||||
case $VSCODE_ARCH in
|
||||
x64) DEB_ARCH="amd64" ;;
|
||||
@@ -47,8 +41,6 @@ PLATFORM_DEB="linux-deb-$VSCODE_ARCH"
|
||||
DEB_FILENAME="$(ls $REPO/.build/linux/deb/$DEB_ARCH/deb/)"
|
||||
DEB_PATH="$REPO/.build/linux/deb/$DEB_ARCH/deb/$DEB_FILENAME"
|
||||
|
||||
node build/azure-pipelines/common/createAsset.js "$PLATFORM_DEB" package "$DEB_FILENAME" "$DEB_PATH"
|
||||
|
||||
# Publish RPM
|
||||
case $VSCODE_ARCH in
|
||||
x64) RPM_ARCH="x86_64" ;;
|
||||
@@ -61,8 +53,6 @@ PLATFORM_RPM="linux-rpm-$VSCODE_ARCH"
|
||||
RPM_FILENAME="$(ls $REPO/.build/linux/rpm/$RPM_ARCH/ | grep .rpm)"
|
||||
RPM_PATH="$REPO/.build/linux/rpm/$RPM_ARCH/$RPM_FILENAME"
|
||||
|
||||
node build/azure-pipelines/common/createAsset.js "$PLATFORM_RPM" package "$RPM_FILENAME" "$RPM_PATH"
|
||||
|
||||
# Publish Snap
|
||||
# Pack snap tarball artifact, in order to preserve file perms
|
||||
mkdir -p $REPO/.build/linux/snap-tarball
|
||||
@@ -73,3 +63,4 @@ rm -rf $SNAP_TARBALL_PATH
|
||||
# Export DEB_PATH, RPM_PATH
|
||||
echo "##vso[task.setvariable variable=DEB_PATH]$DEB_PATH"
|
||||
echo "##vso[task.setvariable variable=RPM_PATH]$RPM_PATH"
|
||||
echo "##vso[task.setvariable variable=TARBALL_PATH]$TARBALL_PATH"
|
||||
@@ -117,19 +117,37 @@ steps:
|
||||
|
||||
- script: |
|
||||
set -e
|
||||
AZURE_DOCUMENTDB_MASTERKEY="$(builds-docdb-key-readwrite)" \
|
||||
AZURE_STORAGE_ACCESS_KEY_2="$(vscode-storage-key)" \
|
||||
VSCODE_MIXIN_PASSWORD="$(github-distro-mixin-password)" \
|
||||
./build/azure-pipelines/linux/alpine/publish.sh
|
||||
displayName: Publish
|
||||
REPO="$(pwd)"
|
||||
ROOT="$REPO/.."
|
||||
|
||||
PLATFORM_LINUX="linux-alpine"
|
||||
|
||||
# Publish Remote Extension Host
|
||||
LEGACY_SERVER_BUILD_NAME="vscode-reh-$PLATFORM_LINUX"
|
||||
SERVER_BUILD_NAME="vscode-server-$PLATFORM_LINUX"
|
||||
SERVER_TARBALL_FILENAME="vscode-server-$PLATFORM_LINUX.tar.gz"
|
||||
SERVER_TARBALL_PATH="$ROOT/$SERVER_TARBALL_FILENAME"
|
||||
|
||||
rm -rf $ROOT/vscode-server-*.tar.*
|
||||
(cd $ROOT && mv $LEGACY_SERVER_BUILD_NAME $SERVER_BUILD_NAME && tar --owner=0 --group=0 -czf $SERVER_TARBALL_PATH $SERVER_BUILD_NAME)
|
||||
|
||||
# Publish Remote Extension Host (Web)
|
||||
LEGACY_SERVER_BUILD_NAME="vscode-reh-web-$PLATFORM_LINUX"
|
||||
SERVER_BUILD_NAME="vscode-server-$PLATFORM_LINUX-web"
|
||||
SERVER_TARBALL_FILENAME="vscode-server-$PLATFORM_LINUX-web.tar.gz"
|
||||
SERVER_TARBALL_PATH="$ROOT/$SERVER_TARBALL_FILENAME"
|
||||
|
||||
rm -rf $ROOT/vscode-server-*-web.tar.*
|
||||
(cd $ROOT && mv $LEGACY_SERVER_BUILD_NAME $SERVER_BUILD_NAME && tar --owner=0 --group=0 -czf $SERVER_TARBALL_PATH $SERVER_BUILD_NAME)
|
||||
displayName: Prepare for publish
|
||||
condition: and(succeeded(), ne(variables['VSCODE_PUBLISH'], 'false'))
|
||||
|
||||
- publish: $(Agent.BuildDirectory)/vscode-server-linux-alpine.tar.gz
|
||||
artifact: vscode-server-linux-alpine
|
||||
artifact: vscode_server_linux_alpine_archive-unsigned
|
||||
displayName: Publish server archive
|
||||
condition: and(succeeded(), ne(variables['VSCODE_PUBLISH'], 'false'))
|
||||
|
||||
- publish: $(Agent.BuildDirectory)/vscode-server-linux-alpine-web.tar.gz
|
||||
artifact: vscode-server-linux-alpine-web
|
||||
artifact: vscode_web_linux_alpine_archive-unsigned
|
||||
displayName: Publish web server archive
|
||||
condition: and(succeeded(), ne(variables['VSCODE_PUBLISH'], 'false'))
|
||||
|
||||
@@ -245,27 +245,32 @@ steps:
|
||||
AZURE_STORAGE_ACCESS_KEY_2="$(vscode-storage-key)" \
|
||||
VSCODE_MIXIN_PASSWORD="$(github-distro-mixin-password)" \
|
||||
VSCODE_ARCH="$(VSCODE_ARCH)" \
|
||||
./build/azure-pipelines/linux/publish.sh
|
||||
displayName: Publish
|
||||
./build/azure-pipelines/linux/prepare-publish.sh
|
||||
displayName: Prepare for Publish
|
||||
condition: and(succeeded(), ne(variables['VSCODE_PUBLISH'], 'false'))
|
||||
|
||||
- publish: $(DEB_PATH)
|
||||
artifact: vscode-linux-deb-$(VSCODE_ARCH)
|
||||
artifact: vscode_client_linux_$(VSCODE_ARCH)_deb-package
|
||||
displayName: Publish deb package
|
||||
condition: and(succeeded(), ne(variables['VSCODE_PUBLISH'], 'false'))
|
||||
|
||||
- publish: $(RPM_PATH)
|
||||
artifact: vscode-linux-rpm-$(VSCODE_ARCH)
|
||||
artifact: vscode_client_linux_$(VSCODE_ARCH)_rpm-package
|
||||
displayName: Publish rpm package
|
||||
condition: and(succeeded(), ne(variables['VSCODE_PUBLISH'], 'false'))
|
||||
|
||||
- publish: $(TARBALL_PATH)
|
||||
artifact: vscode_client_linux_$(VSCODE_ARCH)_archive-unsigned
|
||||
displayName: Publish client archive
|
||||
condition: and(succeeded(), ne(variables['VSCODE_PUBLISH'], 'false'))
|
||||
|
||||
- publish: $(Agent.BuildDirectory)/vscode-server-linux-$(VSCODE_ARCH).tar.gz
|
||||
artifact: vscode-server-linux-$(VSCODE_ARCH)
|
||||
artifact: vscode_server_linux_$(VSCODE_ARCH)_archive-unsigned
|
||||
displayName: Publish server archive
|
||||
condition: and(succeeded(), ne(variables['VSCODE_PUBLISH'], 'false'))
|
||||
|
||||
- publish: $(Agent.BuildDirectory)/vscode-server-linux-$(VSCODE_ARCH)-web.tar.gz
|
||||
artifact: vscode-server-linux-$(VSCODE_ARCH)-web
|
||||
artifact: vscode_web_linux_$(VSCODE_ARCH)_archive-unsigned
|
||||
displayName: Publish web server archive
|
||||
condition: and(succeeded(), ne(variables['VSCODE_PUBLISH'], 'false'))
|
||||
|
||||
|
||||
@@ -50,15 +50,11 @@ steps:
|
||||
esac
|
||||
(cd $SNAP_ROOT/code-* && sudo --preserve-env snapcraft prime $SNAPCRAFT_TARGET_ARGS && snap pack prime --compression=lzo --filename="$SNAP_PATH")
|
||||
|
||||
# Publish snap package
|
||||
AZURE_DOCUMENTDB_MASTERKEY="$(builds-docdb-key-readwrite)" \
|
||||
AZURE_STORAGE_ACCESS_KEY_2="$(vscode-storage-key)" \
|
||||
node build/azure-pipelines/common/createAsset.js "linux-snap-$(VSCODE_ARCH)" package "$SNAP_FILENAME" "$SNAP_PATH"
|
||||
|
||||
# Export SNAP_PATH
|
||||
echo "##vso[task.setvariable variable=SNAP_PATH]$SNAP_PATH"
|
||||
displayName: Prepare for publish
|
||||
|
||||
- publish: $(SNAP_PATH)
|
||||
artifact: vscode-linux-snap-$(VSCODE_ARCH)
|
||||
artifact: vscode_client_linux_$(VSCODE_ARCH)_snap
|
||||
displayName: Publish snap package
|
||||
condition: and(succeeded(), ne(variables['VSCODE_PUBLISH'], 'false'))
|
||||
|
||||
@@ -86,6 +86,8 @@ variables:
|
||||
value: ${{ eq(parameters.ENABLE_TERRAPIN, true) }}
|
||||
- name: VSCODE_QUALITY
|
||||
value: ${{ parameters.VSCODE_QUALITY }}
|
||||
- name: VSCODE_RELEASE
|
||||
value: ${{ parameters.VSCODE_RELEASE }}
|
||||
- name: VSCODE_BUILD_STAGE_WINDOWS
|
||||
value: ${{ or(eq(parameters.VSCODE_BUILD_WIN32, true), eq(parameters.VSCODE_BUILD_WIN32_32BIT, true), eq(parameters.VSCODE_BUILD_WIN32_ARM64, true)) }}
|
||||
- name: VSCODE_BUILD_STAGE_LINUX
|
||||
@@ -301,37 +303,30 @@ stages:
|
||||
steps:
|
||||
- template: darwin/product-build-darwin-sign.yml
|
||||
|
||||
- ${{ if and(eq(variables['VSCODE_PUBLISH'], true), eq(parameters.VSCODE_COMPILE_ONLY, false)) }}:
|
||||
- stage: Mooncake
|
||||
- ${{ if and(eq(parameters.VSCODE_COMPILE_ONLY, false), ne(variables['VSCODE_PUBLISH'], 'false')) }}:
|
||||
- stage: Publish
|
||||
dependsOn:
|
||||
- ${{ if eq(variables['VSCODE_BUILD_STAGE_WINDOWS'], true) }}:
|
||||
- Windows
|
||||
- ${{ if eq(variables['VSCODE_BUILD_STAGE_LINUX'], true) }}:
|
||||
- Linux
|
||||
- ${{ if eq(variables['VSCODE_BUILD_STAGE_MACOS'], true) }}:
|
||||
- macOS
|
||||
condition: succeededOrFailed()
|
||||
- Compile
|
||||
pool:
|
||||
vmImage: "Ubuntu-18.04"
|
||||
variables:
|
||||
- name: BUILDS_API_URL
|
||||
value: $(System.CollectionUri)$(System.TeamProject)/_apis/build/builds/$(Build.BuildId)/
|
||||
jobs:
|
||||
- job: SyncMooncake
|
||||
displayName: Sync Mooncake
|
||||
- job: PublishBuild
|
||||
timeoutInMinutes: 180
|
||||
displayName: Publish Build
|
||||
steps:
|
||||
- template: sync-mooncake.yml
|
||||
- template: product-publish.yml
|
||||
|
||||
- ${{ if and(eq(parameters.VSCODE_COMPILE_ONLY, false), or(eq(parameters.VSCODE_RELEASE, true), and(in(parameters.VSCODE_QUALITY, 'insider', 'exploration'), eq(variables['VSCODE_SCHEDULEDBUILD'], true)))) }}:
|
||||
- stage: Release
|
||||
dependsOn:
|
||||
- ${{ if eq(variables['VSCODE_BUILD_STAGE_WINDOWS'], true) }}:
|
||||
- Windows
|
||||
- ${{ if eq(variables['VSCODE_BUILD_STAGE_LINUX'], true) }}:
|
||||
- Linux
|
||||
- ${{ if eq(variables['VSCODE_BUILD_STAGE_MACOS'], true) }}:
|
||||
- macOS
|
||||
pool:
|
||||
vmImage: "Ubuntu-18.04"
|
||||
jobs:
|
||||
- job: ReleaseBuild
|
||||
displayName: Release Build
|
||||
steps:
|
||||
- template: release.yml
|
||||
- ${{ if or(eq(parameters.VSCODE_RELEASE, true), and(in(parameters.VSCODE_QUALITY, 'insider', 'exploration'), eq(variables['VSCODE_SCHEDULEDBUILD'], true))) }}:
|
||||
- stage: Release
|
||||
dependsOn:
|
||||
- Publish
|
||||
pool:
|
||||
vmImage: "Ubuntu-18.04"
|
||||
jobs:
|
||||
- job: ReleaseBuild
|
||||
displayName: Release Build
|
||||
steps:
|
||||
- template: product-release.yml
|
||||
|
||||
@@ -118,14 +118,6 @@ steps:
|
||||
displayName: Publish Webview
|
||||
condition: and(succeeded(), ne(variables['VSCODE_PUBLISH'], 'false'))
|
||||
|
||||
- script: |
|
||||
set -e
|
||||
VERSION=`node -p "require(\"./package.json\").version"`
|
||||
AZURE_DOCUMENTDB_MASTERKEY="$(builds-docdb-key-readwrite)" \
|
||||
node build/azure-pipelines/common/createBuild.js $VERSION
|
||||
displayName: Create build
|
||||
condition: and(succeeded(), ne(variables['VSCODE_PUBLISH'], 'false'))
|
||||
|
||||
# we gotta tarball everything in order to preserve file permissions
|
||||
- script: |
|
||||
set -e
|
||||
|
||||
114
lib/vscode/build/azure-pipelines/product-publish.ps1
Normal file
114
lib/vscode/build/azure-pipelines/product-publish.ps1
Normal file
@@ -0,0 +1,114 @@
|
||||
. build/azure-pipelines/win32/exec.ps1
|
||||
$ErrorActionPreference = 'Stop'
|
||||
$ProgressPreference = 'SilentlyContinue'
|
||||
$ARTIFACT_PROCESSED_WILDCARD_PATH = "$env:PIPELINE_WORKSPACE/artifacts_processed_*/artifacts_processed_*"
|
||||
$ARTIFACT_PROCESSED_FILE_PATH = "$env:PIPELINE_WORKSPACE/artifacts_processed_$env:SYSTEM_STAGEATTEMPT/artifacts_processed_$env:SYSTEM_STAGEATTEMPT.txt"
|
||||
|
||||
function Get-PipelineArtifact {
|
||||
param($Name = '*')
|
||||
try {
|
||||
$res = Invoke-RestMethod "$($env:BUILDS_API_URL)artifacts?api-version=6.0" -Headers @{
|
||||
Authorization = "Bearer $env:SYSTEM_ACCESSTOKEN"
|
||||
} -MaximumRetryCount 5 -RetryIntervalSec 1
|
||||
|
||||
if (!$res) {
|
||||
return
|
||||
}
|
||||
|
||||
$res.value | Where-Object { $_.name -Like $Name }
|
||||
} catch {
|
||||
Write-Warning $_
|
||||
}
|
||||
}
|
||||
|
||||
# This set will keep track of which artifacts have already been processed
|
||||
$set = [System.Collections.Generic.HashSet[string]]::new()
|
||||
|
||||
if (Test-Path $ARTIFACT_PROCESSED_WILDCARD_PATH) {
|
||||
# Grab the latest artifact_processed text file and load all assets already processed from that.
|
||||
# This means that the latest artifact_processed_*.txt file has all of the contents of the previous ones.
|
||||
# Note: The kusto-like syntax only works in PS7+ and only in scripts, not at the REPL.
|
||||
Get-ChildItem $ARTIFACT_PROCESSED_WILDCARD_PATH
|
||||
| Sort-Object
|
||||
| Select-Object -Last 1
|
||||
| Get-Content
|
||||
| ForEach-Object {
|
||||
$set.Add($_) | Out-Null
|
||||
Write-Host "Already processed artifact: $_"
|
||||
}
|
||||
}
|
||||
|
||||
# Create the artifact file that will be used for this run
|
||||
New-Item -Path $ARTIFACT_PROCESSED_FILE_PATH -Force | Out-Null
|
||||
|
||||
# Determine which stages we need to watch
|
||||
$stages = @(
|
||||
if ($env:VSCODE_BUILD_STAGE_WINDOWS -eq 'True') { 'Windows' }
|
||||
if ($env:VSCODE_BUILD_STAGE_LINUX -eq 'True') { 'Linux' }
|
||||
if ($env:VSCODE_BUILD_STAGE_MACOS -eq 'True') { 'macOS' }
|
||||
)
|
||||
|
||||
do {
|
||||
Start-Sleep -Seconds 10
|
||||
|
||||
$artifacts = Get-PipelineArtifact -Name 'vscode_*'
|
||||
if (!$artifacts) {
|
||||
continue
|
||||
}
|
||||
|
||||
$artifacts | ForEach-Object {
|
||||
$artifactName = $_.name
|
||||
if($set.Add($artifactName)) {
|
||||
Write-Host "Processing artifact: '$artifactName. Downloading from: $($_.resource.downloadUrl)"
|
||||
|
||||
try {
|
||||
Invoke-RestMethod $_.resource.downloadUrl -OutFile "$env:AGENT_TEMPDIRECTORY/$artifactName.zip" -Headers @{
|
||||
Authorization = "Bearer $env:SYSTEM_ACCESSTOKEN"
|
||||
} -MaximumRetryCount 5 -RetryIntervalSec 1 | Out-Null
|
||||
|
||||
Expand-Archive -Path "$env:AGENT_TEMPDIRECTORY/$artifactName.zip" -DestinationPath $env:AGENT_TEMPDIRECTORY | Out-Null
|
||||
} catch {
|
||||
Write-Warning $_
|
||||
$set.Remove($artifactName) | Out-Null
|
||||
continue
|
||||
}
|
||||
|
||||
$null,$product,$os,$arch,$type = $artifactName -split '_'
|
||||
$asset = Get-ChildItem -rec "$env:AGENT_TEMPDIRECTORY/$artifactName"
|
||||
Write-Host "Processing artifact with the following values:"
|
||||
# turning in into an object just to log nicely
|
||||
@{
|
||||
product = $product
|
||||
os = $os
|
||||
arch = $arch
|
||||
type = $type
|
||||
asset = $asset.Name
|
||||
} | Format-Table
|
||||
|
||||
exec { node build/azure-pipelines/common/createAsset.js $product $os $arch $type $asset.Name $asset.FullName }
|
||||
$artifactName >> $ARTIFACT_PROCESSED_FILE_PATH
|
||||
}
|
||||
}
|
||||
|
||||
# Get the timeline and see if it says the other stage completed
|
||||
try {
|
||||
$timeline = Invoke-RestMethod "$($env:BUILDS_API_URL)timeline?api-version=6.0" -Headers @{
|
||||
Authorization = "Bearer $env:SYSTEM_ACCESSTOKEN"
|
||||
} -MaximumRetryCount 5 -RetryIntervalSec 1
|
||||
} catch {
|
||||
Write-Warning $_
|
||||
continue
|
||||
}
|
||||
|
||||
foreach ($stage in $stages) {
|
||||
$otherStageFinished = $timeline.records | Where-Object { $_.name -eq $stage -and $_.type -eq 'stage' -and $_.state -eq 'completed' }
|
||||
if (!$otherStageFinished) {
|
||||
break
|
||||
}
|
||||
}
|
||||
|
||||
$artifacts = Get-PipelineArtifact -Name 'vscode_*'
|
||||
$artifactsStillToProcess = $artifacts.Count -ne $set.Count
|
||||
} while (!$otherStageFinished -or $artifactsStillToProcess)
|
||||
|
||||
Write-Host "Processed $($set.Count) artifacts."
|
||||
89
lib/vscode/build/azure-pipelines/product-publish.yml
Normal file
89
lib/vscode/build/azure-pipelines/product-publish.yml
Normal file
@@ -0,0 +1,89 @@
|
||||
steps:
|
||||
- task: NodeTool@0
|
||||
inputs:
|
||||
versionSpec: "12.x"
|
||||
|
||||
- task: geeklearningio.gl-vsts-tasks-yarn.yarn-installer-task.YarnInstaller@2
|
||||
inputs:
|
||||
versionSpec: "1.x"
|
||||
|
||||
- task: AzureKeyVault@1
|
||||
displayName: "Azure Key Vault: Get Secrets"
|
||||
inputs:
|
||||
azureSubscription: "vscode-builds-subscription"
|
||||
KeyVaultName: vscode
|
||||
|
||||
- pwsh: |
|
||||
. build/azure-pipelines/win32/exec.ps1
|
||||
cd build
|
||||
exec { yarn }
|
||||
displayName: Install dependencies
|
||||
|
||||
- download: current
|
||||
patterns: '**/artifacts_processed_*.txt'
|
||||
displayName: Download all artifacts_processed text files
|
||||
|
||||
- pwsh: |
|
||||
. build/azure-pipelines/win32/exec.ps1
|
||||
|
||||
if (Test-Path "$(Pipeline.Workspace)/artifacts_processed_*/artifacts_processed_*.txt") {
|
||||
Write-Host "Artifacts already processed so a build must have already been created."
|
||||
return
|
||||
}
|
||||
|
||||
$env:AZURE_DOCUMENTDB_MASTERKEY = "$(builds-docdb-key-readwrite)"
|
||||
$VERSION = node -p "require('./package.json').version"
|
||||
Write-Host "Creating build with version: $VERSION"
|
||||
exec { node build/azure-pipelines/common/createBuild.js $VERSION }
|
||||
displayName: Create build if it hasn't been created before
|
||||
|
||||
- pwsh: |
|
||||
$env:VSCODE_MIXIN_PASSWORD = "$(github-distro-mixin-password)"
|
||||
$env:AZURE_DOCUMENTDB_MASTERKEY = "$(builds-docdb-key-readwrite)"
|
||||
$env:AZURE_STORAGE_ACCESS_KEY = "$(ticino-storage-key)"
|
||||
$env:AZURE_STORAGE_ACCESS_KEY_2 = "$(vscode-storage-key)"
|
||||
$env:MOONCAKE_STORAGE_ACCESS_KEY = "$(vscode-mooncake-storage-key)"
|
||||
build/azure-pipelines/product-publish.ps1
|
||||
env:
|
||||
SYSTEM_ACCESSTOKEN: $(System.AccessToken)
|
||||
displayName: Process artifacts
|
||||
|
||||
- publish: $(Pipeline.Workspace)/artifacts_processed_$(System.StageAttempt)/artifacts_processed_$(System.StageAttempt).txt
|
||||
artifact: artifacts_processed_$(System.StageAttempt)
|
||||
displayName: Publish what artifacts were published for this stage attempt
|
||||
|
||||
- pwsh: |
|
||||
$ErrorActionPreference = 'Stop'
|
||||
|
||||
# Determine which stages we need to watch
|
||||
$stages = @(
|
||||
if ($env:VSCODE_BUILD_STAGE_WINDOWS -eq 'True') { 'Windows' }
|
||||
if ($env:VSCODE_BUILD_STAGE_LINUX -eq 'True') { 'Linux' }
|
||||
if ($env:VSCODE_BUILD_STAGE_MACOS -eq 'True') { 'macOS' }
|
||||
)
|
||||
Write-Host "Stages to check: $stages"
|
||||
|
||||
# Get the timeline and see if it says the other stage completed
|
||||
$timeline = Invoke-RestMethod "$($env:BUILDS_API_URL)timeline?api-version=6.0" -Headers @{
|
||||
Authorization = "Bearer $env:SYSTEM_ACCESSTOKEN"
|
||||
} -MaximumRetryCount 5 -RetryIntervalSec 1
|
||||
|
||||
$failedStages = @()
|
||||
foreach ($stage in $stages) {
|
||||
$didStageFail = $timeline.records | Where-Object {
|
||||
$_.name -eq $stage -and $_.type -eq 'stage' -and $_.result -ne 'succeeded' -and $_.result -ne 'succeededWithIssues'
|
||||
}
|
||||
|
||||
if($didStageFail) {
|
||||
$failedStages += $stage
|
||||
} else {
|
||||
Write-Host "'$stage' did not fail."
|
||||
}
|
||||
}
|
||||
|
||||
if ($failedStages.Length) {
|
||||
throw "Failed stages: $($failedStages -join ', '). This stage will now fail so that it is easier to retry failed jobs."
|
||||
}
|
||||
env:
|
||||
SYSTEM_ACCESSTOKEN: $(System.AccessToken)
|
||||
displayName: Determine if stage should succeed
|
||||
@@ -1,24 +0,0 @@
|
||||
steps:
|
||||
- task: NodeTool@0
|
||||
inputs:
|
||||
versionSpec: "14.x"
|
||||
|
||||
- task: geeklearningio.gl-vsts-tasks-yarn.yarn-installer-task.YarnInstaller@2
|
||||
inputs:
|
||||
versionSpec: "1.x"
|
||||
|
||||
- task: AzureKeyVault@1
|
||||
displayName: "Azure Key Vault: Get Secrets"
|
||||
inputs:
|
||||
azureSubscription: "vscode-builds-subscription"
|
||||
KeyVaultName: vscode
|
||||
|
||||
- script: |
|
||||
set -e
|
||||
|
||||
(cd build ; yarn)
|
||||
|
||||
AZURE_DOCUMENTDB_MASTERKEY="$(builds-docdb-key-readwrite)" \
|
||||
AZURE_STORAGE_ACCESS_KEY_2="$(vscode-storage-key)" \
|
||||
MOONCAKE_STORAGE_ACCESS_KEY="$(vscode-mooncake-storage-key)" \
|
||||
node build/azure-pipelines/common/sync-mooncake.js "$VSCODE_QUALITY"
|
||||
@@ -119,13 +119,19 @@ steps:
|
||||
|
||||
- script: |
|
||||
set -e
|
||||
AZURE_DOCUMENTDB_MASTERKEY="$(builds-docdb-key-readwrite)" \
|
||||
AZURE_STORAGE_ACCESS_KEY_2="$(vscode-storage-key)" \
|
||||
VSCODE_MIXIN_PASSWORD="$(github-distro-mixin-password)" \
|
||||
./build/azure-pipelines/web/publish.sh
|
||||
displayName: Publish
|
||||
REPO="$(pwd)"
|
||||
ROOT="$REPO/.."
|
||||
|
||||
WEB_BUILD_NAME="vscode-web"
|
||||
WEB_TARBALL_FILENAME="vscode-web.tar.gz"
|
||||
WEB_TARBALL_PATH="$ROOT/$WEB_TARBALL_FILENAME"
|
||||
|
||||
rm -rf $ROOT/vscode-web.tar.*
|
||||
|
||||
cd $ROOT && tar --owner=0 --group=0 -czf $WEB_TARBALL_PATH $WEB_BUILD_NAME
|
||||
displayName: Prepare for publish
|
||||
|
||||
- publish: $(Agent.BuildDirectory)/vscode-web.tar.gz
|
||||
artifact: vscode-web-standalone
|
||||
artifact: vscode_web_linux_standalone_archive-unsigned
|
||||
displayName: Publish web archive
|
||||
condition: and(succeeded(), ne(variables['VSCODE_PUBLISH'], 'false'))
|
||||
|
||||
@@ -1,15 +0,0 @@
|
||||
#!/usr/bin/env bash
|
||||
set -e
|
||||
REPO="$(pwd)"
|
||||
ROOT="$REPO/.."
|
||||
|
||||
# Publish Web Client
|
||||
WEB_BUILD_NAME="vscode-web"
|
||||
WEB_TARBALL_FILENAME="vscode-web.tar.gz"
|
||||
WEB_TARBALL_PATH="$ROOT/$WEB_TARBALL_FILENAME"
|
||||
|
||||
rm -rf $ROOT/vscode-web.tar.*
|
||||
|
||||
(cd $ROOT && tar --owner=0 --group=0 -czf $WEB_TARBALL_PATH $WEB_BUILD_NAME)
|
||||
|
||||
node build/azure-pipelines/common/createAsset.js web-standalone archive-unsigned "$WEB_TARBALL_FILENAME" "$WEB_TARBALL_PATH"
|
||||
@@ -13,24 +13,31 @@ $Zip = "$Repo\.build\win32-$Arch\archive\VSCode-win32-$Arch.zip"
|
||||
$LegacyServer = "$Root\vscode-reh-win32-$Arch"
|
||||
$Server = "$Root\vscode-server-win32-$Arch"
|
||||
$ServerZip = "$Repo\.build\vscode-server-win32-$Arch.zip"
|
||||
$LegacyWeb = "$Root\vscode-reh-web-win32-$Arch"
|
||||
$Web = "$Root\vscode-server-win32-$Arch-web"
|
||||
$WebZip = "$Repo\.build\vscode-server-win32-$Arch-web.zip"
|
||||
$Build = "$Root\VSCode-win32-$Arch"
|
||||
|
||||
# Create server archive
|
||||
if ("$Arch" -ne "arm64") {
|
||||
exec { xcopy $LegacyServer $Server /H /E /I }
|
||||
exec { .\node_modules\7zip\7zip-lite\7z.exe a -tzip $ServerZip $Server -r }
|
||||
exec { xcopy $LegacyWeb $Web /H /E /I }
|
||||
exec { .\node_modules\7zip\7zip-lite\7z.exe a -tzip $WebZip $Web -r }
|
||||
}
|
||||
|
||||
# get version
|
||||
$PackageJson = Get-Content -Raw -Path "$Build\resources\app\package.json" | ConvertFrom-Json
|
||||
$Version = $PackageJson.version
|
||||
|
||||
$AssetPlatform = if ("$Arch" -eq "ia32") { "win32" } else { "win32-$Arch" }
|
||||
$ARCHIVE_NAME = "VSCode-win32-$Arch-$Version.zip"
|
||||
$SYSTEM_SETUP_NAME = "VSCodeSetup-$Arch-$Version.exe"
|
||||
$USER_SETUP_NAME = "VSCodeUserSetup-$Arch-$Version.exe"
|
||||
|
||||
exec { node build/azure-pipelines/common/createAsset.js "$AssetPlatform-archive" archive "VSCode-win32-$Arch-$Version.zip" $Zip }
|
||||
exec { node build/azure-pipelines/common/createAsset.js "$AssetPlatform" setup "VSCodeSetup-$Arch-$Version.exe" $SystemExe }
|
||||
exec { node build/azure-pipelines/common/createAsset.js "$AssetPlatform-user" setup "VSCodeUserSetup-$Arch-$Version.exe" $UserExe }
|
||||
|
||||
if ("$Arch" -ne "arm64") {
|
||||
exec { node build/azure-pipelines/common/createAsset.js "server-$AssetPlatform" archive "vscode-server-win32-$Arch.zip" $ServerZip }
|
||||
}
|
||||
# Set variables for upload
|
||||
Move-Item $Zip "$Repo\.build\win32-$Arch\archive\$ARCHIVE_NAME"
|
||||
Write-Host "##vso[task.setvariable variable=ARCHIVE_NAME]$ARCHIVE_NAME"
|
||||
Move-Item $SystemExe "$Repo\.build\win32-$Arch\system-setup\$SYSTEM_SETUP_NAME"
|
||||
Write-Host "##vso[task.setvariable variable=SYSTEM_SETUP_NAME]$SYSTEM_SETUP_NAME"
|
||||
Move-Item $UserExe "$Repo\.build\win32-$Arch\user-setup\$USER_SETUP_NAME"
|
||||
Write-Host "##vso[task.setvariable variable=USER_SETUP_NAME]$USER_SETUP_NAME"
|
||||
@@ -295,31 +295,31 @@ steps:
|
||||
$env:AZURE_STORAGE_ACCESS_KEY_2 = "$(vscode-storage-key)"
|
||||
$env:AZURE_DOCUMENTDB_MASTERKEY = "$(builds-docdb-key-readwrite)"
|
||||
$env:VSCODE_MIXIN_PASSWORD="$(github-distro-mixin-password)"
|
||||
.\build\azure-pipelines\win32\publish.ps1
|
||||
.\build\azure-pipelines\win32\prepare-publish.ps1
|
||||
displayName: Publish
|
||||
condition: and(succeeded(), ne(variables['VSCODE_PUBLISH'], 'false'))
|
||||
|
||||
- publish: $(System.DefaultWorkingDirectory)\.build\win32-$(VSCODE_ARCH)\archive\VSCode-win32-$(VSCODE_ARCH).zip
|
||||
artifact: vscode-win32-$(VSCODE_ARCH)
|
||||
- publish: $(System.DefaultWorkingDirectory)\.build\win32-$(VSCODE_ARCH)\archive\$(ARCHIVE_NAME)
|
||||
artifact: vscode_client_win32_$(VSCODE_ARCH)_archive
|
||||
displayName: Publish archive
|
||||
condition: and(succeeded(), ne(variables['VSCODE_PUBLISH'], 'false'))
|
||||
|
||||
- publish: $(System.DefaultWorkingDirectory)\.build\win32-$(VSCODE_ARCH)\system-setup\VSCodeSetup.exe
|
||||
artifact: vscode-win32-$(VSCODE_ARCH)-setup
|
||||
- publish: $(System.DefaultWorkingDirectory)\.build\win32-$(VSCODE_ARCH)\system-setup\$(SYSTEM_SETUP_NAME)
|
||||
artifact: vscode_client_win32_$(VSCODE_ARCH)_setup
|
||||
displayName: Publish system setup
|
||||
condition: and(succeeded(), ne(variables['VSCODE_PUBLISH'], 'false'))
|
||||
|
||||
- publish: $(System.DefaultWorkingDirectory)\.build\win32-$(VSCODE_ARCH)\user-setup\VSCodeSetup.exe
|
||||
artifact: vscode-win32-$(VSCODE_ARCH)-user-setup
|
||||
- publish: $(System.DefaultWorkingDirectory)\.build\win32-$(VSCODE_ARCH)\user-setup\$(USER_SETUP_NAME)
|
||||
artifact: vscode_client_win32_$(VSCODE_ARCH)_user-setup
|
||||
displayName: Publish user setup
|
||||
condition: and(succeeded(), ne(variables['VSCODE_PUBLISH'], 'false'))
|
||||
|
||||
- publish: $(System.DefaultWorkingDirectory)\.build\vscode-server-win32-$(VSCODE_ARCH).zip
|
||||
artifact: vscode-server-win32-$(VSCODE_ARCH)
|
||||
artifact: vscode_server_win32_$(VSCODE_ARCH)_archive
|
||||
displayName: Publish server archive
|
||||
condition: and(succeeded(), ne(variables['VSCODE_PUBLISH'], 'false'), ne(variables['VSCODE_ARCH'], 'arm64'))
|
||||
|
||||
- publish: $(System.DefaultWorkingDirectory)\.build\vscode-server-win32-$(VSCODE_ARCH)-web.zip
|
||||
artifact: vscode-server-win32-$(VSCODE_ARCH)-web
|
||||
artifact: vscode_web_win32_$(VSCODE_ARCH)_archive
|
||||
displayName: Publish web server archive
|
||||
condition: and(succeeded(), ne(variables['VSCODE_PUBLISH'], 'false'), ne(variables['VSCODE_ARCH'], 'arm64'))
|
||||
|
||||
@@ -33,7 +33,7 @@ async function main() {
|
||||
'Credits.rtf',
|
||||
'CodeResources',
|
||||
'fsevents.node',
|
||||
'Info.plist', // TODO@deepak1556: regressed with 11.4.2 internal builds
|
||||
'Info.plist',
|
||||
'.npmrc'
|
||||
],
|
||||
outAppPath,
|
||||
|
||||
@@ -8,7 +8,6 @@ require('events').EventEmitter.defaultMaxListeners = 100;
|
||||
|
||||
const gulp = require('gulp');
|
||||
const path = require('path');
|
||||
const child_process = require('child_process');
|
||||
const nodeUtil = require('util');
|
||||
const es = require('event-stream');
|
||||
const filter = require('gulp-filter');
|
||||
@@ -20,8 +19,6 @@ const glob = require('glob');
|
||||
const root = path.dirname(__dirname);
|
||||
const commit = util.getVersion(root);
|
||||
const plumber = require('gulp-plumber');
|
||||
const fancyLog = require('fancy-log');
|
||||
const ansiColors = require('ansi-colors');
|
||||
const ext = require('./lib/extensions');
|
||||
|
||||
const extensionsPath = path.join(path.dirname(__dirname), 'extensions');
|
||||
@@ -201,45 +198,17 @@ gulp.task(compileExtensionsBuildLegacyTask);
|
||||
|
||||
//#region Extension media
|
||||
|
||||
// Additional projects to webpack. These typically build code for webviews
|
||||
const webpackMediaConfigFiles = [
|
||||
'markdown-language-features/webpack.config.js',
|
||||
'simple-browser/webpack.config.js',
|
||||
];
|
||||
|
||||
// Additional projects to run esbuild on. These typically build code for webviews
|
||||
const esbuildMediaScripts = [
|
||||
'markdown-language-features/esbuild.js',
|
||||
'notebook-markdown-extensions/esbuild.js',
|
||||
];
|
||||
|
||||
const compileExtensionMediaTask = task.define('compile-extension-media', () => buildExtensionMedia(false));
|
||||
const compileExtensionMediaTask = task.define('compile-extension-media', () => ext.buildExtensionMedia(false));
|
||||
gulp.task(compileExtensionMediaTask);
|
||||
exports.compileExtensionMediaTask = compileExtensionMediaTask;
|
||||
|
||||
const watchExtensionMedia = task.define('watch-extension-media', () => buildExtensionMedia(true));
|
||||
const watchExtensionMedia = task.define('watch-extension-media', () => ext.buildExtensionMedia(true));
|
||||
gulp.task(watchExtensionMedia);
|
||||
exports.watchExtensionMedia = watchExtensionMedia;
|
||||
|
||||
const compileExtensionMediaBuildTask = task.define('compile-extension-media-build', () => buildExtensionMedia(false, '.build/extensions'));
|
||||
const compileExtensionMediaBuildTask = task.define('compile-extension-media-build', () => ext.buildExtensionMedia(false, '.build/extensions'));
|
||||
gulp.task(compileExtensionMediaBuildTask);
|
||||
|
||||
async function buildExtensionMedia(isWatch, outputRoot) {
|
||||
const webpackConfigLocations = webpackMediaConfigFiles.map(p => {
|
||||
return {
|
||||
configPath: path.join(extensionsPath, p),
|
||||
outputRoot: outputRoot ? path.join(root, outputRoot, path.dirname(p)) : undefined
|
||||
};
|
||||
});
|
||||
return Promise.all([
|
||||
webpackExtensions('webpacking extension media', isWatch, webpackConfigLocations),
|
||||
esbuildExtensions('esbuilding extension media', isWatch, esbuildMediaScripts.map(p => ({
|
||||
script: path.join(extensionsPath, p),
|
||||
outputRoot: outputRoot ? path.join(root, outputRoot, path.dirname(p)) : undefined
|
||||
}))),
|
||||
]);
|
||||
}
|
||||
|
||||
//#endregion
|
||||
|
||||
//#region Azure Pipelines
|
||||
@@ -271,121 +240,5 @@ async function buildWebExtensions(isWatch) {
|
||||
path.join(extensionsPath, '**', 'extension-browser.webpack.config.js'),
|
||||
{ ignore: ['**/node_modules'] }
|
||||
);
|
||||
return webpackExtensions('packaging web extension', isWatch, webpackConfigLocations.map(configPath => ({ configPath })));
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {string} taskName
|
||||
* @param {boolean} isWatch
|
||||
* @param {{ configPath: string, outputRoot?: boolean}} webpackConfigLocations
|
||||
*/
|
||||
async function webpackExtensions(taskName, isWatch, webpackConfigLocations) {
|
||||
const webpack = require('webpack');
|
||||
|
||||
const webpackConfigs = [];
|
||||
|
||||
for (const { configPath, outputRoot } of webpackConfigLocations) {
|
||||
const configOrFnOrArray = require(configPath);
|
||||
function addConfig(configOrFn) {
|
||||
let config;
|
||||
if (typeof configOrFn === 'function') {
|
||||
config = configOrFn({}, {});
|
||||
webpackConfigs.push(config);
|
||||
} else {
|
||||
config = configOrFn;
|
||||
}
|
||||
|
||||
if (outputRoot) {
|
||||
config.output.path = path.join(outputRoot, path.relative(path.dirname(configPath), config.output.path));
|
||||
}
|
||||
|
||||
webpackConfigs.push(configOrFn);
|
||||
}
|
||||
addConfig(configOrFnOrArray);
|
||||
}
|
||||
function reporter(fullStats) {
|
||||
if (Array.isArray(fullStats.children)) {
|
||||
for (const stats of fullStats.children) {
|
||||
const outputPath = stats.outputPath;
|
||||
if (outputPath) {
|
||||
const relativePath = path.relative(extensionsPath, outputPath).replace(/\\/g, '/');
|
||||
const match = relativePath.match(/[^\/]+(\/server|\/client)?/);
|
||||
fancyLog(`Finished ${ansiColors.green(taskName)} ${ansiColors.cyan(match[0])} with ${stats.errors.length} errors.`);
|
||||
}
|
||||
if (Array.isArray(stats.errors)) {
|
||||
stats.errors.forEach(error => {
|
||||
fancyLog.error(error);
|
||||
});
|
||||
}
|
||||
if (Array.isArray(stats.warnings)) {
|
||||
stats.warnings.forEach(warning => {
|
||||
fancyLog.warn(warning);
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return new Promise((resolve, reject) => {
|
||||
if (isWatch) {
|
||||
webpack(webpackConfigs).watch({}, (err, stats) => {
|
||||
if (err) {
|
||||
reject();
|
||||
} else {
|
||||
reporter(stats.toJson());
|
||||
}
|
||||
});
|
||||
} else {
|
||||
webpack(webpackConfigs).run((err, stats) => {
|
||||
if (err) {
|
||||
fancyLog.error(err);
|
||||
reject();
|
||||
} else {
|
||||
reporter(stats.toJson());
|
||||
resolve();
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {string} taskName
|
||||
* @param {boolean} isWatch
|
||||
* @param {{ script: string, outputRoot?: string }}} scripts
|
||||
*/
|
||||
async function esbuildExtensions(taskName, isWatch, scripts) {
|
||||
function reporter(/** @type {string} */ stdError, /** @type {string} */script) {
|
||||
const matches = (stdError || '').match(/\> (.+): error: (.+)?/g);
|
||||
fancyLog(`Finished ${ansiColors.green(taskName)} ${script} with ${matches ? matches.length : 0} errors.`);
|
||||
for (const match of matches || []) {
|
||||
fancyLog.error(match);
|
||||
}
|
||||
}
|
||||
|
||||
const tasks = scripts.map(({ script, outputRoot }) => {
|
||||
return new Promise((resolve, reject) => {
|
||||
const args = [script];
|
||||
if (isWatch) {
|
||||
args.push('--watch');
|
||||
}
|
||||
if (outputRoot) {
|
||||
args.push('--outputRoot', outputRoot);
|
||||
}
|
||||
const proc = child_process.execFile(process.argv[0], args, {}, (error, _stdout, stderr) => {
|
||||
if (error) {
|
||||
return reject(error);
|
||||
}
|
||||
reporter(stderr, script);
|
||||
if (stderr) {
|
||||
return reject();
|
||||
}
|
||||
return resolve();
|
||||
});
|
||||
|
||||
proc.stdout.on('data', (data) => {
|
||||
fancyLog(`${ansiColors.green(taskName)}: ${data.toString('utf8')}`);
|
||||
});
|
||||
});
|
||||
});
|
||||
return Promise.all(tasks);
|
||||
return ext.webpackExtensions('packaging web extension', isWatch, webpackConfigLocations.map(configPath => ({ configPath })));
|
||||
}
|
||||
|
||||
@@ -42,6 +42,7 @@ BUILD_TARGETS.forEach(({ platform, arch }) => {
|
||||
});
|
||||
|
||||
function getNodeVersion() {
|
||||
// NOTE@coder: Fix version due to .yarnrc removal.
|
||||
return process.versions.node;
|
||||
const yarnrc = fs.readFileSync(path.join(REPO_ROOT, 'remote', '.yarnrc'), 'utf8');
|
||||
const target = /^target "(.*)"$/m.exec(yarnrc)[1];
|
||||
|
||||
@@ -228,7 +228,14 @@ function packageTask(platform, arch, sourceFolderName, destinationFolderName, op
|
||||
.pipe(jsFilter)
|
||||
.pipe(util.rewriteSourceMappingURL(sourceMappingURLBase))
|
||||
.pipe(jsFilter.restore)
|
||||
.pipe(createAsar(path.join(process.cwd(), 'node_modules'), ['**/*.node', '**/vscode-ripgrep/bin/*', '**/node-pty/build/Release/*', '**/*.wasm'], 'node_modules.asar'));
|
||||
.pipe(createAsar(path.join(process.cwd(), 'node_modules'), [
|
||||
'**/*.node',
|
||||
'**/vscode-ripgrep/bin/*',
|
||||
'**/node-pty/build/Release/*',
|
||||
'**/node-pty/lib/worker/conoutSocketWorker.js',
|
||||
'**/node-pty/lib/shared/conout.js',
|
||||
'**/*.wasm'
|
||||
], 'node_modules.asar'));
|
||||
|
||||
let all = es.merge(
|
||||
packageJsonStream,
|
||||
@@ -383,8 +390,6 @@ BUILD_TARGETS.forEach(buildTarget => {
|
||||
}
|
||||
});
|
||||
|
||||
// Transifex Localizations
|
||||
|
||||
const innoSetupConfig = {
|
||||
'zh-cn': { codePage: 'CP936', defaultInfo: { name: 'Simplified Chinese', id: '$0804', } },
|
||||
'zh-tw': { codePage: 'CP950', defaultInfo: { name: 'Traditional Chinese', id: '$0404' } },
|
||||
@@ -400,6 +405,8 @@ const innoSetupConfig = {
|
||||
'tr': { codePage: 'CP1254' }
|
||||
};
|
||||
|
||||
// Transifex Localizations
|
||||
|
||||
const apiHostname = process.env.TRANSIFEX_API_URL;
|
||||
const apiName = process.env.TRANSIFEX_API_NAME;
|
||||
const apiToken = process.env.TRANSIFEX_API_TOKEN;
|
||||
@@ -434,7 +441,7 @@ gulp.task(task.define(
|
||||
function () {
|
||||
const pathToMetadata = './out-vscode/nls.metadata.json';
|
||||
const pathToExtensions = '.build/extensions/*';
|
||||
const pathToSetup = 'build/win32/**/{Default.isl,messages.en.isl}';
|
||||
const pathToSetup = 'build/win32/i18n/messages.en.isl';
|
||||
|
||||
return es.merge(
|
||||
gulp.src(pathToMetadata).pipe(i18n.createXlfFilesForCoreBundle()),
|
||||
@@ -460,8 +467,8 @@ gulp.task('vscode-translations-import', function () {
|
||||
}
|
||||
});
|
||||
return es.merge([...i18n.defaultLanguages, ...i18n.extraLanguages].map(language => {
|
||||
let id = language.transifexId || language.id;
|
||||
return gulp.src(`${options.location}/${id}/setup/*/*.xlf`)
|
||||
let id = language.id;
|
||||
return gulp.src(`${options.location}/${id}/vscode-setup/messages.xlf`)
|
||||
.pipe(i18n.prepareIslFiles(language, innoSetupConfig[language.id]))
|
||||
.pipe(vfs.dest(`./build/win32/i18n`));
|
||||
}));
|
||||
|
||||
@@ -18,8 +18,8 @@ const ansiColors = require("ansi-colors");
|
||||
const mkdirp = require('mkdirp');
|
||||
const root = path.dirname(path.dirname(__dirname));
|
||||
const productjson = JSON.parse(fs.readFileSync(path.join(__dirname, '../../product.json'), 'utf8'));
|
||||
const builtInExtensions = productjson.builtInExtensions;
|
||||
const webBuiltInExtensions = productjson.webBuiltInExtensions;
|
||||
const builtInExtensions = productjson.builtInExtensions || [];
|
||||
const webBuiltInExtensions = productjson.webBuiltInExtensions || [];
|
||||
const controlFilePath = path.join(os.homedir(), '.vscode-oss-dev', 'extensions', 'control.json');
|
||||
const ENABLE_LOGGING = !process.env['VSCODE_BUILD_BUILTIN_EXTENSIONS_SILENCE_PLEASE'];
|
||||
function log(...messages) {
|
||||
|
||||
@@ -36,8 +36,8 @@ export interface IExtensionDefinition {
|
||||
|
||||
const root = path.dirname(path.dirname(__dirname));
|
||||
const productjson = JSON.parse(fs.readFileSync(path.join(__dirname, '../../product.json'), 'utf8'));
|
||||
const builtInExtensions = <IExtensionDefinition[]>productjson.builtInExtensions;
|
||||
const webBuiltInExtensions = <IExtensionDefinition[]>productjson.webBuiltInExtensions;
|
||||
const builtInExtensions = <IExtensionDefinition[]>productjson.builtInExtensions || [];
|
||||
const webBuiltInExtensions = <IExtensionDefinition[]>productjson.webBuiltInExtensions || [];
|
||||
const controlFilePath = path.join(os.homedir(), '.vscode-oss-dev', 'extensions', 'control.json');
|
||||
const ENABLE_LOGGING = !process.env['VSCODE_BUILD_BUILTIN_EXTENSIONS_SILENCE_PLEASE'];
|
||||
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user