mirror of
https://github.com/coder/code-server.git
synced 2026-04-13 21:32:52 -05:00
Compare commits
314 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
9ad0d9e6ad | ||
|
|
55cfba8168 | ||
|
|
4f0d5566c3 | ||
|
|
79e96a99d3 | ||
|
|
c99f4cef25 | ||
|
|
1296848afc | ||
|
|
c51ff3bce1 | ||
|
|
a879844c2d | ||
|
|
f2693d366c | ||
|
|
5ce99f8d1c | ||
|
|
eb314ff727 | ||
|
|
61138b4a61 | ||
|
|
113ad85b37 | ||
|
|
a2bfcfcc78 | ||
|
|
a96162d075 | ||
|
|
744b301c7a | ||
|
|
ba990668a5 | ||
|
|
2c1cf0259e | ||
|
|
d75883bcc6 | ||
|
|
792e954937 | ||
|
|
5d47282ea5 | ||
|
|
d3f58f9b7d | ||
|
|
1e304b1e7d | ||
|
|
5276e41606 | ||
|
|
dedd770a78 | ||
|
|
a02f47714e | ||
|
|
b13849ded0 | ||
|
|
7a8d487729 | ||
|
|
1788537cce | ||
|
|
0155a12500 | ||
|
|
53b5d41271 | ||
|
|
55006ccb5a | ||
|
|
cd78f32dc0 | ||
|
|
3207bfd4ad | ||
|
|
7c1a45a8d8 | ||
|
|
60dd8ab374 | ||
|
|
6cf607eab9 | ||
|
|
f735c87ac7 | ||
|
|
5a5798e45f | ||
|
|
66a364358a | ||
|
|
ef0d76bc16 | ||
|
|
88e971c609 | ||
|
|
7027ec7d60 | ||
|
|
4e93db5b95 | ||
|
|
fc75db6edc | ||
|
|
e3c8bd692c | ||
|
|
a0b36147ea | ||
|
|
683412cb01 | ||
|
|
18ff99693b | ||
|
|
ed7bd2e65b | ||
|
|
c35bf1311e | ||
|
|
7780a13cce | ||
|
|
dea6a40ea8 | ||
|
|
09fc64a4f0 | ||
|
|
fd42b95164 | ||
|
|
b62a68ac37 | ||
|
|
e7e6c163ed | ||
|
|
0e1f396645 | ||
|
|
c05b727c61 | ||
|
|
3bf470f19c | ||
|
|
f4569f0b48 | ||
|
|
fd2a031c21 | ||
|
|
3ba3caa8a6 | ||
|
|
f0bfd3b450 | ||
|
|
38e57a355b | ||
|
|
5bc26e90cb | ||
|
|
d796cc20e0 | ||
|
|
0fceb128f7 | ||
|
|
d5d7c519e8 | ||
|
|
7f884203f0 | ||
|
|
cd6d740dc3 | ||
|
|
9c4f41d784 | ||
|
|
5341294d2d | ||
|
|
06e36b42bb | ||
|
|
be0fe10a6a | ||
|
|
8316a27da4 | ||
|
|
18e19d29e6 | ||
|
|
326a1d1862 | ||
|
|
e1c1ba8b36 | ||
|
|
ba1ddbd181 | ||
|
|
cf7cff0f72 | ||
|
|
a1af9e2a56 | ||
|
|
be727871f6 | ||
|
|
60ebf2f851 | ||
|
|
815c4cf1f0 | ||
|
|
5afb26fb60 | ||
|
|
a0561c7685 | ||
|
|
d22f312cab | ||
|
|
21c74802e8 | ||
|
|
184ef68147 | ||
|
|
86c8590bd5 | ||
|
|
91cabbc246 | ||
|
|
77296c7187 | ||
|
|
52eaea9f7a | ||
|
|
03e0bdac03 | ||
|
|
3b93a86f25 | ||
|
|
643ef1392f | ||
|
|
3c6f85c282 | ||
|
|
f0faa22ee9 | ||
|
|
7aa087ae34 | ||
|
|
b61a8addcf | ||
|
|
c4d87580ef | ||
|
|
78658f1cf4 | ||
|
|
b0181120d4 | ||
|
|
0e78a147b6 | ||
|
|
3f3a489f33 | ||
|
|
83269ba658 | ||
|
|
2c785779b5 | ||
|
|
506d3f43ed | ||
|
|
1465d8d510 | ||
|
|
b3cf4c32ff | ||
|
|
44d74c170f | ||
|
|
a989e0c387 | ||
|
|
769aceacc3 | ||
|
|
793e4d35ec | ||
|
|
f9402a6318 | ||
|
|
23734d356a | ||
|
|
d7c1894fb4 | ||
|
|
01a0e95174 | ||
|
|
94f378c196 | ||
|
|
e3e9f052c4 | ||
|
|
b26cce589f | ||
|
|
8fc4832722 | ||
|
|
36eae3b9f2 | ||
|
|
3ad618db97 | ||
|
|
c9c5c54cda | ||
|
|
102478bdea | ||
|
|
03c62242ee | ||
|
|
8135d2ecc3 | ||
|
|
177f0ed163 | ||
|
|
25b1340771 | ||
|
|
00224fa73a | ||
|
|
fd643dcbc3 | ||
|
|
79412eb137 | ||
|
|
10f57bac65 | ||
|
|
439f27c568 | ||
|
|
c20b0b390b | ||
|
|
14d0feff0d | ||
|
|
9954a88d3a | ||
|
|
48bbbd6c37 | ||
|
|
8816ab93fe | ||
|
|
a2f530161f | ||
|
|
63f99da087 | ||
|
|
6e04501ec5 | ||
|
|
51818dc419 | ||
|
|
48cd3c8b11 | ||
|
|
723469ab5b | ||
|
|
2752d95ff6 | ||
|
|
b621911e61 | ||
|
|
48ddad8351 | ||
|
|
15500bb388 | ||
|
|
ad81a30db5 | ||
|
|
70c91c857a | ||
|
|
33c50972bc | ||
|
|
ca15d4b7a0 | ||
|
|
484429b5da | ||
|
|
3d999986b2 | ||
|
|
f04fcf2d64 | ||
|
|
7695de2831 | ||
|
|
003480881b | ||
|
|
47f0b6f4fa | ||
|
|
047a4f01f2 | ||
|
|
95d965a27b | ||
|
|
c4c480a068 | ||
|
|
b990dabed1 | ||
|
|
4943e9418d | ||
|
|
f10ef42f04 | ||
|
|
c27dbd0463 | ||
|
|
ec3d9974b3 | ||
|
|
73e0b79d7f | ||
|
|
3059d72a5d | ||
|
|
6e9e411542 | ||
|
|
7561fc4306 | ||
|
|
259363bcdb | ||
|
|
1b796d19bf | ||
|
|
5960a6728c | ||
|
|
18e66c4299 | ||
|
|
c77999bcd3 | ||
|
|
9e583fa562 | ||
|
|
3b91cffae5 | ||
|
|
4b4ec37880 | ||
|
|
9d9f3a41ab | ||
|
|
c3eb9b800e | ||
|
|
6c9c84090e | ||
|
|
d15731a570 | ||
|
|
80f30fc42c | ||
|
|
62b3a6fd9f | ||
|
|
6a2740f57e | ||
|
|
3d4660491a | ||
|
|
65d7420ee7 | ||
|
|
0bc96989c2 | ||
|
|
bd09533f40 | ||
|
|
db35c47315 | ||
|
|
3157a40044 | ||
|
|
5fe16be62d | ||
|
|
dd29a823c3 | ||
|
|
cd26f84bc6 | ||
|
|
ccb9d948c0 | ||
|
|
0a072f7532 | ||
|
|
16a5f2e171 | ||
|
|
e705948ef3 | ||
|
|
6606040835 | ||
|
|
cdf0deb534 | ||
|
|
d052cc246d | ||
|
|
e4a797dc9e | ||
|
|
1b60ef418c | ||
|
|
31d5823d10 | ||
|
|
605c3c6367 | ||
|
|
94b2774f8c | ||
|
|
4399c7df64 | ||
|
|
03651e5e0b | ||
|
|
219cad1783 | ||
|
|
dcc9cf3dd2 | ||
|
|
13404df267 | ||
|
|
13e91dedc1 | ||
|
|
0cbf1ca58c | ||
|
|
9c861570cd | ||
|
|
743bab09cd | ||
|
|
976891a2e2 | ||
|
|
946e4e8843 | ||
|
|
49c9c191b9 | ||
|
|
433a3d91dd | ||
|
|
0100d4c72a | ||
|
|
aa9755b8fb | ||
|
|
4abc525801 | ||
|
|
705e821741 | ||
|
|
0e97a94acf | ||
|
|
3520ad2286 | ||
|
|
ad17c7dc8e | ||
|
|
271bc06754 | ||
|
|
dfc505b977 | ||
|
|
ee1de79af6 | ||
|
|
fa6f47965a | ||
|
|
1af83a3c56 | ||
|
|
8745f1aa63 | ||
|
|
bb1799ba04 | ||
|
|
70fbfc7ada | ||
|
|
59f667ec14 | ||
|
|
816152ddbd | ||
|
|
45319ec648 | ||
|
|
e588f8b0b0 | ||
|
|
7c26a82a17 | ||
|
|
75e44fdc84 | ||
|
|
8a4ed5a2e0 | ||
|
|
a8d873f9f8 | ||
|
|
7183b5a43e | ||
|
|
8136769b66 | ||
|
|
672038c6af | ||
|
|
2d7aeb5bf9 | ||
|
|
f342c327f3 | ||
|
|
4619786019 | ||
|
|
1dfcd0448e | ||
|
|
48ce49eec8 | ||
|
|
d8c344beda | ||
|
|
beebf53adc | ||
|
|
a14fa862da | ||
|
|
fc0d127470 | ||
|
|
6eda7ae81f | ||
|
|
3f75aa2db1 | ||
|
|
328b864534 | ||
|
|
876d0275b3 | ||
|
|
b9989ca2db | ||
|
|
4e310b4985 | ||
|
|
d54b4accac | ||
|
|
5e7b419820 | ||
|
|
1b80244af7 | ||
|
|
999960eef5 | ||
|
|
6c95f72d2b | ||
|
|
8ef950af4c | ||
|
|
e5f03e0b06 | ||
|
|
77c1150b8d | ||
|
|
fb2625dbe8 | ||
|
|
82d93186f8 | ||
|
|
8f72481712 | ||
|
|
edb3b41800 | ||
|
|
97a292235f | ||
|
|
4c6e43d8d6 | ||
|
|
8bae81dd83 | ||
|
|
be90b5de35 | ||
|
|
1f819fa534 | ||
|
|
5a36627aae | ||
|
|
c11d51ed7a | ||
|
|
900c34c613 | ||
|
|
c91033c611 | ||
|
|
2c6a47d42b | ||
|
|
05d66c1358 | ||
|
|
bf10341e3f | ||
|
|
83eade6897 | ||
|
|
f3ef414fd2 | ||
|
|
014faf5b1c | ||
|
|
1f95a23d1d | ||
|
|
ed0926819d | ||
|
|
ee04915d12 | ||
|
|
e58b072f24 | ||
|
|
b27e1d8dd4 | ||
|
|
8156fc040a | ||
|
|
80f3884e0f | ||
|
|
4229e95a7d | ||
|
|
e0a1220126 | ||
|
|
e8063c7efd | ||
|
|
1440b263f4 | ||
|
|
f84757507b | ||
|
|
76f4054242 | ||
|
|
a673cf2833 | ||
|
|
30ade712bf | ||
|
|
92d0d28dd7 | ||
|
|
a3cea88f51 | ||
|
|
4f3c8a556e | ||
|
|
6a692487c8 | ||
|
|
0609a1b2bd | ||
|
|
3c61d96d4f | ||
|
|
7925f88776 | ||
|
|
ddd09454df | ||
|
|
b37ff28a0a |
@@ -36,11 +36,8 @@ rules:
|
||||
import/order:
|
||||
[error, { alphabetize: { order: "asc" }, groups: [["builtin", "external", "internal"], "parent", "sibling"] }]
|
||||
no-async-promise-executor: off
|
||||
# This isn't a real module, just types, which apparently doesn't resolve.
|
||||
import/no-unresolved: [error, { ignore: ["express-serve-static-core"] }]
|
||||
|
||||
settings:
|
||||
# Does not work with CommonJS unfortunately.
|
||||
import/ignore:
|
||||
- env-paths
|
||||
- xdg-basedir
|
||||
import/resolver:
|
||||
typescript:
|
||||
alwaysTryTypes: true
|
||||
|
||||
4
.github/CODEOWNERS
vendored
4
.github/CODEOWNERS
vendored
@@ -1,3 +1,3 @@
|
||||
* @cdr/code-server-reviewers
|
||||
* @coder/code-server-reviewers
|
||||
|
||||
ci/helm-chart @Matthew-Beckett @alexgorbatchev
|
||||
ci/helm-chart/ @Matthew-Beckett @alexgorbatchev
|
||||
|
||||
79
.github/ISSUE_TEMPLATE/bug-report.md
vendored
79
.github/ISSUE_TEMPLATE/bug-report.md
vendored
@@ -1,79 +0,0 @@
|
||||
---
|
||||
name: Bug report
|
||||
about: Report a bug and help us improve
|
||||
title: ""
|
||||
labels: ""
|
||||
assignees: ""
|
||||
---
|
||||
|
||||
<!--
|
||||
|
||||
Hi there! 👋
|
||||
|
||||
Thanks for reporting a bug.
|
||||
|
||||
Please search for existing issues before filing, as they may contain additional
|
||||
information about the problem and descriptions of workarounds. Provide as much
|
||||
information as you can, so that we can reproduce the issue. Otherwise, we may
|
||||
not be able to help diagnose the problem, and may close the issue as
|
||||
unreproducible or incomplete. For visual defects, please include screenshots to
|
||||
help us understand the issue.
|
||||
-->
|
||||
|
||||
## OS/Web Information
|
||||
|
||||
- Web Browser:
|
||||
- Local OS:
|
||||
- Remote OS:
|
||||
- Remote Architecture:
|
||||
- `code-server --version`:
|
||||
|
||||
## Steps to Reproduce
|
||||
|
||||
1.
|
||||
2.
|
||||
3.
|
||||
|
||||
## Expected
|
||||
|
||||
<!-- What should happen? -->
|
||||
|
||||
## Actual
|
||||
|
||||
<!-- What actually happens? -->
|
||||
|
||||
## Logs
|
||||
|
||||
<!--
|
||||
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. For example:
|
||||
|
||||
code-server --log debug
|
||||
|
||||
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.
|
||||
-->
|
||||
|
||||
<!--
|
||||
If you're having issues with installation please include the installation logs
|
||||
i.e. the output of `yarn global add code-server` if you installed with `yarn`
|
||||
-->
|
||||
|
||||
## Screenshot
|
||||
|
||||
<!-- Ideally provide a screenshot, gif, video or screen recording. -->
|
||||
|
||||
## Notes
|
||||
|
||||
<!-- If you can reproduce the issue on vanilla VS Code,
|
||||
please file the issue at the VS Code repository instead. -->
|
||||
|
||||
This issue can be reproduced in VS Code: Yes/No
|
||||
88
.github/ISSUE_TEMPLATE/bug-report.yml
vendored
Normal file
88
.github/ISSUE_TEMPLATE/bug-report.yml
vendored
Normal file
@@ -0,0 +1,88 @@
|
||||
name: Bug report
|
||||
description: File a bug report
|
||||
title: "[Bug]: "
|
||||
labels: ["bug", "triage"]
|
||||
body:
|
||||
- type: checkboxes
|
||||
attributes:
|
||||
label: Is there an existing issue for this?
|
||||
description: Please search to see if an issue already exists for the bug you encountered.
|
||||
options:
|
||||
- label: I have searched the existing issues
|
||||
required: true
|
||||
- type: textarea
|
||||
attributes:
|
||||
label: OS/Web Information
|
||||
description: |
|
||||
examples:
|
||||
- **Web Browser**: Chrome
|
||||
- **Local OS**: macOS
|
||||
- **Remote OS**: Ubuntu
|
||||
- **Remote Architecture**: amd64
|
||||
- **`code-server --version`**: 4.0.1
|
||||
value: |
|
||||
- Web Browser:
|
||||
- Local OS:
|
||||
- Remote OS:
|
||||
- Remote Architecture:
|
||||
- `code-server --version`:
|
||||
validations:
|
||||
required: true
|
||||
- type: textarea
|
||||
attributes:
|
||||
label: Steps to Reproduce
|
||||
description: |
|
||||
1. open code-server
|
||||
2. install extension
|
||||
3. run command
|
||||
value: |
|
||||
1.
|
||||
2.
|
||||
3.
|
||||
validations:
|
||||
required: true
|
||||
- type: textarea
|
||||
attributes:
|
||||
label: Expected
|
||||
description: What should happen?
|
||||
validations:
|
||||
required: true
|
||||
- type: textarea
|
||||
attributes:
|
||||
label: Actual
|
||||
description: What actually happens?
|
||||
validations:
|
||||
required: true
|
||||
- type: textarea
|
||||
id: logs
|
||||
attributes:
|
||||
label: Logs
|
||||
description: Run code-server with the --verbose flag and then paste any relevant logs from the server, from the browser console and/or the browser network tab. For issues with installation, include installation logs (i.e. output of `yarn global add code-server`).
|
||||
- type: textarea
|
||||
attributes:
|
||||
label: Screenshot/Video
|
||||
description: Please include a screenshot, gif or screen recording of your issue.
|
||||
validations:
|
||||
required: false
|
||||
- type: checkboxes
|
||||
attributes:
|
||||
label: Does this issue happen in VS Code or GitHub Codespaces?
|
||||
description: Please try reproducing this issue in VS Code or GitHub Codespaces
|
||||
options:
|
||||
- label: I cannot reproduce this in VS Code.
|
||||
required: true
|
||||
- label: I cannot reproduce this in GitHub Codespaces.
|
||||
required: true
|
||||
- type: checkboxes
|
||||
attributes:
|
||||
label: Are you accessing code-server over HTTPS?
|
||||
description: code-server relies on service workers for many features. Double-check that you are using HTTPS.
|
||||
options:
|
||||
- label: I am using HTTPS.
|
||||
required: true
|
||||
- type: textarea
|
||||
attributes:
|
||||
label: Notes
|
||||
description: Please include any addition notes that will help us resolve this issue.
|
||||
validations:
|
||||
required: false
|
||||
8
.github/ISSUE_TEMPLATE/config.yml
vendored
8
.github/ISSUE_TEMPLATE/config.yml
vendored
@@ -1,8 +1,8 @@
|
||||
blank_issues_enabled: false
|
||||
contact_links:
|
||||
- name: Question
|
||||
url: https://github.com/cdr/code-server/discussions/new?category_id=22503114
|
||||
- name: Question?
|
||||
url: https://github.com/coder/code-server/discussions/new?category_id=22503114
|
||||
about: Ask the community for help on our GitHub Discussions board
|
||||
- name: Chat
|
||||
about: Need immediate help or just want to talk? Hop in our Slack
|
||||
- name: code-server Slack Community
|
||||
about: Need immediate help or just want to talk? Hop in our Slack. Note - this Slack is not actively monitored by code-server maintainers.
|
||||
url: https://cdr.co/join-community
|
||||
|
||||
10
.github/ISSUE_TEMPLATE/doc.md
vendored
10
.github/ISSUE_TEMPLATE/doc.md
vendored
@@ -1,7 +1,13 @@
|
||||
---
|
||||
name: Documentation improvement
|
||||
about: Suggest a documentation improvement
|
||||
title: ""
|
||||
title: "[Docs]: "
|
||||
labels: "docs"
|
||||
assignees: ""
|
||||
assignees: "@jsjoeio"
|
||||
---
|
||||
|
||||
## What is your suggestion?
|
||||
|
||||
## How will this improve the docs?
|
||||
|
||||
## Are you interested in submitting a PR for this?
|
||||
|
||||
18
.github/ISSUE_TEMPLATE/extension-request.md
vendored
18
.github/ISSUE_TEMPLATE/extension-request.md
vendored
@@ -1,18 +0,0 @@
|
||||
---
|
||||
name: Extension request
|
||||
about: Request an extension missing from the code-server marketplace
|
||||
title: ""
|
||||
labels: extension-request
|
||||
assignees: ""
|
||||
---
|
||||
|
||||
<!--
|
||||
Details on the code-server extension marketplace are at
|
||||
|
||||
https://github.com/cdr/code-server/blob/master/docs/FAQ.md#whats-the-deal-with-extensions
|
||||
|
||||
Please fill in the issue template!
|
||||
-->
|
||||
|
||||
- [ ] Extension name:
|
||||
- [ ] Extension GitHub or homepage:
|
||||
16
.github/ISSUE_TEMPLATE/feature-request.md
vendored
16
.github/ISSUE_TEMPLATE/feature-request.md
vendored
@@ -1,13 +1,15 @@
|
||||
---
|
||||
name: Feature request
|
||||
about: Suggest an idea
|
||||
title: ""
|
||||
labels: feature
|
||||
about: Suggest an idea to improve code-server
|
||||
title: "[Feat]: "
|
||||
labels: enhancement
|
||||
assignees: ""
|
||||
---
|
||||
|
||||
<!--
|
||||
Please search for existing issues before filing.
|
||||
## What is your suggestion?
|
||||
|
||||
Please describe the feature as clearly as possible!
|
||||
-->
|
||||
## Why do you want this feature?
|
||||
|
||||
## Are there any workarounds to get this functionality today?
|
||||
|
||||
## Are you interested in submitting a PR for this?
|
||||
|
||||
16
.github/ISSUE_TEMPLATE/release.md
vendored
16
.github/ISSUE_TEMPLATE/release.md
vendored
@@ -1,16 +0,0 @@
|
||||
---
|
||||
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
|
||||
8
.github/codecov.yml
vendored
8
.github/codecov.yml
vendored
@@ -8,6 +8,14 @@ coverage:
|
||||
range: "40...70"
|
||||
status:
|
||||
patch: off
|
||||
notify:
|
||||
slack:
|
||||
default:
|
||||
url: secret:v1::tXC7VwEIKYjNU8HRgRv2GdKOSCt5UzpykKZb+o1eCDqBgb2PEqwE3A26QUPYMLo4BO2qtrJhFIvwhUvlPwyzDCNGoNiuZfXr0UeZZ0y1TcZu672R/NBNMwEPO/e1Ye0pHxjzKHnuH7HqbjFucox/RBQLtiL3J56SWGE3JtbkC6o=
|
||||
threshold: 1%
|
||||
only_pulls: false
|
||||
branches:
|
||||
- "main"
|
||||
|
||||
parsers:
|
||||
gcov:
|
||||
|
||||
37
.github/lock.yml
vendored
37
.github/lock.yml
vendored
@@ -1,37 +0,0 @@
|
||||
# Configuration for Lock Threads - https://github.com/dessant/lock-threads-app
|
||||
|
||||
# Number of days of inactivity before a closed issue or pull request is locked
|
||||
daysUntilLock: 90
|
||||
|
||||
# Skip issues and pull requests created before a given timestamp. Timestamp must
|
||||
# follow ISO 8601 (`YYYY-MM-DD`). Set to `false` to disable
|
||||
skipCreatedBefore: false
|
||||
|
||||
# Issues and pull requests with these labels will be ignored. Set to `[]` to disable
|
||||
exemptLabels: []
|
||||
|
||||
# Label to add before locking, such as `outdated`. Set to `false` to disable
|
||||
lockLabel: false
|
||||
|
||||
# Comment to post before locking. Set to `false` to disable
|
||||
lockComment: >
|
||||
This thread has been automatically locked since there has not been
|
||||
any recent activity after it was closed. Please open a new issue for
|
||||
related bugs.
|
||||
|
||||
# Assign `resolved` as the reason for locking. Set to `false` to disable
|
||||
setLockReason: true
|
||||
# Limit to only `issues` or `pulls`
|
||||
# only: issues
|
||||
|
||||
# Optionally, specify configuration settings just for `issues` or `pulls`
|
||||
# issues:
|
||||
# exemptLabels:
|
||||
# - help-wanted
|
||||
# lockLabel: outdated
|
||||
|
||||
# pulls:
|
||||
# daysUntilLock: 30
|
||||
|
||||
# Repository to extend settings from
|
||||
# _extends: repo
|
||||
12
.github/ranger.yml
vendored
12
.github/ranger.yml
vendored
@@ -19,18 +19,6 @@ labels:
|
||||
action: comment
|
||||
delay: 5s
|
||||
message: "Thanks for making your first contribution! :slightly_smiling_face:"
|
||||
extension-request:
|
||||
action: close
|
||||
delay: 5s
|
||||
comment: >
|
||||
Thanks for opening an extension request!
|
||||
We are currently in the process of switching extension
|
||||
marketplaces and transitioning over 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. We suggest installing the VSIX
|
||||
file and then installing into code-server as a temporary workaround.
|
||||
See [docs](https://github.com/cdr/code-server/blob/main/docs/FAQ.md#installing-vsix-extensions-via-the-command-line) for more info.
|
||||
"upstream:vscode":
|
||||
action: close
|
||||
delay: 5s
|
||||
|
||||
66
.github/semantic.yaml
vendored
Normal file
66
.github/semantic.yaml
vendored
Normal file
@@ -0,0 +1,66 @@
|
||||
###############################################################################
|
||||
# This file configures "Semantic Pull Requests", which is documented here:
|
||||
# https://github.com/zeke/semantic-pull-requests
|
||||
###############################################################################
|
||||
|
||||
# Scopes are optionally supplied after a 'type'. For example, in
|
||||
#
|
||||
# feat(docs): autostart ui
|
||||
#
|
||||
# '(docs)' is the scope. Scopes are used to signify where the change occurred.
|
||||
scopes:
|
||||
# docs: changes to the code-server documentation.
|
||||
- docs
|
||||
|
||||
# vendor: changes to vendored dependencies.
|
||||
- vendor
|
||||
|
||||
# deps: changes to code-server's dependencies.
|
||||
- deps
|
||||
|
||||
# cs: changes to code specific to code-server.
|
||||
- cs
|
||||
|
||||
# cli: changes to the command-line interface.
|
||||
- cli
|
||||
|
||||
# We only check that the PR title is semantic. The PR title is automatically
|
||||
# applied to the "Squash & Merge" flow as the suggested commit message, so this
|
||||
# should suffice unless someone drastically alters the message in that flow.
|
||||
titleOnly: true
|
||||
|
||||
# Types are the 'tag' types in a commit or PR title. For example, in
|
||||
#
|
||||
# chore: fix thing
|
||||
#
|
||||
# 'chore' is the type.
|
||||
types:
|
||||
# A build of any kind.
|
||||
- build
|
||||
|
||||
# A user-facing change that corrects a defect in code-server.
|
||||
- fix
|
||||
|
||||
# Any code task that is ignored for changelog purposes. Examples include
|
||||
# devbin scripts and internal-only configurations.
|
||||
- chore
|
||||
|
||||
# Any work performed on CI.
|
||||
- ci
|
||||
|
||||
# Work that directly implements or supports the implementation of a feature.
|
||||
- feat
|
||||
|
||||
# A refactor changes code structure without any behavioral change.
|
||||
- refactor
|
||||
|
||||
# A git revert for any style of commit.
|
||||
- revert
|
||||
|
||||
# Adding tests of any kind. Should be separate from feature or fix
|
||||
# implementations. For example, if a commit adds a fix + test, it's a fix
|
||||
# commit. If a commit is simply bumping coverage, it's a test commit.
|
||||
- test
|
||||
|
||||
# A new release.
|
||||
- release
|
||||
322
.github/workflows/ci.yaml
vendored
322
.github/workflows/ci.yaml
vendored
@@ -8,6 +8,13 @@ on:
|
||||
branches:
|
||||
- main
|
||||
|
||||
# Cancel in-progress runs for pull requests when developers push
|
||||
# additional changes, and serialize builds in branches.
|
||||
# https://docs.github.com/en/actions/using-jobs/using-concurrency#example-using-concurrency-to-cancel-any-in-progress-job-or-run
|
||||
concurrency:
|
||||
group: ${{ github.workflow }}-${{ github.ref }}
|
||||
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
|
||||
|
||||
# Note: if: success() is used in several jobs -
|
||||
# this ensures that it only executes if all previous jobs succeeded.
|
||||
|
||||
@@ -19,23 +26,24 @@ jobs:
|
||||
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 v14
|
||||
uses: actions/setup-node@v2
|
||||
uses: actions/checkout@v3
|
||||
with:
|
||||
node-version: "14"
|
||||
fetch-depth: 0
|
||||
submodules: true
|
||||
|
||||
- name: Install Node.js v16
|
||||
uses: actions/setup-node@v3
|
||||
with:
|
||||
node-version: "16"
|
||||
|
||||
- name: Install helm
|
||||
uses: azure/setup-helm@v1.1
|
||||
uses: azure/setup-helm@v3.0
|
||||
|
||||
- name: Fetch dependencies from cache
|
||||
id: cache-yarn
|
||||
uses: actions/cache@v2
|
||||
uses: actions/cache@v3
|
||||
with:
|
||||
path: "**/node_modules"
|
||||
key: yarn-build-${{ hashFiles('**/yarn.lock') }}
|
||||
@@ -54,31 +62,26 @@ jobs:
|
||||
run: yarn lint
|
||||
if: success()
|
||||
|
||||
- name: Run code-server unit tests
|
||||
run: yarn test:unit
|
||||
if: success()
|
||||
|
||||
- name: Upload coverage report to Codecov
|
||||
run: yarn coverage
|
||||
if: success()
|
||||
|
||||
audit-ci:
|
||||
name: Run audit-ci
|
||||
needs: prebuild
|
||||
runs-on: ubuntu-latest
|
||||
timeout-minutes: 5
|
||||
timeout-minutes: 15
|
||||
steps:
|
||||
- name: Checkout repo
|
||||
uses: actions/checkout@v2
|
||||
|
||||
- name: Install Node.js v14
|
||||
uses: actions/setup-node@v2
|
||||
uses: actions/checkout@v3
|
||||
with:
|
||||
node-version: "14"
|
||||
fetch-depth: 0
|
||||
submodules: true
|
||||
|
||||
- name: Install Node.js v16
|
||||
uses: actions/setup-node@v3
|
||||
with:
|
||||
node-version: "16"
|
||||
|
||||
- name: Fetch dependencies from cache
|
||||
id: cache-yarn
|
||||
uses: actions/cache@v2
|
||||
uses: actions/cache@v3
|
||||
with:
|
||||
path: "**/node_modules"
|
||||
key: yarn-build-${{ hashFiles('**/yarn.lock') }}
|
||||
@@ -98,62 +101,74 @@ jobs:
|
||||
needs: prebuild
|
||||
runs-on: ubuntu-latest
|
||||
timeout-minutes: 30
|
||||
env:
|
||||
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- name: Checkout repo
|
||||
uses: actions/checkout@v3
|
||||
with:
|
||||
fetch-depth: 0
|
||||
submodules: true
|
||||
|
||||
- name: Install Node.js v14
|
||||
uses: actions/setup-node@v2
|
||||
- name: Install quilt
|
||||
run: sudo apt update && sudo apt install quilt
|
||||
|
||||
- name: Patch Code
|
||||
run: quilt push -a
|
||||
|
||||
- name: Install Node.js v16
|
||||
uses: actions/setup-node@v3
|
||||
with:
|
||||
node-version: "14"
|
||||
node-version: "16"
|
||||
|
||||
# TODO@Teffen investigate why this omits code-oss-dev/node_modules
|
||||
# - name: Fetch dependencies from cache
|
||||
# id: cache-yarn
|
||||
# uses: actions/cache@v2
|
||||
# with:
|
||||
# path: |
|
||||
# "**/node_modules"
|
||||
# "**/vendor/modules"
|
||||
# "**/vendor/modules/code-oss-dev/node_modules"
|
||||
# key: yarn-build-${{ hashFiles('**/yarn.lock') }}-${{ hashFiles('**/vendor/yarn.lock') }}
|
||||
# restore-keys: |
|
||||
# yarn-build-
|
||||
- name: Fetch dependencies from cache
|
||||
id: cache-yarn
|
||||
uses: actions/cache@v3
|
||||
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'
|
||||
if: steps.cache-yarn.outputs.cache-hit != 'true'
|
||||
run: yarn --frozen-lockfile
|
||||
|
||||
- name: Build code-server
|
||||
run: yarn build
|
||||
|
||||
# Parse the hash of the latest commit inside vendor/modules/code-oss-dev
|
||||
# use this to avoid rebuilding it if nothing changed
|
||||
# How it works: the `git log` command fetches the hash of the last commit
|
||||
# that changed a file inside `vendor/modules/code-oss-dev`. If a commit changes any file in there,
|
||||
# the hash returned will change, and we rebuild vscode. If the hash did not change,
|
||||
# (for example, a change to `src/` or `docs/`), we reuse the same build as last time.
|
||||
# This saves a lot of time in CI, as compiling VSCode can take anywhere from 5-10 minutes.
|
||||
- name: Get latest vendor/modules/code-oss-dev rev
|
||||
# Get Code's git hash. When this changes it means the content is
|
||||
# different and we need to rebuild.
|
||||
- name: Get latest lib/vscode rev
|
||||
id: vscode-rev
|
||||
run: echo "::set-output name=rev::$(jq -r '.devDependencies["code-oss-dev"]' vendor/package.json | sed -r 's|.*#(.*)$|\1|')"
|
||||
run: echo "::set-output name=rev::$(git rev-parse HEAD:./lib/vscode)"
|
||||
|
||||
- name: Attempt to fetch vscode build from cache
|
||||
# We need to rebuild when we have a new version of Code or when any of
|
||||
# the patches changed. Use VSCODE_CACHE_VERSION to force a rebuild.
|
||||
- name: Fetch prebuilt Code package from cache
|
||||
id: cache-vscode
|
||||
uses: actions/cache@v2
|
||||
uses: actions/cache@v3
|
||||
with:
|
||||
path: |
|
||||
vendor/modules/code-oss-dev/.build
|
||||
vendor/modules/code-oss-dev/out-build
|
||||
vendor/modules/code-oss-dev/out-vscode
|
||||
vendor/modules/code-oss-dev/out-vscode-min
|
||||
key: vscode-build-${{ steps.vscode-rev.outputs.rev }}
|
||||
path: lib/vscode-reh-web-*
|
||||
key: vscode-reh-package-${{ secrets.VSCODE_CACHE_VERSION }}-${{ steps.vscode-rev.outputs.rev }}-${{ hashFiles('patches/*.diff') }}
|
||||
|
||||
- name: Build vscode
|
||||
if: steps.cache-vscode.outputs.cache-hit != 'true'
|
||||
run: yarn build:vscode
|
||||
|
||||
# Our code imports code from VS Code's `out` directory meaning VS Code
|
||||
# must be built before running these tests.
|
||||
# TODO: Move to its own step?
|
||||
- name: Run code-server unit tests
|
||||
run: yarn test:unit
|
||||
if: success()
|
||||
|
||||
- name: Upload coverage report to Codecov
|
||||
uses: codecov/codecov-action@v3
|
||||
with:
|
||||
token: ${{ secrets.CODECOV_TOKEN }}
|
||||
if: success()
|
||||
|
||||
# The release package does not contain any native modules
|
||||
# and is neutral to architecture/os/libc version.
|
||||
- name: Create release package
|
||||
@@ -165,11 +180,65 @@ jobs:
|
||||
run: tar -czf package.tar.gz release
|
||||
|
||||
- name: Upload npm package artifact
|
||||
uses: actions/upload-artifact@v2
|
||||
uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: npm-package
|
||||
path: ./package.tar.gz
|
||||
|
||||
npm:
|
||||
# the npm-package gets uploaded as an artifact in Build
|
||||
# so we need that to complete before this runs
|
||||
needs: build
|
||||
# This environment "npm" requires someone from
|
||||
# coder/code-server-reviewers to approve the PR before this job runs.
|
||||
environment: npm
|
||||
# Only run if PR comes from base repo
|
||||
# Reason: forks cannot access secrets and this will always fail
|
||||
if: github.event.pull_request.head.repo.full_name == github.repository
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout repo
|
||||
uses: actions/checkout@v3
|
||||
with:
|
||||
fetch-depth: 0
|
||||
|
||||
- name: Download artifact
|
||||
uses: actions/download-artifact@v3
|
||||
id: download
|
||||
with:
|
||||
name: "npm-package"
|
||||
path: release-npm-package
|
||||
|
||||
- name: Run ./ci/steps/publish-npm.sh
|
||||
run: yarn publish:npm
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
|
||||
# NOTE@jsjoeio
|
||||
# NPM_ENVIRONMENT intentionally not set here.
|
||||
# Instead, itis determined in publish-npm.sh script
|
||||
# using GITHUB environment variables
|
||||
|
||||
- name: Comment npm information
|
||||
uses: marocchino/sticky-pull-request-comment@v2
|
||||
with:
|
||||
GITHUB_TOKEN: ${{ github.token }}
|
||||
header: npm-dev-build
|
||||
message: |
|
||||
✨ code-server dev build published to npm for PR #${{ github.event.number }}!
|
||||
* _Last publish status_: success
|
||||
* _Commit_: ${{ github.event.pull_request.head.sha }}
|
||||
|
||||
To install in a local project, run:
|
||||
```shell-session
|
||||
npm install @coder/code-server-pr@${{ github.event.number }}
|
||||
```
|
||||
|
||||
To install globally, run:
|
||||
```shell-session
|
||||
npm install -g @coder/code-server-pr@${{ github.event.number }}
|
||||
```
|
||||
|
||||
# TODO: cache building yarn --production
|
||||
# possibly 2m30s of savings(?)
|
||||
# this requires refactoring our release scripts
|
||||
@@ -181,22 +250,26 @@ jobs:
|
||||
container: "centos:7"
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
|
||||
- name: Install Node.js v14
|
||||
uses: actions/setup-node@v2
|
||||
- name: Checkout repo
|
||||
uses: actions/checkout@v3
|
||||
with:
|
||||
node-version: "14"
|
||||
fetch-depth: 0
|
||||
|
||||
- name: Install Node.js v16
|
||||
uses: actions/setup-node@v3
|
||||
with:
|
||||
node-version: "16"
|
||||
|
||||
- name: Install development tools
|
||||
run: |
|
||||
yum install -y epel-release centos-release-scl
|
||||
yum install -y devtoolset-9-{make,gcc,gcc-c++} jq rsync
|
||||
yum install -y devtoolset-9-{make,gcc,gcc-c++} jq rsync python3
|
||||
|
||||
- name: Install nfpm and envsubst
|
||||
run: |
|
||||
curl -sfL https://install.goreleaser.com/github.com/goreleaser/nfpm.sh | sh -s -- -b ~/.local/bin v2.3.1
|
||||
curl -L https://github.com/a8m/envsubst/releases/download/v1.1.0/envsubst-`uname -s`-`uname -m` -o envsubst
|
||||
mkdir -p ~/.local/bin
|
||||
curl -sSfL https://github.com/goreleaser/nfpm/releases/download/v2.3.1/nfpm_2.3.1_`uname -s`_`uname -m`.tar.gz | tar -C ~/.local/bin -zxv nfpm
|
||||
curl -sSfL https://github.com/a8m/envsubst/releases/download/v1.1.0/envsubst-`uname -s`-`uname -m` -o envsubst
|
||||
chmod +x envsubst
|
||||
mv envsubst ~/.local/bin
|
||||
echo "$HOME/.local/bin" >> $GITHUB_PATH
|
||||
@@ -205,7 +278,7 @@ jobs:
|
||||
run: npm install -g yarn
|
||||
|
||||
- name: Download npm package
|
||||
uses: actions/download-artifact@v2
|
||||
uses: actions/download-artifact@v3
|
||||
with:
|
||||
name: npm-package
|
||||
|
||||
@@ -217,14 +290,17 @@ jobs:
|
||||
- name: Build standalone release
|
||||
run: source scl_source enable devtoolset-9 && yarn release:standalone
|
||||
|
||||
- name: Sanity test standalone release
|
||||
run: yarn test:standalone-release
|
||||
- name: Install test dependencies
|
||||
run: SKIP_SUBMODULE_DEPS=1 yarn install
|
||||
|
||||
- name: Run integration tests on standalone release
|
||||
run: yarn test:integration
|
||||
|
||||
- name: Build packages with nfpm
|
||||
run: yarn package
|
||||
|
||||
- name: Upload release artifacts
|
||||
uses: actions/upload-artifact@v2
|
||||
uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: release-packages
|
||||
path: ./release-packages
|
||||
@@ -244,10 +320,14 @@ jobs:
|
||||
# so we just build with "native"/x86_64 node, then download arm64/armv7l node
|
||||
# and then put it in our release. We can't smoke test the cross build this way,
|
||||
# but this means we don't need to maintain a self-hosted runner!
|
||||
|
||||
# NOTE@jsjoeio:
|
||||
# We used to use 16.04 until GitHub deprecated it on September 20, 2021
|
||||
# See here: https://github.com/actions/virtual-environments/pull/3862/files
|
||||
package-linux-cross:
|
||||
name: Linux cross-compile builds
|
||||
needs: build
|
||||
runs-on: ubuntu-16.04
|
||||
runs-on: ubuntu-18.04
|
||||
timeout-minutes: 15
|
||||
strategy:
|
||||
matrix:
|
||||
@@ -263,28 +343,32 @@ jobs:
|
||||
CXX: ${{ format('{0}-g++', matrix.prefix) }}
|
||||
LINK: ${{ format('{0}-g++', matrix.prefix) }}
|
||||
NPM_CONFIG_ARCH: ${{ matrix.arch }}
|
||||
NODE_VERSION: v14.17.4
|
||||
NODE_VERSION: v16.13.0
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
|
||||
- name: Install Node.js v14
|
||||
uses: actions/setup-node@v2
|
||||
- name: Checkout repo
|
||||
uses: actions/checkout@v3
|
||||
with:
|
||||
node-version: "14"
|
||||
fetch-depth: 0
|
||||
|
||||
- name: Install Node.js v16
|
||||
uses: actions/setup-node@v3
|
||||
with:
|
||||
node-version: "16"
|
||||
|
||||
- name: Install nfpm
|
||||
run: |
|
||||
curl -sfL https://install.goreleaser.com/github.com/goreleaser/nfpm.sh | sh -s -- -b ~/.local/bin v2.3.1
|
||||
mkdir -p ~/.local/bin
|
||||
curl -sSfL https://github.com/goreleaser/nfpm/releases/download/v2.3.1/nfpm_2.3.1_`uname -s`_`uname -m`.tar.gz | tar -C ~/.local/bin -zxv nfpm
|
||||
echo "$HOME/.local/bin" >> $GITHUB_PATH
|
||||
|
||||
- name: Install cross-compiler
|
||||
run: sudo apt install $PACKAGE
|
||||
run: sudo apt update && sudo apt install $PACKAGE
|
||||
env:
|
||||
PACKAGE: ${{ format('g++-{0}', matrix.prefix) }}
|
||||
|
||||
- name: Download npm package
|
||||
uses: actions/download-artifact@v2
|
||||
uses: actions/download-artifact@v3
|
||||
with:
|
||||
name: npm-package
|
||||
|
||||
@@ -304,7 +388,7 @@ jobs:
|
||||
run: yarn package ${NPM_CONFIG_ARCH}
|
||||
|
||||
- name: Upload release artifacts
|
||||
uses: actions/upload-artifact@v2
|
||||
uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: release-packages
|
||||
path: ./release-packages
|
||||
@@ -315,20 +399,24 @@ jobs:
|
||||
runs-on: macos-latest
|
||||
timeout-minutes: 15
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
|
||||
- name: Install Node.js v14
|
||||
uses: actions/setup-node@v2
|
||||
- name: Checkout repo
|
||||
uses: actions/checkout@v3
|
||||
with:
|
||||
node-version: "14"
|
||||
fetch-depth: 0
|
||||
|
||||
- name: Install Node.js v16
|
||||
uses: actions/setup-node@v3
|
||||
with:
|
||||
node-version: "16"
|
||||
|
||||
- name: Install nfpm
|
||||
run: |
|
||||
curl -sfL https://install.goreleaser.com/github.com/goreleaser/nfpm.sh | sh -s -- -b ~/.local/bin v2.3.1
|
||||
mkdir -p ~/.local/bin
|
||||
curl -sSfL https://github.com/goreleaser/nfpm/releases/download/v2.3.1/nfpm_2.3.1_`uname -s`_`uname -m`.tar.gz | tar -C ~/.local/bin -zxv nfpm
|
||||
echo "$HOME/.local/bin" >> $GITHUB_PATH
|
||||
|
||||
- name: Download npm package
|
||||
uses: actions/download-artifact@v2
|
||||
uses: actions/download-artifact@v3
|
||||
with:
|
||||
name: npm-package
|
||||
|
||||
@@ -338,14 +426,17 @@ jobs:
|
||||
- name: Build standalone release
|
||||
run: yarn release:standalone
|
||||
|
||||
- name: Sanity test standalone release
|
||||
run: yarn test:standalone-release
|
||||
- name: Install test dependencies
|
||||
run: SKIP_SUBMODULE_DEPS=1 yarn install
|
||||
|
||||
- name: Run integration tests on standalone release
|
||||
run: yarn test:integration
|
||||
|
||||
- name: Build packages with nfpm
|
||||
run: yarn package
|
||||
|
||||
- name: Upload release artifacts
|
||||
uses: actions/upload-artifact@v2
|
||||
uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: release-packages
|
||||
path: ./release-packages
|
||||
@@ -360,19 +451,20 @@ jobs:
|
||||
# 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 v14
|
||||
uses: actions/setup-node@v2
|
||||
- name: Checkout repo
|
||||
uses: actions/checkout@v3
|
||||
with:
|
||||
node-version: "14"
|
||||
fetch-depth: 0
|
||||
submodules: true
|
||||
|
||||
- name: Install playwright OS dependencies
|
||||
run: npx playwright install-deps
|
||||
- name: Install Node.js v16
|
||||
uses: actions/setup-node@v3
|
||||
with:
|
||||
node-version: "16"
|
||||
|
||||
- name: Fetch dependencies from cache
|
||||
id: cache-yarn
|
||||
uses: actions/cache@v2
|
||||
uses: actions/cache@v3
|
||||
with:
|
||||
path: "**/node_modules"
|
||||
key: yarn-build-${{ hashFiles('**/yarn.lock') }}
|
||||
@@ -380,7 +472,7 @@ jobs:
|
||||
yarn-build-
|
||||
|
||||
- name: Download release packages
|
||||
uses: actions/download-artifact@v2
|
||||
uses: actions/download-artifact@v3
|
||||
with:
|
||||
name: release-packages
|
||||
path: ./release-packages
|
||||
@@ -395,21 +487,17 @@ jobs:
|
||||
if: steps.cache-yarn.outputs.cache-hit != 'true'
|
||||
run: yarn --frozen-lockfile
|
||||
|
||||
# HACK: this shouldn't need to exist, but put it here anyway
|
||||
# in an attempt to solve Playwright cache failures.
|
||||
- name: Reinstall playwright
|
||||
if: steps.cache-yarn.outputs.cache-hit == 'true'
|
||||
- name: Install Playwright OS dependencies
|
||||
run: |
|
||||
cd test/
|
||||
rm -r node_modules/playwright
|
||||
yarn install --check-files
|
||||
./test/node_modules/.bin/playwright install-deps
|
||||
./test/node_modules/.bin/playwright install
|
||||
|
||||
- name: Run end-to-end tests
|
||||
run: yarn test:e2e
|
||||
|
||||
- name: Upload test artifacts
|
||||
if: always()
|
||||
uses: actions/upload-artifact@v2
|
||||
uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: failed-test-videos
|
||||
path: ./test/test-results
|
||||
@@ -418,13 +506,18 @@ jobs:
|
||||
run: rm -rf ./release-packages ./test/test-results
|
||||
|
||||
trivy-scan-repo:
|
||||
permissions:
|
||||
contents: read # for actions/checkout to fetch code
|
||||
security-events: write # for github/codeql-action/upload-sarif to upload SARIF results
|
||||
runs-on: ubuntu-20.04
|
||||
steps:
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v2
|
||||
- name: Checkout repo
|
||||
uses: actions/checkout@v3
|
||||
with:
|
||||
fetch-depth: 0
|
||||
|
||||
- name: Run Trivy vulnerability scanner in repo mode
|
||||
#Commit SHA for v0.0.17
|
||||
uses: aquasecurity/trivy-action@8eccb5539730451af599c84f444c6d6cf0fc2bb0
|
||||
uses: aquasecurity/trivy-action@0105373003c89c494a3f436bd5efc57f3ac1ca20
|
||||
with:
|
||||
scan-type: "fs"
|
||||
scan-ref: "."
|
||||
@@ -433,7 +526,8 @@ 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
|
||||
uses: github/codeql-action/upload-sarif@v2
|
||||
with:
|
||||
sarif_file: "trivy-repo-results.sarif"
|
||||
|
||||
22
.github/workflows/codeql-analysis.yml
vendored
22
.github/workflows/codeql-analysis.yml
vendored
@@ -10,24 +10,38 @@ on:
|
||||
# Runs every Monday morning PST
|
||||
- cron: "17 15 * * 1"
|
||||
|
||||
# Cancel in-progress runs for pull requests when developers push
|
||||
# additional changes, and serialize builds in branches.
|
||||
# https://docs.github.com/en/actions/using-jobs/using-concurrency#example-using-concurrency-to-cancel-any-in-progress-job-or-run
|
||||
concurrency:
|
||||
group: ${{ github.workflow }}-${{ github.ref }}
|
||||
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
jobs:
|
||||
analyze:
|
||||
permissions:
|
||||
actions: read # for github/codeql-action/init to get workflow details
|
||||
contents: read # for actions/checkout to fetch code
|
||||
security-events: write # for github/codeql-action/autobuild to send a status report
|
||||
name: Analyze
|
||||
runs-on: ubuntu-20.04
|
||||
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v2
|
||||
uses: actions/checkout@v3
|
||||
|
||||
# Initializes the CodeQL tools for scanning.
|
||||
- name: Initialize CodeQL
|
||||
uses: github/codeql-action/init@v1
|
||||
uses: github/codeql-action/init@v2
|
||||
with:
|
||||
config-file: ./.github/codeql-config.yml
|
||||
languages: javascript
|
||||
|
||||
- name: Autobuild
|
||||
uses: github/codeql-action/autobuild@v1
|
||||
uses: github/codeql-action/autobuild@v2
|
||||
|
||||
- name: Perform CodeQL Analysis
|
||||
uses: github/codeql-action/analyze@v1
|
||||
uses: github/codeql-action/analyze@v2
|
||||
|
||||
52
.github/workflows/docker.yaml
vendored
52
.github/workflows/docker.yaml
vendored
@@ -6,23 +6,55 @@ on:
|
||||
workflow_dispatch:
|
||||
|
||||
release:
|
||||
types: [published]
|
||||
types:
|
||||
- released
|
||||
|
||||
# Cancel in-progress runs for pull requests when developers push
|
||||
# additional changes, and serialize builds in branches.
|
||||
# https://docs.github.com/en/actions/using-jobs/using-concurrency#example-using-concurrency-to-cancel-any-in-progress-job-or-run
|
||||
concurrency:
|
||||
group: ${{ github.workflow }}-${{ github.ref }}
|
||||
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
|
||||
|
||||
jobs:
|
||||
docker-images:
|
||||
runs-on: ubuntu-latest
|
||||
runs-on: ubuntu-20.04
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v3
|
||||
|
||||
- name: Set up QEMU
|
||||
uses: docker/setup-qemu-action@v1
|
||||
uses: docker/setup-qemu-action@v2
|
||||
|
||||
- name: Set up Docker Buildx
|
||||
uses: docker/setup-buildx-action@v1
|
||||
uses: docker/setup-buildx-action@v2
|
||||
|
||||
- name: Run ./ci/steps/docker-buildx-push.sh
|
||||
run: ./ci/steps/docker-buildx-push.sh
|
||||
- name: Login to Docker Hub
|
||||
uses: docker/login-action@v2
|
||||
with:
|
||||
username: ${{ secrets.DOCKER_USERNAME }}
|
||||
password: ${{ secrets.DOCKER_PASSWORD }}
|
||||
|
||||
- name: Login to GHCR
|
||||
uses: docker/login-action@v2
|
||||
with:
|
||||
registry: ghcr.io
|
||||
username: ${{ github.actor }}
|
||||
password: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
||||
- name: Get version
|
||||
id: version
|
||||
run: echo "::set-output name=version::$(jq -r .version package.json)"
|
||||
|
||||
- name: Download release artifacts
|
||||
uses: robinraju/release-downloader@v1.4
|
||||
with:
|
||||
repository: "coder/code-server"
|
||||
tag: v${{ steps.version.outputs.version }}
|
||||
fileName: "*.deb"
|
||||
out-file-path: "release-packages"
|
||||
|
||||
- name: Publish to Docker
|
||||
run: yarn publish:docker
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }}
|
||||
DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }}
|
||||
GITHUB_TOKEN: ${{ github.token }}
|
||||
|
||||
72
.github/workflows/docs-preview.yaml
vendored
72
.github/workflows/docs-preview.yaml
vendored
@@ -22,73 +22,23 @@ jobs:
|
||||
name: Docs preview
|
||||
runs-on: ubuntu-20.04
|
||||
steps:
|
||||
- name: Cancel Previous Runs
|
||||
uses: styfle/cancel-workflow-action@0.9.1
|
||||
- uses: actions/checkout@v3
|
||||
|
||||
- name: Checkout m
|
||||
uses: actions/checkout@v2
|
||||
with:
|
||||
repository: cdr/m
|
||||
ref: refs/heads/master
|
||||
token: ${{ secrets.GH_ACCESS_TOKEN }}
|
||||
submodules: true
|
||||
fetch-depth: 0
|
||||
|
||||
- name: Install Node.js
|
||||
uses: actions/setup-node@v2
|
||||
with:
|
||||
node-version: 12.x
|
||||
|
||||
- name: Cache Node Modules
|
||||
uses: actions/cache@v2
|
||||
with:
|
||||
path: "/node_modules"
|
||||
key: node-${{ hashFiles('yarn.lock') }}
|
||||
|
||||
- name: Create Deployment
|
||||
id: deployment
|
||||
run: ./ci/scripts/github_deployment.sh create
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ github.token }}
|
||||
DEPLOY_ENVIRONMENT: codercom-preview-docs
|
||||
|
||||
- name: Deploy Preview to Vercel
|
||||
id: preview
|
||||
run: ./ci/scripts/deploy_vercel.sh
|
||||
env:
|
||||
VERCEL_ORG_ID: team_tGkWfhEGGelkkqUUm9nXq17r
|
||||
VERCEL_PROJECT_ID: QmZRucMRh3GFk1817ZgXjRVuw5fhTspHPHKct3JNQDEPGd
|
||||
VERCEL_TOKEN: ${{ secrets.VERCEL_TOKEN }}
|
||||
CODE_SERVER_DOCS_MAIN_BRANCH: ${{ github.event.pull_request.head.sha }}
|
||||
|
||||
- name: Install node_modules
|
||||
run: yarn install
|
||||
|
||||
- name: Check docs
|
||||
run: yarn ts-node ./product/coder.com/site/scripts/checkDocs.ts
|
||||
env:
|
||||
BASE_URL: ${{ steps.preview.outputs.url }}
|
||||
|
||||
- name: Update Deployment
|
||||
# If we don't specify always, it won't run this check if failed.
|
||||
# This means the deployment would be stuck pending.
|
||||
if: always()
|
||||
run: ./ci/scripts/github_deployment.sh update
|
||||
env:
|
||||
GITHUB_DEPLOYMENT: ${{ steps.deployment.outputs.id }}
|
||||
GITHUB_TOKEN: ${{ github.token }}
|
||||
DEPLOY_STATUS: ${{ steps.preview.outcome }}
|
||||
DEPLOY_URL: ${{ steps.preview.outputs.url }}
|
||||
- name: Set outputs
|
||||
id: vars
|
||||
run: echo "::set-output name=sha_short::$(git rev-parse --short HEAD)"
|
||||
|
||||
- name: Comment Credentials
|
||||
uses: marocchino/sticky-pull-request-comment@v2
|
||||
if: always()
|
||||
# Only run if PR comes from base repo
|
||||
# Reason: forks cannot access secrets and this will always fail
|
||||
if: github.event.pull_request.head.repo.full_name == github.repository
|
||||
with:
|
||||
GITHUB_TOKEN: ${{ github.token }}
|
||||
header: codercom-preview-docs
|
||||
message: |
|
||||
✨ Coder.com for PR #${{ github.event.number }} deployed! It will be updated on every commit.
|
||||
|
||||
* _Host_: ${{ steps.preview.outputs.url }}/docs/code-server
|
||||
* _Last deploy status_: ${{ steps.preview.outcome }}
|
||||
✨ code-server docs for PR #${{ github.event.number }} is ready! It will be updated on every commit.
|
||||
* _Host_: https://coder.com/docs/code-server/${{ steps.vars.outputs.sha_short }}
|
||||
* _Last deploy status_: success
|
||||
* _Commit_: ${{ github.event.pull_request.head.sha }}
|
||||
* _Workflow status_: https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}
|
||||
|
||||
24
.github/workflows/installer.yml
vendored
24
.github/workflows/installer.yml
vendored
@@ -5,10 +5,22 @@ on:
|
||||
branches:
|
||||
- main
|
||||
paths:
|
||||
- "installer.sh"
|
||||
- "install.sh"
|
||||
pull_request:
|
||||
branches:
|
||||
- main
|
||||
paths:
|
||||
- "install.sh"
|
||||
|
||||
# Cancel in-progress runs for pull requests when developers push
|
||||
# additional changes, and serialize builds in branches.
|
||||
# https://docs.github.com/en/actions/using-jobs/using-concurrency#example-using-concurrency-to-cancel-any-in-progress-job-or-run
|
||||
concurrency:
|
||||
group: ${{ github.workflow }}-${{ github.ref }}
|
||||
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
jobs:
|
||||
ubuntu:
|
||||
@@ -16,13 +28,13 @@ jobs:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout repo
|
||||
uses: actions/checkout@v2
|
||||
uses: actions/checkout@v3
|
||||
|
||||
- name: Install code-server
|
||||
run: ./install.sh
|
||||
|
||||
- name: Test code-server
|
||||
run: yarn test:standalone-release code-server
|
||||
run: CODE_SERVER_PATH="code-server" yarn test:integration
|
||||
|
||||
alpine:
|
||||
name: Test installer on Alpine
|
||||
@@ -30,7 +42,7 @@ jobs:
|
||||
container: "alpine:3.14"
|
||||
steps:
|
||||
- name: Checkout repo
|
||||
uses: actions/checkout@v2
|
||||
uses: actions/checkout@v3
|
||||
|
||||
- name: Install curl
|
||||
run: apk add curl
|
||||
@@ -48,10 +60,10 @@ jobs:
|
||||
|
||||
steps:
|
||||
- name: Checkout repo
|
||||
uses: actions/checkout@v2
|
||||
uses: actions/checkout@v3
|
||||
|
||||
- name: Install code-server
|
||||
run: ./install.sh
|
||||
|
||||
- name: Test code-server
|
||||
run: yarn test:standalone-release code-server
|
||||
run: CODE_SERVER_PATH="code-server" yarn test:integration
|
||||
|
||||
43
.github/workflows/npm-brew.yaml
vendored
43
.github/workflows/npm-brew.yaml
vendored
@@ -6,7 +6,14 @@ on:
|
||||
workflow_dispatch:
|
||||
|
||||
release:
|
||||
types: [published]
|
||||
types: [released]
|
||||
|
||||
# Cancel in-progress runs for pull requests when developers push
|
||||
# additional changes, and serialize builds in branches.
|
||||
# https://docs.github.com/en/actions/using-jobs/using-concurrency#example-using-concurrency-to-cancel-any-in-progress-job-or-run
|
||||
concurrency:
|
||||
group: ${{ github.workflow }}-${{ github.ref }}
|
||||
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
|
||||
|
||||
jobs:
|
||||
# NOTE: this job requires curl, jq and yarn
|
||||
@@ -14,19 +21,32 @@ jobs:
|
||||
npm:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: actions/checkout@v3
|
||||
|
||||
- name: Run ./ci/steps/publish-npm.sh
|
||||
run: ./ci/steps/publish-npm.sh
|
||||
- name: Get version
|
||||
id: version
|
||||
run: echo "::set-output name=version::$(jq -r .version package.json)"
|
||||
|
||||
- name: Download artifact
|
||||
uses: dawidd6/action-download-artifact@v2
|
||||
id: download
|
||||
with:
|
||||
branch: v${{ steps.version.outputs.version }}
|
||||
workflow: ci.yaml
|
||||
workflow_conclusion: completed
|
||||
name: "npm-package"
|
||||
path: release-npm-package
|
||||
|
||||
- name: Publish npm package and tag with "latest"
|
||||
run: yarn publish:npm
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
|
||||
NPM_ENVIRONMENT: "production"
|
||||
|
||||
homebrew:
|
||||
# The newest version of code-server needs to be available on npm when this runs
|
||||
# otherwise, it will 404 and won't open a PR to bump version on homebrew/homebrew-core
|
||||
needs: npm
|
||||
runs-on: macos-latest
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
# Ensure things are up to date
|
||||
# Suggested by homebrew maintainers
|
||||
@@ -35,11 +55,14 @@ jobs:
|
||||
id: set-up-homebrew
|
||||
uses: Homebrew/actions/setup-homebrew@master
|
||||
|
||||
- uses: actions/checkout@v2
|
||||
- name: Checkout code-server
|
||||
uses: actions/checkout@v3
|
||||
|
||||
- name: Configure git
|
||||
run: |
|
||||
git config user.name github-actions
|
||||
git config user.email github-actions@github.com
|
||||
git config --global user.name cdrci
|
||||
git config --global user.email opensource@coder.com
|
||||
|
||||
- name: Bump code-server homebrew version
|
||||
env:
|
||||
HOMEBREW_GITHUB_API_TOKEN: ${{secrets.HOMEBREW_GITHUB_API_TOKEN}}
|
||||
|
||||
27
.github/workflows/scripts.yml
vendored
27
.github/workflows/scripts.yml
vendored
@@ -5,10 +5,33 @@ on:
|
||||
branches:
|
||||
- main
|
||||
paths:
|
||||
- "installer.sh"
|
||||
- "**.sh"
|
||||
- "**.bats"
|
||||
pull_request:
|
||||
branches:
|
||||
- main
|
||||
paths:
|
||||
- "**.sh"
|
||||
- "**.bats"
|
||||
|
||||
permissions:
|
||||
actions: none
|
||||
checks: none
|
||||
contents: read
|
||||
deployments: none
|
||||
issues: none
|
||||
packages: none
|
||||
pull-requests: none
|
||||
repository-projects: none
|
||||
security-events: none
|
||||
statuses: none
|
||||
|
||||
# Cancel in-progress runs for pull requests when developers push
|
||||
# additional changes, and serialize builds in branches.
|
||||
# https://docs.github.com/en/actions/using-jobs/using-concurrency#example-using-concurrency-to-cancel-any-in-progress-job-or-run
|
||||
concurrency:
|
||||
group: ${{ github.workflow }}-${{ github.ref }}
|
||||
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
|
||||
|
||||
jobs:
|
||||
test:
|
||||
@@ -18,7 +41,7 @@ jobs:
|
||||
container: "alpine:3.14"
|
||||
steps:
|
||||
- name: Checkout repo
|
||||
uses: actions/checkout@v2
|
||||
uses: actions/checkout@v3
|
||||
|
||||
- name: Install test utilities
|
||||
run: apk add bats checkbashisms
|
||||
|
||||
65
.github/workflows/trivy-docker.yaml
vendored
Normal file
65
.github/workflows/trivy-docker.yaml
vendored
Normal file
@@ -0,0 +1,65 @@
|
||||
name: Trivy Nightly Docker Scan
|
||||
|
||||
on:
|
||||
# Run scans if the workflow is modified, in order to test the
|
||||
# workflow itself. This results in some spurious notifications,
|
||||
# but seems okay for testing.
|
||||
pull_request:
|
||||
branches:
|
||||
- main
|
||||
paths:
|
||||
- .github/workflows/trivy-docker.yaml
|
||||
|
||||
# Run scans against master whenever changes are merged.
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
paths:
|
||||
- .github/workflows/trivy-docker.yaml
|
||||
|
||||
schedule:
|
||||
# Run at 10:15 am UTC (3:15am PT/5:15am CT)
|
||||
# Run at 0 minutes 0 hours of every day.
|
||||
- cron: "15 10 * * *"
|
||||
|
||||
workflow_dispatch:
|
||||
|
||||
permissions:
|
||||
actions: none
|
||||
checks: none
|
||||
contents: read
|
||||
deployments: none
|
||||
issues: none
|
||||
packages: none
|
||||
pull-requests: none
|
||||
repository-projects: none
|
||||
security-events: write
|
||||
statuses: none
|
||||
|
||||
# Cancel in-progress runs for pull requests when developers push
|
||||
# additional changes, and serialize builds in branches.
|
||||
# https://docs.github.com/en/actions/using-jobs/using-concurrency#example-using-concurrency-to-cancel-any-in-progress-job-or-run
|
||||
concurrency:
|
||||
group: ${{ github.workflow }}-${{ github.ref }}
|
||||
|
||||
jobs:
|
||||
trivy-scan-image:
|
||||
runs-on: ubuntu-20.04
|
||||
|
||||
steps:
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v3
|
||||
|
||||
- name: Run Trivy vulnerability scanner in image mode
|
||||
uses: aquasecurity/trivy-action@0105373003c89c494a3f436bd5efc57f3ac1ca20
|
||||
with:
|
||||
image-ref: "docker.io/codercom/code-server:latest"
|
||||
ignore-unfixed: true
|
||||
format: "sarif"
|
||||
output: "trivy-image-results.sarif"
|
||||
severity: "HIGH,CRITICAL"
|
||||
|
||||
- name: Upload Trivy scan results to GitHub Security tab
|
||||
uses: github/codeql-action/upload-sarif@v2
|
||||
with:
|
||||
sarif_file: "trivy-image-results.sarif"
|
||||
10
.gitignore
vendored
10
.gitignore
vendored
@@ -8,12 +8,18 @@ release-packages/
|
||||
release-gcp/
|
||||
release-images/
|
||||
node_modules
|
||||
vendor/modules
|
||||
node-*
|
||||
/plugins
|
||||
/lib/coder-cloud-agent
|
||||
.home
|
||||
coverage
|
||||
**/.DS_Store
|
||||
|
||||
# Code packages itself here.
|
||||
/lib/vscode-reh-web-*
|
||||
|
||||
# Failed e2e test videos are saved here
|
||||
test/test-results
|
||||
|
||||
# Quilt's internal data.
|
||||
/.pc
|
||||
/patches/*.diff~
|
||||
|
||||
3
.gitmodules
vendored
Normal file
3
.gitmodules
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
[submodule "lib/vscode"]
|
||||
path = lib/vscode
|
||||
url = https://github.com/microsoft/vscode
|
||||
@@ -1 +1 @@
|
||||
14
|
||||
16
|
||||
|
||||
@@ -2,3 +2,16 @@ printWidth: 120
|
||||
semi: false
|
||||
trailingComma: all
|
||||
arrowParens: always
|
||||
singleQuote: false
|
||||
useTabs: false
|
||||
|
||||
overrides:
|
||||
# Attempt to keep VScode's existing code style intact.
|
||||
- files: "lib/vscode/**/*.ts"
|
||||
options:
|
||||
# No limit defined upstream.
|
||||
printWidth: 10000
|
||||
semi: true
|
||||
singleQuote: true
|
||||
useTabs: true
|
||||
arrowParens: avoid
|
||||
|
||||
@@ -50,7 +50,7 @@
|
||||
{
|
||||
"file": "src/node/heart.ts",
|
||||
"line": 7,
|
||||
"description": "code-server's heart beats to indicate recent activity.\n\nAlso documented here: [https://github.com/cdr/code-server/blob/master/docs/FAQ.md#heartbeat-file](https://github.com/cdr/code-server/blob/master/docs/FAQ.md#heartbeat-file)"
|
||||
"description": "code-server's heart beats to indicate recent activity.\n\nAlso documented here: [https://github.com/coder/code-server/blob/main/docs/FAQ.md#heartbeat-file](https://github.com/coder/code-server/blob/main/docs/FAQ.md#heartbeat-file)"
|
||||
},
|
||||
{
|
||||
"file": "src/node/socket.ts",
|
||||
@@ -80,12 +80,12 @@
|
||||
{
|
||||
"file": "src/node/routes/domainProxy.ts",
|
||||
"line": 18,
|
||||
"description": "code-server provides a built-in proxy to help in developing web-based applications. This is the code for the domain-based proxy.\n\nAlso documented here: [https://github.com/cdr/code-server/blob/master/docs/FAQ.md#how-do-i-securely-access-web-services](https://github.com/cdr/code-server/blob/master/docs/FAQ.md#how-do-i-securely-access-web-services)"
|
||||
"description": "code-server provides a built-in proxy to help in developing web-based applications. This is the code for the domain-based proxy.\n\nAlso documented here: [https://github.com/coder/code-server/blob/main/docs/FAQ.md#how-do-i-securely-access-web-services](https://github.com/coder/code-server/blob/main/docs/FAQ.md#how-do-i-securely-access-web-services)"
|
||||
},
|
||||
{
|
||||
"file": "src/node/routes/pathProxy.ts",
|
||||
"line": 19,
|
||||
"description": "Here is the path-based version of the proxy.\n\nAlso documented here: [https://github.com/cdr/code-server/blob/master/docs/FAQ.md#how-do-i-securely-access-web-services](https://github.com/cdr/code-server/blob/master/docs/FAQ.md#how-do-i-securely-access-web-services)"
|
||||
"description": "Here is the path-based version of the proxy.\n\nAlso documented here: [https://github.com/coder/code-server/blob/main/docs/FAQ.md#how-do-i-securely-access-web-services](https://github.com/coder/code-server/blob/main/docs/FAQ.md#how-do-i-securely-access-web-services)"
|
||||
},
|
||||
{
|
||||
"file": "src/node/proxy.ts",
|
||||
@@ -95,7 +95,7 @@
|
||||
{
|
||||
"file": "src/node/routes/health.ts",
|
||||
"line": 5,
|
||||
"description": "A simple endpoint that lets you see if code-server is up.\n\nAlso documented here: [https://github.com/cdr/code-server/blob/master/docs/FAQ.md#healthz-endpoint](https://github.com/cdr/code-server/blob/master/docs/FAQ.md#healthz-endpoint)"
|
||||
"description": "A simple endpoint that lets you see if code-server is up.\n\nAlso documented here: [https://github.com/coder/code-server/blob/main/docs/FAQ.md#healthz-endpoint](https://github.com/coder/code-server/blob/main/docs/FAQ.md#healthz-endpoint)"
|
||||
},
|
||||
{
|
||||
"file": "src/node/routes/login.ts",
|
||||
@@ -143,9 +143,9 @@
|
||||
"description": "Static images and the manifest live here in `src/browser/media` (see the explorer)."
|
||||
},
|
||||
{
|
||||
"directory": "vendor/modules/code-oss-dev",
|
||||
"directory": "lib/vscode",
|
||||
"line": 1,
|
||||
"description": "code-server makes use of VS Code's frontend web/remote support. Most of the modifications implement the remote server since that portion of the code is closed source and not released with VS Code.\n\nWe also have a few bug fixes and have added some features (like client-side extensions). See [https://github.com/cdr/code-server/blob/master/docs/CONTRIBUTING.md#modifications-to-vs-code](https://github.com/cdr/code-server/blob/master/docs/CONTRIBUTING.md#modifications-to-vs-code) for a list.\n\nWe make an effort to keep the modifications as few as possible."
|
||||
"description": "code-server makes use of VS Code's frontend web/remote support. Most of the modifications implement the remote server since that portion of the code is closed source and not released with VS Code.\n\nWe also have a few bug fixes and have added some features (like client-side extensions). See [https://github.com/coder/code-server/blob/main/docs/CONTRIBUTING.md#modifications-to-vs-code](https://github.com/coder/code-server/blob/main/docs/CONTRIBUTING.md#modifications-to-vs-code) for a list.\n\nWe make an effort to keep the modifications as few as possible."
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
{
|
||||
"file": "package.json",
|
||||
"line": 31,
|
||||
"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"
|
||||
"description": "## Commands\n\nTo start developing, make sure you have Node 16+ 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",
|
||||
@@ -20,7 +20,7 @@
|
||||
{
|
||||
"file": "src/node/app.ts",
|
||||
"line": 62,
|
||||
"description": "## That's it!\n\n\nThat's all there is to it! When this tour ends, your terminal session may stop, but just use `yarn watch` to start developing from here on out!\n\n\nIf you haven't already, be sure to check out these resources:\n- [Tour: Contributing](command:codetour.startTourByTitle?[\"Contributing\")\n- [Docs: FAQ.md](https://github.com/cdr/code-server/blob/master/docs/FAQ.md)\n- [Docs: CONTRIBUTING.md](https://github.com/cdr/code-server/blob/master/docs/CONTRIBUTING.md)\n- [Community: GitHub Discussions](https://github.com/cdr/code-server/discussions)\n- [Community: Slack](https://community.coder.com)"
|
||||
"description": "## That's it!\n\n\nThat's all there is to it! When this tour ends, your terminal session may stop, but just use `yarn watch` to start developing from here on out!\n\n\nIf you haven't already, be sure to check out these resources:\n- [Tour: Contributing](command:codetour.startTourByTitle?[\"Contributing\"])\n- [Docs: FAQ.md](https://github.com/coder/code-server/blob/main/docs/FAQ.md)\n- [Docs: CONTRIBUTING.md](https://github.com/coder/code-server/blob/main/docs/CONTRIBUTING.md)\n- [Community: GitHub Discussions](https://github.com/coder/code-server/discussions)\n- [Community: Slack](https://community.coder.com)"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
369
CHANGELOG.md
369
CHANGELOG.md
@@ -1,175 +1,296 @@
|
||||
# Changelog
|
||||
|
||||
<!--
|
||||
All notable changes to this project will be documented in this file.
|
||||
|
||||
This should be updated on every PR.
|
||||
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
||||
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
||||
|
||||
We copy from here into the release notes.
|
||||
<!-- Example:
|
||||
|
||||
-->
|
||||
## [9.99.999] - 9090-09-09
|
||||
|
||||
<!--
|
||||
Add next version above previous version but below this line using the template
|
||||
Code v99.99.999
|
||||
|
||||
## Next Version
|
||||
|
||||
VS Code v0.00.0
|
||||
|
||||
### New Features
|
||||
|
||||
- item
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
- fix(socket): did this thing #321 @githubuser
|
||||
|
||||
### Documentation
|
||||
|
||||
- item
|
||||
|
||||
### Development
|
||||
|
||||
- item
|
||||
### Changed
|
||||
### Added
|
||||
### Deprecated
|
||||
### Removed
|
||||
### Fixed
|
||||
### Security
|
||||
|
||||
-->
|
||||
|
||||
## Next Version
|
||||
## [4.5.0](https://github.com/coder/code-server/releases/tag/v4.5.0) - 2022-06-29
|
||||
|
||||
VS Code v0.00.0
|
||||
Code v1.68.1
|
||||
|
||||
### New Features
|
||||
### Changed
|
||||
|
||||
- item
|
||||
- Updated codecov to use codecov uploader
|
||||
- Moved integration tests to Jest
|
||||
- Fixed docker release to only download .deb
|
||||
- Upgraded to Code 1.68.1
|
||||
- Install `nfpm` from GitHub
|
||||
- Upgraded to TypeScript 4.6
|
||||
|
||||
### Bug Fixes
|
||||
### Added
|
||||
|
||||
- Fix logout when using a base path (#3608)
|
||||
- Added tests for `open`, `isWsl`, `handlePasswordValidation`
|
||||
- Provided alternate image registry to dockerhub
|
||||
- Allowed users to have scripts run on container with `ENTRYPOINTD` environment
|
||||
variable
|
||||
|
||||
### Documentation
|
||||
### Fixed
|
||||
|
||||
- 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
|
||||
- Fixed open CLI command to work on macOS
|
||||
|
||||
### Development
|
||||
## [4.4.0](https://github.com/coder/code-server/releases/tag/v4.4.0) - 2022-05-06
|
||||
|
||||
- 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
|
||||
Code v1.66.2
|
||||
|
||||
### Development
|
||||
### Changed
|
||||
|
||||
- fix(publish): update cdrci fork in brew-bump.sh #3468 @jsjoeio
|
||||
- chore(dev): migrate away from parcel #3578 @jsjoeio
|
||||
- Refactored methods in `Heart` class and made `Heart.beat()` async to make
|
||||
testing easier.
|
||||
- Upgraded to Code 1.66.2.
|
||||
|
||||
## 3.10.2
|
||||
### Added
|
||||
|
||||
VS Code v1.56.1
|
||||
- Added back telemetry patch which was removed in the Code reachitecture.
|
||||
- Added support to use `true` for `CS_DISABLE_FILE_DOWNLOADS` environment
|
||||
variable. This means you can disable file downloads by setting
|
||||
`CS_DISABLE_FILE_DOWNLOADS` to `true` or `1`.
|
||||
- Added tests for `Heart` class.
|
||||
|
||||
### New Features
|
||||
### Fixed
|
||||
|
||||
- feat: support `extraInitContainers` in helm chart values #3393 @strowk
|
||||
- feat: change `extraContainers` to support templating in helm chart #3393 @strowk
|
||||
- Fixed installation issue in AUR after LICENSE rename.
|
||||
- Fixed issue with listening on IPv6 addresses.
|
||||
- Fixed issue with Docker publish action not being able to find artifacts. Now
|
||||
it downloads the release assets from the release.
|
||||
|
||||
### Bug Fixes
|
||||
## [4.3.0](https://github.com/coder/code-server/releases/tag/v4.3.0) - 2022-04-14
|
||||
|
||||
- fix: use correct command to Open Folder on Welcome page #3437 @jsjoeio
|
||||
Code v1.65.2
|
||||
|
||||
### Development
|
||||
### Changed
|
||||
|
||||
- fix(ci): update brew-bump.sh to update remote first #3438 @jsjoeio
|
||||
- Excluded .deb files from release Docker image which drops the compressed and
|
||||
uncompressed size by 58% and 34%.
|
||||
- Upgraded to Code 1.65.2.
|
||||
|
||||
## 3.10.1
|
||||
### Added
|
||||
|
||||
VS Code v1.56.1
|
||||
- Added a new CLI flag called `--disable-file-downloads` which allows you to
|
||||
disable the "Download..." option that shows in the UI when right-clicking on a
|
||||
file. This can also set by running `CS_DISABLE_FILE_DOWNLOADS=1`.
|
||||
- Aligned the dependencies for binary and npm release artifacts.
|
||||
|
||||
### Bug Fixes
|
||||
### Fixed
|
||||
|
||||
- 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
|
||||
- Fixed the code-server version from not displaying in the Help > About dialog.
|
||||
- Fixed issues with the TypeScript and JavaScript Language Features Extension
|
||||
failing to activate.
|
||||
- Fixed missing files in ipynb extension.
|
||||
- Fixed the homebrew release workflow.
|
||||
- Fixed the Docker release workflow from not always publishing version tags.
|
||||
|
||||
### Documentation
|
||||
## [4.2.0](https://github.com/coder/code-server/releases/tag/v4.2.0) - 2022-03-22
|
||||
|
||||
- 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
|
||||
Code v1.64.2
|
||||
|
||||
### Development
|
||||
### Added
|
||||
|
||||
- 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
|
||||
- Added tests for `handleArgsSocketCatchError`, `setDefaults` and
|
||||
`optionDescriptions`.
|
||||
|
||||
## 3.10.0
|
||||
### Changed
|
||||
|
||||
VS Code v1.56.0
|
||||
- We switched from using the fork `coder/vscode` to a submodule of
|
||||
`microsoft/vscode` + patches managed by `quilt` for how Code sits inside the
|
||||
code-server codebase.
|
||||
- Upgraded to Code 1.64.2.
|
||||
|
||||
### New Features
|
||||
### Fixed
|
||||
|
||||
- feat: minor connections refactor #3178 @code-asher
|
||||
- feat(security): add code-scanning with CodeQL #3229 @jsjoeio
|
||||
- feat(ci): add trivy job for security #3261 @jsjoeio
|
||||
- feat(vscode): update to version 1.56.0 #3269 @oxy
|
||||
- feat: use ptyHostService #3308 @code-asher
|
||||
- Update popup notification through `--disable-update-check` is now fixed.
|
||||
- Fixed PWA icons not loading on iPad
|
||||
- Fixed the homebrew release process. Our `cdrci` bot should now automatically
|
||||
update the version as part of the release pipeline.
|
||||
- Fixed titleBar color setting being ignored in PWA.
|
||||
|
||||
### Bug Fixes
|
||||
### Security
|
||||
|
||||
- fix(socket): did this thing #321 @githubuser
|
||||
- fix(login): rate limiter shouldn't count successful logins #3141 @jsjoeio
|
||||
- chore(lib/vscode): update netmask #3187 @oxy
|
||||
- chore(deps): update dependencies with CVEs #3223 @oxy
|
||||
- fix: refactor logout #3277 @code-asher
|
||||
- fix: add flag for toggling permessage-deflate #3286 @code-asher
|
||||
- fix: make sure directories exist #3309 @code-asher
|
||||
- Updated to `minimist-list`.
|
||||
- Updated `cloud-agent` to `v0.2.4` which uses `nhooyr.io/webscoket` `v1.8.7`.
|
||||
|
||||
### Documentation
|
||||
## [4.1.0](https://github.com/coder/code-server/releases/tag/v4.1.0) - 2022-03-03
|
||||
|
||||
- docs(FAQ): add mention of sysbox #3087 @bpmct
|
||||
- docs: add security policy #3148 @jsjoeio
|
||||
- docs(guide.md): add `caddy` example for serving from sub-path #3217 @catthehacker
|
||||
- docs: revamp debugging section #3224 @code-asher
|
||||
- docs(readme): refactor to use codecov shield #3227 @jsjoeio
|
||||
- docs(maintaining): use milestones over boards #3228 @jsjoeio
|
||||
- docs(faq): add entry for accessing OSX folders #3247 @bpmct
|
||||
- docs(termux): add workaround for Android backspace issue #3251 @jsjoeio
|
||||
- docs(maintaining): add triage to workflow #3284 @jsjoeio
|
||||
- docs(security): add section for tools #3287 @jsjoeio
|
||||
- docs(maintaining): add versioning #3288 @jsjoeio
|
||||
- docs: add changelog #3337 @jsjoeio
|
||||
Code v1.63.0
|
||||
|
||||
### Development
|
||||
### Added
|
||||
|
||||
- fix(update-vscode): add check/docs for git-subtree #3129 @oxy
|
||||
- refactor(testing): migrate to playwright-test from jest-playwright #3133 @jsjoeio
|
||||
- refactor(ci): remove unmaintained CI images and update release workflow #3147 @oxy
|
||||
- chore(ci): migrate from hub to gh #3168 @oxy
|
||||
- feat(testing): add e2e tests for code-server and terminal #3169 @jsjoeio
|
||||
- chore(ranger): fix syntax for extension-request #3172 @oxy
|
||||
- feat(testing): add codecov to generate test coverage reports #3194 @jsjoeio
|
||||
- feat(testing): add tests for registerServiceWorker #3200 @jsjoeio
|
||||
- refactor(testing): fix flaky terminal test #3230 @jsjoeio
|
||||
- chore: ignore 15.x @types/node updates #3244 @jsjoeio
|
||||
- chore(build): compile vscode+extensions in parallel #3250 @oxy
|
||||
- fix(deps): remove eslint-plugin-jest-playwright #3260 @jsjoeio
|
||||
- fix(testing): reduce flakiness of terminal.test.ts and use 1 worker for e2e tests #3263 @jsjoeio
|
||||
- feat(testing): add isConnected check #3271 @jsjoeio
|
||||
- feat(testing): add test for src/node/constants.ts #3290 @jsjoeio
|
||||
- feat: test static route #3297 @code-asher
|
||||
- refactor(ci): split audit from prebuild #3298 @oxy
|
||||
- chore(lib/vscode): cleanup/update build deps #3314 @oxy
|
||||
- fix(build): download correct cloud-agent for arch #3331 @oxy
|
||||
- fix: xmldom and underscore #3332 @oxy
|
||||
- Support for injecting GitHub token into Code so extensions can make use of it.
|
||||
This can be done with the `GITHUB_TOKEN` environment variable or `github-auth`
|
||||
in the config file.
|
||||
- New flag `--socket-mode` allows setting the mode (file permissions) of the
|
||||
socket created when using `--socket`.
|
||||
- The version of Code bundled with code-server now appears when using the
|
||||
`--version` flag. For example: `4.0.2 5cdfe74686aa73e023f8354a9a6014eb30caa7dd with Code 1.63.0`.
|
||||
If you have been parsing this flag for the version you might want to use
|
||||
`--version --json` instead as doing that will be more stable.
|
||||
|
||||
### Changed
|
||||
|
||||
- The workspace or folder passed on the CLI will now use the same redirect
|
||||
method that the last opened workspace or folder uses. This means if you use
|
||||
something like `code-server /path/to/dir` you will now get a query parameter
|
||||
added (like so: `my-domain.tld?folder=/path/to/dir`), making it easier to edit
|
||||
by hand and making it consistent with the last opened and menu open behaviors.
|
||||
- The folder/workspace query parameter no longer has encoded slashes, making
|
||||
them more readable and editable by hand. This was only affecting the last
|
||||
opened behavior, not opens from the menu.
|
||||
|
||||
### Fixed
|
||||
|
||||
- Fix web sockets not connecting when using `--cert`.
|
||||
- Prevent workspace state collisions when opening a workspace that shares the
|
||||
same file path with another workspace on a different machine that shares the
|
||||
same domain. This was causing files opened in one workspace to be "re-"opened
|
||||
in the other workspace when the other workspace is opened.
|
||||
- Pin the Express version which should make installing from npm work again.
|
||||
- Propagate signals to code-server in the Docker image which means it should
|
||||
stop more quickly and gracefully.
|
||||
- Fix missing argon binaries in the standalone releases on arm machines.
|
||||
|
||||
## [4.0.2](https://github.com/coder/code-server/releases/tag/v4.0.2) - 2022-01-27
|
||||
|
||||
Code v1.63.0
|
||||
|
||||
### Fixed
|
||||
|
||||
- Unset the `BROWSER` environment variable. This fixes applications that hard
|
||||
exit when trying to spawn the helper script `BROWSER` points to because the
|
||||
file is missing. While we do include the script now we are leaving the
|
||||
variable omitted because the script does not work yet.
|
||||
|
||||
## [4.0.1](https://github.com/coder/code-server/releases/tag/v4.0.1) - 2022-01-04
|
||||
|
||||
Code v1.63.0
|
||||
|
||||
code-server has been rebased on upstream's newly open-sourced server
|
||||
implementation (#4414).
|
||||
|
||||
### Changed
|
||||
|
||||
- Web socket compression has been made the default (when supported). This means
|
||||
the `--enable` flag will no longer take `permessage-deflate` as an option.
|
||||
- The static endpoint can no longer reach outside code-server. However the
|
||||
vscode-remote-resource endpoint still can.
|
||||
- OpenVSX has been made the default marketplace.
|
||||
- The last opened folder/workspace is no longer stored separately in the
|
||||
settings file (we rely on the already-existing query object instead).
|
||||
- The marketplace override environment variables `SERVICE_URL` and `ITEM_URL`
|
||||
have been replaced with a single `EXTENSIONS_GALLERY` variable that
|
||||
corresponds to `extensionsGallery` in Code's `product.json`.
|
||||
|
||||
### Added
|
||||
|
||||
- `VSCODE_PROXY_URI` env var for use in the terminal and extensions.
|
||||
|
||||
### Removed
|
||||
|
||||
- Extra extension directories have been removed. The `--extra-extensions-dir`
|
||||
and `--extra-builtin-extensions-dir` flags will no longer be accepted.
|
||||
- The `--install-source` flag has been removed.
|
||||
|
||||
### Deprecated
|
||||
|
||||
- `--link` is now deprecated (#4562).
|
||||
|
||||
### Security
|
||||
|
||||
- We fixed a XSS vulnerability by escaping HTML from messages in the error page (#4430).
|
||||
|
||||
## [3.12.0](https://github.com/coder/code-server/releases/tag/v3.12.0) - 2021-09-15
|
||||
|
||||
Code v1.60.0
|
||||
|
||||
### Changed
|
||||
|
||||
- Upgrade Code to 1.60.0.
|
||||
|
||||
### Fixed
|
||||
|
||||
- Fix logout when using a base path (#3608).
|
||||
|
||||
## [3.11.1](https://github.com/coder/code-server/releases/tag/v3.11.1) - 2021-08-06
|
||||
|
||||
Undocumented (see releases page).
|
||||
|
||||
## [3.11.0](https://github.com/coder/code-server/releases/tag/v3.11.0) - 2021-06-14
|
||||
|
||||
Undocumented (see releases page).
|
||||
|
||||
## [3.10.2](https://github.com/coder/code-server/releases/tag/v3.10.2) - 2021-05-21
|
||||
|
||||
Code v1.56.1
|
||||
|
||||
### Added
|
||||
|
||||
- Support `extraInitContainers` in helm chart values (#3393).
|
||||
|
||||
### Changed
|
||||
|
||||
- Change `extraContainers` to support templating in helm chart (#3393).
|
||||
|
||||
### Fixed
|
||||
|
||||
- Fix "Open Folder" on welcome page (#3437).
|
||||
|
||||
## [3.10.1](https://github.com/coder/code-server/releases/tag/v3.10.1) - 2021-05-17
|
||||
|
||||
Code v1.56.1
|
||||
|
||||
### Fixed
|
||||
|
||||
- Check the logged user instead of $USER (#3330).
|
||||
- Fix broken node_modules.asar symlink in npm package (#3355).
|
||||
- Update cloud agent to fix version issue (#3342).
|
||||
|
||||
### Changed
|
||||
|
||||
- Use xdgBasedir.runtime instead of tmp (#3304).
|
||||
|
||||
## [3.10.0](https://github.com/coder/code-server/releases/tag/v3.10.0) - 2021-05-10
|
||||
|
||||
Code v1.56.0
|
||||
|
||||
### Changed
|
||||
|
||||
- Update to Code 1.56.0 (#3269).
|
||||
- Minor connections refactor (#3178). Improves connection stability.
|
||||
- Use ptyHostService (#3308). This brings us closer to upstream Code.
|
||||
|
||||
### Added
|
||||
|
||||
- Add flag for toggling permessage-deflate (#3286). The default is off so
|
||||
compression will no longer be used by default. Use the --enable flag to
|
||||
toggle it back on.
|
||||
|
||||
### Fixed
|
||||
|
||||
- Make rate limiter not count against successful logins (#3141).
|
||||
- Refactor logout (#3277). This fixes logging out in some scenarios.
|
||||
- Make sure directories exist (#3309). This fixes some errors on startup.
|
||||
|
||||
### Security
|
||||
|
||||
- Update dependencies with CVEs (#3223).
|
||||
|
||||
## Previous versions
|
||||
|
||||
This was added with `3.10.0`, which means any previous versions are not documented in the changelog.
|
||||
This was added with `3.10.0`, which means any previous versions are not
|
||||
documented in the changelog.
|
||||
|
||||
To see those, please visit the [Releases page](https://github.com/cdr/code-server/releases).
|
||||
To see those, please visit the [Releases page](https://github.com/coder/code-server/releases).
|
||||
|
||||
@@ -45,9 +45,6 @@ You can disable minification by setting `MINIFY=`.
|
||||
- Builds vscode into `./lib/vscode/out-vscode`.
|
||||
- [./ci/build/build-release.sh](./build/build-release.sh) (`yarn release`)
|
||||
- Bundles the output of the above two scripts into a single node module at `./release`.
|
||||
- [./ci/build/build-standalone-release.sh](./build/build-standalone-release.sh) (`yarn release:standalone`)
|
||||
- Requires a node module already built into `./release` with the above script.
|
||||
- Will build a standalone release with node and node_modules bundled into `./release-standalone`.
|
||||
- [./ci/build/clean.sh](./build/clean.sh) (`yarn clean`)
|
||||
- Removes all build artifacts.
|
||||
- Useful to do a clean build.
|
||||
@@ -97,6 +94,8 @@ Helps avoid clobbering the CI configuration.
|
||||
- Runs `yarn lint`.
|
||||
- [./steps/test-unit.sh](./steps/test-unit.sh)
|
||||
- Runs `yarn test:unit`.
|
||||
- [./steps/test-integration.sh](./steps/test-integration.sh)
|
||||
- Runs `yarn test:integration`.
|
||||
- [./steps/test-e2e.sh](./steps/test-e2e.sh)
|
||||
- Runs `yarn test:e2e`.
|
||||
- [./steps/release.sh](./steps/release.sh)
|
||||
|
||||
@@ -1,8 +0,0 @@
|
||||
{
|
||||
"rpm": {
|
||||
"armv7l": "armhfp"
|
||||
},
|
||||
"deb": {
|
||||
"armv7l": "armhf"
|
||||
}
|
||||
}
|
||||
@@ -15,23 +15,21 @@ main() {
|
||||
chmod +x out/node/entry.js
|
||||
fi
|
||||
|
||||
# for arch; we do not use OS from lib.sh and get our own.
|
||||
# lib.sh normalizes macos to darwin - but cloud-agent's binaries do not
|
||||
source ./ci/lib.sh
|
||||
OS="$(uname | tr '[:upper:]' '[:lower:]')"
|
||||
|
||||
mkdir -p ./lib
|
||||
|
||||
if ! [ -f ./lib/coder-cloud-agent ]; then
|
||||
echo "Downloading the cloud agent..."
|
||||
|
||||
# for arch; we do not use OS from lib.sh and get our own.
|
||||
# lib.sh normalizes macos to darwin - but cloud-agent's binaries do not
|
||||
source ./ci/lib.sh
|
||||
OS="$(uname | tr '[:upper:]' '[:lower:]')"
|
||||
|
||||
set +e
|
||||
curl -fsSL "https://github.com/cdr/cloud-agent/releases/latest/download/cloud-agent-$OS-$ARCH" -o ./lib/coder-cloud-agent
|
||||
curl -fsSL "https://github.com/coder/cloud-agent/releases/latest/download/cloud-agent-$OS-$ARCH" -o ./lib/coder-cloud-agent
|
||||
chmod +x ./lib/coder-cloud-agent
|
||||
set -e
|
||||
fi
|
||||
|
||||
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 "$@"
|
||||
|
||||
28
ci/build/build-lib.sh
Executable file
28
ci/build/build-lib.sh
Executable file
@@ -0,0 +1,28 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
# This is a library which contains functions used inside ci/build
|
||||
#
|
||||
# We separated it into it's own file so that we could easily unit test
|
||||
# these functions and helpers.
|
||||
|
||||
# On some CPU architectures (notably node/uname "armv7l", default on Raspberry Pis),
|
||||
# different package managers have different labels for the same CPU (deb=armhf, rpm=armhfp).
|
||||
# This function returns the overriden arch on platforms
|
||||
# with alternate labels, or the same arch otherwise.
|
||||
get_nfpm_arch() {
|
||||
local PKG_FORMAT="${1:-}"
|
||||
local ARCH="${2:-}"
|
||||
|
||||
case "$ARCH" in
|
||||
armv7l)
|
||||
if [ "$PKG_FORMAT" = "deb" ]; then
|
||||
echo armhf
|
||||
elif [ "$PKG_FORMAT" = "rpm" ]; then
|
||||
echo armhfp
|
||||
fi
|
||||
;;
|
||||
*)
|
||||
echo "$ARCH"
|
||||
;;
|
||||
esac
|
||||
}
|
||||
@@ -7,6 +7,7 @@ set -euo pipefail
|
||||
main() {
|
||||
cd "$(dirname "${0}")/../.."
|
||||
source ./ci/lib.sh
|
||||
source ./ci/build/build-lib.sh
|
||||
|
||||
# Allow us to override architecture
|
||||
# we use this for our Linux ARM64 cross compile builds
|
||||
@@ -43,30 +44,29 @@ release_gcp() {
|
||||
cp "./release-packages/$release_name.tar.gz" "./release-gcp/latest/$OS-$ARCH.tar.gz"
|
||||
}
|
||||
|
||||
# On some CPU architectures (notably node/uname "armv7l", default on Raspberry Pis),
|
||||
# different package managers have different labels for the same CPU (deb=armhf, rpm=armhfp).
|
||||
# This function parses arch-override.json and returns the overriden arch on platforms
|
||||
# with alternate labels, or the same arch otherwise.
|
||||
get_nfpm_arch() {
|
||||
if jq -re ".${PKG_FORMAT}.${ARCH}" ./ci/build/arch-override.json > /dev/null; then
|
||||
jq -re ".${PKG_FORMAT}.${ARCH}" ./ci/build/arch-override.json
|
||||
else
|
||||
echo "$ARCH"
|
||||
fi
|
||||
}
|
||||
|
||||
# Generates deb and rpm packages.
|
||||
release_nfpm() {
|
||||
local nfpm_config
|
||||
|
||||
export NFPM_ARCH
|
||||
|
||||
# Code deletes some files from the extension node_modules directory which
|
||||
# leaves broken symlinks in the corresponding .bin directory. nfpm will fail
|
||||
# on these broken symlinks so clean them up.
|
||||
rm -fr "./release-standalone/lib/vscode/extensions/node_modules/.bin"
|
||||
|
||||
PKG_FORMAT="deb"
|
||||
NFPM_ARCH="$(get_nfpm_arch)"
|
||||
NFPM_ARCH="$(get_nfpm_arch $PKG_FORMAT "$ARCH")"
|
||||
nfpm_config="$(envsubst < ./ci/build/nfpm.yaml)"
|
||||
echo "Building deb"
|
||||
echo "$nfpm_config" | head --lines=4
|
||||
nfpm pkg -f <(echo "$nfpm_config") --target "release-packages/code-server_${VERSION}_${NFPM_ARCH}.deb"
|
||||
|
||||
PKG_FORMAT="rpm"
|
||||
NFPM_ARCH="$(get_nfpm_arch)"
|
||||
NFPM_ARCH="$(get_nfpm_arch $PKG_FORMAT "$ARCH")"
|
||||
nfpm_config="$(envsubst < ./ci/build/nfpm.yaml)"
|
||||
echo "Building rpm"
|
||||
echo "$nfpm_config" | head --lines=4
|
||||
nfpm pkg -f <(echo "$nfpm_config") --target "release-packages/code-server-$VERSION-$NFPM_ARCH.rpm"
|
||||
}
|
||||
|
||||
|
||||
@@ -15,8 +15,8 @@ main() {
|
||||
|
||||
source ./ci/lib.sh
|
||||
|
||||
VSCODE_SRC_PATH="vendor/modules/code-oss-dev"
|
||||
VSCODE_OUT_PATH="$RELEASE_PATH/vendor/modules/code-oss-dev"
|
||||
VSCODE_SRC_PATH="lib/vscode"
|
||||
VSCODE_OUT_PATH="$RELEASE_PATH/lib/vscode"
|
||||
|
||||
mkdir -p "$RELEASE_PATH"
|
||||
|
||||
@@ -24,8 +24,8 @@ main() {
|
||||
bundle_vscode
|
||||
|
||||
rsync ./docs/README.md "$RELEASE_PATH"
|
||||
rsync LICENSE.txt "$RELEASE_PATH"
|
||||
rsync ./vendor/modules/code-oss-dev/ThirdPartyNotices.txt "$RELEASE_PATH"
|
||||
rsync LICENSE "$RELEASE_PATH"
|
||||
rsync ./lib/vscode/ThirdPartyNotices.txt "$RELEASE_PATH"
|
||||
}
|
||||
|
||||
bundle_code_server() {
|
||||
@@ -49,12 +49,23 @@ bundle_code_server() {
|
||||
{
|
||||
"commit": "$(git rev-parse HEAD)",
|
||||
"scripts": {
|
||||
"postinstall": "bash ./postinstall.sh"
|
||||
"postinstall": "sh ./postinstall.sh"
|
||||
}
|
||||
}
|
||||
EOF
|
||||
) > "$RELEASE_PATH/package.json"
|
||||
rsync yarn.lock "$RELEASE_PATH"
|
||||
|
||||
# To ensure deterministic dependency versions (even when code-server is installed with NPM), we seed
|
||||
# an npm-shrinkwrap file from our yarn lockfile and the current node-modules installed.
|
||||
synp --source-file yarn.lock
|
||||
npm shrinkwrap
|
||||
# HACK@edvincent: The shrinkwrap file will contain the devDependencies, which by default
|
||||
# are installed if present in a lockfile. To avoid every user having to specify --production
|
||||
# to skip them, we carefully remove them from the shrinkwrap file.
|
||||
json -f npm-shrinkwrap.json -I -e "Object.keys(this.dependencies).forEach(dependency => { if (this.dependencies[dependency].dev) { delete this.dependencies[dependency] } } )"
|
||||
mv npm-shrinkwrap.json "$RELEASE_PATH"
|
||||
|
||||
rsync ci/build/npm-postinstall.sh "$RELEASE_PATH/postinstall.sh"
|
||||
|
||||
if [ "$KEEP_MODULES" = 1 ]; then
|
||||
@@ -66,39 +77,39 @@ EOF
|
||||
|
||||
bundle_vscode() {
|
||||
mkdir -p "$VSCODE_OUT_PATH"
|
||||
rsync "$VSCODE_SRC_PATH/yarn.lock" "$VSCODE_OUT_PATH"
|
||||
rsync "$VSCODE_SRC_PATH/out-vscode${MINIFY:+-min}/" "$VSCODE_OUT_PATH/out"
|
||||
|
||||
rsync "$VSCODE_SRC_PATH/.build/extensions/" "$VSCODE_OUT_PATH/extensions"
|
||||
if [ "$KEEP_MODULES" = 0 ]; then
|
||||
rm -Rf "$VSCODE_OUT_PATH/extensions/node_modules"
|
||||
else
|
||||
rsync "$VSCODE_SRC_PATH/node_modules/" "$VSCODE_OUT_PATH/node_modules"
|
||||
local rsync_opts=()
|
||||
if [[ ${DEBUG-} = 1 ]]; then
|
||||
rsync_opts+=(-vh)
|
||||
fi
|
||||
rsync "$VSCODE_SRC_PATH/extensions/package.json" "$VSCODE_OUT_PATH/extensions"
|
||||
rsync "$VSCODE_SRC_PATH/extensions/yarn.lock" "$VSCODE_OUT_PATH/extensions"
|
||||
rsync "$VSCODE_SRC_PATH/extensions/postinstall.js" "$VSCODE_OUT_PATH/extensions"
|
||||
|
||||
mkdir -p "$VSCODE_OUT_PATH/resources/"{linux,web}
|
||||
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"
|
||||
# Some extensions have a .gitignore which excludes their built source from the
|
||||
# npm package so exclude any .gitignore files.
|
||||
rsync_opts+=(--exclude .gitignore)
|
||||
|
||||
# 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
|
||||
{
|
||||
"enableTelemetry": true,
|
||||
"commit": "$(git rev-parse HEAD)",
|
||||
"date": $(jq -n 'now | todate')
|
||||
}
|
||||
EOF
|
||||
) > "$VSCODE_OUT_PATH/product.json"
|
||||
# Exclude Node as we will add it ourselves for the standalone and will not
|
||||
# need it for the npm package.
|
||||
rsync_opts+=(--exclude /node)
|
||||
|
||||
# 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"
|
||||
# Exclude Node modules.
|
||||
if [[ $KEEP_MODULES = 0 ]]; then
|
||||
rsync_opts+=(--exclude node_modules)
|
||||
fi
|
||||
|
||||
rsync "${rsync_opts[@]}" ./lib/vscode-reh-web-*/ "$VSCODE_OUT_PATH"
|
||||
|
||||
# Use the package.json for the web/remote server. It does not have the right
|
||||
# version though so pull that from the main package.json.
|
||||
jq --slurp '.[0] * {version: .[1].version}' \
|
||||
"$VSCODE_SRC_PATH/remote/package.json" \
|
||||
"$VSCODE_SRC_PATH/package.json" > "$VSCODE_OUT_PATH/package.json"
|
||||
|
||||
rsync "$VSCODE_SRC_PATH/remote/yarn.lock" "$VSCODE_OUT_PATH/yarn.lock"
|
||||
|
||||
# Include global extension dependencies as well.
|
||||
rsync "$VSCODE_SRC_PATH/extensions/package.json" "$VSCODE_OUT_PATH/extensions/package.json"
|
||||
rsync "$VSCODE_SRC_PATH/extensions/yarn.lock" "$VSCODE_OUT_PATH/extensions/yarn.lock"
|
||||
rsync "$VSCODE_SRC_PATH/extensions/postinstall.mjs" "$VSCODE_OUT_PATH/extensions/postinstall.mjs"
|
||||
|
||||
pushd "$VSCODE_OUT_PATH"
|
||||
symlink_asar
|
||||
|
||||
@@ -29,12 +29,6 @@ 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/vendor/modules/code-oss-dev/extensions/node_modules/.bin"
|
||||
}
|
||||
|
||||
main "$@"
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
#!/usr/bin/env bash
|
||||
set -euo pipefail
|
||||
|
||||
# Builds vscode into vendor/modules/code-oss-dev/out-vscode.
|
||||
# Builds vscode into lib/vscode/out-vscode.
|
||||
|
||||
# MINIFY controls whether a minified version of vscode is built.
|
||||
MINIFY=${MINIFY-true}
|
||||
@@ -9,13 +9,62 @@ MINIFY=${MINIFY-true}
|
||||
main() {
|
||||
cd "$(dirname "${0}")/../.."
|
||||
|
||||
cd vendor/modules/code-oss-dev
|
||||
source ./ci/lib.sh
|
||||
|
||||
yarn gulp compile-build compile-extensions-build compile-extension-media
|
||||
yarn gulp optimize --gulpfile ./coder.js
|
||||
if [[ $MINIFY ]]; then
|
||||
yarn gulp minify --gulpfile ./coder.js
|
||||
fi
|
||||
cd lib/vscode
|
||||
|
||||
# Set the commit Code will embed into the product.json. We need to do this
|
||||
# since Code tries to get the commit from the `.git` directory which will fail
|
||||
# as it is a submodule.
|
||||
export VSCODE_DISTRO_COMMIT
|
||||
VSCODE_DISTRO_COMMIT=$(git rev-parse HEAD)
|
||||
|
||||
# Add the date, our name, links, and enable telemetry (this just makes
|
||||
# telemetry available; telemetry can still be disabled by flag or setting).
|
||||
# This needs to be done before building as Code will read this file and embed
|
||||
# it into the client-side code.
|
||||
git checkout product.json # Reset in case the script exited early.
|
||||
cp product.json product.original.json # Since jq has no inline edit.
|
||||
jq --slurp '.[0] * .[1]' product.original.json <(
|
||||
cat << EOF
|
||||
{
|
||||
"enableTelemetry": true,
|
||||
"quality": "stable",
|
||||
"codeServerVersion": "$VERSION",
|
||||
"nameShort": "code-server",
|
||||
"nameLong": "code-server",
|
||||
"applicationName": "code-server",
|
||||
"dataFolderName": ".code-server",
|
||||
"win32MutexName": "codeserver",
|
||||
"licenseUrl": "https://github.com/coder/code-server/blob/main/LICENSE",
|
||||
"win32DirName": "code-server",
|
||||
"win32NameVersion": "code-server",
|
||||
"win32AppUserModelId": "coder.code-server",
|
||||
"win32ShellNameShort": "c&ode-server",
|
||||
"darwinBundleIdentifier": "com.coder.code.server",
|
||||
"linuxIconName": "com.coder.code.server",
|
||||
"reportIssueUrl": "https://github.com/coder/code-server/issues/new",
|
||||
"documentationUrl": "https://go.microsoft.com/fwlink/?LinkID=533484#vscode",
|
||||
"keyboardShortcutsUrlMac": "https://go.microsoft.com/fwlink/?linkid=832143",
|
||||
"keyboardShortcutsUrlLinux": "https://go.microsoft.com/fwlink/?linkid=832144",
|
||||
"keyboardShortcutsUrlWin": "https://go.microsoft.com/fwlink/?linkid=832145",
|
||||
"introductoryVideosUrl": "https://go.microsoft.com/fwlink/?linkid=832146",
|
||||
"tipsAndTricksUrl": "https://go.microsoft.com/fwlink/?linkid=852118",
|
||||
"newsletterSignupUrl": "https://www.research.net/r/vsc-newsletter",
|
||||
"linkProtectionTrustedDomains": [
|
||||
"https://open-vsx.org"
|
||||
]
|
||||
}
|
||||
EOF
|
||||
) > product.json
|
||||
|
||||
# Any platform works since we have our own packaging step (for now).
|
||||
yarn gulp "vscode-reh-web-linux-x64${MINIFY:+-min}"
|
||||
|
||||
# Reset so if you develop after building you will not be stuck with the wrong
|
||||
# commit (the dev client will use `oss-dev` but the dev server will still use
|
||||
# product.json which will have `stable-$commit`).
|
||||
git checkout product.json
|
||||
}
|
||||
|
||||
main "$@"
|
||||
|
||||
@@ -5,7 +5,7 @@ set -eu
|
||||
# Runs code-server with the bundled node binary.
|
||||
|
||||
_realpath() {
|
||||
# See https://github.com/cdr/code-server/issues/1537 on why no realpath or readlink -f.
|
||||
# See https://github.com/coder/code-server/issues/1537 on why no realpath or readlink -f.
|
||||
|
||||
script="$1"
|
||||
cd "$(dirname "$script")"
|
||||
@@ -16,7 +16,7 @@ _realpath() {
|
||||
&& cat package.json | grep -q '^ "name": "code-server",$'; then
|
||||
echo "***** Please use the script in bin/code-server instead!" >&2
|
||||
echo "***** This script will soon be removed!" >&2
|
||||
echo "***** See the release notes at https://github.com/cdr/code-server/releases/tag/v3.4.0" >&2
|
||||
echo "***** See the release notes at https://github.com/coder/code-server/releases/tag/v3.4.0" >&2
|
||||
fi
|
||||
|
||||
script="$(readlink "$(basename "$script")")"
|
||||
|
||||
@@ -8,7 +8,7 @@ maintainer: "Anmol Sethi <hi@nhooyr.io>"
|
||||
description: |
|
||||
Run VS Code in the browser.
|
||||
vendor: "Coder"
|
||||
homepage: "https://github.com/cdr/code-server"
|
||||
homepage: "https://github.com/coder/code-server"
|
||||
license: "MIT"
|
||||
|
||||
contents:
|
||||
|
||||
@@ -33,8 +33,8 @@ main() {
|
||||
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 [ "$major_node_version" -ne "${FORCE_NODE_VERSION:-16}" ]; then
|
||||
echo "ERROR: code-server currently requires node v16."
|
||||
if [ -n "$FORCE_NODE_VERSION" ]; then
|
||||
echo "However, you have overrided the version check to use v$FORCE_NODE_VERSION."
|
||||
fi
|
||||
@@ -57,7 +57,10 @@ main() {
|
||||
esac
|
||||
|
||||
OS="$(uname | tr '[:upper:]' '[:lower:]')"
|
||||
if curl -fsSL "https://github.com/cdr/cloud-agent/releases/latest/download/cloud-agent-$OS-$ARCH" -o ./lib/coder-cloud-agent; then
|
||||
|
||||
mkdir -p ./lib
|
||||
|
||||
if curl -fsSL "https://github.com/coder/cloud-agent/releases/latest/download/cloud-agent-$OS-$ARCH" -o ./lib/coder-cloud-agent; then
|
||||
chmod +x ./lib/coder-cloud-agent
|
||||
else
|
||||
echo "Failed to download cloud agent; --link will not work"
|
||||
@@ -65,7 +68,7 @@ main() {
|
||||
|
||||
if ! vscode_yarn; then
|
||||
echo "You may not have the required dependencies to build the native modules."
|
||||
echo "Please see https://github.com/cdr/code-server/blob/master/docs/npm.md"
|
||||
echo "Please see https://github.com/coder/code-server/blob/main/docs/npm.md"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
@@ -87,22 +90,14 @@ symlink_asar() {
|
||||
}
|
||||
|
||||
vscode_yarn() {
|
||||
echo 'Installing vendor dependencies...'
|
||||
cd vendor/modules/code-oss-dev
|
||||
yarn --production --frozen-lockfile
|
||||
echo 'Installing Code dependencies...'
|
||||
cd lib/vscode
|
||||
yarn --production --frozen-lockfile --no-default-rc
|
||||
|
||||
symlink_asar
|
||||
|
||||
cd extensions
|
||||
yarn --production --frozen-lockfile
|
||||
|
||||
for ext in */; do
|
||||
ext="${ext%/}"
|
||||
echo "extensions/$ext: installing dependencies"
|
||||
cd "$ext"
|
||||
yarn --production --frozen-lockfile
|
||||
cd "$OLDPWD"
|
||||
done
|
||||
}
|
||||
|
||||
main "$@"
|
||||
|
||||
@@ -9,11 +9,20 @@ set -euo pipefail
|
||||
main() {
|
||||
cd "$(dirname "$0")/../.."
|
||||
source ./ci/lib.sh
|
||||
source ./ci/steps/steps-lib.sh
|
||||
|
||||
# NOTE@jsjoeio - only needed if we use the download_artifact
|
||||
# because we talk to the GitHub API.
|
||||
# Needed to use GitHub API
|
||||
if ! is_env_var_set "GITHUB_TOKEN"; then
|
||||
echo "GITHUB_TOKEN is not set. Cannot download npm release-packages without GitHub credentials."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
download_artifact release-packages ./release-packages
|
||||
local assets=(./release-packages/code-server*"$VERSION"*{.tar.gz,.deb,.rpm})
|
||||
|
||||
EDITOR=true gh release upload "v$VERSION" "${assets[@]}"
|
||||
EDITOR=true gh release upload "v$VERSION" "${assets[@]}" --clobber
|
||||
}
|
||||
|
||||
main "$@"
|
||||
|
||||
@@ -81,16 +81,16 @@ 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' -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 rg -g '!yarn.lock' -g '!*.svg' -g '!CHANGELOG.md' -g '!lib/vscode/**' --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"
|
||||
$CMD git commit --no-verify -am "chore(release): bump version to $CODE_SERVER_VERSION_TO_UPDATE"
|
||||
|
||||
# This runs from the root so that's why we use this path vs. ../../
|
||||
RELEASE_TEMPLATE_STRING=$(cat ./.github/PULL_REQUEST_TEMPLATE/release_template.md)
|
||||
|
||||
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 --assignee "@me"
|
||||
$CMD gh pr create --base main --title "release: $CODE_SERVER_VERSION_TO_UPDATE" --body "$RELEASE_TEMPLATE_STRING" --reviewer @coder/code-server-reviewers --repo coder/code-server --draft --assignee "@me"
|
||||
|
||||
# Open PR in browser
|
||||
$CMD gh pr view --web
|
||||
|
||||
@@ -1,33 +0,0 @@
|
||||
#!/usr/bin/env bash
|
||||
set -euo pipefail
|
||||
|
||||
# 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() {
|
||||
cd "$(dirname "${0}")/../.."
|
||||
|
||||
local EXTENSIONS_DIR
|
||||
EXTENSIONS_DIR="$(mktemp -d)"
|
||||
|
||||
local path=${1:-./release-standalone/bin/code-server}
|
||||
|
||||
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="$("$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:"
|
||||
echo "$installed_extensions"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo "Standalone release works correctly."
|
||||
}
|
||||
|
||||
main "$@"
|
||||
@@ -19,7 +19,7 @@ main() {
|
||||
"*.sh"
|
||||
)
|
||||
prettier --write --loglevel=warn $(
|
||||
git ls-files "${prettierExts[@]}" | grep -v "lib/vscode" | grep -v "vendor/modules/code-oss-dev" | grep -v 'helm-chart'
|
||||
git ls-files "${prettierExts[@]}" | grep -v "lib/vscode" | grep -v 'helm-chart'
|
||||
)
|
||||
|
||||
doctoc --title '# FAQ' docs/FAQ.md > /dev/null
|
||||
|
||||
@@ -4,10 +4,10 @@ set -euo pipefail
|
||||
main() {
|
||||
cd "$(dirname "$0")/../.."
|
||||
|
||||
eslint --max-warnings=0 --fix $(git ls-files "*.ts" "*.tsx" "*.js" | grep -v "vendor/modules/code-oss-dev" | grep -v "lib/vscode")
|
||||
stylelint $(git ls-files "*.css" | grep -v "vendor/modules/code-oss-dev" | grep -v "lib/vscode")
|
||||
eslint --max-warnings=0 --fix $(git ls-files "*.ts" "*.tsx" "*.js" | grep -v "lib/vscode")
|
||||
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 "vendor/modules/code-oss-dev" | grep -v "lib/vscode")
|
||||
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
|
||||
helm kubeval ci/helm-chart
|
||||
fi
|
||||
|
||||
@@ -1,30 +1,39 @@
|
||||
#!/usr/bin/env bash
|
||||
set -euo pipefail
|
||||
|
||||
# Install dependencies in $1.
|
||||
install-deps() {
|
||||
local args=(install)
|
||||
if [[ ${CI-} ]]; then
|
||||
args+=(--frozen-lockfile)
|
||||
fi
|
||||
if [[ "$1" == "lib/vscode" ]]; then
|
||||
args+=(--no-default-rc)
|
||||
fi
|
||||
# If there is no package.json then yarn will look upward and end up installing
|
||||
# from the root resulting in an infinite loop (this can happen if you have not
|
||||
# checked out the submodule yet for example).
|
||||
if [[ ! -f "$1/package.json" ]]; then
|
||||
echo "$1/package.json is missing; did you run git submodule update --init?"
|
||||
exit 1
|
||||
fi
|
||||
pushd "$1"
|
||||
echo "Installing dependencies for $PWD"
|
||||
yarn "${args[@]}"
|
||||
popd
|
||||
}
|
||||
|
||||
main() {
|
||||
cd "$(dirname "$0")/../.."
|
||||
source ./ci/lib.sh
|
||||
|
||||
echo 'Installing code-server test dependencies...'
|
||||
|
||||
cd test
|
||||
yarn install
|
||||
cd ..
|
||||
|
||||
cd vendor
|
||||
echo 'Installing vendor dependencies...'
|
||||
|
||||
# * We install in 'modules' instead of 'node_modules' because VS Code's extensions
|
||||
# use a webpack config which cannot differentiate between its own node_modules
|
||||
# and itself being in a directory with the same name.
|
||||
#
|
||||
# * We ignore scripts because NPM/Yarn's default behavior is to assume that
|
||||
# devDependencies are not needed, and that even git repo based packages are
|
||||
# assumed to be compiled. Because the default behavior for VS Code's `postinstall`
|
||||
# assumes we're also compiled, this needs to be ignored.
|
||||
yarn install --modules-folder modules --ignore-scripts --frozen-lockfile
|
||||
|
||||
# Finally, run the vendor `postinstall`
|
||||
yarn run postinstall
|
||||
install-deps test
|
||||
install-deps test/e2e/extensions/test-extension
|
||||
# We don't need these when running the integration tests
|
||||
# so you can pass SKIP_SUBMODULE_DEPS
|
||||
if [[ ! ${SKIP_SUBMODULE_DEPS-} ]]; then
|
||||
install-deps lib/vscode
|
||||
fi
|
||||
}
|
||||
|
||||
main "$@"
|
||||
|
||||
@@ -1,11 +1,23 @@
|
||||
#!/usr/bin/env bash
|
||||
set -euo pipefail
|
||||
|
||||
help() {
|
||||
echo >&2 " You can build with 'yarn watch' or you can build a release"
|
||||
echo >&2 " For example: 'yarn build && yarn build:vscode && KEEP_MODULES=1 yarn release'"
|
||||
echo >&2 " Then 'CODE_SERVER_TEST_ENTRY=./release yarn test:e2e'"
|
||||
echo >&2 " You can manually run that release with 'node ./release'"
|
||||
}
|
||||
|
||||
main() {
|
||||
cd "$(dirname "$0")/../.."
|
||||
|
||||
source ./ci/lib.sh
|
||||
|
||||
pushd test/e2e/extensions/test-extension
|
||||
echo "Building test extension"
|
||||
yarn build
|
||||
popd
|
||||
|
||||
local dir="$PWD"
|
||||
if [[ ! ${CODE_SERVER_TEST_ENTRY-} ]]; then
|
||||
echo "Set CODE_SERVER_TEST_ENTRY to test another build of code-server"
|
||||
@@ -21,13 +33,13 @@ main() {
|
||||
# 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'"
|
||||
help
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [[ ! -d $dir/vendor/modules/code-oss-dev/out ]]; then
|
||||
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'"
|
||||
help
|
||||
exit 1
|
||||
fi
|
||||
|
||||
|
||||
39
ci/dev/test-integration.sh
Executable file
39
ci/dev/test-integration.sh
Executable file
@@ -0,0 +1,39 @@
|
||||
#!/usr/bin/env bash
|
||||
set -euo pipefail
|
||||
|
||||
help() {
|
||||
echo >&2 " You can build the standalone release with 'yarn release:standalone'"
|
||||
echo >&2 " Or you can pass in a custom path."
|
||||
echo >&2 " CODE_SERVER_PATH='/var/tmp/coder/code-server/bin/code-server' yarn test:integration"
|
||||
}
|
||||
|
||||
# Make sure a code-server release works. You can pass in the path otherwise it
|
||||
# will look for 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() {
|
||||
cd "$(dirname "$0")/../.."
|
||||
|
||||
source ./ci/lib.sh
|
||||
|
||||
local path="$RELEASE_PATH-standalone/bin/code-server"
|
||||
if [[ ! ${CODE_SERVER_PATH-} ]]; then
|
||||
echo "Set CODE_SERVER_PATH to test another build of code-server"
|
||||
else
|
||||
path="$CODE_SERVER_PATH"
|
||||
fi
|
||||
|
||||
echo "Running tests with code-server binary: '$path'"
|
||||
|
||||
if [[ ! -f $path ]]; then
|
||||
echo >&2 "No code-server build detected"
|
||||
echo >&2 "Looked in $path"
|
||||
help
|
||||
exit 1
|
||||
fi
|
||||
|
||||
CODE_SERVER_PATH="$path" CS_DISABLE_PLUGINS=true ./test/node_modules/.bin/jest "$@" --coverage=false --testRegex "./test/integration" --testPathIgnorePatterns "./test/integration/fixtures"
|
||||
}
|
||||
|
||||
main "$@"
|
||||
@@ -3,13 +3,34 @@ set -euo pipefail
|
||||
|
||||
main() {
|
||||
cd "$(dirname "$0")/../.."
|
||||
cd test/unit/node/test-plugin
|
||||
|
||||
source ./ci/lib.sh
|
||||
|
||||
echo "Building test plugin"
|
||||
pushd test/unit/node/test-plugin
|
||||
make -s out/index.js
|
||||
popd
|
||||
|
||||
# Our code imports from `out` in order to work during development but if you
|
||||
# have only built for production you will have not have this directory. In
|
||||
# that case symlink `out` to a production build directory.
|
||||
if [[ ! -e lib/vscode/out ]]; then
|
||||
pushd lib
|
||||
local out=(vscode-reh-web-*)
|
||||
if [[ -d "${out[0]}" ]]; then
|
||||
ln -s "../${out[0]}/out" ./vscode/out
|
||||
else
|
||||
echo "Could not find lib/vscode/out or lib/vscode-reh-web-*"
|
||||
echo "Code must be built before running unit tests"
|
||||
exit 1
|
||||
fi
|
||||
popd
|
||||
fi
|
||||
|
||||
# We must keep jest in a sub-directory. See ../../test/package.json for more
|
||||
# information. We must also run it from the root otherwise coverage will not
|
||||
# include our source files.
|
||||
cd "$OLDPWD"
|
||||
CS_DISABLE_PLUGINS=true ./test/node_modules/.bin/jest "$@"
|
||||
CS_DISABLE_PLUGINS=true ./test/node_modules/.bin/jest "$@" --testRegex "./test/unit/.*ts" --testPathIgnorePatterns "./test/unit/node/test-plugin"
|
||||
}
|
||||
|
||||
main "$@"
|
||||
|
||||
275
ci/dev/watch.ts
275
ci/dev/watch.ts
@@ -1,157 +1,140 @@
|
||||
import browserify from "browserify"
|
||||
import * as cp from "child_process"
|
||||
import * as fs from "fs"
|
||||
import { spawn, fork, ChildProcess } from "child_process"
|
||||
import * as path from "path"
|
||||
import { onLine } from "../../src/node/util"
|
||||
import { onLine, OnLineCallback } from "../../src/node/util"
|
||||
|
||||
interface DevelopmentCompilers {
|
||||
[key: string]: ChildProcess | undefined
|
||||
vscode: ChildProcess
|
||||
vscodeWebExtensions: ChildProcess
|
||||
codeServer: ChildProcess
|
||||
plugins: ChildProcess | undefined
|
||||
}
|
||||
|
||||
class Watcher {
|
||||
private rootPath = path.resolve(process.cwd())
|
||||
private readonly paths = {
|
||||
/** Path to uncompiled VS Code source. */
|
||||
vscodeDir: path.join(this.rootPath, "lib/vscode"),
|
||||
pluginDir: process.env.PLUGIN_DIR,
|
||||
}
|
||||
|
||||
//#region Web Server
|
||||
|
||||
/** Development web server. */
|
||||
private webServer: ChildProcess | undefined
|
||||
|
||||
private reloadWebServer = (): void => {
|
||||
if (this.webServer) {
|
||||
this.webServer.kill()
|
||||
}
|
||||
|
||||
// Pass CLI args, save for `node` and the initial script name.
|
||||
const args = process.argv.slice(2)
|
||||
this.webServer = fork(path.join(this.rootPath, "out/node/entry.js"), args)
|
||||
const { pid } = this.webServer
|
||||
|
||||
this.webServer.on("exit", () => console.log("[Code Server]", `Web process ${pid} exited`))
|
||||
|
||||
console.log("\n[Code Server]", `Spawned web server process ${pid}`)
|
||||
}
|
||||
|
||||
//#endregion
|
||||
|
||||
//#region Compilers
|
||||
|
||||
private readonly compilers: DevelopmentCompilers = {
|
||||
codeServer: spawn("tsc", ["--watch", "--pretty", "--preserveWatchOutput"], { cwd: this.rootPath }),
|
||||
vscode: spawn("yarn", ["watch"], { cwd: this.paths.vscodeDir }),
|
||||
vscodeWebExtensions: spawn("yarn", ["watch-web"], { cwd: this.paths.vscodeDir }),
|
||||
plugins: this.paths.pluginDir ? spawn("yarn", ["build", "--watch"], { cwd: this.paths.pluginDir }) : undefined,
|
||||
}
|
||||
|
||||
public async initialize(): Promise<void> {
|
||||
for (const event of ["SIGINT", "SIGTERM"]) {
|
||||
process.on(event, () => this.dispose(0))
|
||||
}
|
||||
|
||||
for (const [processName, devProcess] of Object.entries(this.compilers)) {
|
||||
if (!devProcess) continue
|
||||
|
||||
devProcess.on("exit", (code) => {
|
||||
console.log(`[${processName}]`, "Terminated unexpectedly")
|
||||
this.dispose(code)
|
||||
})
|
||||
|
||||
if (devProcess.stderr) {
|
||||
devProcess.stderr.on("data", (d: string | Uint8Array) => process.stderr.write(d))
|
||||
}
|
||||
}
|
||||
|
||||
onLine(this.compilers.vscode, this.parseVSCodeLine)
|
||||
onLine(this.compilers.codeServer, this.parseCodeServerLine)
|
||||
|
||||
if (this.compilers.plugins) {
|
||||
onLine(this.compilers.plugins, this.parsePluginLine)
|
||||
}
|
||||
}
|
||||
|
||||
//#endregion
|
||||
|
||||
//#region Line Parsers
|
||||
|
||||
private parseVSCodeLine: OnLineCallback = (strippedLine, originalLine) => {
|
||||
if (!strippedLine.length) return
|
||||
|
||||
console.log("[VS Code]", originalLine)
|
||||
|
||||
if (strippedLine.includes("Finished compilation with")) {
|
||||
console.log("[VS Code] ✨ Finished compiling! ✨", "(Refresh your web browser ♻️)")
|
||||
this.reloadWebServer()
|
||||
}
|
||||
}
|
||||
|
||||
private parseCodeServerLine: OnLineCallback = (strippedLine, originalLine) => {
|
||||
if (!strippedLine.length) return
|
||||
|
||||
console.log("[Compiler][Code Server]", originalLine)
|
||||
|
||||
if (strippedLine.includes("Watching for file changes")) {
|
||||
console.log("[Compiler][Code Server]", "Finished compiling!", "(Refresh your web browser ♻️)")
|
||||
this.reloadWebServer()
|
||||
}
|
||||
}
|
||||
|
||||
private parsePluginLine: OnLineCallback = (strippedLine, originalLine) => {
|
||||
if (!strippedLine.length) return
|
||||
|
||||
console.log("[Compiler][Plugin]", originalLine)
|
||||
|
||||
if (strippedLine.includes("Watching for file changes...")) {
|
||||
this.reloadWebServer()
|
||||
}
|
||||
}
|
||||
|
||||
//#endregion
|
||||
|
||||
//#region Utilities
|
||||
|
||||
private dispose(code: number | null): void {
|
||||
for (const [processName, devProcess] of Object.entries(this.compilers)) {
|
||||
console.log(`[${processName}]`, "Killing...\n")
|
||||
devProcess?.removeAllListeners()
|
||||
devProcess?.kill()
|
||||
}
|
||||
process.exit(typeof code === "number" ? code : 0)
|
||||
}
|
||||
|
||||
//#endregion
|
||||
}
|
||||
|
||||
async function main(): Promise<void> {
|
||||
try {
|
||||
const watcher = new Watcher()
|
||||
await watcher.watch()
|
||||
} catch (error) {
|
||||
await watcher.initialize()
|
||||
} catch (error: any) {
|
||||
console.error(error.message)
|
||||
process.exit(1)
|
||||
}
|
||||
}
|
||||
|
||||
class Watcher {
|
||||
private readonly rootPath = path.resolve(__dirname, "../..")
|
||||
private readonly vscodeSourcePath = path.join(this.rootPath, "vendor/modules/code-oss-dev")
|
||||
|
||||
private static log(message: string, skipNewline = false): void {
|
||||
process.stdout.write(message)
|
||||
if (!skipNewline) {
|
||||
process.stdout.write("\n")
|
||||
}
|
||||
}
|
||||
|
||||
public async watch(): Promise<void> {
|
||||
let server: cp.ChildProcess | undefined
|
||||
const restartServer = (): void => {
|
||||
if (server) {
|
||||
server.kill()
|
||||
}
|
||||
const s = cp.fork(path.join(this.rootPath, "out/node/entry.js"), process.argv.slice(2))
|
||||
console.log(`[server] spawned process ${s.pid}`)
|
||||
s.on("exit", () => console.log(`[server] process ${s.pid} exited`))
|
||||
server = s
|
||||
}
|
||||
|
||||
const vscode = cp.spawn("yarn", ["watch"], { cwd: this.vscodeSourcePath })
|
||||
const tsc = cp.spawn("tsc", ["--watch", "--pretty", "--preserveWatchOutput"], { cwd: this.rootPath })
|
||||
const plugin = process.env.PLUGIN_DIR
|
||||
? cp.spawn("yarn", ["build", "--watch"], { cwd: process.env.PLUGIN_DIR })
|
||||
: undefined
|
||||
|
||||
const cleanup = (code?: number | null): void => {
|
||||
Watcher.log("killing vs code watcher")
|
||||
vscode.removeAllListeners()
|
||||
vscode.kill()
|
||||
|
||||
Watcher.log("killing tsc")
|
||||
tsc.removeAllListeners()
|
||||
tsc.kill()
|
||||
|
||||
if (plugin) {
|
||||
Watcher.log("killing plugin")
|
||||
plugin.removeAllListeners()
|
||||
plugin.kill()
|
||||
}
|
||||
|
||||
if (server) {
|
||||
Watcher.log("killing server")
|
||||
server.removeAllListeners()
|
||||
server.kill()
|
||||
}
|
||||
|
||||
Watcher.log("killing watch")
|
||||
process.exit(code || 0)
|
||||
}
|
||||
|
||||
process.on("SIGINT", () => cleanup())
|
||||
process.on("SIGTERM", () => cleanup())
|
||||
|
||||
vscode.on("exit", (code) => {
|
||||
Watcher.log("vs code watcher terminated unexpectedly")
|
||||
cleanup(code)
|
||||
})
|
||||
tsc.on("exit", (code) => {
|
||||
Watcher.log("tsc terminated unexpectedly")
|
||||
cleanup(code)
|
||||
})
|
||||
if (plugin) {
|
||||
plugin.on("exit", (code) => {
|
||||
Watcher.log("plugin terminated unexpectedly")
|
||||
cleanup(code)
|
||||
})
|
||||
}
|
||||
|
||||
vscode.stderr.on("data", (d) => process.stderr.write(d))
|
||||
tsc.stderr.on("data", (d) => process.stderr.write(d))
|
||||
if (plugin) {
|
||||
plugin.stderr.on("data", (d) => process.stderr.write(d))
|
||||
}
|
||||
|
||||
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
|
||||
onLine(vscode, (line, original) => {
|
||||
console.log("[vscode]", original)
|
||||
// Wait for watch-client since "Finished compilation" will appear multiple
|
||||
// times before the client starts building.
|
||||
if (!startingVscode && line.includes("Starting watch-client")) {
|
||||
startingVscode = true
|
||||
} else if (startingVscode && line.includes("Finished compilation")) {
|
||||
if (startedVscode) {
|
||||
restartServer()
|
||||
}
|
||||
startedVscode = true
|
||||
}
|
||||
})
|
||||
|
||||
onLine(tsc, (line, original) => {
|
||||
// tsc outputs blank lines; skip them.
|
||||
if (line !== "") {
|
||||
console.log("[tsc]", original)
|
||||
}
|
||||
if (line.includes("Watching for file changes")) {
|
||||
bundleBrowserCode(browserFiles)
|
||||
restartServer()
|
||||
}
|
||||
})
|
||||
|
||||
if (plugin) {
|
||||
onLine(plugin, (line, original) => {
|
||||
// tsc outputs blank lines; skip them.
|
||||
if (line !== "") {
|
||||
console.log("[plugin]", original)
|
||||
}
|
||||
if (line.includes("Watching for file changes")) {
|
||||
restartServer()
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
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()
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
apiVersion: v2
|
||||
name: code-server
|
||||
description: A Helm chart for cdr/code-server
|
||||
description: A Helm chart for coder/code-server
|
||||
|
||||
# A chart can be either an 'application' or a 'library' chart.
|
||||
#
|
||||
@@ -15,9 +15,9 @@ type: application
|
||||
# This is the chart version. This version number should be incremented each time you make changes
|
||||
# to the chart and its templates, including the app version.
|
||||
# Versions are expected to follow Semantic Versioning (https://semver.org/)
|
||||
version: 1.0.3
|
||||
version: 2.6.0
|
||||
|
||||
# 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.12.0
|
||||
appVersion: 4.5.0
|
||||
|
||||
@@ -15,9 +15,8 @@
|
||||
export SERVICE_IP=$(kubectl get svc --namespace {{ .Release.Namespace }} {{ include "code-server.fullname" . }} -o jsonpath='{.status.loadBalancer.ingress[0].ip}')
|
||||
echo http://$SERVICE_IP:{{ .Values.service.port }}
|
||||
{{- else if contains "ClusterIP" .Values.service.type }}
|
||||
export POD_NAME=$(kubectl get pods --namespace {{ .Release.Namespace }} -l "app.kubernetes.io/name={{ include "code-server.name" . }},app.kubernetes.io/instance={{ .Release.Name }}" -o jsonpath="{.items[0].metadata.name}")
|
||||
echo "Visit http://127.0.0.1:8080 to use your application"
|
||||
kubectl port-forward $POD_NAME 8080:80
|
||||
kubectl port-forward --namespace {{ .Release.Namespace }} service/{{ include "code-server.fullname" . }} 8080:http
|
||||
{{- end }}
|
||||
|
||||
Administrator credentials:
|
||||
|
||||
@@ -21,6 +21,7 @@ spec:
|
||||
app.kubernetes.io/name: {{ include "code-server.name" . }}
|
||||
app.kubernetes.io/instance: {{ .Release.Name }}
|
||||
spec:
|
||||
imagePullSecrets: {{- toYaml .Values.imagePullSecrets | nindent 8 }}
|
||||
{{- if .Values.hostnameOverride }}
|
||||
hostname: {{ .Values.hostnameOverride }}
|
||||
{{- end }}
|
||||
@@ -142,6 +143,12 @@ spec:
|
||||
secretName: {{ .secretName }}
|
||||
defaultMode: {{ .defaultMode }}
|
||||
{{- end }}
|
||||
{{- range .Values.extraConfigmapMounts }}
|
||||
- name: {{ .name }}
|
||||
configMap:
|
||||
name: {{ .configMap }}
|
||||
defaultMode: {{ .defaultMode }}
|
||||
{{- end }}
|
||||
{{- range .Values.extraVolumeMounts }}
|
||||
- name: {{ .name }}
|
||||
{{- if .existingClaim }}
|
||||
|
||||
@@ -1,7 +1,9 @@
|
||||
{{- if .Values.ingress.enabled -}}
|
||||
{{- $fullName := include "code-server.fullname" . -}}
|
||||
{{- $svcPort := .Values.service.port -}}
|
||||
{{- if semverCompare ">=1.14-0" .Capabilities.KubeVersion.GitVersion -}}
|
||||
{{- if semverCompare ">=1.19-0" $.Capabilities.KubeVersion.GitVersion -}}
|
||||
apiVersion: networking.k8s.io/v1
|
||||
{{- else if semverCompare ">=1.14-0" .Capabilities.KubeVersion.GitVersion -}}
|
||||
apiVersion: networking.k8s.io/v1beta1
|
||||
{{- else -}}
|
||||
apiVersion: extensions/v1beta1
|
||||
@@ -16,6 +18,9 @@ metadata:
|
||||
{{- toYaml . | nindent 4 }}
|
||||
{{- end }}
|
||||
spec:
|
||||
{{- if .Values.ingress.ingressClassName }}
|
||||
ingressClassName: {{ .Values.ingress.ingressClassName }}
|
||||
{{- end }}
|
||||
{{- if .Values.ingress.tls }}
|
||||
tls:
|
||||
{{- range .Values.ingress.tls }}
|
||||
@@ -27,6 +32,22 @@ spec:
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
rules:
|
||||
{{- if semverCompare ">=1.19-0" $.Capabilities.KubeVersion.GitVersion -}}
|
||||
{{- range .Values.ingress.hosts }}
|
||||
- host: {{ .host | quote }}
|
||||
http:
|
||||
paths:
|
||||
{{- range .paths }}
|
||||
- path: {{ . }}
|
||||
pathType: Prefix
|
||||
backend:
|
||||
service:
|
||||
name: {{ $fullName }}
|
||||
port:
|
||||
number: {{ $svcPort }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
{{- else -}}
|
||||
{{- range .Values.ingress.hosts }}
|
||||
- host: {{ .host | quote }}
|
||||
http:
|
||||
@@ -39,3 +60,4 @@ spec:
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
@@ -6,10 +6,15 @@ replicaCount: 1
|
||||
|
||||
image:
|
||||
repository: codercom/code-server
|
||||
tag: '3.12.0'
|
||||
tag: '4.5.0'
|
||||
pullPolicy: Always
|
||||
|
||||
# Specifies one or more secrets to be used when pulling images from a
|
||||
# private container repository
|
||||
# https://kubernetes.io/docs/tasks/configure-pod-container/pull-image-private-registry
|
||||
imagePullSecrets: []
|
||||
# - name: registry-creds
|
||||
|
||||
nameOverride: ""
|
||||
fullnameOverride: ""
|
||||
hostnameOverride: ""
|
||||
@@ -28,14 +33,6 @@ podAnnotations: {}
|
||||
podSecurityContext: {}
|
||||
# fsGroup: 2000
|
||||
|
||||
securityContext: {}
|
||||
# capabilities:
|
||||
# drop:
|
||||
# - ALL
|
||||
# readOnlyRootFilesystem: true
|
||||
# runAsNonRoot: true
|
||||
# runAsUser: 1000
|
||||
|
||||
service:
|
||||
type: ClusterIP
|
||||
port: 8080
|
||||
@@ -43,13 +40,12 @@ service:
|
||||
ingress:
|
||||
enabled: false
|
||||
#annotations:
|
||||
# kubernetes.io/ingress.class: nginx
|
||||
# kubernetes.io/tls-acme: "true"
|
||||
#hosts:
|
||||
# - host: code-server.example.loc
|
||||
# paths:
|
||||
# - /
|
||||
|
||||
ingressClassName: ""
|
||||
#tls:
|
||||
# - secretName: code-server
|
||||
# hosts:
|
||||
@@ -74,6 +70,8 @@ extraArgs: []
|
||||
extraVars: []
|
||||
# - name: DISABLE_TELEMETRY
|
||||
# value: true
|
||||
# - name: DOCKER_HOST
|
||||
# value: "tcp://localhost:2375"
|
||||
|
||||
##
|
||||
## Init containers parameters:
|
||||
@@ -127,13 +125,10 @@ persistence:
|
||||
# existingClaim: ""
|
||||
# hostPath: /data
|
||||
|
||||
serviceAccount:
|
||||
create: true
|
||||
name:
|
||||
|
||||
## Enable an Specify container in extraContainers.
|
||||
## This is meant to allow adding code-server dependencies, like docker-dind.
|
||||
extraContainers: |
|
||||
# If docker-dind is used, DOCKER_HOST env is mandatory to set in "extraVars"
|
||||
#- name: docker-dind
|
||||
# image: docker:19.03-dind
|
||||
# imagePullPolicy: IfNotPresent
|
||||
|
||||
@@ -14,7 +14,7 @@ pkg_json_version() {
|
||||
}
|
||||
|
||||
vscode_version() {
|
||||
jq -r .version vendor/modules/code-oss-dev/package.json
|
||||
jq -r .version lib/vscode/package.json
|
||||
}
|
||||
|
||||
os() {
|
||||
|
||||
@@ -1,3 +1,8 @@
|
||||
# syntax=docker/dockerfile:experimental
|
||||
|
||||
FROM scratch AS packages
|
||||
COPY release-packages/code-server*.deb /tmp/
|
||||
|
||||
FROM debian:11
|
||||
|
||||
RUN apt-get update \
|
||||
@@ -10,11 +15,13 @@ RUN apt-get update \
|
||||
man \
|
||||
nano \
|
||||
git \
|
||||
git-lfs \
|
||||
procps \
|
||||
openssh-client \
|
||||
sudo \
|
||||
vim.tiny \
|
||||
lsb-release \
|
||||
&& git lfs install \
|
||||
&& rm -rf /var/lib/apt/lists/*
|
||||
|
||||
# https://wiki.debian.org/Locale#Manually
|
||||
@@ -32,9 +39,12 @@ RUN ARCH="$(dpkg --print-architecture)" && \
|
||||
mkdir -p /etc/fixuid && \
|
||||
printf "user: coder\ngroup: coder\n" > /etc/fixuid/config.yml
|
||||
|
||||
COPY release-packages/code-server*.deb /tmp/
|
||||
COPY ci/release-image/entrypoint.sh /usr/bin/entrypoint.sh
|
||||
RUN dpkg -i /tmp/code-server*$(dpkg --print-architecture).deb && rm /tmp/code-server*.deb
|
||||
RUN --mount=from=packages,src=/tmp,dst=/tmp/packages dpkg -i /tmp/packages/code-server*$(dpkg --print-architecture).deb
|
||||
|
||||
# Allow users to have scripts run on container startup to prepare workspace.
|
||||
# https://github.com/coder/code-server/issues/5177
|
||||
ENV ENTRYPOINTD=${HOME}/entrypoint.d
|
||||
|
||||
EXPOSE 8080
|
||||
# This way, if someone sets $DOCKER_USER, docker-exec will still work as
|
||||
|
||||
@@ -15,6 +15,8 @@ target "code-server" {
|
||||
tags = [
|
||||
"docker.io/codercom/code-server:latest",
|
||||
notequal("latest",VERSION) ? "docker.io/codercom/code-server:${VERSION}" : "",
|
||||
"ghcr.io/coder/code-server:latest",
|
||||
notequal("latest",VERSION) ? "ghcr.io/coder/code-server:${VERSION}" : "",
|
||||
]
|
||||
platforms = ["linux/amd64", "linux/arm64"]
|
||||
}
|
||||
|
||||
@@ -18,4 +18,10 @@ if [ "${DOCKER_USER-}" ]; then
|
||||
fi
|
||||
fi
|
||||
|
||||
dumb-init /usr/bin/code-server "$@"
|
||||
# Allow users to have scripts run on container startup to prepare workspace.
|
||||
# https://github.com/coder/code-server/issues/5177
|
||||
if [ -d "${ENTRYPOINTD}" ]; then
|
||||
find "${ENTRYPOINTD}" -type f -executable -print -exec {} \;
|
||||
fi
|
||||
|
||||
exec dumb-init /usr/bin/code-server "$@"
|
||||
|
||||
@@ -2,38 +2,23 @@
|
||||
set -euo pipefail
|
||||
|
||||
main() {
|
||||
cd "$(dirname "$0")/../.."
|
||||
# Only sourcing this so we get access to $VERSION
|
||||
source ./ci/lib.sh
|
||||
source ./ci/steps/steps-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 "Checking environment variables"
|
||||
|
||||
echo "Changing into homebrew-core directory"
|
||||
cd homebrew-core && pwd
|
||||
# We need VERSION to bump the brew formula
|
||||
if ! is_env_var_set "VERSION"; then
|
||||
echo "VERSION is not set"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo "Adding Homebrew/homebrew-core as $(upstream)"
|
||||
git remote add upstream https://github.com/Homebrew/homebrew-core.git
|
||||
|
||||
echo "Fetching upstream Homebrew/hombrew-core commits"
|
||||
git fetch upstream
|
||||
|
||||
echo "Merging in latest Homebrew/homebrew-core 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
|
||||
# We need HOMEBREW_GITHUB_API_TOKEN to push up commits
|
||||
if ! is_env_var_set "HOMEBREW_GITHUB_API_TOKEN"; then
|
||||
echo "HOMEBREW_GITHUB_API_TOKEN is not set"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Find the docs for bump-formula-pr here
|
||||
# https://github.com/Homebrew/brew/blob/master/Library/Homebrew/dev-cmd/bump-formula-pr.rb#L18
|
||||
@@ -41,15 +26,12 @@ main() {
|
||||
if ! output=$(brew bump-formula-pr --version="${VERSION}" code-server --no-browse --no-audit 2>&1); then
|
||||
if [[ $output == *"Duplicate PRs should not be opened"* ]]; then
|
||||
echo "$VERSION is already submitted"
|
||||
exit 0
|
||||
else
|
||||
echo "$output"
|
||||
exit 1
|
||||
fi
|
||||
fi
|
||||
|
||||
# Clean up and remove homebrew-core
|
||||
cd ..
|
||||
rm -rf homebrew-core
|
||||
}
|
||||
|
||||
main "$@"
|
||||
|
||||
@@ -1,36 +1,15 @@
|
||||
#!/usr/bin/env bash
|
||||
set -euo pipefail
|
||||
|
||||
# See if this version already exists on Docker Hub.
|
||||
function version_exists() {
|
||||
local output
|
||||
output=$(curl --silent "https://index.docker.io/v1/repositories/codercom/code-server/tags/$VERSION")
|
||||
if [[ $output == "Tag not found" ]]; then
|
||||
return 1
|
||||
else
|
||||
return 0
|
||||
fi
|
||||
}
|
||||
|
||||
main() {
|
||||
cd "$(dirname "$0")/../.."
|
||||
|
||||
# ci/lib.sh sets VERSION and provides download_artifact here
|
||||
# ci/lib.sh sets VERSION so it's available to ci/release-image/docker-bake.hcl
|
||||
# to push the VERSION tag.
|
||||
source ./ci/lib.sh
|
||||
|
||||
if version_exists; then
|
||||
echo "$VERSION is already pushed"
|
||||
return
|
||||
fi
|
||||
|
||||
# Download the release-packages artifact
|
||||
download_artifact release-packages ./release-packages
|
||||
|
||||
# Login to Docker
|
||||
if [[ ${CI-} ]]; then
|
||||
echo "$DOCKER_PASSWORD" | docker login -u "$DOCKER_USERNAME" --password-stdin
|
||||
fi
|
||||
|
||||
# NOTE@jsjoeio - this script assumes that you've downloaded
|
||||
# the release-packages artifact to ./release-packages before
|
||||
# running this docker buildx step
|
||||
docker buildx bake -f ci/release-image/docker-bake.hcl --push
|
||||
}
|
||||
|
||||
|
||||
@@ -4,27 +4,160 @@ set -euo pipefail
|
||||
main() {
|
||||
cd "$(dirname "$0")/../.."
|
||||
source ./ci/lib.sh
|
||||
source ./ci/steps/steps-lib.sh
|
||||
|
||||
# npm view won't exit with non-zero so we have to check the output.
|
||||
local hasVersion
|
||||
hasVersion=$(npm view "code-server@$VERSION" version)
|
||||
if [[ $hasVersion == "$VERSION" ]]; then
|
||||
echo "$VERSION is already published"
|
||||
return
|
||||
## Authentication tokens
|
||||
# Needed to publish on NPM
|
||||
if ! is_env_var_set "NPM_TOKEN"; then
|
||||
echo "NPM_TOKEN is not set. Cannot publish to npm without credentials."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
## Publishing Information
|
||||
# All the variables below are used to determine how we should publish
|
||||
# the npm package. We also use this information for bumping the version.
|
||||
# This is because npm won't publish your package unless it's a new version.
|
||||
# i.e. for development, we bump the version to <current version>-<pr number>-<commit sha>
|
||||
# example: "version": "4.0.1-4769-ad7b23cfe6ffd72914e34781ef7721b129a23040"
|
||||
# We need the current package.json VERSION
|
||||
if ! is_env_var_set "VERSION"; then
|
||||
echo "VERSION is not set. Cannot publish to npm without VERSION."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# We use this to grab the PR_NUMBER
|
||||
if ! is_env_var_set "GITHUB_REF"; then
|
||||
echo "GITHUB_REF is not set. Are you running this locally? We rely on values provided by GitHub."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# We use this when setting NPM_VERSION
|
||||
if ! is_env_var_set "GITHUB_SHA"; then
|
||||
echo "GITHUB_SHA is not set. Are you running this locally? We rely on values provided by GitHub."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# We use this to determine the NPM_ENVIRONMENT
|
||||
if ! is_env_var_set "GITHUB_EVENT_NAME"; then
|
||||
echo "GITHUB_EVENT_NAME is not set. Are you running this locally? We rely on values provided by GitHub."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Check that we're using at least v7 of npm CLI
|
||||
if ! command -v jq &> /dev/null; then
|
||||
echo "Couldn't find jq"
|
||||
echo "We need this in order to modify the package.json for dev builds."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# This allows us to publish to npm in CI workflows
|
||||
if [[ ${CI-} ]]; then
|
||||
echo "//registry.npmjs.org/:_authToken=${NPM_TOKEN}" > ~/.npmrc
|
||||
fi
|
||||
|
||||
download_artifact npm-package ./release-npm-package
|
||||
## Environment
|
||||
# This string is used to determine how we should tag the npm release.
|
||||
# Environment can be one of three choices:
|
||||
# "development" - this means we tag with the PR number, allowing
|
||||
# a developer to install this version with `yarn add code-server@<pr-number>`
|
||||
# "staging" - this means we tag with `beta`, allowing
|
||||
# a developer to install this version with `yarn add code-server@beta`
|
||||
# "production" - this means we tag with `latest` (default), allowing
|
||||
# a developer to install this version with `yarn add code-server@latest`
|
||||
if ! is_env_var_set "NPM_ENVIRONMENT"; then
|
||||
echo "NPM_ENVIRONMENT is not set. Determining in script based on GITHUB environment variables."
|
||||
|
||||
if [[ "$GITHUB_EVENT_NAME" == 'push' && "$GITHUB_REF" == 'refs/heads/main' ]]; then
|
||||
NPM_ENVIRONMENT="staging"
|
||||
else
|
||||
NPM_ENVIRONMENT="development"
|
||||
fi
|
||||
|
||||
echo "Using npm environment: $NPM_ENVIRONMENT"
|
||||
fi
|
||||
|
||||
# NOTE@jsjoeio - this script assumes we have the artifact downloaded on disk
|
||||
# That happens in CI as a step before we run this.
|
||||
# https://github.com/actions/upload-artifact/issues/38
|
||||
tar -xzf release-npm-package/package.tar.gz
|
||||
|
||||
# Ignore symlink when publishing npm package
|
||||
# See: https://github.com/cdr/code-server/pull/3935
|
||||
# See: https://github.com/coder/code-server/pull/3935
|
||||
echo "node_modules.asar" > release/.npmignore
|
||||
yarn publish --non-interactive release
|
||||
|
||||
# We use this to set the name of the package in the
|
||||
# package.json
|
||||
PACKAGE_NAME="code-server"
|
||||
|
||||
# NOTES:@jsjoeio
|
||||
# We only need to run npm version for "development" and "staging".
|
||||
# This is because our release:prep script automatically bumps the version
|
||||
# in the package.json and we commit it as part of the release PR.
|
||||
if [[ "$NPM_ENVIRONMENT" == "production" ]]; then
|
||||
NPM_VERSION="$VERSION"
|
||||
# This means the npm version will be published as "stable"
|
||||
# and installed when a user runs `yarn install code-server`
|
||||
NPM_TAG="latest"
|
||||
else
|
||||
COMMIT_SHA="$GITHUB_SHA"
|
||||
echo "Not a production environment"
|
||||
echo "Found environment: $NPM_ENVIRONMENT"
|
||||
echo "Manually bumping npm version..."
|
||||
|
||||
if [[ "$NPM_ENVIRONMENT" == "staging" ]]; then
|
||||
NPM_VERSION="$VERSION-beta-$COMMIT_SHA"
|
||||
# This means the npm version will be tagged with "beta"
|
||||
# and installed when a user runs `yarn install code-server@beta`
|
||||
NPM_TAG="beta"
|
||||
fi
|
||||
|
||||
if [[ "$NPM_ENVIRONMENT" == "development" ]]; then
|
||||
# Source: https://github.com/actions/checkout/issues/58#issuecomment-614041550
|
||||
PR_NUMBER=$(echo "$GITHUB_REF" | awk 'BEGIN { FS = "/" } ; { print $3 }')
|
||||
NPM_VERSION="$VERSION-$PR_NUMBER-$COMMIT_SHA"
|
||||
PACKAGE_NAME="@coder/code-server-pr"
|
||||
# This means the npm version will be tagged with "<pr number>"
|
||||
# and installed when a user runs `yarn install code-server@<pr number>`
|
||||
NPM_TAG="$PR_NUMBER"
|
||||
fi
|
||||
|
||||
echo "using tag: $NPM_TAG"
|
||||
echo "using package name: $PACKAGE_NAME"
|
||||
|
||||
# We modify the version in the package.json
|
||||
# to be the current version + the PR number + commit SHA
|
||||
# or we use current version + beta + commit SHA
|
||||
# Example: "version": "4.0.1-4769-ad7b23cfe6ffd72914e34781ef7721b129a23040"
|
||||
# Example: "version": "4.0.1-beta-ad7b23cfe6ffd72914e34781ef7721b129a23040"
|
||||
pushd release
|
||||
# NOTE@jsjoeio
|
||||
# I originally tried to use `yarn version` but ran into issues and abandoned it.
|
||||
npm version "$NPM_VERSION"
|
||||
# NOTE@jsjoeio
|
||||
# Use the development package name
|
||||
# This is so we don't clutter the code-server versions on npm
|
||||
# with development versions.
|
||||
# jq can't edit in place so we must store in memory and echo
|
||||
local contents
|
||||
contents="$(jq ".name |= \"$PACKAGE_NAME\"" package.json)"
|
||||
echo "${contents}" > package.json
|
||||
popd
|
||||
fi
|
||||
|
||||
# We need to make sure we haven't already published the version.
|
||||
# This is because npm view won't exit with non-zero so we have
|
||||
# to check the output.
|
||||
local hasVersion
|
||||
hasVersion=$(npm view "code-server@$NPM_VERSION" version)
|
||||
if [[ $hasVersion == "$NPM_VERSION" ]]; then
|
||||
echo "$NPM_VERSION is already published"
|
||||
return
|
||||
fi
|
||||
|
||||
# NOTE@jsjoeio
|
||||
# Since the dev builds are scoped to @coder
|
||||
# We pass --access public to ensure npm knows it's not private.
|
||||
yarn publish --non-interactive release --tag "$NPM_TAG" --access public
|
||||
}
|
||||
|
||||
main "$@"
|
||||
|
||||
47
ci/steps/steps-lib.sh
Executable file
47
ci/steps/steps-lib.sh
Executable file
@@ -0,0 +1,47 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
# This is a library which contains functions used inside ci/steps
|
||||
#
|
||||
# We separated it into it's own file so that we could easily unit test
|
||||
# these functions and helpers
|
||||
|
||||
# Checks whether and environment variable is set.
|
||||
# Source: https://stackoverflow.com/a/62210688/3015595
|
||||
is_env_var_set() {
|
||||
local name="${1:-}"
|
||||
if test -n "${!name:-}"; then
|
||||
return 0
|
||||
else
|
||||
return 1
|
||||
fi
|
||||
}
|
||||
|
||||
# Checks whether a directory exists.
|
||||
directory_exists() {
|
||||
local dir="${1:-}"
|
||||
if [[ -d "${dir:-}" ]]; then
|
||||
return 0
|
||||
else
|
||||
return 1
|
||||
fi
|
||||
}
|
||||
|
||||
# Checks whether a file exists.
|
||||
file_exists() {
|
||||
local file="${1:-}"
|
||||
if test -f "${file:-}"; then
|
||||
return 0
|
||||
else
|
||||
return 1
|
||||
fi
|
||||
}
|
||||
|
||||
# Checks whether a file is executable.
|
||||
is_executable() {
|
||||
local file="${1:-}"
|
||||
if [ -f "${file}" ] && [ -r "${file}" ] && [ -x "${file}" ]; then
|
||||
return 0
|
||||
else
|
||||
return 1
|
||||
fi
|
||||
}
|
||||
@@ -3,17 +3,21 @@
|
||||
# Contributing
|
||||
|
||||
- [Requirements](#requirements)
|
||||
- [Linux-specific requirements](#linux-specific-requirements)
|
||||
- [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)
|
||||
- [Version updates to Code](#version-updates-to-code)
|
||||
- [Patching Code](#patching-code)
|
||||
- [Build](#build)
|
||||
- [Test](#test)
|
||||
- [Help](#help)
|
||||
- [Test](#test)
|
||||
- [Unit tests](#unit-tests)
|
||||
- [Script tests](#script-tests)
|
||||
- [Integration tests](#integration-tests)
|
||||
- [End-to-end tests](#end-to-end-tests)
|
||||
- [Structure](#structure)
|
||||
- [Modifications to VS Code](#modifications-to-vs-code)
|
||||
- [Modifications to Code](#modifications-to-code)
|
||||
- [Currently Known Issues](#currently-known-issues)
|
||||
|
||||
<!-- END doctoc generated TOC please keep comment here to allow auto update -->
|
||||
@@ -27,12 +31,12 @@ for [VS
|
||||
Code](https://github.com/Microsoft/vscode/wiki/How-to-Contribute#prerequisites).
|
||||
Here is what is needed:
|
||||
|
||||
- `node` v14.x
|
||||
- `node` v16.x
|
||||
- `git` v2.x or greater
|
||||
- [`git-lfs`](https://git-lfs.github.com)
|
||||
- [`yarn`](https://classic.yarnpkg.com/en/)
|
||||
- Used to install JS packages and run scripts
|
||||
- [`nfpm`](https://classic.yarnpkg.com/en/)
|
||||
- [`nfpm`](https://nfpm.goreleaser.com/)
|
||||
- Used to build `.deb` and `.rpm` packages
|
||||
- [`jq`](https://stedolan.github.io/jq/)
|
||||
- Used to build code-server releases
|
||||
@@ -41,16 +45,26 @@ Here is what is needed:
|
||||
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`
|
||||
- `quilt`
|
||||
- Used to manage patches to Code
|
||||
- `rsync` and `unzip`
|
||||
- Used for code-server releases
|
||||
- `bats`
|
||||
- Used to run script unit tests
|
||||
|
||||
### Linux-specific requirements
|
||||
|
||||
If you're developing code-server on Linux, make sure you have installed or install the following dependencies:
|
||||
|
||||
```shell
|
||||
sudo apt-get install build-essential g++ libx11-dev libxkbfile-dev libsecret-1-dev python-is-python3
|
||||
```
|
||||
|
||||
These are required by Code. See [their Wiki](https://github.com/microsoft/vscode/wiki/How-to-Contribute#prerequisites) for more information.
|
||||
|
||||
## Creating pull requests
|
||||
|
||||
Please create a [GitHub Issue](https://github.com/cdr/code-server/issues) that
|
||||
Please create a [GitHub Issue](https://github.com/coder/code-server/issues) that
|
||||
includes context for issues that you see. You can skip this if the proposed fix
|
||||
is minor.
|
||||
|
||||
@@ -67,35 +81,46 @@ we'll guide you.
|
||||
|
||||
## Development workflow
|
||||
|
||||
```shell
|
||||
yarn
|
||||
yarn watch
|
||||
# Visit http://localhost:8080 once the build is completed.
|
||||
```
|
||||
1. `git clone https://github.com/coder/code-server.git` - Clone `code-server`
|
||||
2. `git submodule update --init` - Clone `vscode` submodule
|
||||
3. `quilt push -a` - Apply patches to the `vscode` submodule.
|
||||
4. `yarn` - Install dependencies
|
||||
5. `yarn watch` - Launch code-server localhost:8080. code-server will be live
|
||||
reloaded when changes are made; the browser needs to be refreshed manually.
|
||||
|
||||
`yarn watch` will live reload changes to the source.
|
||||
When pulling down changes that include modifications to the patches you will
|
||||
need to apply them with `quilt`. If you pull down changes that update the
|
||||
`vscode` submodule you will need to run `git submodule update --init` and
|
||||
re-apply the patches.
|
||||
|
||||
### Updates to VS Code
|
||||
### Version updates to Code
|
||||
|
||||
1. Update the package tag listed in `vendor/package.json`:
|
||||
|
||||
```json
|
||||
{
|
||||
"devDependencies": {
|
||||
"vscode": "cdr/vscode#X.XX.X-code-server"
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
2. From the code-server **project root**, run `yarn install`.
|
||||
Then, test code-server locally to make sure everything works.
|
||||
1. Check the Node.js version that's used by Electron (which is shipped with VS
|
||||
1. Update the `lib/vscode` submodule to the desired upstream version branch.
|
||||
1. `cd lib/vscode && git checkout release/1.66 && cd ../..`
|
||||
2. `git add lib && git commit -m "chore: update Code"`
|
||||
2. Apply the patches (`quilt push -a`) or restore your stashed changes. At this
|
||||
stage you may need to resolve conflicts. For example use `quilt push -f`,
|
||||
manually apply the rejected portions, then `quilt refresh`.
|
||||
3. From the code-server **project root**, run `yarn install`.
|
||||
4. Test code-server locally to make sure everything works.
|
||||
5. 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.
|
||||
1. Open a PR
|
||||
6. Commit the updated submodule and patches to `code-server`.
|
||||
7. Open a PR.
|
||||
|
||||
> Watch for updates to
|
||||
> `vendor/modules/code-oss-dev/src/vs/code/browser/workbench/workbench.html`. You may need to
|
||||
> make changes to `src/browser/pages/vscode.html`.
|
||||
### Patching Code
|
||||
|
||||
0. You can go through the patch stack with `quilt push` and `quilt pop`.
|
||||
1. Create a new patch (`quilt new {name}.diff`) or use an existing patch.
|
||||
2. Add the file(s) you are patching (`quilt add [-P patch] {file}`). A file
|
||||
**must** be added before you make changes to it.
|
||||
3. Make your changes. Patches do not need to be independent of each other but
|
||||
each patch must result in a working code-server without any broken in-between
|
||||
states otherwise they are difficult to test and modify.
|
||||
4. Add your changes to the patch (`quilt refresh`)
|
||||
5. Add a comment in the patch about the reason for the patch and how to
|
||||
reproduce the behavior it fixes or adds. Every patch should have an e2e test
|
||||
as well.
|
||||
|
||||
### Build
|
||||
|
||||
@@ -107,11 +132,13 @@ yarn build:vscode
|
||||
yarn release
|
||||
```
|
||||
|
||||
_NOTE: this does not keep `node_modules`. If you want them to be kept, use `KEEP_MODULES=1 yarn release` (if you're testing in Coder, you'll want to do this)_
|
||||
|
||||
Run your build:
|
||||
|
||||
```shell
|
||||
cd release
|
||||
yarn --production
|
||||
yarn --production # Skip if you used KEEP_MODULES=1
|
||||
# Runs the built JavaScript with Node.
|
||||
node .
|
||||
```
|
||||
@@ -120,7 +147,7 @@ Build the release packages (make sure that you run `yarn release` first):
|
||||
|
||||
```shell
|
||||
yarn release:standalone
|
||||
yarn test:standalone-release
|
||||
yarn test:integration
|
||||
yarn package
|
||||
```
|
||||
|
||||
@@ -129,13 +156,18 @@ yarn package
|
||||
> If you need your builds to support older distros, run the build commands
|
||||
> inside a Docker container with all the build requirements installed.
|
||||
|
||||
### Test
|
||||
### Help
|
||||
|
||||
There are three kinds of tests in code-server:
|
||||
If you get stuck or need help, you can always start a new GitHub Discussion [here](https://github.com/coder/code-server/discussions). One of the maintainers will respond and help you out.
|
||||
|
||||
## Test
|
||||
|
||||
There are four kinds of tests in code-server:
|
||||
|
||||
1. Unit tests
|
||||
2. Integration tests
|
||||
3. End-to-end tests
|
||||
2. Script tests
|
||||
3. Integration tests
|
||||
4. End-to-end tests
|
||||
|
||||
### Unit tests
|
||||
|
||||
@@ -146,11 +178,18 @@ These live under [test/unit](../test/unit).
|
||||
|
||||
We use unit tests for functions and things that can be tested in isolation. The file structure is modeled closely after `/src` so it's easy for people to know where test files should live.
|
||||
|
||||
### Script tests
|
||||
|
||||
Our script tests are written in bash and run using [bats](https://github.com/bats-core/bats-core).
|
||||
|
||||
These tests live under `test/scripts`.
|
||||
|
||||
We use these to test anything related to our scripts (most of which live under `ci`).
|
||||
|
||||
### 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.
|
||||
These are a work in progress. We build code-server and run tests with `yarn test:integration`, which ensures that code-server builds work on their respective
|
||||
platforms.
|
||||
|
||||
Our integration tests look at components that rely on one another. For example,
|
||||
testing the CLI requires us to build and package code-server.
|
||||
@@ -178,99 +217,46 @@ code-server running locally. In CI, this is taken care of for you.
|
||||
|
||||
## Structure
|
||||
|
||||
The `code-server` script serves as an HTTP API for login and starting a remote VS
|
||||
The `code-server` script serves as an HTTP API for login and starting a remote
|
||||
Code process.
|
||||
|
||||
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
|
||||
[vendor/modules/code-oss-dev](../vendor/modules/code-oss-dev), which we describe next.
|
||||
Most of the meaty parts are in the Code portion of the codebase under
|
||||
[lib/vscode](../lib/vscode), which we describe next.
|
||||
|
||||
### Modifications to VS Code
|
||||
### Modifications to 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 the UI code, while the server
|
||||
ran the extensions and exposed an API to the front-end for file access and all
|
||||
UI needs.
|
||||
Our modifications to Code can be found in the [patches](../patches) directory.
|
||||
We pull in Code as a submodule pointing to an upstream release branch.
|
||||
|
||||
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
|
||||
[vendor/modules/code-oss-dev](../vendor/modules/code-oss-dev).
|
||||
In v1 of code-server, we had Code as a submodule and used a single massive patch
|
||||
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.
|
||||
|
||||
Some noteworthy changes in our version of VS Code include:
|
||||
Over time, Microsoft added support to Code to run it on the web. They had made
|
||||
the front-end open source, but not the server. As such, code-server v2 (and
|
||||
later) uses the Code front-end and implements the server. We did this by using a
|
||||
Git subtree to fork and modify Code.
|
||||
|
||||
- Adding our build file, [`vendor/modules/code-oss-dev/coder.js`](../vendor/modules/code-oss-dev/coder.js), which includes build steps specific to code-server
|
||||
- Node.js version detection changes in [`build/lib/node.ts`](../vendor/modules/code-oss-dev/build/lib/node.ts) and [`build/lib/util.ts`](../vendor/modules/code-oss-dev/build/lib/util.ts)
|
||||
- Allowing extra extension directories
|
||||
- Added extra arguments to [`src/vs/platform/environment/common/argv.ts`](../vendor/modules/code-oss-dev/src/vs/platform/environment/common/argv.ts) and to [`src/vs/platform/environment/node/argv.ts`](../vendor/modules/code-oss-dev/src/vs/platform/environment/node/argv.ts)
|
||||
- Added extra environment state to [`src/vs/platform/environment/common/environment.ts`](../vendor/modules/code-oss-dev/src/vs/platform/environment/common/environment.ts);
|
||||
- Added extra getters to [`src/vs/platform/environment/common/environmentService.ts`](../vendor/modules/code-oss-dev/src/vs/platform/environment/common/environmentService.ts)
|
||||
- Added extra scanning paths to [`src/vs/platform/extensionManagement/node/extensionsScanner.ts`](../vendor/modules/code-oss-dev/src/vs/platform/extensionManagement/node/extensionsScanner.ts)
|
||||
- Additions/removals from [`package.json`](../vendor/modules/code-oss-dev/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`](../vendor/modules/code-oss-dev/product.json)
|
||||
- [`src/vs/base/common/product.ts`](../vendor/modules/code-oss-dev/src/vs/base/common/product.ts)
|
||||
- [`src/vs/workbench/browser/parts/dialogs/dialogHandler.ts`](../vendor/modules/code-oss-dev/src/vs/workbench/browser/parts/dialogs/dialogHandler.ts)
|
||||
- [`src/vs/workbench/contrib/welcome/page/browser/vs_code_welcome_page.ts`](../vendor/modules/code-oss-dev/src/vs/workbench/contrib/welcome/page/browser/vs_code_welcome_page.ts)
|
||||
- [`src/vs/workbench/contrib/welcome/page/browser/welcomePage.ts`](../vendor/modules/code-oss-dev/src/vs/workbench/contrib/welcome/page/browser/welcomePage.ts)
|
||||
- Removing azure/macOS signing related dependencies from [`build/package.json`](../vendor/modules/code-oss-dev/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`](../vendor/modules/code-oss-dev/src/vs/base/common/ipc.d.ts) points to [`typings/ipc.d.ts`](../typings/ipc.d.ts)
|
||||
- [`src/vs/base/common/util.ts`](../vendor/modules/code-oss-dev/src/vs/base/common/util.ts) points to [`src/common/util.ts`](../src/common/util.ts)
|
||||
- [`src/vs/base/node/proxy_agent.ts`](../vendor/modules/code-oss-dev/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`](../vendor/modules/code-oss-dev/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`](../vendor/modules/code-oss-dev/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`](../vendor/modules/code-oss-dev/src/vs/workbench/browser/web.main.ts)
|
||||
- Added a (hopefully temporary) hotfix to [`src/vs/workbench/common/resources.ts`](../vendor/modules/code-oss-dev/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`](../vendor/modules/code-oss-dev/src/vs/platform/remote/common/remoteAgentConnection.ts)
|
||||
- Added `CODE_SERVER*` variables to the sanitization list in [`src/vs/base/common/processes.ts`](../vendor/modules/code-oss-dev/src/vs/base/common/processes.ts)
|
||||
- Fix localization support:
|
||||
- Added file [`src/vs/workbench/services/localizations/browser/localizationsService.ts`](../vendor/modules/code-oss-dev/src/vs/workbench/services/localizations/browser/localizationsService.ts).
|
||||
- Modified file [`src/vs/base/common/platform.ts`](../vendor/modules/code-oss-dev/src/vs/base/common/platform.ts)
|
||||
- Modified file [`src/vs/base/node/languagePacks.js`](../vendor/modules/code-oss-dev/src/vs/base/node/languagePacks.js)
|
||||
- Added code to allow server to inject settings to [`src/vs/platform/product/common/product.ts`](../vendor/modules/code-oss-dev/src/vs/platform/product/common/product.ts)
|
||||
- Extension fixes:
|
||||
- Avoid disabling extensions by extensionKind in [`src/vs/workbench/services/extensionManagement/browser/extensionEnablementService.ts`](../vendor/modules/code-oss-dev/src/vs/workbench/services/extensionManagement/browser/extensionEnablementService.ts) (Needed for vscode-icons)
|
||||
- Remove broken symlinks in [`extensions/postinstall.js`](../vendor/modules/code-oss-dev/extensions/postinstall.js)
|
||||
- Add tip about extension gallery in [`src/vs/workbench/contrib/extensions/browser/extensionsViewlet.ts`](../vendor/modules/code-oss-dev/src/vs/workbench/contrib/extensions/browser/extensionsViewlet.ts)
|
||||
- Use our own server for GitHub authentication in [`extensions/github-authentication/src/githubServer.ts`](../vendor/modules/code-oss-dev/extensions/github-authentication/src/githubServer.ts)
|
||||
- Settings persistence on the server in [`src/vs/workbench/services/environment/browser/environmentService.ts`](../vendor/modules/code-oss-dev/src/vs/workbench/services/environment/browser/environmentService.ts)
|
||||
- Add extension install fallback in [`src/vs/workbench/services/extensionManagement/common/extensionManagementService.ts`](../vendor/modules/code-oss-dev/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`](../vendor/modules/code-oss-dev/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`](../vendor/modules/code-oss-dev/build/lib/extensions.ts)
|
||||
- Allow all extensions to use proposed APIs in [`src/vs/workbench/services/environment/browser/environmentService.ts`](../vendor/modules/code-oss-dev/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`](../vendor/modules/code-oss-dev/src/vs/platform/storage/common/storage.ts)
|
||||
- Specify webview path in [`src/vs/code/browser/workbench/workbench.ts`](../vendor/modules/code-oss-dev/src/vs/code/browser/workbench/workbench.ts)
|
||||
- URL readability improvements for folder/workspace in [`src/vs/code/browser/workbench/workbench.ts`](../vendor/modules/code-oss-dev/src/vs/code/browser/workbench/workbench.ts)
|
||||
- Socket/Authority-related fixes (for remote proxying etc.):
|
||||
- [`src/vs/code/browser/workbench/workbench.ts`](../vendor/modules/code-oss-dev/src/vs/code/browser/workbench/workbench.ts)
|
||||
- [`src/vs/platform/remote/browser/browserSocketFactory.ts`](../vendor/modules/code-oss-dev/src/vs/platform/remote/browser/browserSocketFactory.ts)
|
||||
- [`src/vs/base/common/network.ts`](../vendor/modules/code-oss-dev/src/vs/base/common/network.ts)
|
||||
- Added code to write out IPC path in [`src/vs/workbench/api/node/extHostCLIServer.ts`](../vendor/modules/code-oss-dev/src/vs/workbench/api/node/extHostCLIServer.ts)
|
||||
Microsoft eventually made the server open source and we were able to reduce our
|
||||
changes significantly. Some time later we moved back to a submodule and patches
|
||||
(managed by `quilt` this time instead of the mega-patch).
|
||||
|
||||
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
|
||||
us to ensure that our changes are still applied and work as intended. In the future,
|
||||
we'd like to run VS Code unit tests against our builds to ensure that features
|
||||
work as expected.
|
||||
As the web portion of Code continues to mature, we'll be able to shrink and
|
||||
possibly eliminate our patches. In the meantime, upgrading the Code version
|
||||
requires us to ensure that our changes are still applied correctly and work as
|
||||
intended. In the future, we'd like to run Code unit tests against our builds to
|
||||
ensure that features work as expected.
|
||||
|
||||
> 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
|
||||
If the functionality you're working on does NOT depend on code from Code, please
|
||||
move it out and into code-server.
|
||||
|
||||
### Currently Known Issues
|
||||
|
||||
- Creating custom VS Code extensions and debugging them doesn't work
|
||||
- Creating custom Code extensions and debugging them doesn't work
|
||||
- Extension profiling and tips are currently disabled
|
||||
|
||||
75
docs/FAQ.md
75
docs/FAQ.md
@@ -26,7 +26,8 @@
|
||||
- [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)
|
||||
- [What's the difference between code-server and OpenVSCode-Server?](#whats-the-difference-between-code-server-and-openvscode-server)
|
||||
- [What's the difference between code-server and GitHub Codespaces?](#whats-the-difference-between-code-server-and-github-codespaces)
|
||||
- [Does code-server have any security login validation?](#does-code-server-have-any-security-login-validation)
|
||||
- [Are there community projects involving code-server?](#are-there-community-projects-involving-code-server)
|
||||
- [How do I change the port?](#how-do-i-change-the-port)
|
||||
@@ -36,7 +37,7 @@
|
||||
## Questions?
|
||||
|
||||
Please file all questions and support requests at
|
||||
<https://github.com/cdr/code-server/discussions>.
|
||||
<https://github.com/coder/code-server/discussions>.
|
||||
|
||||
## How should I expose code-server to the internet?
|
||||
|
||||
@@ -100,32 +101,28 @@ Service](https://cdn.vsassets.io/v/M146_20190123.39/_content/Microsoft-Visual-St
|
||||
> 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.
|
||||
Instead, we use the [Open-VSX extension gallery](https://open-vsx.org), which is also used by various other forks.
|
||||
It isn't perfect, but its getting better by the day with more and more extensions.
|
||||
|
||||
We also offer our own marketplace for open source extensions, but plan to
|
||||
deprecate it at a future date and completely migrate to Open-VSX.
|
||||
|
||||
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))
|
||||
[#33](https://github.com/coder/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)).
|
||||
([#1315](https://github.com/coder/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)
|
||||
To add an extension to Open-VSX, please see [open-vsx/publish-extensions](https://github.com/open-vsx/publish-extensions).
|
||||
We no longer plan to add new extensions to our legacy extension gallery.
|
||||
|
||||
## How do I install an extension?
|
||||
|
||||
@@ -158,20 +155,19 @@ You can also download extensions using the command line. For instance,
|
||||
downloading from 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>
|
||||
code-server --install-extension <extension id>
|
||||
```
|
||||
|
||||
## How do I use my own extensions marketplace?
|
||||
|
||||
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`.
|
||||
can point code-server to it by setting `$EXTENSIONS_GALLERY`.
|
||||
This corresponds directly with the `extensionsGallery` entry in in VS Code's `product.json`.
|
||||
|
||||
For example, to use [open-vsx.org](https://open-vsx.org), run:
|
||||
For example, to use the legacy Coder extensions marketplace:
|
||||
|
||||
```bash
|
||||
export SERVICE_URL=https://open-vsx.org/vscode/gallery
|
||||
export ITEM_URL=https://open-vsx.org/vscode/item
|
||||
export EXTENSIONS_GALLERY='{"serviceUrl": "https://extensions.coder.com/api"}'
|
||||
```
|
||||
|
||||
Though you can technically use Microsoft's marketplace in this manner, we
|
||||
@@ -226,7 +222,7 @@ You may have to give Node.js full disk access, since it doesn't implement any of
|
||||
Privacy** > **Privacy** > **Full Disk Access**. Then, click the 🔒 to unlock,
|
||||
click **+**, and select the Node.js binary you located in the previous step.
|
||||
|
||||
See [#2794](https://github.com/cdr/code-server/issues/2794) for additional context.
|
||||
See [#2794](https://github.com/coder/code-server/issues/2794) for additional context.
|
||||
|
||||
## How do I direct server-side requests through a proxy?
|
||||
|
||||
@@ -306,7 +302,7 @@ 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
|
||||
Eventually, [#1636](https://github.com/coder/code-server/issues/1636) will make
|
||||
this process better.
|
||||
|
||||
## How do I change the password?
|
||||
@@ -377,18 +373,31 @@ 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?
|
||||
## What's the difference between code-server and OpenVSCode-Server?
|
||||
|
||||
Both code-server and VS Code Codespaces allow you to access VS Code via a
|
||||
browser.
|
||||
code-server and OpenVSCode-Server both allow you to access VS Code via a
|
||||
browser. The two projects also use their own [forks of VS Code](https://github.com/coder/vscode) to
|
||||
leverage modern VS Code APIs and stay up to date with the upsteam version.
|
||||
|
||||
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.
|
||||
However, OpenVSCode-Server is scoped at only making VS Code available in the web browser.
|
||||
code-server includes some other features:
|
||||
|
||||
On the other hand, code-server is free, open-source, and can be run on any
|
||||
machine with few limitations.
|
||||
- password auth
|
||||
- proxy web ports
|
||||
- certificate support
|
||||
- plugin API
|
||||
- settings sync (coming soon)
|
||||
|
||||
For more details, see [this discussion post](https://github.com/coder/code-server/discussions/4267#discussioncomment-1411583).
|
||||
|
||||
## What's the difference between code-server and GitHub Codespaces?
|
||||
|
||||
Both code-server and GitHub Codespaces allow you to access VS Code via a
|
||||
browser. GitHub Codespaces, however, is a closed-source, paid service offered by
|
||||
GitHub and Microsoft.
|
||||
|
||||
On the other hand, code-server is self-hosted, free, open-source, and
|
||||
can be run on any machine with few limitations.
|
||||
|
||||
## Does code-server have any security login validation?
|
||||
|
||||
@@ -397,7 +406,7 @@ minute plus an additional twelve per hour.
|
||||
|
||||
## Are there community projects involving code-server?
|
||||
|
||||
Visit the [awesome-code-server](https://github.com/cdr/awesome-code-server)
|
||||
Visit the [awesome-code-server](https://github.com/coder/awesome-code-server)
|
||||
repository to view community projects and guides with code-server! Feel free to
|
||||
add your own!
|
||||
|
||||
|
||||
@@ -2,6 +2,9 @@
|
||||
<!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE -->
|
||||
# Maintaining
|
||||
|
||||
- [Team](#team)
|
||||
- [Onboarding](#onboarding)
|
||||
- [Offboarding](#offboarding)
|
||||
- [Workflow](#workflow)
|
||||
- [Milestones](#milestones)
|
||||
- [Triage](#triage)
|
||||
@@ -12,19 +15,44 @@
|
||||
- [Changelog](#changelog)
|
||||
- [Releases](#releases)
|
||||
- [Publishing a release](#publishing-a-release)
|
||||
- [AUR](#aur)
|
||||
- [Docker](#docker)
|
||||
- [Homebrew](#homebrew)
|
||||
- [npm](#npm)
|
||||
- [Syncing with upstream Code](#syncing-with-upstream-code)
|
||||
- [Testing](#testing)
|
||||
- [Documentation](#documentation)
|
||||
- [Troubleshooting](#troubleshooting)
|
||||
|
||||
<!-- END doctoc generated TOC please keep comment here to allow auto update -->
|
||||
|
||||
This document is meant to serve current and future maintainers of code-server,
|
||||
as well as share our workflow for maintaining the project.
|
||||
|
||||
## Team
|
||||
|
||||
Current maintainers:
|
||||
|
||||
- @code-asher
|
||||
- @oxy
|
||||
- @jsjoeio
|
||||
|
||||
This document is meant to serve current and future maintainers of code-server,
|
||||
as well as share our workflow for maintaining the project.
|
||||
Occasionally, other Coder employees may step in time to time to assist with code-server.
|
||||
|
||||
### Onboarding
|
||||
|
||||
To onboard a new maintainer to the project, please make sure to do the following:
|
||||
|
||||
- [ ] Add to [coder/code-server-reviewers](https://github.com/orgs/coder/teams/code-server-reviewers)
|
||||
- [ ] Add as Admin under [Repository Settings > Access](https://github.com/coder/code-server/settings/access)
|
||||
- [ ] Add to [npm Coder org](https://www.npmjs.com/org/coder)
|
||||
- [ ] Add as [AUR maintainer](https://aur.archlinux.org/packages/code-server/) (talk to Colin)
|
||||
- [ ] Introduce to community via Discussion (see [example](https://github.com/coder/code-server/discussions/3955))
|
||||
|
||||
### Offboarding
|
||||
|
||||
Very similar to Onboarding but Remove maintainer from all teams and revoke access. Please also do the following:
|
||||
|
||||
- [ ] Write farewell post via Discussion (see [example](https://github.com/coder/code-server/discussions/3933))
|
||||
|
||||
## Workflow
|
||||
|
||||
@@ -35,7 +63,7 @@ contributing on day one.
|
||||
### Milestones
|
||||
|
||||
We operate mainly using
|
||||
[milestones](https://github.com/cdr/code-server/milestones). This was heavily
|
||||
[milestones](https://github.com/coder/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:
|
||||
@@ -98,8 +126,7 @@ 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
|
||||
For most things, we recommend the **squash 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.
|
||||
|
||||
@@ -137,12 +164,14 @@ If you're the current release manager, follow these steps:
|
||||
|
||||
### Publishing a release
|
||||
|
||||
1. Create a new branch called `v0.0.0` (replace 0s with actual version aka v4.5.0)
|
||||
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.
|
||||
template with the updated version. Make sure to update the `CHANGELOG.md`.
|
||||
1. Bump chart version in `Chart.yaml`.
|
||||
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`
|
||||
@@ -156,16 +185,61 @@ If you're the current release manager, follow these steps:
|
||||
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).
|
||||
[coder/code-server-aur](https://github.com/coder/code-server-aur).
|
||||
1. Wait for the npm package to be published.
|
||||
|
||||
#### AUR
|
||||
|
||||
We publish to AUR as a package [here](https://aur.archlinux.org/packages/code-server/). This process is manual and can be done by following the steps in [this repo](https://github.com/coder/code-server-aur).
|
||||
|
||||
#### Docker
|
||||
|
||||
We publish code-server as a Docker image [here](https://registry.hub.docker.com/r/codercom/code-server), tagging it both with the version and latest.
|
||||
|
||||
This is currently automated with the release process.
|
||||
|
||||
#### Homebrew
|
||||
|
||||
We publish code-server on Homebrew [here](https://github.com/Homebrew/homebrew-core/blob/master/Formula/code-server.rb).
|
||||
|
||||
This is currently automated with the release process (but may fail occasionally). If it does, run this locally:
|
||||
|
||||
```shell
|
||||
# Replace VERSION with version
|
||||
brew bump-formula-pr --version="${VERSION}" code-server --no-browse --no-audit
|
||||
```
|
||||
|
||||
#### npm
|
||||
|
||||
We publish code-server as a npm package [here](https://www.npmjs.com/package/code-server/v/latest).
|
||||
|
||||
This is currently automated with the release process.
|
||||
|
||||
## Syncing with upstream Code
|
||||
|
||||
Refer to the [contributing docs](https://coder.com/docs/code-server/latest/CONTRIBUTING#version-updates-to-code) for information on how to update Code within code-server.
|
||||
|
||||
## Testing
|
||||
|
||||
Our testing structure is laid out under our [Contributing docs](https://coder.com/docs/code-server/latest/CONTRIBUTING#test).
|
||||
|
||||
We hope to eventually hit 100% test coverage with our unit tests, and maybe one day our scripts (coverage not tracked currently).
|
||||
|
||||
If you're ever looking to add more tests, here are a few ways to get started:
|
||||
|
||||
- run `yarn test:unit` and look at the coverage chart. You'll see all the uncovered lines. This is a good place to start.
|
||||
- look at `test/scripts` to see which scripts are tested. We can always use more tests there.
|
||||
- look at `test/e2e`. We can always use more end-to-end tests.
|
||||
|
||||
Otherwise, talk to a current maintainer and ask which part of the codebase is lacking most when it comes to tests.
|
||||
|
||||
## Documentation
|
||||
|
||||
### Troubleshooting
|
||||
|
||||
Our docs are hosted on [Vercel](https://vercel.com/). Vercel only shows logs in realtime, which means you need to have the logs open in one tab and reproduce your error in another tab. Since our logs are private to Coder the organization, you can only follow these steps if you're a Coder employee. Ask a maintainer for help if you need it.
|
||||
|
||||
Taking a real scenario, let's say you wanted to troubleshoot [this docs change](https://github.com/cdr/code-server/pull/4042). Here is how you would do it:
|
||||
Taking a real scenario, let's say you wanted to troubleshoot [this docs change](https://github.com/coder/code-server/pull/4042). Here is how you would do it:
|
||||
|
||||
1. Go to https://vercel.com/codercom/codercom
|
||||
2. Click "View Function Logs"
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
# 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.12.0/docs)
|
||||
[](https://github.com/coder/code-server/discussions) [](https://coder.com/community) [](https://twitter.com/coderhq) [](https://codecov.io/gh/coder/code-server) [](https://coder.com/docs/code-server/latest)
|
||||
|
||||
Run [VS Code](https://github.com/Microsoft/vscode) on any machine anywhere and
|
||||
access it in the browser.
|
||||
@@ -14,6 +14,10 @@ access it in the browser.
|
||||
- Preserve battery life when you're on the go; all intensive tasks run on your
|
||||
server
|
||||
|
||||
> **Note**
|
||||
> To manage multiple IDEs, workspaces, and teams, see
|
||||
> our new project: [coder/coder](http://cdr.co/coder-github)
|
||||
|
||||
## Requirements
|
||||
|
||||
See [requirements](requirements.md) for minimum specs, as well as instructions
|
||||
@@ -26,13 +30,13 @@ on how to set up a Google VM on which you can install code-server.
|
||||
There are three ways to get started:
|
||||
|
||||
1. Using the [install
|
||||
script](https://github.com/cdr/code-server/blob/main/install.sh), which
|
||||
script](https://github.com/coder/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/latest/install)
|
||||
3. Using our one-click buttons and guides to [deploy code-server to a cloud
|
||||
provider](https://github.com/cdr/deploy-code-server) ⚡
|
||||
provider](https://github.com/coder/deploy-code-server) ⚡
|
||||
|
||||
If you use the install script, you can preview what occurs during the install
|
||||
process:
|
||||
@@ -53,10 +57,6 @@ code-server.
|
||||
We also have an in-depth [setup and
|
||||
configuration](https://coder.com/docs/code-server/latest/guide) guide.
|
||||
|
||||
## TLS and authentication (beta)
|
||||
|
||||
To add TLS and authentication out of the box, use [code-server --link](https://coder.com/docs/code-server/latest/link).
|
||||
|
||||
## Questions?
|
||||
|
||||
See answers to [frequently asked
|
||||
|
||||
@@ -26,9 +26,9 @@ We use the following tools to help us stay on top of vulnerability mitigation.
|
||||
|
||||
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 |
|
||||
| ----------------------------------------------------- | ------------------ |
|
||||
| [Latest](https://github.com/cdr/code-server/releases) | :white_check_mark: |
|
||||
| Version | Supported |
|
||||
| ------------------------------------------------------- | ------------------ |
|
||||
| [Latest](https://github.com/coder/code-server/releases) | :white_check_mark: |
|
||||
|
||||
## Reporting a Vulnerability
|
||||
|
||||
|
||||
23
docs/android.md
Normal file
23
docs/android.md
Normal file
@@ -0,0 +1,23 @@
|
||||
# Running code-server using UserLAnd
|
||||
|
||||
1. Install UserLAnd from [Google Play](https://play.google.com/store/apps/details?id=tech.ula&hl=en_US&gl=US)
|
||||
2. Install an Ubuntu VM
|
||||
3. Start app
|
||||
4. Install Node.js, `curl` and `yarn` using `sudo apt install nodejs npm yarn curl -y`
|
||||
5. Install `nvm`:
|
||||
|
||||
```shell
|
||||
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.0/install.sh | bash
|
||||
```
|
||||
|
||||
6. Exit the terminal using `exit` and then reopen the terminal
|
||||
7. Install and use Node.js 16:
|
||||
|
||||
```shell
|
||||
nvm install 16
|
||||
nvm use 16
|
||||
```
|
||||
|
||||
8. Install code-server globally on device with: `npm i -g code-server`
|
||||
9. Run code-server with `code-server`
|
||||
10. Access on localhost:8080 in your browser
|
||||
@@ -30,15 +30,19 @@ SERVICE_URL=https://open-vsx.org/vscode/gallery \
|
||||
|
||||
As `code-server` is based on VS Code, you can follow the steps described on Duckly's [Pair programming with VS Code](https://duckly.com/tools/vscode) page and skip the installation step.
|
||||
|
||||
## Code sharing with CodeTogether
|
||||
## Code sharing using CodeTogether
|
||||
|
||||
[CodeTogether](https://www.codetogether.com/) is another service with cross-platform live collaborative features:
|
||||
[CodeTogether](https://www.codetogether.com/) is a real-time cross-IDE replacement for Microsoft Live Share providing:
|
||||
|
||||
- Sharing ports,
|
||||
- Sharing, read/write terminals,
|
||||
- Joining via web browser or another IDE.
|
||||
|
||||
However, some of these are [paid options](https://www.codetogether.com/pricing/).
|
||||
- Cross-IDE support - between VS Code, Eclipse, IntelliJ and IDEs based on them (browser or desktop)
|
||||
- Real-time editing - shared or individual cursors for pairing, mobbing, swarming, or whatever
|
||||
- P2P encrypted - servers can't decrypt the traffic ([Security Details](https://codetogether.com/download/security/))
|
||||
- SaaS or [On-premises](https://codetogether.com/on-premises/) options
|
||||
- Shared servers, terminals, and consoles
|
||||
- Unit Testing - with support for Red, Green, Refactor TDD
|
||||
- Joining via a web browser or your preferred IDE
|
||||
- Free unlimited 1 hour sessions with 4 participants
|
||||
- Multiple plans including [free or paid options](https://www.codetogether.com/pricing/)
|
||||
|
||||
### Installing the CodeTogether extension
|
||||
|
||||
@@ -56,6 +60,6 @@ However, some of these are [paid options](https://www.codetogether.com/pricing/)
|
||||
code-server --enable-proposed-api genuitecllc.codetogether
|
||||
```
|
||||
|
||||
Another option would be to add a value in code-server's [config file](https://coder.com/docs/code-server/v3.12.0/FAQ#how-does-the-config-file-work).
|
||||
Another option would be to add a value in code-server's [config file](https://coder.com/docs/code-server/v4.5.0/FAQ#how-does-the-config-file-work).
|
||||
|
||||
3. Refresh code-server and navigate to the CodeTogether icon in the sidebar to host or join a coding session.
|
||||
|
||||
421
docs/guide.md
421
docs/guide.md
@@ -1,396 +1,5 @@
|
||||
<!-- START doctoc generated TOC please keep comment here to allow auto update -->
|
||||
<!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE -->
|
||||
# Setup Guide
|
||||
|
||||
- [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 and self-signed certificates](#https-and-self-signed-certificates)
|
||||
- [Accessing web services](#accessing-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)
|
||||
- [Proxying to a Vue app](#proxying-to-a-vue-app)
|
||||
- [Setup Guide](#setup-guide)
|
||||
- [Expose code-server](#expose-code-server-1)
|
||||
- [Port forwarding via SSH](#port-forwarding-via-ssh-1)
|
||||
- [Using Let's Encrypt with Caddy](#using-lets-encrypt-with-caddy-1)
|
||||
- [Using Let's Encrypt with NGINX](#using-lets-encrypt-with-nginx-1)
|
||||
- [Using a self-signed certificate](#using-a-self-signed-certificate-1)
|
||||
- [External authentication](#external-authentication-1)
|
||||
- [HTTPS and self-signed certificates](#https-and-self-signed-certificates-1)
|
||||
- [Accessing web services](#accessing-web-services-1)
|
||||
- [Using a subdomain](#using-a-subdomain-1)
|
||||
- [Using a subpath](#using-a-subpath-1)
|
||||
- [Stripping `/proxy/<port>` from the request path](#stripping-proxyport-from-the-request-path-1)
|
||||
- [Proxying to create a React app](#proxying-to-create-a-react-app-1)
|
||||
- [Proxying to a Vue app](#proxying-to-a-vue-app-1)
|
||||
- [SSH into code-server on VS Code](#ssh-into-code-server-on-vs-code)
|
||||
- [Option 1: cloudflared tunnel](#option-1-cloudflared-tunnel)
|
||||
- [Option 2: ngrok tunnel](#option-2-ngrok-tunnel)
|
||||
|
||||
<!-- END doctoc generated TOC please keep comment here to allow auto update -->
|
||||
|
||||
This article will walk you through exposing code-server securely once you've
|
||||
completed the [installation process](install.md).
|
||||
|
||||
## Expose code-server
|
||||
|
||||
**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.
|
||||
|
||||
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.
|
||||
|
||||
> **Rate limits:** code-server rate limits password authentication attempts to
|
||||
> two per minute plus an additional twelve per hour.
|
||||
|
||||
There are several approaches to operating and exposing code-server securely:
|
||||
|
||||
- Port forwarding via SSH
|
||||
- Using Let's Encrypt with Caddy
|
||||
- Using Let's Encrypt with NGINX
|
||||
- Using a self-signed certificate
|
||||
|
||||
### Port forwarding via SSH
|
||||
|
||||
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.
|
||||
|
||||
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.
|
||||
|
||||
> To work properly, your environment should have WebSockets enabled, which
|
||||
> code-server uses to communicate between the browser and server.
|
||||
|
||||
1. SSH into your instance and edit the code-server config file to disable
|
||||
password authentication:
|
||||
|
||||
```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
|
||||
```
|
||||
|
||||
2. Restart code-server:
|
||||
|
||||
```console
|
||||
sudo systemctl restart code-server@$USER
|
||||
```
|
||||
|
||||
3. Forward local port `8080` to `127.0.0.1:8080` on the remote instance by running the following command on your local machine:
|
||||
|
||||
```console
|
||||
# -N disables executing a remote shell
|
||||
ssh -N -L 8080:127.0.0.1:8080 [user]@<instance-ip>
|
||||
```
|
||||
|
||||
4. At this point, you can access code-server by pointing your web browser to `http://127.0.0.1:8080`.
|
||||
|
||||
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:
|
||||
|
||||
```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
|
||||
```
|
||||
|
||||
6. Optional, but highly recommended: add the following to `~/.ssh/config` so
|
||||
that you can detect bricked SSH connections:
|
||||
|
||||
```bash
|
||||
Host *
|
||||
ServerAliveInterval 5
|
||||
ExitOnForwardFailure yes
|
||||
```
|
||||
|
||||
> 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.
|
||||
|
||||
### Using Let's Encrypt with Caddy
|
||||
|
||||
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.
|
||||
|
||||
1. This option requires that the remote machine be exposed to the internet. Make sure that your instance allows HTTP/HTTP traffic.
|
||||
|
||||
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.
|
||||
|
||||
1. Install [Caddy](https://caddyserver.com/docs/download#debian-ubuntu-raspbian):
|
||||
|
||||
```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
|
||||
sudo apt update
|
||||
sudo apt install caddy
|
||||
```
|
||||
|
||||
1. Replace `/etc/caddy/Caddyfile` using `sudo` so that the file looks like this:
|
||||
|
||||
```text
|
||||
mydomain.com
|
||||
|
||||
reverse_proxy 127.0.0.1:8080
|
||||
```
|
||||
|
||||
If you want to serve code-server from a sub-path, you can do so as follows:
|
||||
|
||||
```text
|
||||
mydomain.com/code/* {
|
||||
uri strip_prefix /code
|
||||
reverse_proxy 127.0.0.1:8080
|
||||
}
|
||||
```
|
||||
|
||||
Remember to replace `mydomain.com` with your domain name!
|
||||
|
||||
1. Reload Caddy:
|
||||
|
||||
```console
|
||||
sudo systemctl reload caddy
|
||||
```
|
||||
|
||||
At this point, you should be able to access code-server via
|
||||
`https://mydomain.com`.
|
||||
|
||||
### Using Let's Encrypt with NGINX
|
||||
|
||||
1. This option requires that the remote machine be exposed to the internet. Make sure that your instance allows HTTP/HTTP traffic.
|
||||
|
||||
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.
|
||||
|
||||
1. Install NGINX:
|
||||
|
||||
```bash
|
||||
sudo apt update
|
||||
sudo apt install -y nginx certbot python3-certbot-nginx
|
||||
```
|
||||
|
||||
1. Update `/etc/nginx/sites-available/code-server` using sudo with the following
|
||||
configuration:
|
||||
|
||||
```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;
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
Be sure to replace `mydomain.com` with your domain name!
|
||||
|
||||
1. Enable the config:
|
||||
|
||||
```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
|
||||
```
|
||||
|
||||
Be sure to replace `me@example.com` with your actual email.
|
||||
|
||||
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 and self-signed certificates
|
||||
|
||||
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.
|
||||
|
||||
## Accessing web services
|
||||
|
||||
If you're working on web services 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.
|
||||
|
||||
### Using a subdomain
|
||||
|
||||
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).
|
||||
|
||||
You should also set up TLS certificates for these subdomains, either using a
|
||||
wildcard certificate for `*.<domain>` or individual certificates for each port.
|
||||
|
||||
To set your domain, start code-server with the `--proxy-domain` flag:
|
||||
|
||||
```console
|
||||
code-server --proxy-domain <domain>
|
||||
```
|
||||
|
||||
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.
|
||||
|
||||
### 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
|
||||
```
|
||||
|
||||
You should then be able to visit `https://my-code-server-address.io/absproxy/3000` to see your app exposed through
|
||||
code-server!
|
||||
|
||||
> We highly recommend using the subdomain approach instead to avoid this class of issue.
|
||||
|
||||
### Proxying to a Vue app
|
||||
|
||||
Similar to the situation with React apps, you have to make a few modifications to proxy a Vue app.
|
||||
|
||||
1. add `vue.config.js`
|
||||
2. update the values to match this (you can use any free port):
|
||||
|
||||
```js
|
||||
module.exports = {
|
||||
devServer: {
|
||||
port: 3454,
|
||||
sockPath: "sockjs-node",
|
||||
},
|
||||
publicPath: "/absproxy/3454",
|
||||
}
|
||||
```
|
||||
|
||||
3. access app at `<code-server-root>/absproxy/3454` e.g. `http://localhost:8080/absproxy/3454`
|
||||
|
||||
Read more about `publicPath` in the [Vue.js docs](https://cli.vuejs.org/config/#publicpath)
|
||||
|
||||
<!-- START doctoc generated TOC please keep comment here to allow auto update -->
|
||||
<!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE -->
|
||||
|
||||
# Setup Guide
|
||||
|
||||
- [Expose code-server](#expose-code-server)
|
||||
@@ -398,6 +7,7 @@ Read more about `publicPath` in the [Vue.js docs](https://cli.vuejs.org/config/#
|
||||
- [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)
|
||||
- [TLS 1.3 and Safari](#tls-13-and-safari)
|
||||
- [External authentication](#external-authentication)
|
||||
- [HTTPS and self-signed certificates](#https-and-self-signed-certificates)
|
||||
- [Accessing web services](#accessing-web-services)
|
||||
@@ -442,7 +52,7 @@ There are several approaches to operating and exposing code-server securely:
|
||||
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.
|
||||
doesn't require any additional setup at all.
|
||||
|
||||
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,
|
||||
@@ -505,7 +115,7 @@ we recommend using another method, such as [Let's Encrypt](#let-encrypt) instead
|
||||
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.
|
||||
|
||||
1. This option requires that the remote machine be exposed to the internet. Make sure that your instance allows HTTP/HTTP traffic.
|
||||
1. This option requires that the remote machine be exposed to the internet. Make sure that your instance allows HTTP/HTTPS traffic.
|
||||
|
||||
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
|
||||
@@ -516,8 +126,8 @@ access code-server on an iPad or do not want to use SSH port forwarding.
|
||||
|
||||
```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
|
||||
curl -1sLf 'https://dl.cloudsmith.io/public/caddy/stable/gpg.key' | sudo apt-key add -
|
||||
curl -1sLf 'https://dl.cloudsmith.io/public/caddy/stable/debian.deb.txt' | sudo tee /etc/apt/sources.list.d/caddy-stable.list
|
||||
sudo apt update
|
||||
sudo apt install caddy
|
||||
```
|
||||
@@ -536,7 +146,7 @@ sudo apt install caddy
|
||||
mydomain.com/code/* {
|
||||
uri strip_prefix /code
|
||||
reverse_proxy 127.0.0.1:8080
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
Remember to replace `mydomain.com` with your domain name!
|
||||
@@ -552,7 +162,7 @@ At this point, you should be able to access code-server via
|
||||
|
||||
### Using Let's Encrypt with NGINX
|
||||
|
||||
1. This option requires that the remote machine be exposed to the internet. Make sure that your instance allows HTTP/HTTP traffic.
|
||||
1. This option requires that the remote machine be exposed to the internet. Make sure that your instance allows HTTP/HTTPS traffic.
|
||||
|
||||
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
|
||||
@@ -619,7 +229,7 @@ code-server. You should only proceed with this option if:
|
||||
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.
|
||||
sure that your instance allows HTTP/HTTPS traffic.
|
||||
|
||||
1. SSH into your instance and edit your code-server config file to use a
|
||||
randomly generated self-signed certificate:
|
||||
@@ -647,6 +257,13 @@ 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.
|
||||
|
||||
### TLS 1.3 and Safari
|
||||
|
||||
If you will be using Safari and your configuration does not allow anything less
|
||||
than TLS 1.3 you will need to add support for TLS 1.2 since Safari does not
|
||||
support TLS 1.3 for web sockets at the time of writing. If this is the case you
|
||||
should see OSSStatus: 9836 in the browser console.
|
||||
|
||||
## External authentication
|
||||
|
||||
If you want to use external authentication mechanism (e.g., Sign in with
|
||||
@@ -677,7 +294,7 @@ Note: if you set `proxy_set_header Host $host;` in your reverse proxy config, it
|
||||
|
||||
## Accessing web services
|
||||
|
||||
If you're working on web services and want to access it locally, code-server
|
||||
If you're working on web services and want to access them 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.
|
||||
|
||||
@@ -728,8 +345,8 @@ 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).
|
||||
[#2565](https://github.com/coder/code-server/issues/2565) and
|
||||
[#2222](https://github.com/coder/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`:
|
||||
|
||||
@@ -779,7 +396,7 @@ sudo apt update
|
||||
sudo apt install wget unzip openssh-server
|
||||
```
|
||||
|
||||
2. Start the SSH server and set the password for your user, if you haven't already. If you use [deploy-code-server](https://github.com/cdr/deploy-code-server),
|
||||
2. Start the SSH server and set the password for your user, if you haven't already. If you use [deploy-code-server](https://github.com/coder/deploy-code-server),
|
||||
|
||||
```bash
|
||||
sudo service ssh start
|
||||
|
||||
10
docs/helm.md
10
docs/helm.md
@@ -1,8 +1,8 @@
|
||||
# code-server Helm Chart
|
||||
|
||||
[](https://img.shields.io/badge/Version-1.0.0-informational?style=flat-square) [](https://img.shields.io/badge/Type-application-informational?style=flat-square) [](https://img.shields.io/badge/AppVersion-3.12.0-informational?style=flat-square)
|
||||
[](https://img.shields.io/badge/Version-1.0.0-informational?style=flat-square) [](https://img.shields.io/badge/Type-application-informational?style=flat-square) [](https://img.shields.io/badge/AppVersion-4.5.0-informational?style=flat-square)
|
||||
|
||||
[code-server](https://github.com/cdr/code-server) code-server is VS Code running
|
||||
[code-server](https://github.com/coder/code-server) code-server is VS Code running
|
||||
on a remote server, accessible through the browser.
|
||||
|
||||
This chart is community maintained by [@Matthew-Beckett](https://github.com/Matthew-Beckett) and [@alexgorbatchev](https://github.com/alexgorbatchev)
|
||||
@@ -10,7 +10,7 @@ This chart is community maintained by [@Matthew-Beckett](https://github.com/Matt
|
||||
## Quickstart
|
||||
|
||||
```console
|
||||
$ git clone https://github.com/cdr/code-server
|
||||
$ git clone https://github.com/coder/code-server
|
||||
$ cd code-server
|
||||
$ helm upgrade --install code-server ci/helm-chart
|
||||
```
|
||||
@@ -30,7 +30,7 @@ package manager.
|
||||
To install the chart with the release name `code-server`:
|
||||
|
||||
```console
|
||||
$ git clone https://github.com/cdr/code-server
|
||||
$ git clone https://github.com/coder/code-server
|
||||
$ cd code-server
|
||||
$ helm upgrade --install code-server ci/helm-chart
|
||||
```
|
||||
@@ -73,7 +73,7 @@ and their default values.
|
||||
| hostnameOverride | string | `""` |
|
||||
| image.pullPolicy | string | `"Always"` |
|
||||
| image.repository | string | `"codercom/code-server"` |
|
||||
| image.tag | string | `"3.12.0"` |
|
||||
| image.tag | string | `"4.5.0"` |
|
||||
| imagePullSecrets | list | `[]` |
|
||||
| ingress.enabled | bool | `false` |
|
||||
| nameOverride | string | `""` |
|
||||
|
||||
@@ -30,7 +30,7 @@ operating systems.
|
||||
## install.sh
|
||||
|
||||
The easiest way to install code-server is to use our [install
|
||||
script](../install.sh) for Linux, macOS and FreeBSD. The install script
|
||||
script](https://github.com/coder/code-server/blob/main/install.sh) for Linux, macOS and FreeBSD. The install script
|
||||
[attempts to use the system package manager](#detection-reference) if possible.
|
||||
|
||||
You can preview what occurs during the install process:
|
||||
@@ -67,7 +67,7 @@ code-server.
|
||||
|
||||
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
|
||||
information on how to do this. The [`install.sh`](https://github.com/coder/code-server/blob/main/install.sh) script runs the
|
||||
_exact_ same commands presented in the rest of this document.
|
||||
|
||||
### Detection reference
|
||||
@@ -104,7 +104,7 @@ We recommend installing with `yarn` or `npm` when:
|
||||
1. You're on Linux with `glibc` < v2.17, `glibcxx` < v3.4.18 on `amd64`, `glibc`
|
||||
< v2.23, or `glibcxx` < v3.4.21 on `arm64`.
|
||||
1. You're running Alpine Linux or are using a non-glibc libc. See
|
||||
[#1430](https://github.com/cdr/code-server/issues/1430#issuecomment-629883198)
|
||||
[#1430](https://github.com/coder/code-server/issues/1430#issuecomment-629883198)
|
||||
for more information.
|
||||
|
||||
Installing code-server with `yarn` or `npm` builds native modules on install.
|
||||
@@ -114,7 +114,7 @@ This process requires C dependencies; see our guide on [installing with yarn and
|
||||
## 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
|
||||
[GitHub](https://github.com/coder/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
|
||||
@@ -127,7 +127,7 @@ requirement).
|
||||
To use a standalone release:
|
||||
|
||||
1. Download the latest release archive for your system from
|
||||
[GitHub](https://github.com/cdr/code-server/releases).
|
||||
[GitHub](https://github.com/coder/code-server/releases).
|
||||
2. Unpack the release.
|
||||
3. Run code-server by executing `./bin/code-server`.
|
||||
|
||||
@@ -139,7 +139,7 @@ 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 \
|
||||
curl -fL https://github.com/coder/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
|
||||
@@ -154,7 +154,7 @@ code-server
|
||||
> 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
|
||||
curl -fOL https://github.com/coder/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
|
||||
@@ -166,7 +166,7 @@ sudo systemctl enable --now code-server@$USER
|
||||
> with yarn](#yarn-npm).
|
||||
|
||||
```bash
|
||||
curl -fOL https://github.com/cdr/code-server/releases/download/v$VERSION/code-server-$VERSION-amd64.rpm
|
||||
curl -fOL https://github.com/coder/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
|
||||
@@ -228,9 +228,9 @@ You can install code-server using the [Helm package manager](https://coder.com/d
|
||||
|
||||
## Windows
|
||||
|
||||
We currently [do not publish Windows releases](https://github.com/cdr/code-server/issues/1397). We recommend installing code-server onto Windows with [`yarn` or `npm`](#yarn-npm).
|
||||
We currently [do not publish Windows releases](https://github.com/coder/code-server/issues/1397). We recommend installing code-server onto Windows with [`yarn` or `npm`](#yarn-npm).
|
||||
|
||||
> Note: You will also need to [build cdr/cloud-agent manually](https://github.com/cdr/cloud-agent/issues/17) if you would like to use `code-server --link` on Windows.
|
||||
> Note: You will also need to [build coder/cloud-agent manually](https://github.com/coder/cloud-agent/issues/17) if you would like to use `code-server --link` on Windows.
|
||||
|
||||
## Raspberry Pi
|
||||
|
||||
@@ -245,7 +245,7 @@ information.
|
||||
## Cloud providers
|
||||
|
||||
We maintain [one-click apps and install scripts for cloud
|
||||
providers](https://github.com/cdr/deploy-code-server) such as DigitalOcean,
|
||||
providers](https://github.com/coder/deploy-code-server) such as DigitalOcean,
|
||||
Railway, Heroku, and Azure.
|
||||
|
||||
## Uninstall
|
||||
|
||||
9
docs/ios.md
Normal file
9
docs/ios.md
Normal file
@@ -0,0 +1,9 @@
|
||||
# Using code-server on iOS with iSH
|
||||
|
||||
1. Install iSH from the [App Store](https://apps.apple.com/us/app/ish-shell/id1436902243)
|
||||
2. Install `curl` and `nano` with `apk add curl nano`
|
||||
3. Configure iSH to use an earlier version of NodeJS with `nano /etc/apk/repositories` and edit `v3.14` to `v3.12` on both repository links.
|
||||
4. Install `nodejs` and `npm` with `apk add nodejs npm`
|
||||
5. Install code-server with `curl -fsSL https://code-server.dev/install.sh | sh`
|
||||
6. Run code-server with `code-server`
|
||||
7. Access on localhost:8080 in your browser
|
||||
118
docs/ipad.md
118
docs/ipad.md
@@ -3,14 +3,14 @@
|
||||
# iPad
|
||||
|
||||
- [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)
|
||||
- [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)
|
||||
- [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)
|
||||
|
||||
<!-- END doctoc generated TOC please keep comment here to allow auto update -->
|
||||
|
||||
@@ -45,51 +45,6 @@ can add this to `keybindings.json`:
|
||||
|
||||
4. Test the command by using `cmd+w` to close an active file.
|
||||
|
||||
## Access code-server with a self-signed certificate on an iPad
|
||||
|
||||
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).
|
||||
|
||||
### Certificate requirements
|
||||
|
||||
- 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`.
|
||||
|
||||
### 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
|
||||
not allow WebSockets connections.
|
||||
|
||||
## Access code-server using Servediter
|
||||
|
||||
If you are unable to get the self-signed certificate working, or you do not have a domain
|
||||
@@ -149,30 +104,26 @@ and tricks helpful:
|
||||
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)
|
||||
[#979](https://github.com/coder/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
|
||||
- Trackpad scrolling does not work on iPadOS < 14.5
|
||||
([#1455](https://github.com/coder/code-server/issues/1455))
|
||||
- [WebKit fix](https://bugs.webkit.org/show_bug.cgi?id=210071#c13)
|
||||
- Keyboard may lose focus in Safari / split view [#4182](https://github.com/coder/code-server/issues/4182)
|
||||
- Terminal text does not appear by default [#3824](https://github.com/coder/code-server/issues/3824)
|
||||
- Copy & paste in terminal does not work well with keyboard shortcuts [#3491](https://github.com/coder/code-server/issues/3491)
|
||||
- `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)
|
||||
|
||||
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)
|
||||
Additionally, see [issues in the code-server repo that are tagged with the `os-ios`
|
||||
label](https://github.com/coder/code-server/issues?q=is%3Aopen+is%3Aissue+label%3Aos-ios)
|
||||
for more information.
|
||||
|
||||
### Workaround for issue with `ctrl+c` not stopping a running process in the terminal
|
||||
@@ -199,3 +150,48 @@ In the meantime, you can manually define a shortcut as a workaround:
|
||||
```
|
||||
|
||||
_Source: [StackOverflow](https://stackoverflow.com/a/52735954/3015595)_
|
||||
|
||||
## Access code-server with a self-signed certificate on an iPad
|
||||
|
||||
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).
|
||||
|
||||
### Certificate requirements
|
||||
|
||||
- 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`.
|
||||
|
||||
### 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
|
||||
not allow WebSockets connections.
|
||||
|
||||
@@ -1,9 +1,11 @@
|
||||
# code-server --link
|
||||
|
||||
Run code-server with the beta flag `--link` and you'll get TLS, authentication, and a dedicated URL
|
||||
> Note: This feature is no longer recommended due to instability. Stay tuned for a revised version.
|
||||
|
||||
Run code-server with the flag `--link` and you'll get TLS, authentication, and a dedicated URL
|
||||
for accessing your IDE out of the box.
|
||||
|
||||
```console
|
||||
$ code-server --link
|
||||
Proxying code-server, you can access your IDE at https://example.cdr.co
|
||||
Proxying code-server, you can access your IDE at https://example.coder.co
|
||||
```
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
{
|
||||
"versions": ["v3.12.0"],
|
||||
"versions": ["v4.5.0"],
|
||||
"routes": [
|
||||
{
|
||||
"title": "Home",
|
||||
@@ -51,6 +51,16 @@
|
||||
"title": "Termux",
|
||||
"description": "How to install Termux to run code-server on an Android device.",
|
||||
"path": "./termux.md"
|
||||
},
|
||||
{
|
||||
"title": "iOS",
|
||||
"description": "How to use code-server on iOS with iSH.",
|
||||
"path": "./ios.md"
|
||||
},
|
||||
{
|
||||
"title": "Android",
|
||||
"description": "How to run code-server on an Android device using UserLAnd.",
|
||||
"path": "./android.md"
|
||||
}
|
||||
]
|
||||
},
|
||||
@@ -63,7 +73,7 @@
|
||||
{
|
||||
"title": "Upgrade",
|
||||
"description": "How to upgrade code-server.",
|
||||
"icon": "<svg width=\"20\" height=\"20\" viewBox=\"0 0 20 20\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\"><path d=\"M17.8049 2.19795C17.7385 2.1311 17.6587 2.07899 17.5708 2.04504C17.4829 2.01108 17.3889 1.99604 17.2948 2.00089C7.89216 2.49153 4.4188 10.8673 4.38528 10.9517C4.33624 11.0736 4.32406 11.2071 4.35028 11.3358C4.3765 11.4645 4.43995 11.5827 4.53274 11.6756L8.32449 15.4674C8.41787 15.5606 8.53669 15.6242 8.66606 15.6502C8.79543 15.6762 8.92959 15.6634 9.05174 15.6135C9.13552 15.5793 17.4664 12.0671 17.9986 2.7087C18.0039 2.61474 17.9895 2.5207 17.9561 2.4327C17.9227 2.3447 17.8712 2.26471 17.8049 2.19795ZM12.3314 9.56427C12.1439 9.75179 11.9051 9.87951 11.645 9.93126C11.385 9.98302 11.1154 9.9565 10.8704 9.85505C10.6254 9.7536 10.4161 9.58178 10.2687 9.36131C10.1214 9.14085 10.0428 8.88166 10.0428 8.6165C10.0428 8.35135 10.1214 8.09215 10.2687 7.87169C10.4161 7.65123 10.6254 7.47941 10.8704 7.37796C11.1154 7.27651 11.385 7.24998 11.645 7.30174C11.9051 7.3535 12.1439 7.48121 12.3314 7.66873C12.5827 7.92012 12.7239 8.26104 12.7239 8.6165C12.7239 8.97197 12.5827 9.31288 12.3314 9.56427Z\"/><path d=\"M2.74602 14.5444C2.92281 14.3664 3.133 14.2251 3.36454 14.1285C3.59608 14.0319 3.8444 13.9819 4.09529 13.9815C4.34617 13.9811 4.59466 14.0302 4.82653 14.126C5.05839 14.2218 5.26907 14.3624 5.44647 14.5398C5.62386 14.7172 5.7645 14.9279 5.86031 15.1598C5.95612 15.3916 6.00522 15.6401 6.00479 15.891C6.00437 16.1419 5.95442 16.3902 5.85782 16.6218C5.76122 16.8533 5.61987 17.0635 5.44186 17.2403C4.69719 17.985 2 18.0004 2 18.0004C2 18.0004 2 15.2884 2.74602 14.5444Z\"/><path d=\"M8.9416 3.48269C7.99688 3.31826 7.02645 3.38371 6.11237 3.67352C5.19828 3.96332 4.36741 4.46894 3.68999 5.14765C3.33153 5.50944 3.01988 5.91477 2.76233 6.35415C2.68692 6.4822 2.6562 6.63169 2.67501 6.77911C2.69381 6.92652 2.76108 7.06351 2.86623 7.16853L4.1994 8.50238C5.43822 6.53634 7.04911 4.83119 8.9416 3.48269Z\"/><path d=\"M16.5181 11.0585C16.6825 12.0033 16.6171 12.9737 16.3273 13.8878C16.0375 14.8019 15.5318 15.6327 14.8531 16.3101C14.4914 16.6686 14.086 16.9803 13.6466 17.2378C13.5186 17.3132 13.3691 17.3439 13.2217 17.3251C13.0743 17.3063 12.9373 17.2391 12.8323 17.1339L11.4984 15.8007C13.4645 14.5619 15.1696 12.951 16.5181 11.0585Z\"/></svg>",
|
||||
"icon": "<svg width=\"20\" height=\"20\" viewBox=\"0 0 20 20\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\"><path d=\"M17.8049 2.19795C17.7385 2.1311 17.6587 2.07899 17.5708 2.04504C17.4829 2.01108 17.3889 1.99604 17.2948 2.00089C7.89216 2.49153 4.4188 10.8673 4.38528 10.9517C4.33624 11.0736 4.32406 11.2071 4.5.028 11.3358C4.3765 11.4645 4.43995 11.5827 4.53274 11.6756L8.32449 15.4674C8.41787 15.5606 8.53669 15.6242 8.66606 15.6502C8.79543 15.6762 8.92959 15.6634 9.05174 15.6135C9.13552 15.5793 17.4664 12.0671 17.9986 2.7087C18.0039 2.61474 17.9895 2.5207 17.9561 2.4327C17.9227 2.3447 17.8712 2.26471 17.8049 2.19795ZM12.3314 9.56427C12.1439 9.75179 11.9051 9.87951 11.645 9.93126C11.385 9.98302 11.1154 9.9565 10.8704 9.85505C10.6254 9.7536 10.4161 9.58178 10.2687 9.36131C10.1214 9.14085 10.0428 8.88166 10.0428 8.6165C10.0428 8.35135 10.1214 8.09215 10.2687 7.87169C10.4161 7.65123 10.6254 7.47941 10.8704 7.37796C11.1154 7.27651 11.385 7.24998 11.645 7.30174C11.9051 7.3535 12.1439 7.48121 12.3314 7.66873C12.5827 7.92012 12.7239 8.26104 12.7239 8.6165C12.7239 8.97197 12.5827 9.31288 12.3314 9.56427Z\"/><path d=\"M2.74602 14.5444C2.92281 14.3664 3.133 14.2251 3.36454 14.1285C3.59608 14.0319 3.8444 13.9819 4.09529 13.9815C4.34617 13.9811 4.59466 14.0.12 4.82653 14.126C5.05839 14.2218 5.26907 14.3624 5.44647 14.5398C5.62386 14.7172 5.7645 14.9279 5.86031 15.1598C5.95612 15.3916 6.00522 15.6401 6.00479 15.891C6.00437 16.1419 5.95442 16.3902 5.85782 16.6218C5.76122 16.8533 5.61987 17.0635 5.44186 17.2403C4.69719 17.985 2 18.0004 2 18.0004C2 18.0004 2 15.2884 2.74602 14.5444Z\"/><path d=\"M8.9416 3.48269C7.99688 3.31826 7.02645 3.38371 6.11237 3.67352C5.19828 3.96332 4.36741 4.46894 3.68999 5.14765C3.33153 5.50944.5.01988 5.91477 2.76233 6.35415C2.68692 6.4822 2.6562 6.63169 2.67501 6.77911C2.69381 6.92652 2.76108 7.06351 2.86623 7.16853L4.1994 8.50238C5.43822 6.53634 7.04911 4.83119 8.9416 3.48269Z\"/><path d=\"M16.5181 11.0585C16.6825 12.0033 16.6171 12.9737 16.3273 13.8878C16.0375 14.8019 15.5318 15.6327 14.8531 16.3101C14.4914 16.6686 14.086 16.9803 13.6466 17.2378C13.5186 17.3132 13.3691 17.3439 13.2217 17.3251C13.0743 17.3063 12.9373 17.2391 12.8323 17.1339L11.4984 15.8007C13.4645 14.5619 15.1696 12.951 16.5181 11.0585Z\"/></svg>",
|
||||
"path": "./upgrade.md"
|
||||
},
|
||||
{
|
||||
|
||||
12
docs/npm.md
12
docs/npm.md
@@ -22,12 +22,12 @@ includes installing instructions based on your operating system.
|
||||
|
||||
## Node.js version
|
||||
|
||||
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
|
||||
We use the same major version of Node.js shipped with Code's remote, which is
|
||||
currently `16.x`. VS Code also [lists Node.js
|
||||
requirements](https://github.com/microsoft/vscode/wiki/How-to-Contribute#prerequisites).
|
||||
|
||||
Using other versions of Node.js [may lead to unexpected
|
||||
behavior](https://github.com/cdr/code-server/issues/1633).
|
||||
behavior](https://github.com/coder/code-server/issues/1633).
|
||||
|
||||
## Ubuntu, Debian
|
||||
|
||||
@@ -72,7 +72,7 @@ Proceed to [installing](#installing)
|
||||
## FreeBSD
|
||||
|
||||
```sh
|
||||
pkg install -y git python npm-node14 yarn-node14 pkgconf
|
||||
pkg install -y git python npm-node16 yarn-node16 pkgconf
|
||||
pkg install -y libinotify
|
||||
```
|
||||
|
||||
@@ -100,7 +100,7 @@ yarn global bin
|
||||
# Or: npm config get prefix
|
||||
```
|
||||
|
||||
For help and additional troubleshooting, see [#1397](https://github.com/cdr/code-server/issues/1397).
|
||||
For help and additional troubleshooting, see [#1397](https://github.com/coder/code-server/issues/1397).
|
||||
|
||||
## Installing
|
||||
|
||||
@@ -116,7 +116,7 @@ code-server
|
||||
## Troubleshooting
|
||||
|
||||
If you need further assistance, post on our [GitHub Discussions
|
||||
page](https://github.com/cdr/code-server/discussions).
|
||||
page](https://github.com/coder/code-server/discussions).
|
||||
|
||||
### Issues with Node.js after version upgrades
|
||||
|
||||
|
||||
@@ -33,7 +33,7 @@ new Compute Engine VM 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
|
||||
6. We recommend choosing 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
|
||||
|
||||
190
docs/termux.md
190
docs/termux.md
@@ -5,67 +5,181 @@
|
||||
- [Install](#install)
|
||||
- [Upgrade](#upgrade)
|
||||
- [Known Issues](#known-issues)
|
||||
- [Search doesn't work](#search-doesnt-work)
|
||||
- [Backspace doesn't work](#backspace-doesnt-work)
|
||||
- [Git won't work in `/sdcard`](#git-wont-work-in-sdcard)
|
||||
- [Extra](#extra)
|
||||
- [Create a new user](#create-a-new-user)
|
||||
- [Install Go](#install-go)
|
||||
- [Install Python](#install-python)
|
||||
- [Working with PRoot](#working-with-proot)
|
||||
|
||||
<!-- END doctoc generated TOC please keep comment here to allow auto update -->
|
||||
|
||||
Termux is a terminal application and Linux environment that you can also use to
|
||||
run code-server from your Android phone.
|
||||
|
||||
## Install
|
||||
|
||||
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. Get [Termux](https://f-droid.org/en/packages/com.termux/) from **F-Droid**.
|
||||
2. Install Debian by running the following:
|
||||
- Run `termux-setup-storage` to allow storage access, or else code-server won't be able to read from `/sdcard`.\
|
||||
> The following command is from [proot-distro](https://github.com/termux/proot-distro), but you can also use [Andronix](https://andronix.app/).
|
||||
> After Debian is installed the `~ $` will change to `root@localhost`.
|
||||
|
||||
```bash
|
||||
pkg update -y && pkg install proot-distro -y && proot-distro install debian && proot-distro login debian
|
||||
```
|
||||
|
||||
3. Run the following commands to setup Debian:
|
||||
|
||||
```bash
|
||||
apt update && apt upgrade -y && apt-get install sudo vim git -y
|
||||
```
|
||||
|
||||
4. Install [NVM](https://github.com/nvm-sh/nvm#install--update-script) by following the install guide in the README, just a curl/wget command.
|
||||
|
||||
5. Set up NVM for multi-user. After installing NVM it automatically adds the necessary commands for it to work, but it will only work if you are logged in as root:
|
||||
|
||||
- Copy the lines NVM asks you to run after running the install script.
|
||||
- Run `nano /root/.bashrc` and comment out those lines by adding a `#` at the start.
|
||||
- Run `nano /etc/profile` and paste those lines at the end of the file. Make sure to replace `$HOME` with `/root` on the first line.
|
||||
- Now run `exit`
|
||||
- Start Debian again `proot-distro login debian`
|
||||
|
||||
6. After following the instructions and setting up NVM you can now install the [required node version](https://coder.com/docs/code-server/latest/npm#nodejs-version) by running:
|
||||
|
||||
```bash
|
||||
nvm install v<major_version_here>
|
||||
```
|
||||
|
||||
7. To install `code-server` run the following:
|
||||
> To check the install process (Will not actually install code-server)
|
||||
> If it all looks good, you can install code-server by running the second command
|
||||
|
||||
```bash
|
||||
curl -fsSL https://code-server.dev/install.sh | sh -s -- --dry-run
|
||||
```
|
||||
|
||||
```bash
|
||||
curl -fsSL https://code-server.dev/install.sh | sh
|
||||
```
|
||||
|
||||
8. You can now start code server by simply running `code-server`.
|
||||
|
||||
> Consider using a new user instead of root, read [here](https://www.howtogeek.com/124950/htg-explains-why-you-shouldnt-log-into-your-linux-system-as-root/) why using root is not recommended.\
|
||||
> Learn how to add a user [here](#create-a-new-user).
|
||||
|
||||
## Upgrade
|
||||
|
||||
To upgrade run: `yarn global upgrade code-server --latest`
|
||||
1. Remove all previous installs `rm -rf ~/.local/lib/code-server-*`
|
||||
2. Run the install script again `curl -fsSL https://code-server.dev/install.sh | sh`
|
||||
|
||||
## Known Issues
|
||||
|
||||
The following details known issues and suggested workarounds for using
|
||||
code-server with Termux.
|
||||
### Git won't work in `/sdcard`
|
||||
|
||||
### Search doesn't work
|
||||
Issue : Using git in the `/sdcard` directory will fail during cloning/commit/staging/etc...\
|
||||
Fix : None\
|
||||
Potential Workaround :
|
||||
|
||||
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. Create a soft-link from the debian-fs to your folder in `/sdcard`
|
||||
2. Use git from termux (preferred)
|
||||
|
||||
1. Install `ripgrep` with `pkg`
|
||||
## Extra
|
||||
|
||||
```sh
|
||||
pkg install ripgrep
|
||||
```
|
||||
### Create a new user
|
||||
|
||||
1. Make a soft link using `ln -s`
|
||||
To create a new user follow these simple steps -
|
||||
|
||||
```sh
|
||||
# run this command inside the code-server directory
|
||||
ln -s $PREFIX/bin/rg ./vendor/modules/code-oss-dev/vscode-ripgrep/bin/rg
|
||||
```
|
||||
1. Create a new user by running `useradd <username> -m`.
|
||||
2. Change the password by running `passwd <username>`.
|
||||
3. Give your new user sudo access by running `visudo`, scroll down to `User privilege specification` and add the following line after root `username ALL=(ALL:ALL) ALL`.
|
||||
4. Now edit the `/etc/passwd` file with your command line editor of choice and at the end of the line that specifies your user change `/bin/sh` to `/bin/bash`.
|
||||
5. Now switch users by running `su - <username>`
|
||||
|
||||
### Backspace doesn't work
|
||||
- Remember the `-` betweeen `su` and username is required to execute `/etc/profile`,\
|
||||
since `/etc/profile` may have some necessary things to be executed you should always add a `-`.
|
||||
|
||||
When using Android's on-screen keyboard, the backspace key doesn't work
|
||||
properly. This is a known upstream issue:
|
||||
### Install Go
|
||||
|
||||
- [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)
|
||||
> From https://golang.org/doc/install
|
||||
|
||||
There are two workarounds.
|
||||
1. Go to https://golang.org/dl/ and copy the download link for `linux arm` and run the following:
|
||||
|
||||
**Option 1:** Modify keyboard dispatch settings
|
||||
```bash
|
||||
wget download_link
|
||||
```
|
||||
|
||||
1. Open the Command Palette
|
||||
2. Search for **Preferences: Open Settings (JSON)**
|
||||
3. Add `"keyboard.dispatch": "keyCode"`
|
||||
2. Extract the downloaded archive. (This step will erase all previous GO installs, make sure to create a backup if you have previously installed GO)
|
||||
|
||||
The backspace button should work at this point.
|
||||
```bash
|
||||
rm -rf /usr/local/go && tar -C /usr/local -xzf archive_name
|
||||
```
|
||||
|
||||
_Thanks to @Nefomemes for the [suggestion](https://github.com/cdr/code-server/issues/1141#issuecomment-789463707)!_
|
||||
3. Run `nano /etc/profile` and add the following line `export PATH=$PATH:/usr/local/go/bin`.
|
||||
4. Now run `exit` (depending on if you have switched users or not, you may have to run `exit` multiple times to get to normal termux shell) and start Debian again.
|
||||
5. Check if your install was successful by running `go version`
|
||||
|
||||
**Option 2:** Use a Bluetooth keyboard.
|
||||
### Install Python
|
||||
|
||||
> Run these commands as root
|
||||
|
||||
1. Run the following commands to install required packages to build python:
|
||||
|
||||
```bash
|
||||
sudo apt-get update
|
||||
sudo apt-get install make build-essential libssl-dev zlib1g-dev \
|
||||
libbz2-dev libreadline-dev libsqlite3-dev wget curl llvm \
|
||||
libncursesw5-dev xz-utils tk-dev libxml2-dev libxmlsec1-dev libffi-dev liblzma-dev
|
||||
```
|
||||
|
||||
2. Install [pyenv](https://github.com/pyenv/pyenv/) from [pyenv-installer](https://github.com/pyenv/pyenv-installer) by running:
|
||||
|
||||
```bash
|
||||
curl -L https://github.com/pyenv/pyenv-installer/raw/master/bin/pyenv-installer | bash
|
||||
```
|
||||
|
||||
3. Run `nano /etc/profile` and add the following:
|
||||
|
||||
```bash
|
||||
export PYENV_ROOT="/root/.pyenv"
|
||||
export PATH="/root/.pyenv/bin:$PATH"
|
||||
eval "$(pyenv init --path)"
|
||||
eval "$(pyenv virtualenv-init -)"
|
||||
```
|
||||
|
||||
4. Exit and start Debian again.
|
||||
5. Run `pyenv versions` to list all installable versions.
|
||||
6. Run `pyenv install version` to install the desired python version.
|
||||
> The build process may take some time (an hour or 2 depending on your device).
|
||||
7. Run `touch /root/.pyenv/version && echo "your_version_here" > /root/.pyenv/version`
|
||||
8. (You may have to start Debian again) Run `python3 -V` to verify if PATH works or not.
|
||||
> If `python3` doesn't work but pyenv says that the install was successful in step 6 then try running `$PYENV_ROOT/versions/your_version/bin/python3`.
|
||||
|
||||
### Working with PRoot
|
||||
|
||||
Debian PRoot Distro Dev Environment
|
||||
|
||||
- Since Node and code-server are installed in the Debian PRoot distro, your `~/.ssh/` configuration, `~/.bashrc`, git, npm packages, etc. should be setup in PRoot as well.
|
||||
- The terminal accessible in code-server will bring up the filesystem and `~/.bashrc` in the Debian PRoot distro.
|
||||
|
||||
Accessing files in the Debian PRoot Distro
|
||||
|
||||
- The `/data/data/com.termux/files/home` directory in PRoot accesses the termux home directory (`~`)
|
||||
- The `/sdcard` directory in PRoot accesses the Android storage directory, though there are [known issues with git and files in the `/sdcard` path](#git-wont-work-in-sdcard)
|
||||
|
||||
Accessing the Debian PRoot distro/Starting code-server
|
||||
|
||||
- Run the following command to access the Debian PRoot distro, from the termux shell:
|
||||
|
||||
```bash
|
||||
proot-distro login debian
|
||||
```
|
||||
|
||||
- Run the following command to start code-server directly in the Debian PRoot distro, from the termux shell:
|
||||
|
||||
```bash
|
||||
proot-distro login debian -- code-server
|
||||
```
|
||||
|
||||
- If you [created a new user](#create-a-new-user), you'll need to insert the `--user <username>` option between `login` and `debian` in the commands above to run as the user instead of root in PRoot.
|
||||
|
||||
Additional information on PRoot and Termux
|
||||
|
||||
- Additional information on using your Debian PRoot Distro can be [found here](https://github.com/termux/proot-distro#functionality-overview).
|
||||
|
||||
@@ -28,8 +28,8 @@ This will show issues that:
|
||||
1. If more information is required, please ask the submitter and tag as
|
||||
`waiting-for-info` and wait.
|
||||
1. Finally, the issue should be moved into the
|
||||
[code-server](https://github.com/cdr/code-server/projects/1) project where we
|
||||
[code-server](https://github.com/coder/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
|
||||
We also use [milestones](https://github.com/coder/code-server/milestones) to track
|
||||
what issues are planned/or were closed for what release.
|
||||
|
||||
45
install.sh
45
install.sh
@@ -23,7 +23,7 @@ The remote host must have internet access.
|
||||
${not_curl_usage-}
|
||||
Usage:
|
||||
|
||||
$arg0 [--dry-run] [--version X.X.X] [--method detect] \
|
||||
$arg0 [--dry-run] [--version X.X.X] [--edge] [--method detect] \
|
||||
[--prefix ~/.local] [--rsh ssh] [user@host]
|
||||
|
||||
--dry-run
|
||||
@@ -32,6 +32,9 @@ Usage:
|
||||
--version X.X.X
|
||||
Install a specific version instead of the latest.
|
||||
|
||||
--edge
|
||||
Install the latest edge version instead of the latest stable version.
|
||||
|
||||
--method [detect | standalone]
|
||||
Choose the installation method. Defaults to detect.
|
||||
- detect detects the system package manager and tries to use it.
|
||||
@@ -52,7 +55,7 @@ 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.
|
||||
- FreeBSD, Alpine: install from npm.
|
||||
- macOS: install using Homebrew if installed otherwise install from GitHub.
|
||||
- All others: install the release from GitHub.
|
||||
|
||||
@@ -71,9 +74,13 @@ EOF
|
||||
}
|
||||
|
||||
echo_latest_version() {
|
||||
# https://gist.github.com/lukechilds/a83e1d7127b78fef38c2914c4ececc3c#gistcomment-2758860
|
||||
version="$(curl -fsSLI -o /dev/null -w "%{url_effective}" https://github.com/cdr/code-server/releases/latest)"
|
||||
version="${version#https://github.com/cdr/code-server/releases/tag/}"
|
||||
if [ "${EDGE-}" ]; then
|
||||
version="$(curl -fsSL https://api.github.com/repos/coder/code-server/releases | awk 'match($0,/.*"html_url": "(.*\/releases\/tag\/.*)".*/)' | head -n 1 | awk -F '"' '{print $4}')"
|
||||
else
|
||||
# https://gist.github.com/lukechilds/a83e1d7127b78fef38c2914c4ececc3c#gistcomment-2758860
|
||||
version="$(curl -fsSLI -o /dev/null -w "%{url_effective}" https://github.com/coder/code-server/releases/latest)"
|
||||
fi
|
||||
version="${version#https://github.com/coder/code-server/releases/tag/}"
|
||||
version="${version#v}"
|
||||
echo "$version"
|
||||
}
|
||||
@@ -135,6 +142,7 @@ main() {
|
||||
OPTIONAL \
|
||||
ALL_FLAGS \
|
||||
RSH_ARGS \
|
||||
EDGE \
|
||||
RSH
|
||||
|
||||
ALL_FLAGS=""
|
||||
@@ -170,6 +178,9 @@ main() {
|
||||
--version=*)
|
||||
VERSION="$(parse_arg "$@")"
|
||||
;;
|
||||
--edge)
|
||||
EDGE=1
|
||||
;;
|
||||
--rsh)
|
||||
RSH="$(parse_arg "$@")"
|
||||
shift
|
||||
@@ -340,7 +351,7 @@ install_deb() {
|
||||
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" \
|
||||
fetch "https://github.com/coder/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"
|
||||
|
||||
@@ -351,7 +362,7 @@ install_rpm() {
|
||||
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" \
|
||||
fetch "https://github.com/coder/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"
|
||||
|
||||
@@ -377,7 +388,7 @@ install_standalone() {
|
||||
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" \
|
||||
fetch "https://github.com/coder/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
|
||||
@@ -408,19 +419,9 @@ install_npm() {
|
||||
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 [ ! "${DRY_RUN-}" ] && [ ! -w "$($YARN_PATH global bin)" ]; then
|
||||
sh_c="sudo_sh_c"
|
||||
fi
|
||||
echoh "Installing with yarn."
|
||||
echoh
|
||||
"$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_PATH"; then
|
||||
|
||||
if command_exists "$NPM_PATH"; then
|
||||
sh_c="sh_c"
|
||||
if [ ! "${DRY_RUN-}" ] && [ ! -w "$(NPM_PATH config get prefix)" ]; then
|
||||
sh_c="sudo_sh_c"
|
||||
@@ -431,9 +432,9 @@ install_npm() {
|
||||
NPM_BIN_DIR="\$($NPM_PATH bin -g)" echo_npm_postinstall
|
||||
return
|
||||
fi
|
||||
echoerr "Please install npm or yarn to install code-server!"
|
||||
echoerr "Please install npm to install code-server!"
|
||||
echoerr "You will need at least node v12 and a few C dependencies."
|
||||
echoerr "See the docs https://coder.com/docs/code-server/latest/install#yarn-npm"
|
||||
echoerr "See the docs https://coder.com/docs/code-server/latest/install#npm"
|
||||
|
||||
exit 1
|
||||
}
|
||||
|
||||
1
lib/vscode
Submodule
1
lib/vscode
Submodule
Submodule lib/vscode added at 30d9c6cd94
76
package.json
76
package.json
@@ -1,13 +1,13 @@
|
||||
{
|
||||
"name": "code-server",
|
||||
"license": "MIT",
|
||||
"version": "3.12.0",
|
||||
"version": "4.5.0",
|
||||
"description": "Run VS Code on a remote server.",
|
||||
"homepage": "https://github.com/cdr/code-server",
|
||||
"homepage": "https://github.com/coder/code-server",
|
||||
"bugs": {
|
||||
"url": "https://github.com/cdr/code-server/issues"
|
||||
"url": "https://github.com/coder/code-server/issues"
|
||||
},
|
||||
"repository": "https://github.com/cdr/code-server",
|
||||
"repository": "https://github.com/coder/code-server",
|
||||
"scripts": {
|
||||
"clean": "./ci/build/clean.sh",
|
||||
"build": "./ci/build/build-code-server.sh",
|
||||
@@ -17,26 +17,25 @@
|
||||
"release:github-draft": "./ci/build/release-github-draft.sh",
|
||||
"release:github-assets": "./ci/build/release-github-assets.sh",
|
||||
"release:prep": "./ci/build/release-prep.sh",
|
||||
"test:e2e": "./ci/dev/test-e2e.sh",
|
||||
"test:standalone-release": "./ci/build/test-standalone-release.sh",
|
||||
"test:unit": "./ci/dev/test-unit.sh",
|
||||
"test:e2e": "VSCODE_IPC_HOOK_CLI= ./ci/dev/test-e2e.sh",
|
||||
"test:unit": "./ci/dev/test-unit.sh --forceExit --detectOpenHandles",
|
||||
"test:integration": "./ci/dev/test-integration.sh",
|
||||
"test:scripts": "./ci/dev/test-scripts.sh",
|
||||
"package": "./ci/build/build-packages.sh",
|
||||
"postinstall": "./ci/dev/postinstall.sh",
|
||||
"publish:npm": "./ci/steps/publish-npm.sh",
|
||||
"publish:docker": "./ci/steps/docker-buildx-push.sh",
|
||||
"_audit": "./ci/dev/audit.sh",
|
||||
"fmt": "./ci/dev/fmt.sh",
|
||||
"lint": "./ci/dev/lint.sh",
|
||||
"test": "echo 'Run yarn test:unit or yarn test:e2e' && exit 1",
|
||||
"ci": "./ci/dev/ci.sh",
|
||||
"watch": "VSCODE_IPC_HOOK_CLI= NODE_OPTIONS='--max_old_space_size=32384 --trace-warnings' ts-node ./ci/dev/watch.ts",
|
||||
"icons": "./ci/dev/gen_icons.sh",
|
||||
"coverage": "codecov"
|
||||
"watch": "VSCODE_DEV=1 VSCODE_IPC_HOOK_CLI= NODE_OPTIONS='--max_old_space_size=32384 --trace-warnings' ts-node ./ci/dev/watch.ts",
|
||||
"icons": "./ci/dev/gen_icons.sh"
|
||||
},
|
||||
"main": "out/node/entry.js",
|
||||
"devDependencies": {
|
||||
"@schemastore/package": "^0.0.6",
|
||||
"@types/body-parser": "^1.19.0",
|
||||
"@types/browserify": "^12.0.36",
|
||||
"@types/compression": "^1.7.0",
|
||||
"@types/cookie-parser": "^1.4.2",
|
||||
"@types/express": "^4.17.8",
|
||||
@@ -48,61 +47,63 @@
|
||||
"@types/safe-compare": "^1.1.0",
|
||||
"@types/semver": "^7.1.0",
|
||||
"@types/split2": "^3.2.0",
|
||||
"@types/tar-fs": "^2.0.0",
|
||||
"@types/tar-stream": "^2.1.0",
|
||||
"@types/ws": "^7.2.6",
|
||||
"@typescript-eslint/eslint-plugin": "^4.7.0",
|
||||
"@typescript-eslint/parser": "^4.7.0",
|
||||
"audit-ci": "^4.0.0",
|
||||
"browserify": "^17.0.0",
|
||||
"codecov": "^3.8.3",
|
||||
"@types/trusted-types": "^2.0.2",
|
||||
"@types/ws": "^8.0.0",
|
||||
"@typescript-eslint/eslint-plugin": "^5.23.0",
|
||||
"@typescript-eslint/parser": "^5.23.0",
|
||||
"audit-ci": "^6.0.0",
|
||||
"doctoc": "^2.0.0",
|
||||
"eslint": "^7.7.0",
|
||||
"eslint-config-prettier": "^8.1.0",
|
||||
"eslint-import-resolver-alias": "^1.1.2",
|
||||
"eslint-import-resolver-typescript": "^2.5.0",
|
||||
"eslint-plugin-import": "^2.18.2",
|
||||
"eslint-plugin-prettier": "^4.0.0",
|
||||
"json": "^11.0.0",
|
||||
"prettier": "^2.2.1",
|
||||
"prettier-plugin-sh": "^0.7.1",
|
||||
"prettier-plugin-sh": "^0.12.0",
|
||||
"shellcheck": "^1.0.0",
|
||||
"stylelint": "^13.0.0",
|
||||
"stylelint-config-recommended": "^5.0.0",
|
||||
"synp": "^1.9.10",
|
||||
"ts-node": "^10.0.0",
|
||||
"typescript": "^4.1.3"
|
||||
"typescript": "^4.6.2"
|
||||
},
|
||||
"resolutions": {
|
||||
"normalize-package-data": "^3.0.0",
|
||||
"ansi-regex": "^5.0.1",
|
||||
"normalize-package-data": "^4.0.0",
|
||||
"doctoc/underscore": "^1.13.1",
|
||||
"doctoc/**/trim": "^1.0.0",
|
||||
"postcss": "^8.2.1",
|
||||
"browserslist": "^4.16.5",
|
||||
"safe-buffer": "^5.1.1",
|
||||
"vfile-message": "^2.0.2",
|
||||
"argon2/@mapbox/node-pre-gyp/tar": "^6.1.9",
|
||||
"path-parse": "^1.0.7"
|
||||
"tar": "^6.1.9",
|
||||
"path-parse": "^1.0.7",
|
||||
"vm2": "^3.9.6",
|
||||
"follow-redirects": "^1.14.8",
|
||||
"node-fetch": "^2.6.7",
|
||||
"nanoid": "^3.1.31",
|
||||
"minimist": "npm:minimist-lite@2.2.1"
|
||||
},
|
||||
"dependencies": {
|
||||
"@coder/logger": "1.1.16",
|
||||
"argon2": "^0.28.0",
|
||||
"body-parser": "^1.19.0",
|
||||
"compression": "^1.7.4",
|
||||
"cookie-parser": "^1.4.5",
|
||||
"env-paths": "^2.2.0",
|
||||
"express": "^5.0.0-alpha.8",
|
||||
"express": "5.0.0-alpha.8",
|
||||
"http-proxy": "^1.18.0",
|
||||
"httpolyglot": "^0.1.2",
|
||||
"js-yaml": "^4.0.0",
|
||||
"limiter": "^1.1.5",
|
||||
"pem": "^1.14.2",
|
||||
"proxy-agent": "^5.0.0",
|
||||
"proxy-from-env": "^1.1.0",
|
||||
"qs": "6.10.1",
|
||||
"rotating-file-stream": "^2.1.1",
|
||||
"qs": "6.11.0",
|
||||
"rotating-file-stream": "^3.0.0",
|
||||
"safe-buffer": "^5.1.1",
|
||||
"safe-compare": "^1.1.4",
|
||||
"semver": "^7.1.3",
|
||||
"split2": "^3.2.2",
|
||||
"tar-fs": "^2.0.0",
|
||||
"split2": "^4.0.0",
|
||||
"ws": "^8.0.0",
|
||||
"xdg-basedir": "^4.0.0",
|
||||
"yarn": "^1.22.4"
|
||||
@@ -119,7 +120,7 @@
|
||||
"browser-ide"
|
||||
],
|
||||
"engines": {
|
||||
"node": "= 14"
|
||||
"node": "16"
|
||||
},
|
||||
"jest": {
|
||||
"transform": {
|
||||
@@ -128,7 +129,6 @@
|
||||
"testEnvironment": "node",
|
||||
"testPathIgnorePatterns": [
|
||||
"/node_modules/",
|
||||
"/vendor/",
|
||||
"/lib/",
|
||||
"/out/",
|
||||
"test/e2e"
|
||||
@@ -158,10 +158,12 @@
|
||||
"<rootDir>/release-standalone",
|
||||
"<rootDir>/release-npm-package",
|
||||
"<rootDir>/release-gcp",
|
||||
"<rootDir>/release-images"
|
||||
"<rootDir>/release-images",
|
||||
"<rootDir>/lib"
|
||||
],
|
||||
"moduleNameMapper": {
|
||||
"^.+\\.(css|less)$": "<rootDir>/test/utils/cssStub.ts"
|
||||
}
|
||||
},
|
||||
"globalSetup": "<rootDir>/test/utils/globalUnitSetup.ts"
|
||||
}
|
||||
}
|
||||
|
||||
285
patches/base-path.diff
Normal file
285
patches/base-path.diff
Normal file
@@ -0,0 +1,285 @@
|
||||
Add base path support
|
||||
|
||||
Some users will host code-server behind a path-rewriting reverse proxy, for
|
||||
example domain.tld/my/base/path. This patch adds support for that since Code
|
||||
assumes everything is on / by default.
|
||||
|
||||
To test this serve code-server behind a reverse proxy with a path like /code.
|
||||
|
||||
Index: code-server/lib/vscode/src/vs/base/common/network.ts
|
||||
===================================================================
|
||||
--- code-server.orig/lib/vscode/src/vs/base/common/network.ts
|
||||
+++ code-server/lib/vscode/src/vs/base/common/network.ts
|
||||
@@ -157,7 +157,9 @@ class RemoteAuthoritiesImpl {
|
||||
return URI.from({
|
||||
scheme: platform.isWeb ? this._preferredWebSchema : Schemas.vscodeRemoteResource,
|
||||
authority: `${host}:${port}`,
|
||||
- path: this._remoteResourcesPath,
|
||||
+ path: platform.isWeb
|
||||
+ ? (window.location.pathname + "/" + this._remoteResourcesPath).replace(/\/\/+/g, "/")
|
||||
+ : this._remoteResourcesPath,
|
||||
query
|
||||
});
|
||||
}
|
||||
Index: code-server/lib/vscode/src/vs/code/browser/workbench/workbench-dev.html
|
||||
===================================================================
|
||||
--- code-server.orig/lib/vscode/src/vs/code/browser/workbench/workbench-dev.html
|
||||
+++ code-server/lib/vscode/src/vs/code/browser/workbench/workbench-dev.html
|
||||
@@ -11,8 +11,8 @@
|
||||
<meta name="mobile-web-app-capable" content="yes" />
|
||||
<meta name="apple-mobile-web-app-capable" content="yes" />
|
||||
<meta name="apple-mobile-web-app-title" content="Code">
|
||||
- <link rel="apple-touch-icon" sizes="192x192" href="/_static/src/browser/media/pwa-icon-192.png" />
|
||||
- <link rel="apple-touch-icon" sizes="512x512" href="/_static/src/browser/media/pwa-icon-512.png" />
|
||||
+ <link rel="apple-touch-icon" sizes="192x192" href="{{BASE}}/_static/src/browser/media/pwa-icon-192.png" />
|
||||
+ <link rel="apple-touch-icon" sizes="512x512" href="{{BASE}}/_static/src/browser/media/pwa-icon-512.png" />
|
||||
|
||||
<!-- Disable pinch zooming -->
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0, user-scalable=no">
|
||||
@@ -27,9 +27,9 @@
|
||||
<meta id="vscode-workbench-builtin-extensions" data-settings="{{WORKBENCH_BUILTIN_EXTENSIONS}}">
|
||||
|
||||
<!-- Workbench Icon/Manifest/CSS -->
|
||||
- <link rel="icon" href="/_static/src/browser/media/favicon-dark-support.svg" />
|
||||
- <link rel="alternate icon" href="/_static/src/browser/media/favicon.ico" type="image/x-icon" />
|
||||
- <link rel="manifest" href="/manifest.json" crossorigin="use-credentials" />
|
||||
+ <link rel="icon" href="{{BASE}}/_static/src/browser/media/favicon-dark-support.svg" />
|
||||
+ <link rel="alternate icon" href="{{BASE}}/_static/src/browser/media/favicon.ico" type="image/x-icon" />
|
||||
+ <link rel="manifest" href="{{VS_BASE}}/manifest.json" crossorigin="use-credentials" />
|
||||
</head>
|
||||
|
||||
<body aria-label="">
|
||||
@@ -39,7 +39,7 @@
|
||||
<script src="{{WORKBENCH_WEB_BASE_URL}}/out/vs/loader.js"></script>
|
||||
<script src="{{WORKBENCH_WEB_BASE_URL}}/out/vs/webPackagePaths.js"></script>
|
||||
<script>
|
||||
- const baseUrl = new URL('{{WORKBENCH_WEB_BASE_URL}}', window.location.origin).toString();
|
||||
+ const baseUrl = new URL('{{WORKBENCH_WEB_BASE_URL}}', window.location).toString();
|
||||
Object.keys(self.webPackagePaths).map(function (key, index) {
|
||||
self.webPackagePaths[key] = `${baseUrl}/remote/web/node_modules/${key}/${self.webPackagePaths[key]}`;
|
||||
});
|
||||
Index: code-server/lib/vscode/src/vs/code/browser/workbench/workbench.html
|
||||
===================================================================
|
||||
--- code-server.orig/lib/vscode/src/vs/code/browser/workbench/workbench.html
|
||||
+++ code-server/lib/vscode/src/vs/code/browser/workbench/workbench.html
|
||||
@@ -11,8 +11,8 @@
|
||||
<meta name="mobile-web-app-capable" content="yes" />
|
||||
<meta name="apple-mobile-web-app-capable" content="yes" />
|
||||
<meta name="apple-mobile-web-app-title" content="Code">
|
||||
- <link rel="apple-touch-icon" sizes="192x192" href="/_static/src/browser/media/pwa-icon-192.png" />
|
||||
- <link rel="apple-touch-icon" sizes="512x512" href="/_static/src/browser/media/pwa-icon-512.png" />
|
||||
+ <link rel="apple-touch-icon" sizes="192x192" href="{{BASE}}/_static/src/browser/media/pwa-icon-192.png" />
|
||||
+ <link rel="apple-touch-icon" sizes="512x512" href="{{BASE}}/_static/src/browser/media/pwa-icon-512.png" />
|
||||
|
||||
<!-- Disable pinch zooming -->
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0, user-scalable=no">
|
||||
@@ -24,9 +24,9 @@
|
||||
<meta id="vscode-workbench-auth-session" data-settings="{{WORKBENCH_AUTH_SESSION}}">
|
||||
|
||||
<!-- Workbench Icon/Manifest/CSS -->
|
||||
- <link rel="icon" href="/_static/src/browser/media/favicon-dark-support.svg" />
|
||||
- <link rel="alternate icon" href="/_static/src/browser/media/favicon.ico" type="image/x-icon" />
|
||||
- <link rel="manifest" href="/manifest.json" crossorigin="use-credentials" />
|
||||
+ <link rel="icon" href="{{BASE}}/_static/src/browser/media/favicon-dark-support.svg" />
|
||||
+ <link rel="alternate icon" href="{{BASE}}/_static/src/browser/media/favicon.ico" type="image/x-icon" />
|
||||
+ <link rel="manifest" href="{{VS_BASE}}/manifest.json" crossorigin="use-credentials" />
|
||||
<link data-name="vs/workbench/workbench.web.main" rel="stylesheet" href="{{WORKBENCH_WEB_BASE_URL}}/out/vs/workbench/workbench.web.main.css">
|
||||
|
||||
</head>
|
||||
Index: code-server/lib/vscode/src/vs/platform/remote/browser/browserSocketFactory.ts
|
||||
===================================================================
|
||||
--- code-server.orig/lib/vscode/src/vs/platform/remote/browser/browserSocketFactory.ts
|
||||
+++ code-server/lib/vscode/src/vs/platform/remote/browser/browserSocketFactory.ts
|
||||
@@ -274,6 +274,7 @@ export class BrowserSocketFactory implem
|
||||
|
||||
connect(host: string, port: number, path: string, query: string, debugLabel: string, callback: IConnectCallback): void {
|
||||
const webSocketSchema = (/^https:/.test(window.location.href) ? 'wss' : 'ws');
|
||||
+ path = (window.location.pathname + "/" + path).replace(/\/\/+/g, "/")
|
||||
const socket = this._webSocketFactory.create(`${webSocketSchema}://${/:/.test(host) ? `[${host}]` : host}:${port}${path}?${query}&skipWebSocketFrames=false`, debugLabel);
|
||||
const errorListener = socket.onError((err) => callback(err, undefined));
|
||||
socket.onOpen(() => {
|
||||
@@ -282,6 +283,3 @@ export class BrowserSocketFactory implem
|
||||
});
|
||||
}
|
||||
}
|
||||
-
|
||||
-
|
||||
-
|
||||
Index: code-server/lib/vscode/src/vs/server/node/webClientServer.ts
|
||||
===================================================================
|
||||
--- code-server.orig/lib/vscode/src/vs/server/node/webClientServer.ts
|
||||
+++ code-server/lib/vscode/src/vs/server/node/webClientServer.ts
|
||||
@@ -267,14 +267,10 @@ export class WebClientServer {
|
||||
return res.end();
|
||||
}
|
||||
|
||||
- let originalHost = req.headers['x-original-host'];
|
||||
- if (Array.isArray(originalHost)) {
|
||||
- originalHost = originalHost[0];
|
||||
- }
|
||||
- const remoteAuthority = originalHost || req.headers.host;
|
||||
- if (!remoteAuthority) {
|
||||
- return serveError(req, res, 400, `Bad request.`);
|
||||
- }
|
||||
+ // It is not possible to reliably detect the remote authority on the server
|
||||
+ // in all cases. Set this to something invalid to make sure we catch code
|
||||
+ // that is using this when it should not.
|
||||
+ const remoteAuthority = 'remote';
|
||||
|
||||
function asJSON(value: unknown): string {
|
||||
return JSON.stringify(value).replace(/"/g, '"');
|
||||
@@ -297,6 +293,8 @@ export class WebClientServer {
|
||||
scopes: [['user:email'], ['repo']]
|
||||
} : undefined;
|
||||
|
||||
+ const base = relativeRoot(getOriginalUrl(req))
|
||||
+ const vscodeBase = relativePath(getOriginalUrl(req))
|
||||
|
||||
const workbenchWebConfiguration = {
|
||||
remoteAuthority,
|
||||
@@ -308,6 +306,7 @@ export class WebClientServer {
|
||||
workspaceUri: resolveWorkspaceURI(this._environmentService.args['default-workspace']),
|
||||
productConfiguration: <Partial<IProductConfiguration>>{
|
||||
codeServerVersion: this._productService.codeServerVersion,
|
||||
+ rootEndpoint: base,
|
||||
embedderIdentifier: 'server-distro',
|
||||
extensionsGallery: this._webExtensionResourceUrlTemplate ? {
|
||||
...this._productService.extensionsGallery,
|
||||
@@ -328,8 +327,10 @@ export class WebClientServer {
|
||||
const values: { [key: string]: string } = {
|
||||
WORKBENCH_WEB_CONFIGURATION: asJSON(workbenchWebConfiguration),
|
||||
WORKBENCH_AUTH_SESSION: authSessionInfo ? asJSON(authSessionInfo) : '',
|
||||
- WORKBENCH_WEB_BASE_URL: this._staticRoute,
|
||||
- WORKBENCH_NLS_BASE_URL: nlsBaseUrl ? `${nlsBaseUrl}${this._productService.commit}/${this._productService.version}/` : '',
|
||||
+ WORKBENCH_WEB_BASE_URL: vscodeBase + this._staticRoute,
|
||||
+ WORKBENCH_NLS_BASE_URL: vscodeBase + (nlsBaseUrl ? `${nlsBaseUrl}${this._productService.commit}/${this._productService.version}/` : ''),
|
||||
+ BASE: base,
|
||||
+ VS_BASE: vscodeBase,
|
||||
};
|
||||
|
||||
|
||||
@@ -419,3 +420,70 @@ export class WebClientServer {
|
||||
return res.end(data);
|
||||
}
|
||||
}
|
||||
+
|
||||
+/**
|
||||
+ * Remove extra slashes in a URL.
|
||||
+ *
|
||||
+ * This is meant to fill the job of `path.join` so you can concatenate paths and
|
||||
+ * then normalize out any extra slashes.
|
||||
+ *
|
||||
+ * If you are using `path.join` you do not need this but note that `path` is for
|
||||
+ * file system paths, not URLs.
|
||||
+ */
|
||||
+export const normalizeUrlPath = (url: string, keepTrailing = false): string => {
|
||||
+ return url.replace(/\/\/+/g, "/").replace(/\/+$/, keepTrailing ? "/" : "")
|
||||
+}
|
||||
+
|
||||
+/**
|
||||
+ * Get the relative path that will get us to the root of the page. For each
|
||||
+ * slash we need to go up a directory. Will not have a trailing slash.
|
||||
+ *
|
||||
+ * For example:
|
||||
+ *
|
||||
+ * / => .
|
||||
+ * /foo => .
|
||||
+ * /foo/ => ./..
|
||||
+ * /foo/bar => ./..
|
||||
+ * /foo/bar/ => ./../..
|
||||
+ *
|
||||
+ * All paths must be relative in order to work behind a reverse proxy since we
|
||||
+ * we do not know the base path. Anything that needs to be absolute (for
|
||||
+ * example cookies) must get the base path from the frontend.
|
||||
+ *
|
||||
+ * All relative paths must be prefixed with the relative root to ensure they
|
||||
+ * work no matter the depth at which they happen to appear.
|
||||
+ *
|
||||
+ * For Express `req.originalUrl` should be used as they remove the base from the
|
||||
+ * standard `url` property making it impossible to get the true depth.
|
||||
+ */
|
||||
+export const relativeRoot = (originalUrl: string): string => {
|
||||
+ const depth = (originalUrl.split("?", 1)[0].match(/\//g) || []).length
|
||||
+ return normalizeUrlPath("./" + (depth > 1 ? "../".repeat(depth - 1) : ""))
|
||||
+}
|
||||
+
|
||||
+/**
|
||||
+ * Get the relative path to the current resource.
|
||||
+ *
|
||||
+ * For example:
|
||||
+ *
|
||||
+ * / => .
|
||||
+ * /foo => ./foo
|
||||
+ * /foo/ => .
|
||||
+ * /foo/bar => ./bar
|
||||
+ * /foo/bar/ => .
|
||||
+ */
|
||||
+export const relativePath = (originalUrl: string): string => {
|
||||
+ const parts = originalUrl.split("?", 1)[0].split("/")
|
||||
+ return normalizeUrlPath("./" + parts[parts.length - 1])
|
||||
+}
|
||||
+
|
||||
+/**
|
||||
+ * code-server serves Code using Express. Express removes the base from the url
|
||||
+ * and puts the original in `originalUrl` so we must use this to get the correct
|
||||
+ * depth. Code is not aware it is behind Express so the types do not match. We
|
||||
+ * may want to continue moving code into Code and eventually remove the Express
|
||||
+ * wrapper or move the web server back into code-server.
|
||||
+ */
|
||||
+export const getOriginalUrl = (req: http.IncomingMessage): string => {
|
||||
+ return (req as any).originalUrl || req.url
|
||||
+}
|
||||
Index: code-server/lib/vscode/src/vs/base/common/product.ts
|
||||
===================================================================
|
||||
--- code-server.orig/lib/vscode/src/vs/base/common/product.ts
|
||||
+++ code-server/lib/vscode/src/vs/base/common/product.ts
|
||||
@@ -32,6 +32,7 @@ export type ExtensionVirtualWorkspaceSup
|
||||
|
||||
export interface IProductConfiguration {
|
||||
readonly codeServerVersion?: string
|
||||
+ readonly rootEndpoint?: string
|
||||
|
||||
readonly version: string;
|
||||
readonly date?: string;
|
||||
Index: code-server/lib/vscode/src/vs/code/browser/workbench/workbench.ts
|
||||
===================================================================
|
||||
--- code-server.orig/lib/vscode/src/vs/code/browser/workbench/workbench.ts
|
||||
+++ code-server/lib/vscode/src/vs/code/browser/workbench/workbench.ts
|
||||
@@ -485,6 +485,7 @@ function doCreateUri(path: string, query
|
||||
});
|
||||
}
|
||||
|
||||
+ path = (window.location.pathname + "/" + path).replace(/\/\/+/g, "/")
|
||||
return URI.parse(window.location.href).with({ path, query });
|
||||
}
|
||||
|
||||
@@ -496,7 +497,7 @@ function doCreateUri(path: string, query
|
||||
if (!configElement || !configElementAttribute) {
|
||||
throw new Error('Missing web configuration element');
|
||||
}
|
||||
- const config: IWorkbenchConstructionOptions & { folderUri?: UriComponents; workspaceUri?: UriComponents; callbackRoute: string } = JSON.parse(configElementAttribute);
|
||||
+ const config: IWorkbenchConstructionOptions & { folderUri?: UriComponents; workspaceUri?: UriComponents; callbackRoute: string } = { ...JSON.parse(configElementAttribute), remoteAuthority: location.host }
|
||||
|
||||
// Create workbench
|
||||
create(document.body, {
|
||||
Index: code-server/lib/vscode/src/vs/workbench/services/extensionResourceLoader/common/extensionResourceLoader.ts
|
||||
===================================================================
|
||||
--- code-server.orig/lib/vscode/src/vs/workbench/services/extensionResourceLoader/common/extensionResourceLoader.ts
|
||||
+++ code-server/lib/vscode/src/vs/workbench/services/extensionResourceLoader/common/extensionResourceLoader.ts
|
||||
@@ -16,7 +16,6 @@ import { getServiceMachineId } from 'vs/
|
||||
import { IStorageService } from 'vs/platform/storage/common/storage';
|
||||
import { TelemetryLevel } from 'vs/platform/telemetry/common/telemetry';
|
||||
import { getTelemetryLevel, supportsTelemetry } from 'vs/platform/telemetry/common/telemetryUtils';
|
||||
-import { RemoteAuthorities } from 'vs/base/common/network';
|
||||
import { getRemoteServerRootPath } from 'vs/platform/remote/common/remoteHosts';
|
||||
|
||||
export const WEB_EXTENSION_RESOURCE_END_POINT = 'web-extension-resource';
|
||||
@@ -75,7 +74,7 @@ export abstract class AbstractExtensionR
|
||||
public getExtensionGalleryResourceURL(galleryExtension: { publisher: string; name: string; version: string }, path?: string): URI | undefined {
|
||||
if (this._extensionGalleryResourceUrlTemplate) {
|
||||
const uri = URI.parse(format2(this._extensionGalleryResourceUrlTemplate, { publisher: galleryExtension.publisher, name: galleryExtension.name, version: galleryExtension.version, path: 'extension' }));
|
||||
- return this._isWebExtensionResourceEndPoint(uri) ? uri.with({ scheme: RemoteAuthorities.getPreferredWebSchema() }) : uri;
|
||||
+ return this._isWebExtensionResourceEndPoint(uri) ? URI.joinPath(URI.parse(window.location.href), uri.path) : uri;
|
||||
}
|
||||
return undefined;
|
||||
}
|
||||
26
patches/connection-type.diff
Normal file
26
patches/connection-type.diff
Normal file
@@ -0,0 +1,26 @@
|
||||
Add connection type to web sockets
|
||||
|
||||
This allows the backend to distinguish them. In our case we use them to count a
|
||||
single "open" of Code so we need to be able to distinguish between web sockets
|
||||
from two instances and two web sockets used in a single instance.
|
||||
|
||||
To test this,
|
||||
1. Run code-server
|
||||
2. Open Network tab in Browser DevTools and filter for websocket requests
|
||||
3. You should see the `type=<connection-type>` in the request url
|
||||
|
||||
|
||||
Index: code-server/lib/vscode/src/vs/platform/remote/common/remoteAgentConnection.ts
|
||||
===================================================================
|
||||
--- code-server.orig/lib/vscode/src/vs/platform/remote/common/remoteAgentConnection.ts
|
||||
+++ code-server/lib/vscode/src/vs/platform/remote/common/remoteAgentConnection.ts
|
||||
@@ -233,7 +233,8 @@ async function connectToRemoteExtensionH
|
||||
|
||||
let socket: ISocket;
|
||||
try {
|
||||
- socket = await createSocket(options.logService, options.socketFactory, options.host, options.port, getRemoteServerRootPath(options), `reconnectionToken=${options.reconnectionToken}&reconnection=${options.reconnectionProtocol ? 'true' : 'false'}`, `renderer-${connectionTypeToString(connectionType)}-${options.reconnectionToken}`, timeoutCancellationToken);
|
||||
+
|
||||
+ socket = await createSocket(options.logService, options.socketFactory, options.host, options.port, getRemoteServerRootPath(options), `type=${connectionTypeToString(connectionType)}&reconnectionToken=${options.reconnectionToken}&reconnection=${options.reconnectionProtocol ? 'true' : 'false'}`, `renderer-${connectionTypeToString(connectionType)}-${options.reconnectionToken}`, timeoutCancellationToken);
|
||||
} catch (error) {
|
||||
options.logService.error(`${logPrefix} socketFactory.connect() failed or timed out. Error:`);
|
||||
options.logService.error(error);
|
||||
31
patches/disable-builtin-ext-update.diff
Normal file
31
patches/disable-builtin-ext-update.diff
Normal file
@@ -0,0 +1,31 @@
|
||||
Prevent builtin extensions from being updated
|
||||
|
||||
Updating builtin extensions from the marketplace prevents us from patching them
|
||||
(for example out GitHub authentication patches).
|
||||
|
||||
Index: code-server/lib/vscode/src/vs/workbench/contrib/extensions/browser/extensionsWorkbenchService.ts
|
||||
===================================================================
|
||||
--- code-server.orig/lib/vscode/src/vs/workbench/contrib/extensions/browser/extensionsWorkbenchService.ts
|
||||
+++ code-server/lib/vscode/src/vs/workbench/contrib/extensions/browser/extensionsWorkbenchService.ts
|
||||
@@ -234,6 +234,10 @@ export class Extension implements IExten
|
||||
if (this.type === ExtensionType.System && this.productService.quality === 'stable') {
|
||||
return false;
|
||||
}
|
||||
+ // Do not update builtin extensions.
|
||||
+ if (this.type !== ExtensionType.User) {
|
||||
+ return false;
|
||||
+ }
|
||||
if (!this.local.preRelease && this.gallery.properties.isPreReleaseVersion) {
|
||||
return false;
|
||||
}
|
||||
@@ -1088,6 +1092,10 @@ export class ExtensionsWorkbenchService
|
||||
// Skip if check updates only for builtin extensions and current extension is not builtin.
|
||||
continue;
|
||||
}
|
||||
+ if (installed.type !== ExtensionType.User) {
|
||||
+ // Never update builtin extensions.
|
||||
+ continue;
|
||||
+ }
|
||||
if (installed.isBuiltin && (!installed.local?.identifier.uuid || (!isWeb && this.productService.quality === 'stable'))) {
|
||||
// Skip checking updates for a builtin extension if it does not has Marketplace identifier or the current product is VS Code Desktop stable.
|
||||
continue;
|
||||
183
patches/disable-downloads.diff
Normal file
183
patches/disable-downloads.diff
Normal file
@@ -0,0 +1,183 @@
|
||||
Add option to disable file downloads via CLI
|
||||
|
||||
This patch adds support for a new CLI flag called `--disable-file-downloads`
|
||||
which allows a user to remove the "Download..." option that shows up when you
|
||||
right-click files in Code. The default value for this is `false`.
|
||||
|
||||
To test this, start code-server with `--disable-file-downloads`, open editor,
|
||||
right-click on a file (not a folder) and you should **not** see the
|
||||
"Download..." option.
|
||||
|
||||
Index: code-server/lib/vscode/src/vs/workbench/browser/web.api.ts
|
||||
===================================================================
|
||||
--- code-server.orig/lib/vscode/src/vs/workbench/browser/web.api.ts
|
||||
+++ code-server/lib/vscode/src/vs/workbench/browser/web.api.ts
|
||||
@@ -250,6 +250,11 @@ export interface IWorkbenchConstructionO
|
||||
*/
|
||||
readonly userDataPath?: string
|
||||
|
||||
+ /**
|
||||
+ * Whether the "Download..." option is enabled for files.
|
||||
+ */
|
||||
+ readonly isEnabledFileDownloads?: boolean
|
||||
+
|
||||
//#endregion
|
||||
|
||||
|
||||
Index: code-server/lib/vscode/src/vs/workbench/services/environment/browser/environmentService.ts
|
||||
===================================================================
|
||||
--- code-server.orig/lib/vscode/src/vs/workbench/services/environment/browser/environmentService.ts
|
||||
+++ code-server/lib/vscode/src/vs/workbench/services/environment/browser/environmentService.ts
|
||||
@@ -31,6 +31,11 @@ export interface IBrowserWorkbenchEnviro
|
||||
* Options used to configure the workbench.
|
||||
*/
|
||||
readonly options?: IWorkbenchConstructionOptions;
|
||||
+
|
||||
+ /**
|
||||
+ * Enable downloading files via menu actions.
|
||||
+ */
|
||||
+ readonly isEnabledFileDownloads?: boolean;
|
||||
}
|
||||
|
||||
export class BrowserWorkbenchEnvironmentService implements IBrowserWorkbenchEnvironmentService {
|
||||
@@ -62,6 +67,13 @@ export class BrowserWorkbenchEnvironment
|
||||
return this.options.userDataPath;
|
||||
}
|
||||
|
||||
+ get isEnabledFileDownloads(): boolean {
|
||||
+ if (typeof this.options.isEnabledFileDownloads === "undefined") {
|
||||
+ throw new Error('isEnabledFileDownloads was not provided to the browser');
|
||||
+ }
|
||||
+ return this.options.isEnabledFileDownloads;
|
||||
+ }
|
||||
+
|
||||
@memoize
|
||||
get settingsResource(): URI { return joinPath(this.userRoamingDataHome, 'settings.json'); }
|
||||
|
||||
Index: code-server/lib/vscode/src/vs/server/node/serverEnvironmentService.ts
|
||||
===================================================================
|
||||
--- code-server.orig/lib/vscode/src/vs/server/node/serverEnvironmentService.ts
|
||||
+++ code-server/lib/vscode/src/vs/server/node/serverEnvironmentService.ts
|
||||
@@ -14,6 +14,7 @@ export const serverOptions: OptionDescri
|
||||
/* ----- code-server ----- */
|
||||
'disable-update-check': { type: 'boolean' },
|
||||
'auth': { type: 'string' },
|
||||
+ 'disable-file-downloads': { type: 'boolean' },
|
||||
|
||||
/* ----- server setup ----- */
|
||||
|
||||
@@ -94,6 +95,7 @@ export interface ServerParsedArgs {
|
||||
/* ----- code-server ----- */
|
||||
'disable-update-check'?: boolean;
|
||||
'auth'?: string
|
||||
+ 'disable-file-downloads'?: boolean;
|
||||
|
||||
/* ----- server setup ----- */
|
||||
|
||||
Index: code-server/lib/vscode/src/vs/server/node/webClientServer.ts
|
||||
===================================================================
|
||||
--- code-server.orig/lib/vscode/src/vs/server/node/webClientServer.ts
|
||||
+++ code-server/lib/vscode/src/vs/server/node/webClientServer.ts
|
||||
@@ -300,6 +300,7 @@ export class WebClientServer {
|
||||
remoteAuthority,
|
||||
webviewEndpoint: vscodeBase + this._staticRoute + '/out/vs/workbench/contrib/webview/browser/pre',
|
||||
userDataPath: this._environmentService.userDataPath,
|
||||
+ isEnabledFileDownloads: !this._environmentService.args['disable-file-downloads'],
|
||||
_wrapWebWorkerExtHostInIframe,
|
||||
developmentOptions: {
|
||||
enableSmokeTestDriver: this._environmentService.args['enable-smoke-test-driver'] ? true : undefined,
|
||||
Index: code-server/lib/vscode/src/vs/workbench/browser/contextkeys.ts
|
||||
===================================================================
|
||||
--- code-server.orig/lib/vscode/src/vs/workbench/browser/contextkeys.ts
|
||||
+++ code-server/lib/vscode/src/vs/workbench/browser/contextkeys.ts
|
||||
@@ -7,12 +7,11 @@ import { Event } from 'vs/base/common/ev
|
||||
import { Disposable } from 'vs/base/common/lifecycle';
|
||||
import { IContextKeyService, IContextKey } from 'vs/platform/contextkey/common/contextkey';
|
||||
import { InputFocusedContext, IsMacContext, IsLinuxContext, IsWindowsContext, IsWebContext, IsMacNativeContext, IsDevelopmentContext, IsIOSContext } from 'vs/platform/contextkey/common/contextkeys';
|
||||
-import { SplitEditorsVertically, InEditorZenModeContext, ActiveEditorCanRevertContext, ActiveEditorGroupLockedContext, ActiveEditorCanSplitInGroupContext, SideBySideEditorActiveContext, AuxiliaryBarVisibleContext, SideBarVisibleContext, PanelAlignmentContext, PanelMaximizedContext, PanelVisibleContext, ActiveEditorContext, EditorsVisibleContext, TextCompareEditorVisibleContext, TextCompareEditorActiveContext, ActiveEditorGroupEmptyContext, MultipleEditorGroupsContext, EditorTabsVisibleContext, IsCenteredLayoutContext, ActiveEditorGroupIndexContext, ActiveEditorGroupLastContext, ActiveEditorReadonlyContext, EditorAreaVisibleContext, ActiveEditorAvailableEditorIdsContext, DirtyWorkingCopiesContext, EmptyWorkspaceSupportContext, EnterMultiRootWorkspaceSupportContext, HasWebFileSystemAccess, IsFullscreenContext, OpenFolderWorkspaceSupportContext, RemoteNameContext, VirtualWorkspaceContext, WorkbenchStateContext, WorkspaceFolderCountContext, PanelPositionContext } from 'vs/workbench/common/contextkeys';
|
||||
+import { SplitEditorsVertically, InEditorZenModeContext, ActiveEditorCanRevertContext, ActiveEditorGroupLockedContext, ActiveEditorCanSplitInGroupContext, SideBySideEditorActiveContext, AuxiliaryBarVisibleContext, SideBarVisibleContext, PanelAlignmentContext, PanelMaximizedContext, PanelVisibleContext, ActiveEditorContext, EditorsVisibleContext, TextCompareEditorVisibleContext, TextCompareEditorActiveContext, ActiveEditorGroupEmptyContext, MultipleEditorGroupsContext, EditorTabsVisibleContext, IsCenteredLayoutContext, ActiveEditorGroupIndexContext, ActiveEditorGroupLastContext, ActiveEditorReadonlyContext, EditorAreaVisibleContext, ActiveEditorAvailableEditorIdsContext, DirtyWorkingCopiesContext, EmptyWorkspaceSupportContext, EnterMultiRootWorkspaceSupportContext, HasWebFileSystemAccess, IsFullscreenContext, OpenFolderWorkspaceSupportContext, RemoteNameContext, VirtualWorkspaceContext, WorkbenchStateContext, WorkspaceFolderCountContext, PanelPositionContext, IsEnabledFileDownloads } from 'vs/workbench/common/contextkeys';
|
||||
import { TEXT_DIFF_EDITOR_ID, EditorInputCapabilities, SIDE_BY_SIDE_EDITOR_ID, DEFAULT_EDITOR_ASSOCIATION } from 'vs/workbench/common/editor';
|
||||
import { trackFocus, addDisposableListener, EventType } from 'vs/base/browser/dom';
|
||||
import { preferredSideBySideGroupDirection, GroupDirection, IEditorGroupsService } from 'vs/workbench/services/editor/common/editorGroupsService';
|
||||
import { IConfigurationService } from 'vs/platform/configuration/common/configuration';
|
||||
-import { IWorkbenchEnvironmentService } from 'vs/workbench/services/environment/common/environmentService';
|
||||
import { IEditorService } from 'vs/workbench/services/editor/common/editorService';
|
||||
import { WorkbenchState, IWorkspaceContextService } from 'vs/platform/workspace/common/workspace';
|
||||
import { IWorkbenchLayoutService, Parts, positionToString } from 'vs/workbench/services/layout/browser/layoutService';
|
||||
@@ -24,6 +23,7 @@ import { IEditorResolverService } from '
|
||||
import { IPaneCompositePartService } from 'vs/workbench/services/panecomposite/browser/panecomposite';
|
||||
import { Schemas } from 'vs/base/common/network';
|
||||
import { WebFileSystemAccess } from 'vs/platform/files/browser/webFileSystemAccess';
|
||||
+import { IBrowserWorkbenchEnvironmentService } from '../services/environment/browser/environmentService';
|
||||
|
||||
export class WorkbenchContextKeysHandler extends Disposable {
|
||||
private inputFocusedContext: IContextKey<boolean>;
|
||||
@@ -75,7 +75,7 @@ export class WorkbenchContextKeysHandler
|
||||
@IContextKeyService private readonly contextKeyService: IContextKeyService,
|
||||
@IWorkspaceContextService private readonly contextService: IWorkspaceContextService,
|
||||
@IConfigurationService private readonly configurationService: IConfigurationService,
|
||||
- @IWorkbenchEnvironmentService private readonly environmentService: IWorkbenchEnvironmentService,
|
||||
+ @IBrowserWorkbenchEnvironmentService private readonly environmentService: IBrowserWorkbenchEnvironmentService,
|
||||
@IEditorService private readonly editorService: IEditorService,
|
||||
@IEditorResolverService private readonly editorResolverService: IEditorResolverService,
|
||||
@IEditorGroupsService private readonly editorGroupService: IEditorGroupsService,
|
||||
@@ -194,6 +194,9 @@ export class WorkbenchContextKeysHandler
|
||||
this.auxiliaryBarVisibleContext = AuxiliaryBarVisibleContext.bindTo(this.contextKeyService);
|
||||
this.auxiliaryBarVisibleContext.set(this.layoutService.isVisible(Parts.AUXILIARYBAR_PART));
|
||||
|
||||
+ // code-server
|
||||
+ IsEnabledFileDownloads.bindTo(this.contextKeyService).set(this.environmentService.isEnabledFileDownloads ?? true)
|
||||
+
|
||||
this.registerListeners();
|
||||
}
|
||||
|
||||
Index: code-server/lib/vscode/src/vs/workbench/contrib/files/browser/fileActions.contribution.ts
|
||||
===================================================================
|
||||
--- code-server.orig/lib/vscode/src/vs/workbench/contrib/files/browser/fileActions.contribution.ts
|
||||
+++ code-server/lib/vscode/src/vs/workbench/contrib/files/browser/fileActions.contribution.ts
|
||||
@@ -22,7 +22,7 @@ import { CLOSE_SAVED_EDITORS_COMMAND_ID,
|
||||
import { AutoSaveAfterShortDelayContext } from 'vs/workbench/services/filesConfiguration/common/filesConfigurationService';
|
||||
import { WorkbenchListDoubleSelection } from 'vs/platform/list/browser/listService';
|
||||
import { Schemas } from 'vs/base/common/network';
|
||||
-import { DirtyWorkingCopiesContext, EmptyWorkspaceSupportContext, EnterMultiRootWorkspaceSupportContext, HasWebFileSystemAccess, WorkbenchStateContext, WorkspaceFolderCountContext, SidebarFocusContext, ActiveEditorCanRevertContext, ActiveEditorContext, ResourceContextKey } from 'vs/workbench/common/contextkeys';
|
||||
+import { DirtyWorkingCopiesContext, EmptyWorkspaceSupportContext, EnterMultiRootWorkspaceSupportContext, HasWebFileSystemAccess, WorkbenchStateContext, WorkspaceFolderCountContext, SidebarFocusContext, ActiveEditorCanRevertContext, ActiveEditorContext, ResourceContextKey, IsEnabledFileDownloads } from 'vs/workbench/common/contextkeys';
|
||||
import { IsWebContext } from 'vs/platform/contextkey/common/contextkeys';
|
||||
import { ServicesAccessor } from 'vs/platform/instantiation/common/instantiation';
|
||||
import { ThemeIcon } from 'vs/platform/theme/common/themeService';
|
||||
@@ -477,13 +477,16 @@ MenuRegistry.appendMenuItem(MenuId.Explo
|
||||
id: DOWNLOAD_COMMAND_ID,
|
||||
title: DOWNLOAD_LABEL
|
||||
},
|
||||
- when: ContextKeyExpr.or(
|
||||
- // native: for any remote resource
|
||||
- ContextKeyExpr.and(IsWebContext.toNegated(), ResourceContextKey.Scheme.notEqualsTo(Schemas.file)),
|
||||
- // web: for any files
|
||||
- ContextKeyExpr.and(IsWebContext, ExplorerFolderContext.toNegated(), ExplorerRootContext.toNegated()),
|
||||
- // web: for any folders if file system API support is provided
|
||||
- ContextKeyExpr.and(IsWebContext, HasWebFileSystemAccess)
|
||||
+ when: ContextKeyExpr.and(
|
||||
+ IsEnabledFileDownloads,
|
||||
+ ContextKeyExpr.or(
|
||||
+ // native: for any remote resource
|
||||
+ ContextKeyExpr.and(IsWebContext.toNegated(), ResourceContextKey.Scheme.notEqualsTo(Schemas.file)),
|
||||
+ // web: for any files
|
||||
+ ContextKeyExpr.and(IsWebContext, ExplorerFolderContext.toNegated(), ExplorerRootContext.toNegated()),
|
||||
+ // web: for any folders if file system API support is provided
|
||||
+ ContextKeyExpr.and(IsWebContext, HasWebFileSystemAccess)
|
||||
+ )
|
||||
)
|
||||
}));
|
||||
|
||||
Index: code-server/lib/vscode/src/vs/workbench/common/contextkeys.ts
|
||||
===================================================================
|
||||
--- code-server.orig/lib/vscode/src/vs/workbench/common/contextkeys.ts
|
||||
+++ code-server/lib/vscode/src/vs/workbench/common/contextkeys.ts
|
||||
@@ -30,6 +30,8 @@ export const IsFullscreenContext = new R
|
||||
|
||||
export const HasWebFileSystemAccess = new RawContextKey<boolean>('hasWebFileSystemAccess', false, true); // Support for FileSystemAccess web APIs (https://wicg.github.io/file-system-access)
|
||||
|
||||
+export const IsEnabledFileDownloads = new RawContextKey<boolean>('isEnabledFileDownloads', true, true);
|
||||
+
|
||||
//#endregion
|
||||
|
||||
|
||||
269
patches/display-language.diff
Normal file
269
patches/display-language.diff
Normal file
@@ -0,0 +1,269 @@
|
||||
Add display language support
|
||||
|
||||
We can remove this once upstream supports all language packs.
|
||||
|
||||
1. Proxies language packs to the service on the backend.
|
||||
2. NLS configuration is embedded into the HTML for the browser to pick up. This
|
||||
code to generate this configuration is copied from the native portion.
|
||||
3. Remove navigator.language default since that will prevent the argv file from
|
||||
being created if you are changing the language to whatever your browser
|
||||
default happens to be.
|
||||
4. Move the argv.json file to the server instead of in-browser storage. This is
|
||||
where the current locale is stored and currently the server needs to be able
|
||||
to read it.
|
||||
5. Add the locale flag.
|
||||
|
||||
Index: code-server/lib/vscode/src/vs/server/node/serverServices.ts
|
||||
===================================================================
|
||||
--- code-server.orig/lib/vscode/src/vs/server/node/serverServices.ts
|
||||
+++ code-server/lib/vscode/src/vs/server/node/serverServices.ts
|
||||
@@ -202,6 +202,9 @@ export async function setupServerService
|
||||
const channel = new ExtensionManagementChannel(extensionManagementService, (ctx: RemoteAgentConnectionContext) => getUriTransformer(ctx.remoteAuthority));
|
||||
socketServer.registerChannel('extensions', channel);
|
||||
|
||||
+ const languagePackChannel = ProxyChannel.fromService<RemoteAgentConnectionContext>(accessor.get(ILanguagePackService));
|
||||
+ socketServer.registerChannel('languagePacks', languagePackChannel);
|
||||
+
|
||||
const encryptionChannel = ProxyChannel.fromService<RemoteAgentConnectionContext>(accessor.get(IEncryptionMainService));
|
||||
socketServer.registerChannel('encryption', encryptionChannel);
|
||||
|
||||
Index: code-server/lib/vscode/src/vs/base/common/platform.ts
|
||||
===================================================================
|
||||
--- code-server.orig/lib/vscode/src/vs/base/common/platform.ts
|
||||
+++ code-server/lib/vscode/src/vs/base/common/platform.ts
|
||||
@@ -80,8 +80,19 @@ if (typeof navigator === 'object' && !is
|
||||
_isIOS = (_userAgent.indexOf('Macintosh') >= 0 || _userAgent.indexOf('iPad') >= 0 || _userAgent.indexOf('iPhone') >= 0) && !!navigator.maxTouchPoints && navigator.maxTouchPoints > 0;
|
||||
_isLinux = _userAgent.indexOf('Linux') >= 0;
|
||||
_isWeb = true;
|
||||
- _locale = navigator.language;
|
||||
+ _locale = LANGUAGE_DEFAULT;
|
||||
_language = _locale;
|
||||
+
|
||||
+ const el = typeof document !== 'undefined' && document.getElementById('vscode-remote-nls-configuration');
|
||||
+ const rawNlsConfig = el && el.getAttribute('data-settings');
|
||||
+ if (rawNlsConfig) {
|
||||
+ try {
|
||||
+ const nlsConfig: NLSConfig = JSON.parse(rawNlsConfig);
|
||||
+ _locale = nlsConfig.locale;
|
||||
+ _translationsConfigFile = nlsConfig._translationsConfigFile;
|
||||
+ _language = nlsConfig.availableLanguages['*'] || LANGUAGE_DEFAULT;
|
||||
+ } catch (error) { /* Oh well. */ }
|
||||
+ }
|
||||
}
|
||||
|
||||
// Native environment
|
||||
Index: code-server/lib/vscode/src/vs/code/browser/workbench/workbench.html
|
||||
===================================================================
|
||||
--- code-server.orig/lib/vscode/src/vs/code/browser/workbench/workbench.html
|
||||
+++ code-server/lib/vscode/src/vs/code/browser/workbench/workbench.html
|
||||
@@ -23,6 +23,9 @@
|
||||
<!-- Workbench Auth Session -->
|
||||
<meta id="vscode-workbench-auth-session" data-settings="{{WORKBENCH_AUTH_SESSION}}">
|
||||
|
||||
+ <!-- NLS Configuration -->
|
||||
+ <meta id="vscode-remote-nls-configuration" data-settings="{{NLS_CONFIGURATION}}">
|
||||
+
|
||||
<!-- Workbench Icon/Manifest/CSS -->
|
||||
<link rel="icon" href="{{BASE}}/_static/src/browser/media/favicon-dark-support.svg" />
|
||||
<link rel="alternate icon" href="{{BASE}}/_static/src/browser/media/favicon.ico" type="image/x-icon" />
|
||||
@@ -43,17 +46,27 @@
|
||||
self.webPackagePaths[key] = `${baseUrl}/node_modules/${key}/${self.webPackagePaths[key]}`;
|
||||
});
|
||||
|
||||
- // Set up nls if the user is not using the default language (English)
|
||||
const nlsConfig = {};
|
||||
- const locale = navigator.language;
|
||||
- if (!locale.startsWith('en')) {
|
||||
- nlsConfig['vs/nls'] = {
|
||||
- availableLanguages: {
|
||||
- '*': locale
|
||||
- },
|
||||
- baseUrl: '{{WORKBENCH_NLS_BASE_URL}}'
|
||||
- };
|
||||
- }
|
||||
+ try {
|
||||
+ nlsConfig['vs/nls'] = JSON.parse(document.getElementById("vscode-remote-nls-configuration").getAttribute("data-settings"))
|
||||
+ if (nlsConfig['vs/nls']._resolvedLanguagePackCoreLocation) {
|
||||
+ const bundles = Object.create(null)
|
||||
+ nlsConfig['vs/nls'].loadBundle = (bundle, _language, cb) => {
|
||||
+ const result = bundles[bundle]
|
||||
+ if (result) {
|
||||
+ return cb(undefined, result)
|
||||
+ }
|
||||
+ const path = nlsConfig['vs/nls']._resolvedLanguagePackCoreLocation + "/" + bundle.replace(/\//g, "!") + ".nls.json"
|
||||
+ fetch(`{{WORKBENCH_WEB_BASE_URL}}/vscode-remote-resource?path=${encodeURIComponent(path)}`)
|
||||
+ .then((response) => response.json())
|
||||
+ .then((json) => {
|
||||
+ bundles[bundle] = json
|
||||
+ cb(undefined, json)
|
||||
+ })
|
||||
+ .catch(cb)
|
||||
+ }
|
||||
+ }
|
||||
+ } catch (error) { /* Probably fine. */ }
|
||||
|
||||
require.config({
|
||||
baseUrl: `${baseUrl}/out`,
|
||||
Index: code-server/lib/vscode/src/vs/platform/environment/common/environmentService.ts
|
||||
===================================================================
|
||||
--- code-server.orig/lib/vscode/src/vs/platform/environment/common/environmentService.ts
|
||||
+++ code-server/lib/vscode/src/vs/platform/environment/common/environmentService.ts
|
||||
@@ -108,7 +108,7 @@ export abstract class AbstractNativeEnvi
|
||||
return URI.file(join(vscodePortable, 'argv.json'));
|
||||
}
|
||||
|
||||
- return joinPath(this.userHome, this.productService.dataFolderName, 'argv.json');
|
||||
+ return joinPath(this.appSettingsHome, 'argv.json');
|
||||
}
|
||||
|
||||
@memoize
|
||||
Index: code-server/lib/vscode/src/vs/server/node/remoteLanguagePacks.ts
|
||||
===================================================================
|
||||
--- code-server.orig/lib/vscode/src/vs/server/node/remoteLanguagePacks.ts
|
||||
+++ code-server/lib/vscode/src/vs/server/node/remoteLanguagePacks.ts
|
||||
@@ -30,6 +30,12 @@ export function getNLSConfiguration(lang
|
||||
if (InternalNLSConfiguration.is(value)) {
|
||||
value._languagePackSupport = true;
|
||||
}
|
||||
+ // If the configuration has no results keep trying since code-server
|
||||
+ // doesn't restart when a language is installed so this result would
|
||||
+ // persist (the plugin might not be installed yet for example).
|
||||
+ if (value.locale !== 'en' && value.locale !== 'en-us' && Object.keys(value.availableLanguages).length === 0) {
|
||||
+ _cache.delete(key);
|
||||
+ }
|
||||
return value;
|
||||
});
|
||||
_cache.set(key, result);
|
||||
@@ -44,3 +50,43 @@ export namespace InternalNLSConfiguratio
|
||||
return candidate && typeof candidate._languagePackId === 'string';
|
||||
}
|
||||
}
|
||||
+
|
||||
+/**
|
||||
+ * The code below is copied from from src/main.js.
|
||||
+ */
|
||||
+
|
||||
+export const getLocaleFromConfig = async (argvResource: string): Promise<string> => {
|
||||
+ try {
|
||||
+ const content = stripComments(await fs.promises.readFile(argvResource, 'utf8'));
|
||||
+ return JSON.parse(content).locale;
|
||||
+ } catch (error) {
|
||||
+ if (error.code !== "ENOENT") {
|
||||
+ console.warn(error)
|
||||
+ }
|
||||
+ return 'en';
|
||||
+ }
|
||||
+};
|
||||
+
|
||||
+const stripComments = (content: string): string => {
|
||||
+ const regexp = /('(?:[^\\']*(?:\\.)?)*')|('(?:[^\\']*(?:\\.)?)*')|(\/\*(?:\r?\n|.)*?\*\/)|(\/{2,}.*?(?:(?:\r?\n)|$))/g;
|
||||
+
|
||||
+ return content.replace(regexp, (match, _m1, _m2, m3, m4) => {
|
||||
+ // Only one of m1, m2, m3, m4 matches
|
||||
+ if (m3) {
|
||||
+ // A block comment. Replace with nothing
|
||||
+ return '';
|
||||
+ } else if (m4) {
|
||||
+ // A line comment. If it ends in \r?\n then keep it.
|
||||
+ const length_1 = m4.length;
|
||||
+ if (length_1 > 2 && m4[length_1 - 1] === '\n') {
|
||||
+ return m4[length_1 - 2] === '\r' ? '\r\n' : '\n';
|
||||
+ }
|
||||
+ else {
|
||||
+ return '';
|
||||
+ }
|
||||
+ } else {
|
||||
+ // We match a string
|
||||
+ return match;
|
||||
+ }
|
||||
+ });
|
||||
+};
|
||||
Index: code-server/lib/vscode/src/vs/server/node/webClientServer.ts
|
||||
===================================================================
|
||||
--- code-server.orig/lib/vscode/src/vs/server/node/webClientServer.ts
|
||||
+++ code-server/lib/vscode/src/vs/server/node/webClientServer.ts
|
||||
@@ -26,6 +26,7 @@ import { URI } from 'vs/base/common/uri'
|
||||
import { streamToBuffer } from 'vs/base/common/buffer';
|
||||
import { IProductConfiguration } from 'vs/base/common/product';
|
||||
import { isString } from 'vs/base/common/types';
|
||||
+import { getLocaleFromConfig, getNLSConfiguration } from 'vs/server/node/remoteLanguagePacks';
|
||||
import { CharCode } from 'vs/base/common/charCode';
|
||||
import { getRemoteServerRootPath } from 'vs/platform/remote/common/remoteHosts';
|
||||
|
||||
@@ -295,6 +296,8 @@ export class WebClientServer {
|
||||
|
||||
const base = relativeRoot(getOriginalUrl(req))
|
||||
const vscodeBase = relativePath(getOriginalUrl(req))
|
||||
+ const locale = this._environmentService.args.locale || await getLocaleFromConfig(this._environmentService.argvResource.fsPath);
|
||||
+ const nlsConfiguration = await getNLSConfiguration(locale, this._environmentService.userDataPath)
|
||||
|
||||
const workbenchWebConfiguration = {
|
||||
remoteAuthority,
|
||||
@@ -338,6 +341,7 @@ export class WebClientServer {
|
||||
WORKBENCH_NLS_BASE_URL: vscodeBase + (nlsBaseUrl ? `${nlsBaseUrl}${this._productService.commit}/${this._productService.version}/` : ''),
|
||||
BASE: base,
|
||||
VS_BASE: vscodeBase,
|
||||
+ NLS_CONFIGURATION: asJSON(nlsConfiguration),
|
||||
};
|
||||
|
||||
|
||||
Index: code-server/lib/vscode/src/vs/server/node/serverEnvironmentService.ts
|
||||
===================================================================
|
||||
--- code-server.orig/lib/vscode/src/vs/server/node/serverEnvironmentService.ts
|
||||
+++ code-server/lib/vscode/src/vs/server/node/serverEnvironmentService.ts
|
||||
@@ -15,6 +15,7 @@ export const serverOptions: OptionDescri
|
||||
'disable-update-check': { type: 'boolean' },
|
||||
'auth': { type: 'string' },
|
||||
'disable-file-downloads': { type: 'boolean' },
|
||||
+ 'locale': { type: 'string' },
|
||||
|
||||
/* ----- server setup ----- */
|
||||
|
||||
@@ -96,6 +97,7 @@ export interface ServerParsedArgs {
|
||||
'disable-update-check'?: boolean;
|
||||
'auth'?: string
|
||||
'disable-file-downloads'?: boolean;
|
||||
+ 'locale'?: string
|
||||
|
||||
/* ----- server setup ----- */
|
||||
|
||||
Index: code-server/lib/vscode/src/vs/workbench/workbench.web.main.ts
|
||||
===================================================================
|
||||
--- code-server.orig/lib/vscode/src/vs/workbench/workbench.web.main.ts
|
||||
+++ code-server/lib/vscode/src/vs/workbench/workbench.web.main.ts
|
||||
@@ -109,6 +109,12 @@ registerSingleton(IDiagnosticsService, N
|
||||
|
||||
//#region --- workbench contributions
|
||||
|
||||
+// Localization. These do not actually import anything specific to Electron so
|
||||
+// they should be safe.
|
||||
+import 'vs/workbench/services/localization/electron-sandbox/localeService';
|
||||
+import 'vs/workbench/contrib/localization/electron-sandbox/localization.contribution';
|
||||
+import 'vs/platform/languagePacks/browser/languagePacks';
|
||||
+
|
||||
// Output
|
||||
import 'vs/workbench/contrib/output/common/outputChannelModelService';
|
||||
|
||||
Index: code-server/lib/vscode/src/vs/platform/languagePacks/browser/languagePacks.ts
|
||||
===================================================================
|
||||
--- /dev/null
|
||||
+++ code-server/lib/vscode/src/vs/platform/languagePacks/browser/languagePacks.ts
|
||||
@@ -0,0 +1,18 @@
|
||||
+import { ProxyChannel } from 'vs/base/parts/ipc/common/ipc';
|
||||
+import { registerSingleton } from 'vs/platform/instantiation/common/extensions';
|
||||
+import { ILanguagePackService } from 'vs/platform/languagePacks/common/languagePacks';
|
||||
+import { IRemoteAgentService } from 'vs/workbench/services/remote/common/remoteAgentService';
|
||||
+
|
||||
+// @ts-ignore: interface is implemented via proxy
|
||||
+export class LanguagePackService implements ILanguagePackService {
|
||||
+
|
||||
+ declare readonly _serviceBrand: undefined;
|
||||
+
|
||||
+ constructor(
|
||||
+ @IRemoteAgentService remoteAgentService: IRemoteAgentService,
|
||||
+ ) {
|
||||
+ return ProxyChannel.toService<ILanguagePackService>(remoteAgentService.getConnection()!.getChannel('languagePacks'));
|
||||
+ }
|
||||
+}
|
||||
+
|
||||
+registerSingleton(ILanguagePackService, LanguagePackService, true);
|
||||
106
patches/github-auth.diff
Normal file
106
patches/github-auth.diff
Normal file
@@ -0,0 +1,106 @@
|
||||
Add the ability to provide a GitHub token
|
||||
|
||||
To test install the GitHub PR extension and start code-server with GITHUB_TOKEN
|
||||
or set github-auth in the config file. The extension should be authenticated.
|
||||
|
||||
Index: code-server/lib/vscode/src/vs/platform/credentials/node/credentialsMainService.ts
|
||||
===================================================================
|
||||
--- code-server.orig/lib/vscode/src/vs/platform/credentials/node/credentialsMainService.ts
|
||||
+++ code-server/lib/vscode/src/vs/platform/credentials/node/credentialsMainService.ts
|
||||
@@ -5,9 +5,18 @@
|
||||
|
||||
import { InMemoryCredentialsProvider } from 'vs/platform/credentials/common/credentials';
|
||||
import { ILogService } from 'vs/platform/log/common/log';
|
||||
-import { INativeEnvironmentService } from 'vs/platform/environment/common/environment';
|
||||
+import { IServerEnvironmentService } from 'vs/server/node/serverEnvironmentService';
|
||||
import { IProductService } from 'vs/platform/product/common/productService';
|
||||
import { BaseCredentialsMainService, KeytarModule } from 'vs/platform/credentials/common/credentialsMainService';
|
||||
+import { generateUuid } from 'vs/base/common/uuid';
|
||||
+import { equals as arrayEquals } from 'vs/base/common/arrays';
|
||||
+
|
||||
+interface IToken {
|
||||
+ accessToken: string
|
||||
+ account?: { label: string }
|
||||
+ id: string
|
||||
+ scopes: string[]
|
||||
+}
|
||||
|
||||
export class CredentialsWebMainService extends BaseCredentialsMainService {
|
||||
// Since we fallback to the in-memory credentials provider, we do not need to surface any Keytar load errors
|
||||
@@ -16,10 +25,15 @@ export class CredentialsWebMainService e
|
||||
|
||||
constructor(
|
||||
@ILogService logService: ILogService,
|
||||
- @INativeEnvironmentService private readonly environmentMainService: INativeEnvironmentService,
|
||||
+ @IServerEnvironmentService private readonly environmentMainService: IServerEnvironmentService,
|
||||
@IProductService private readonly productService: IProductService,
|
||||
) {
|
||||
super(logService);
|
||||
+ if (this.environmentMainService.args["github-auth"]) {
|
||||
+ this.storeGitHubToken(this.environmentMainService.args["github-auth"]).catch((error) => {
|
||||
+ this.logService.error('Failed to store provided GitHub token', error)
|
||||
+ })
|
||||
+ }
|
||||
}
|
||||
|
||||
// If the credentials service is running on the server, we add a suffix -server to differentiate from the location that the
|
||||
@@ -48,4 +62,59 @@ export class CredentialsWebMainService e
|
||||
}
|
||||
return this._keytarCache;
|
||||
}
|
||||
+
|
||||
+ private async storeGitHubToken(githubToken: string): Promise<void> {
|
||||
+ const extensionId = 'vscode.github-authentication';
|
||||
+ const service = `${await this.getSecretStoragePrefix()}${extensionId}`;
|
||||
+ const account = 'github.auth';
|
||||
+ const scopes = [['read:user', 'user:email', 'repo']]
|
||||
+
|
||||
+ // Oddly the scopes need to match exactly so we cannot just have one token
|
||||
+ // with all the scopes, instead we have to duplicate the token for each
|
||||
+ // expected set of scopes.
|
||||
+ const tokens: IToken[] = scopes.map((scopes) => ({
|
||||
+ id: generateUuid(),
|
||||
+ scopes: scopes.sort(), // Sort for comparing later.
|
||||
+ accessToken: githubToken,
|
||||
+ }));
|
||||
+
|
||||
+ const raw = await this.getPassword(service, account)
|
||||
+
|
||||
+ let existing: {
|
||||
+ content: IToken[]
|
||||
+ } | undefined;
|
||||
+
|
||||
+ if (raw) {
|
||||
+ try {
|
||||
+ const json = JSON.parse(raw);
|
||||
+ json.content = JSON.parse(json.content);
|
||||
+ existing = json;
|
||||
+ } catch (error) {
|
||||
+ this.logService.error('Failed to parse existing GitHub credentials', error)
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+ // Keep tokens for account and scope combinations we do not have in case
|
||||
+ // there is an extension that uses scopes we have not accounted for (in
|
||||
+ // these cases the user will need to manually authenticate the extension
|
||||
+ // through the UI) or the user has tokens for other accounts.
|
||||
+ if (existing?.content) {
|
||||
+ existing.content = existing.content.filter((existingToken) => {
|
||||
+ const scopes = existingToken.scopes.sort();
|
||||
+ return !(tokens.find((token) => {
|
||||
+ return arrayEquals(scopes, token.scopes)
|
||||
+ && token.account?.label === existingToken.account?.label;
|
||||
+ }))
|
||||
+ })
|
||||
+ }
|
||||
+
|
||||
+ return this.setPassword(service, account, JSON.stringify({
|
||||
+ extensionId,
|
||||
+ ...(existing || {}),
|
||||
+ content: JSON.stringify([
|
||||
+ ...tokens,
|
||||
+ ...(existing?.content || []),
|
||||
+ ])
|
||||
+ }));
|
||||
+ }
|
||||
}
|
||||
62
patches/insecure-notification.diff
Normal file
62
patches/insecure-notification.diff
Normal file
@@ -0,0 +1,62 @@
|
||||
Add a notification when accessing code-server in an insecure context
|
||||
|
||||
This is done because otherwise when things like the clipboard do not work users
|
||||
may think code-server is broken. Ideally there would be a notification at the
|
||||
point where these things are used instead of this though.
|
||||
|
||||
To test access over something like an HTTP domain or an IP address (not
|
||||
localhost). For example:
|
||||
|
||||
1. run code-server
|
||||
2. use ngrok to expose code-server
|
||||
3. access via HTTP
|
||||
4. look for notification in bottom right
|
||||
|
||||
Index: code-server/lib/vscode/src/vs/workbench/browser/client.ts
|
||||
===================================================================
|
||||
--- code-server.orig/lib/vscode/src/vs/workbench/browser/client.ts
|
||||
+++ code-server/lib/vscode/src/vs/workbench/browser/client.ts
|
||||
@@ -1,7 +1,10 @@
|
||||
import { Disposable } from 'vs/base/common/lifecycle';
|
||||
+import { localize } from 'vs/nls';
|
||||
+import { INotificationService, Severity } from 'vs/platform/notification/common/notification';
|
||||
|
||||
export class CodeServerClient extends Disposable {
|
||||
constructor (
|
||||
+ @INotificationService private notificationService: INotificationService,
|
||||
) {
|
||||
super();
|
||||
}
|
||||
@@ -42,5 +45,32 @@ export class CodeServerClient extends Di
|
||||
}
|
||||
});
|
||||
}
|
||||
+
|
||||
+ if (!window.isSecureContext) {
|
||||
+ this.notificationService.notify({
|
||||
+ severity: Severity.Warning,
|
||||
+ message: localize(
|
||||
+ 'insecureContext',
|
||||
+ "{0} is being accessed in an insecure context. Web views, the clipboard, and other functionality may not work as expected.",
|
||||
+ 'code-server',
|
||||
+ ),
|
||||
+ actions: {
|
||||
+ primary: [
|
||||
+ {
|
||||
+ id: 'understand',
|
||||
+ label: localize('confirmInsecure', "I understand"),
|
||||
+ tooltip: '',
|
||||
+ class: undefined,
|
||||
+ enabled: true,
|
||||
+ checked: true,
|
||||
+ dispose: () => undefined,
|
||||
+ run: () => {
|
||||
+ return Promise.resolve();
|
||||
+ },
|
||||
+ },
|
||||
+ ],
|
||||
+ },
|
||||
+ });
|
||||
+ }
|
||||
}
|
||||
}
|
||||
273
patches/integration.diff
Normal file
273
patches/integration.diff
Normal file
@@ -0,0 +1,273 @@
|
||||
Prepare Code for integration with code-server
|
||||
|
||||
1. We already have the arguments so allow passing them in. There is also a
|
||||
slight change in a few directories to preserve the directory structure we
|
||||
have been using and to not override passed-in arguments.
|
||||
2. Modify the terminal environment to filter out code-server environment variables.
|
||||
3. Add the code-server version to the help dialog.
|
||||
4. Add ready events for use in an iframe.
|
||||
5. Add our icons.
|
||||
6. Use our own manifest.
|
||||
|
||||
Index: code-server/lib/vscode/src/vs/server/node/server.main.ts
|
||||
===================================================================
|
||||
--- code-server.orig/lib/vscode/src/vs/server/node/server.main.ts
|
||||
+++ code-server/lib/vscode/src/vs/server/node/server.main.ts
|
||||
@@ -12,7 +12,7 @@ import { createServer as doCreateServer,
|
||||
import { parseArgs, ErrorReporter } from 'vs/platform/environment/node/argv';
|
||||
import { join, dirname } from 'vs/base/common/path';
|
||||
import { performance } from 'perf_hooks';
|
||||
-import { serverOptions } from 'vs/server/node/serverEnvironmentService';
|
||||
+import { serverOptions, ServerParsedArgs } from 'vs/server/node/serverEnvironmentService';
|
||||
import product from 'vs/platform/product/common/product';
|
||||
import * as perf from 'vs/base/common/performance';
|
||||
|
||||
@@ -34,38 +34,43 @@ const errorReporter: ErrorReporter = {
|
||||
}
|
||||
};
|
||||
|
||||
-const args = parseArgs(process.argv.slice(2), serverOptions, errorReporter);
|
||||
+function parse(): ServerParsedArgs {
|
||||
+ return parseArgs(process.argv.slice(2), serverOptions, errorReporter);
|
||||
+}
|
||||
|
||||
-const REMOTE_DATA_FOLDER = args['server-data-dir'] || process.env['VSCODE_AGENT_FOLDER'] || join(os.homedir(), product.serverDataFolderName || '.vscode-remote');
|
||||
-const USER_DATA_PATH = join(REMOTE_DATA_FOLDER, 'data');
|
||||
-const APP_SETTINGS_HOME = join(USER_DATA_PATH, 'User');
|
||||
-const GLOBAL_STORAGE_HOME = join(APP_SETTINGS_HOME, 'globalStorage');
|
||||
-const LOCAL_HISTORY_HOME = join(APP_SETTINGS_HOME, 'History');
|
||||
-const MACHINE_SETTINGS_HOME = join(USER_DATA_PATH, 'Machine');
|
||||
-args['user-data-dir'] = USER_DATA_PATH;
|
||||
-const APP_ROOT = dirname(FileAccess.asFileUri('', require).fsPath);
|
||||
-const BUILTIN_EXTENSIONS_FOLDER_PATH = join(APP_ROOT, 'extensions');
|
||||
-args['builtin-extensions-dir'] = BUILTIN_EXTENSIONS_FOLDER_PATH;
|
||||
-args['extensions-dir'] = args['extensions-dir'] || join(REMOTE_DATA_FOLDER, 'extensions');
|
||||
-
|
||||
-[REMOTE_DATA_FOLDER, args['extensions-dir'], USER_DATA_PATH, APP_SETTINGS_HOME, MACHINE_SETTINGS_HOME, GLOBAL_STORAGE_HOME, LOCAL_HISTORY_HOME].forEach(f => {
|
||||
- try {
|
||||
- if (!fs.existsSync(f)) {
|
||||
- fs.mkdirSync(f, { mode: 0o700 });
|
||||
- }
|
||||
- } catch (err) { console.error(err); }
|
||||
-});
|
||||
+function createDirs(args: ServerParsedArgs): string {
|
||||
+ const REMOTE_DATA_FOLDER = args['server-data-dir'] || args['user-data-dir'] || process.env['VSCODE_AGENT_FOLDER'] || join(os.homedir(), product.serverDataFolderName || '.vscode-remote');
|
||||
+ const USER_DATA_PATH = args['user-data-dir'] || join(REMOTE_DATA_FOLDER, 'data');
|
||||
+ const APP_SETTINGS_HOME = join(USER_DATA_PATH, 'User');
|
||||
+ const GLOBAL_STORAGE_HOME = join(APP_SETTINGS_HOME, 'globalStorage');
|
||||
+ const LOCAL_HISTORY_HOME = join(APP_SETTINGS_HOME, 'History');
|
||||
+ const MACHINE_SETTINGS_HOME = join(USER_DATA_PATH, 'Machine');
|
||||
+ args['user-data-dir'] = USER_DATA_PATH;
|
||||
+ const APP_ROOT = dirname(FileAccess.asFileUri('', require).fsPath);
|
||||
+ const BUILTIN_EXTENSIONS_FOLDER_PATH = args['builtin-extensions-dir'] || join(APP_ROOT, 'extensions');
|
||||
+ args['builtin-extensions-dir'] = BUILTIN_EXTENSIONS_FOLDER_PATH;
|
||||
+ args['extensions-dir'] = args['extensions-dir'] || join(REMOTE_DATA_FOLDER, 'extensions');
|
||||
+
|
||||
+ [REMOTE_DATA_FOLDER, args['extensions-dir'], USER_DATA_PATH, APP_SETTINGS_HOME, MACHINE_SETTINGS_HOME, GLOBAL_STORAGE_HOME, LOCAL_HISTORY_HOME].forEach(f => {
|
||||
+ try {
|
||||
+ if (!fs.existsSync(f)) {
|
||||
+ fs.mkdirSync(f, { mode: 0o700 });
|
||||
+ }
|
||||
+ } catch (err) { console.error(err); }
|
||||
+ });
|
||||
+ return REMOTE_DATA_FOLDER;
|
||||
+}
|
||||
|
||||
/**
|
||||
* invoked by server-main.js
|
||||
*/
|
||||
-export function spawnCli() {
|
||||
- runCli(args, REMOTE_DATA_FOLDER, serverOptions);
|
||||
+export function spawnCli(args = parse()): Promise<void> {
|
||||
+ return runCli(args, createDirs(args), serverOptions);
|
||||
}
|
||||
|
||||
/**
|
||||
* invoked by server-main.js
|
||||
*/
|
||||
-export function createServer(address: string | net.AddressInfo | null): Promise<IServerAPI> {
|
||||
- return doCreateServer(address, args, REMOTE_DATA_FOLDER);
|
||||
+export function createServer(address: string | net.AddressInfo | null, args = parse()): Promise<IServerAPI> {
|
||||
+ return doCreateServer(address, args, createDirs(args));
|
||||
}
|
||||
Index: code-server/lib/vscode/src/vs/base/common/processes.ts
|
||||
===================================================================
|
||||
--- code-server.orig/lib/vscode/src/vs/base/common/processes.ts
|
||||
+++ code-server/lib/vscode/src/vs/base/common/processes.ts
|
||||
@@ -111,6 +111,8 @@ export function sanitizeProcessEnvironme
|
||||
/^VSCODE_(?!SHELL_LOGIN).+$/,
|
||||
/^SNAP(|_.*)$/,
|
||||
/^GDK_PIXBUF_.+$/,
|
||||
+ /^CODE_SERVER_.+$/,
|
||||
+ /^CS_.+$/,
|
||||
];
|
||||
const envKeys = Object.keys(env);
|
||||
envKeys
|
||||
Index: code-server/lib/vscode/src/vs/workbench/browser/parts/dialogs/dialogHandler.ts
|
||||
===================================================================
|
||||
--- code-server.orig/lib/vscode/src/vs/workbench/browser/parts/dialogs/dialogHandler.ts
|
||||
+++ code-server/lib/vscode/src/vs/workbench/browser/parts/dialogs/dialogHandler.ts
|
||||
@@ -143,8 +143,11 @@ export class BrowserDialogHandler implem
|
||||
|
||||
async about(): Promise<void> {
|
||||
const detailString = (useAgo: boolean): string => {
|
||||
- return localize('aboutDetail',
|
||||
- "Version: {0}\nCommit: {1}\nDate: {2}\nBrowser: {3}",
|
||||
+ return localize('aboutCodeServerDetail',
|
||||
+ "code-server: {0}",
|
||||
+ this.productService.codeServerVersion ? `v${this.productService.codeServerVersion}` : 'Unknown'
|
||||
+ ) + '\n' + localize('aboutDetail',
|
||||
+ "Code: {0}\nCommit: {1}\nDate: {2}\nBrowser: {3}",
|
||||
this.productService.version || 'Unknown',
|
||||
this.productService.commit || 'Unknown',
|
||||
this.productService.date ? `${this.productService.date}${useAgo ? ' (' + fromNow(new Date(this.productService.date), true) + ')' : ''}` : 'Unknown',
|
||||
Index: code-server/lib/vscode/src/vs/workbench/browser/client.ts
|
||||
===================================================================
|
||||
--- /dev/null
|
||||
+++ code-server/lib/vscode/src/vs/workbench/browser/client.ts
|
||||
@@ -0,0 +1,46 @@
|
||||
+import { Disposable } from 'vs/base/common/lifecycle';
|
||||
+
|
||||
+export class CodeServerClient extends Disposable {
|
||||
+ constructor (
|
||||
+ ) {
|
||||
+ super();
|
||||
+ }
|
||||
+
|
||||
+ async startup(): Promise<void> {
|
||||
+ // Emit ready events
|
||||
+ const event = new CustomEvent('ide-ready');
|
||||
+ window.dispatchEvent(event);
|
||||
+
|
||||
+ if (parent) {
|
||||
+ // Tell the parent loading has completed.
|
||||
+ parent.postMessage({ event: 'loaded' }, '*');
|
||||
+
|
||||
+ // Proxy or stop proxing events as requested by the parent.
|
||||
+ const listeners = new Map<string, (event: Event) => void>();
|
||||
+
|
||||
+ window.addEventListener('message', parentEvent => {
|
||||
+ const eventName = parentEvent.data.bind || parentEvent.data.unbind;
|
||||
+ if (eventName) {
|
||||
+ const oldListener = listeners.get(eventName);
|
||||
+ if (oldListener) {
|
||||
+ document.removeEventListener(eventName, oldListener);
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+ if (parentEvent.data.bind && parentEvent.data.prop) {
|
||||
+ const listener = (event: Event) => {
|
||||
+ parent?.postMessage(
|
||||
+ {
|
||||
+ event: parentEvent.data.event,
|
||||
+ [parentEvent.data.prop]: event[parentEvent.data.prop as keyof Event],
|
||||
+ },
|
||||
+ window.location.origin,
|
||||
+ );
|
||||
+ };
|
||||
+ listeners.set(parentEvent.data.bind, listener);
|
||||
+ document.addEventListener(parentEvent.data.bind, listener);
|
||||
+ }
|
||||
+ });
|
||||
+ }
|
||||
+ }
|
||||
+}
|
||||
Index: code-server/lib/vscode/src/vs/workbench/browser/web.main.ts
|
||||
===================================================================
|
||||
--- code-server.orig/lib/vscode/src/vs/workbench/browser/web.main.ts
|
||||
+++ code-server/lib/vscode/src/vs/workbench/browser/web.main.ts
|
||||
@@ -69,6 +69,7 @@ import { IndexedDB } from 'vs/base/brows
|
||||
import { BrowserCredentialsService } from 'vs/workbench/services/credentials/browser/credentialsService';
|
||||
import { IWorkspace } from 'vs/workbench/services/host/browser/browserHostService';
|
||||
import { WebFileSystemAccess } from 'vs/platform/files/browser/webFileSystemAccess';
|
||||
+import { CodeServerClient } from 'vs/workbench/browser/client';
|
||||
import { ITelemetryService } from 'vs/platform/telemetry/common/telemetry';
|
||||
import { IProgressService } from 'vs/platform/progress/common/progress';
|
||||
import { DelayedLogChannel } from 'vs/workbench/services/output/common/delayedLogChannel';
|
||||
@@ -109,6 +110,9 @@ export class BrowserMain extends Disposa
|
||||
// Startup
|
||||
const instantiationService = workbench.startup();
|
||||
|
||||
+ const codeServerClient = this._register(instantiationService.createInstance(CodeServerClient));
|
||||
+ await codeServerClient.startup();
|
||||
+
|
||||
// Window
|
||||
this._register(instantiationService.createInstance(BrowserWindow));
|
||||
|
||||
Index: code-server/lib/vscode/src/vs/base/common/product.ts
|
||||
===================================================================
|
||||
--- code-server.orig/lib/vscode/src/vs/base/common/product.ts
|
||||
+++ code-server/lib/vscode/src/vs/base/common/product.ts
|
||||
@@ -31,6 +31,8 @@ export type ExtensionVirtualWorkspaceSup
|
||||
};
|
||||
|
||||
export interface IProductConfiguration {
|
||||
+ readonly codeServerVersion?: string
|
||||
+
|
||||
readonly version: string;
|
||||
readonly date?: string;
|
||||
readonly quality?: string;
|
||||
Index: code-server/lib/vscode/src/vs/code/browser/workbench/workbench-dev.html
|
||||
===================================================================
|
||||
--- code-server.orig/lib/vscode/src/vs/code/browser/workbench/workbench-dev.html
|
||||
+++ code-server/lib/vscode/src/vs/code/browser/workbench/workbench-dev.html
|
||||
@@ -11,7 +11,8 @@
|
||||
<meta name="mobile-web-app-capable" content="yes" />
|
||||
<meta name="apple-mobile-web-app-capable" content="yes" />
|
||||
<meta name="apple-mobile-web-app-title" content="Code">
|
||||
- <link rel="apple-touch-icon" href="{{WORKBENCH_WEB_BASE_URL}}/resources/server/code-192.png" />
|
||||
+ <link rel="apple-touch-icon" sizes="192x192" href="/_static/src/browser/media/pwa-icon-192.png" />
|
||||
+ <link rel="apple-touch-icon" sizes="512x512" href="/_static/src/browser/media/pwa-icon-512.png" />
|
||||
|
||||
<!-- Disable pinch zooming -->
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0, user-scalable=no">
|
||||
@@ -26,8 +27,9 @@
|
||||
<meta id="vscode-workbench-builtin-extensions" data-settings="{{WORKBENCH_BUILTIN_EXTENSIONS}}">
|
||||
|
||||
<!-- Workbench Icon/Manifest/CSS -->
|
||||
- <link rel="icon" href="{{WORKBENCH_WEB_BASE_URL}}/resources/server/favicon.ico" type="image/x-icon" />
|
||||
- <link rel="manifest" href="{{WORKBENCH_WEB_BASE_URL}}/resources/server/manifest.json" crossorigin="use-credentials" />
|
||||
+ <link rel="icon" href="/_static/src/browser/media/favicon-dark-support.svg" />
|
||||
+ <link rel="alternate icon" href="/_static/src/browser/media/favicon.ico" type="image/x-icon" />
|
||||
+ <link rel="manifest" href="/manifest.json" crossorigin="use-credentials" />
|
||||
</head>
|
||||
|
||||
<body aria-label="">
|
||||
Index: code-server/lib/vscode/src/vs/code/browser/workbench/workbench.html
|
||||
===================================================================
|
||||
--- code-server.orig/lib/vscode/src/vs/code/browser/workbench/workbench.html
|
||||
+++ code-server/lib/vscode/src/vs/code/browser/workbench/workbench.html
|
||||
@@ -11,7 +11,8 @@
|
||||
<meta name="mobile-web-app-capable" content="yes" />
|
||||
<meta name="apple-mobile-web-app-capable" content="yes" />
|
||||
<meta name="apple-mobile-web-app-title" content="Code">
|
||||
- <link rel="apple-touch-icon" href="{{WORKBENCH_WEB_BASE_URL}}/resources/server/code-192.png" />
|
||||
+ <link rel="apple-touch-icon" sizes="192x192" href="/_static/src/browser/media/pwa-icon-192.png" />
|
||||
+ <link rel="apple-touch-icon" sizes="512x512" href="/_static/src/browser/media/pwa-icon-512.png" />
|
||||
|
||||
<!-- Disable pinch zooming -->
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0, user-scalable=no">
|
||||
@@ -23,8 +24,9 @@
|
||||
<meta id="vscode-workbench-auth-session" data-settings="{{WORKBENCH_AUTH_SESSION}}">
|
||||
|
||||
<!-- Workbench Icon/Manifest/CSS -->
|
||||
- <link rel="icon" href="{{WORKBENCH_WEB_BASE_URL}}/resources/server/favicon.ico" type="image/x-icon" />
|
||||
- <link rel="manifest" href="{{WORKBENCH_WEB_BASE_URL}}/resources/server/manifest.json" crossorigin="use-credentials" />
|
||||
+ <link rel="icon" href="/_static/src/browser/media/favicon-dark-support.svg" />
|
||||
+ <link rel="alternate icon" href="/_static/src/browser/media/favicon.ico" type="image/x-icon" />
|
||||
+ <link rel="manifest" href="/manifest.json" crossorigin="use-credentials" />
|
||||
<link data-name="vs/workbench/workbench.web.main" rel="stylesheet" href="{{WORKBENCH_WEB_BASE_URL}}/out/vs/workbench/workbench.web.main.css">
|
||||
|
||||
</head>
|
||||
Index: code-server/lib/vscode/src/vs/server/node/webClientServer.ts
|
||||
===================================================================
|
||||
--- code-server.orig/lib/vscode/src/vs/server/node/webClientServer.ts
|
||||
+++ code-server/lib/vscode/src/vs/server/node/webClientServer.ts
|
||||
@@ -307,6 +307,7 @@ export class WebClientServer {
|
||||
folderUri: resolveWorkspaceURI(this._environmentService.args['default-folder']),
|
||||
workspaceUri: resolveWorkspaceURI(this._environmentService.args['default-workspace']),
|
||||
productConfiguration: <Partial<IProductConfiguration>>{
|
||||
+ codeServerVersion: this._productService.codeServerVersion,
|
||||
embedderIdentifier: 'server-distro',
|
||||
extensionsGallery: this._webExtensionResourceUrlTemplate ? {
|
||||
...this._productService.extensionsGallery,
|
||||
66
patches/local-storage.diff
Normal file
66
patches/local-storage.diff
Normal file
@@ -0,0 +1,66 @@
|
||||
Make storage local to the remote server
|
||||
|
||||
This solves two problems:
|
||||
1. Extensions running in the browser (like Vim) might use these paths
|
||||
directly instead of using the file service and most likely can't write
|
||||
to `/User` on disk.
|
||||
2. Settings will be stored in the file system instead of in browser
|
||||
storage. Using browser storage makes sharing or seeding settings
|
||||
between browsers difficult. We may want to revisit this once/if we get
|
||||
settings sync.
|
||||
|
||||
Unfortunately this does not affect state which uses a separate method with
|
||||
IndexedDB and does not appear nearly as easy to redirect to disk.
|
||||
|
||||
To test install the Vim extension and make sure something that uses file storage
|
||||
works (history recall for example) and change settings from the UI and on disk
|
||||
while making sure they appear on the other side.
|
||||
|
||||
Index: code-server/lib/vscode/src/vs/server/node/webClientServer.ts
|
||||
===================================================================
|
||||
--- code-server.orig/lib/vscode/src/vs/server/node/webClientServer.ts
|
||||
+++ code-server/lib/vscode/src/vs/server/node/webClientServer.ts
|
||||
@@ -299,6 +299,7 @@ export class WebClientServer {
|
||||
const workbenchWebConfiguration = {
|
||||
remoteAuthority,
|
||||
webviewEndpoint: vscodeBase + this._staticRoute + '/out/vs/workbench/contrib/webview/browser/pre',
|
||||
+ userDataPath: this._environmentService.userDataPath,
|
||||
_wrapWebWorkerExtHostInIframe,
|
||||
developmentOptions: {
|
||||
enableSmokeTestDriver: this._environmentService.args['enable-smoke-test-driver'] ? true : undefined,
|
||||
Index: code-server/lib/vscode/src/vs/workbench/browser/web.api.ts
|
||||
===================================================================
|
||||
--- code-server.orig/lib/vscode/src/vs/workbench/browser/web.api.ts
|
||||
+++ code-server/lib/vscode/src/vs/workbench/browser/web.api.ts
|
||||
@@ -245,6 +245,11 @@ export interface IWorkbenchConstructionO
|
||||
*/
|
||||
readonly configurationDefaults?: Record<string, any>;
|
||||
|
||||
+ /**
|
||||
+ * Path to the user data directory.
|
||||
+ */
|
||||
+ readonly userDataPath?: string
|
||||
+
|
||||
//#endregion
|
||||
|
||||
|
||||
Index: code-server/lib/vscode/src/vs/workbench/services/environment/browser/environmentService.ts
|
||||
===================================================================
|
||||
--- code-server.orig/lib/vscode/src/vs/workbench/services/environment/browser/environmentService.ts
|
||||
+++ code-server/lib/vscode/src/vs/workbench/services/environment/browser/environmentService.ts
|
||||
@@ -53,7 +53,14 @@ export class BrowserWorkbenchEnvironment
|
||||
get logFile(): URI { return joinPath(this.logsHome, 'window.log'); }
|
||||
|
||||
@memoize
|
||||
- get userRoamingDataHome(): URI { return URI.file('/User').with({ scheme: Schemas.vscodeUserData }); }
|
||||
+ get userRoamingDataHome(): URI { return joinPath(URI.file(this.userDataPath).with({ scheme: Schemas.vscodeRemote }), 'User'); }
|
||||
+
|
||||
+ get userDataPath(): string {
|
||||
+ if (!this.options.userDataPath) {
|
||||
+ throw new Error('userDataPath was not provided to the browser');
|
||||
+ }
|
||||
+ return this.options.userDataPath;
|
||||
+ }
|
||||
|
||||
@memoize
|
||||
get settingsResource(): URI { return joinPath(this.userRoamingDataHome, 'settings.json'); }
|
||||
21
patches/log-level.diff
Normal file
21
patches/log-level.diff
Normal file
@@ -0,0 +1,21 @@
|
||||
Propagate the log level to the client
|
||||
|
||||
This can be tested by using `--log trace`. You should see plenty of debug and
|
||||
trace logs in the console.
|
||||
|
||||
Index: code-server/lib/vscode/src/vs/server/node/webClientServer.ts
|
||||
===================================================================
|
||||
--- code-server.orig/lib/vscode/src/vs/server/node/webClientServer.ts
|
||||
+++ code-server/lib/vscode/src/vs/server/node/webClientServer.ts
|
||||
@@ -300,7 +300,10 @@ export class WebClientServer {
|
||||
remoteAuthority,
|
||||
webviewEndpoint: vscodeBase + this._staticRoute + '/out/vs/workbench/contrib/webview/browser/pre',
|
||||
_wrapWebWorkerExtHostInIframe,
|
||||
- developmentOptions: { enableSmokeTestDriver: this._environmentService.args['enable-smoke-test-driver'] ? true : undefined },
|
||||
+ developmentOptions: {
|
||||
+ enableSmokeTestDriver: this._environmentService.args['enable-smoke-test-driver'] ? true : undefined,
|
||||
+ logLevel: this._logService.getLevel(),
|
||||
+ },
|
||||
settingsSyncOptions: !this._environmentService.isBuilt && this._environmentService.args['enable-sync'] ? { enabled: true } : undefined,
|
||||
enableWorkspaceTrust: !this._environmentService.args['disable-workspace-trust'],
|
||||
folderUri: resolveWorkspaceURI(this._environmentService.args['default-folder']),
|
||||
107
patches/logout.diff
Normal file
107
patches/logout.diff
Normal file
@@ -0,0 +1,107 @@
|
||||
Add a logout command and menu item
|
||||
|
||||
This will only show if you have authentication enabled.
|
||||
|
||||
This has e2e tests but are currently disabled and need to be fixed.
|
||||
|
||||
Index: code-server/lib/vscode/src/vs/base/common/product.ts
|
||||
===================================================================
|
||||
--- code-server.orig/lib/vscode/src/vs/base/common/product.ts
|
||||
+++ code-server/lib/vscode/src/vs/base/common/product.ts
|
||||
@@ -34,6 +34,7 @@ export interface IProductConfiguration {
|
||||
readonly codeServerVersion?: string
|
||||
readonly rootEndpoint?: string
|
||||
readonly updateEndpoint?: string
|
||||
+ readonly logoutEndpoint?: string
|
||||
|
||||
readonly version: string;
|
||||
readonly date?: string;
|
||||
Index: code-server/lib/vscode/src/vs/server/node/serverEnvironmentService.ts
|
||||
===================================================================
|
||||
--- code-server.orig/lib/vscode/src/vs/server/node/serverEnvironmentService.ts
|
||||
+++ code-server/lib/vscode/src/vs/server/node/serverEnvironmentService.ts
|
||||
@@ -13,6 +13,7 @@ import { IEnvironmentService, INativeEnv
|
||||
export const serverOptions: OptionDescriptions<ServerParsedArgs> = {
|
||||
/* ----- code-server ----- */
|
||||
'disable-update-check': { type: 'boolean' },
|
||||
+ 'auth': { type: 'string' },
|
||||
|
||||
/* ----- server setup ----- */
|
||||
|
||||
@@ -92,6 +93,7 @@ export const serverOptions: OptionDescri
|
||||
export interface ServerParsedArgs {
|
||||
/* ----- code-server ----- */
|
||||
'disable-update-check'?: boolean;
|
||||
+ 'auth'?: string
|
||||
|
||||
/* ----- server setup ----- */
|
||||
|
||||
Index: code-server/lib/vscode/src/vs/server/node/webClientServer.ts
|
||||
===================================================================
|
||||
--- code-server.orig/lib/vscode/src/vs/server/node/webClientServer.ts
|
||||
+++ code-server/lib/vscode/src/vs/server/node/webClientServer.ts
|
||||
@@ -309,6 +309,7 @@ export class WebClientServer {
|
||||
codeServerVersion: this._productService.codeServerVersion,
|
||||
rootEndpoint: base,
|
||||
updateEndpoint: !this._environmentService.args['disable-update-check'] ? base + '/update/check' : undefined,
|
||||
+ logoutEndpoint: this._environmentService.args['auth'] ? base + '/logout' : undefined,
|
||||
embedderIdentifier: 'server-distro',
|
||||
extensionsGallery: this._productService.extensionsGallery,
|
||||
},
|
||||
Index: code-server/lib/vscode/src/vs/workbench/browser/client.ts
|
||||
===================================================================
|
||||
--- code-server.orig/lib/vscode/src/vs/workbench/browser/client.ts
|
||||
+++ code-server/lib/vscode/src/vs/workbench/browser/client.ts
|
||||
@@ -1,11 +1,15 @@
|
||||
import { Disposable } from 'vs/base/common/lifecycle';
|
||||
import { localize } from 'vs/nls';
|
||||
+import { MenuId, MenuRegistry } from 'vs/platform/actions/common/actions';
|
||||
+import { CommandsRegistry } from 'vs/platform/commands/common/commands';
|
||||
import { ILogService } from 'vs/platform/log/common/log';
|
||||
import { INotificationService, Severity } from 'vs/platform/notification/common/notification';
|
||||
import { IProductService } from 'vs/platform/product/common/productService';
|
||||
import { IStorageService, StorageScope, StorageTarget } from 'vs/platform/storage/common/storage';
|
||||
|
||||
export class CodeServerClient extends Disposable {
|
||||
+ static LOGOUT_COMMAND_ID = 'code-server.logout';
|
||||
+
|
||||
constructor (
|
||||
@ILogService private logService: ILogService,
|
||||
@INotificationService private notificationService: INotificationService,
|
||||
@@ -82,6 +86,10 @@ export class CodeServerClient extends Di
|
||||
if (this.productService.updateEndpoint) {
|
||||
this.checkUpdates(this.productService.updateEndpoint)
|
||||
}
|
||||
+
|
||||
+ if (this.productService.logoutEndpoint) {
|
||||
+ this.addLogoutCommand(this.productService.logoutEndpoint);
|
||||
+ }
|
||||
}
|
||||
|
||||
private checkUpdates(updateEndpoint: string) {
|
||||
@@ -133,4 +141,25 @@ export class CodeServerClient extends Di
|
||||
|
||||
updateLoop();
|
||||
}
|
||||
+
|
||||
+ private addLogoutCommand(logoutEndpoint: string) {
|
||||
+ CommandsRegistry.registerCommand(CodeServerClient.LOGOUT_COMMAND_ID, () => {
|
||||
+ const logoutUrl = new URL(logoutEndpoint, window.location.href);
|
||||
+ // Cookies must be set with absolute paths and must use the same path to
|
||||
+ // be unset (we set it on the root) so send the relative root and the
|
||||
+ // current href so the backend can derive the absolute path to the root.
|
||||
+ logoutUrl.searchParams.set('base', this.productService.rootEndpoint || ".");
|
||||
+ logoutUrl.searchParams.set('href', window.location.href);
|
||||
+ window.location.assign(logoutUrl);
|
||||
+ });
|
||||
+
|
||||
+ for (const menuId of [MenuId.CommandPalette, MenuId.MenubarHomeMenu]) {
|
||||
+ MenuRegistry.appendMenuItem(menuId, {
|
||||
+ command: {
|
||||
+ id: CodeServerClient.LOGOUT_COMMAND_ID,
|
||||
+ title: localize('logout', "Sign out of {0}", 'code-server'),
|
||||
+ },
|
||||
+ });
|
||||
+ }
|
||||
+ }
|
||||
}
|
||||
87
patches/marketplace.diff
Normal file
87
patches/marketplace.diff
Normal file
@@ -0,0 +1,87 @@
|
||||
Add Open VSX default and an env var for marketplace, fix old marketplace
|
||||
|
||||
Our old marketplace only supports `serviceUrl` but this causes the marketplace
|
||||
to be disabled entirely so this moves the template var check to fix that.
|
||||
|
||||
This also removes serverRootPath from the web extension route because that will
|
||||
include the commit. When you update code-server (including this update) the web
|
||||
extension will continue using the old path since it is stored in the browser but
|
||||
the path will 404 because the commit no longer matches. This change is only to
|
||||
support current installations though because this patch also removes the
|
||||
in-between and has web extensions install directly from the marketplace.
|
||||
|
||||
This can be tested by setting EXTENSIONS_GALLERY set to:
|
||||
|
||||
'{"serviceUrl": "https://extensions.coder.com/api"}'
|
||||
|
||||
|
||||
Index: code-server/lib/vscode/src/vs/platform/product/common/product.ts
|
||||
===================================================================
|
||||
--- code-server.orig/lib/vscode/src/vs/platform/product/common/product.ts
|
||||
+++ code-server/lib/vscode/src/vs/platform/product/common/product.ts
|
||||
@@ -45,7 +45,14 @@ else if (typeof require?.__$__nodeRequir
|
||||
}
|
||||
|
||||
Object.assign(product, {
|
||||
- version: pkg.version
|
||||
+ version: pkg.version,
|
||||
+ extensionsGallery: env.EXTENSIONS_GALLERY ? JSON.parse(env.EXTENSIONS_GALLERY) : (product.extensionsGallery || {
|
||||
+ serviceUrl: "https://open-vsx.org/vscode/gallery",
|
||||
+ itemUrl: "https://open-vsx.org/vscode/item",
|
||||
+ resourceUrlTemplate: "https://open-vsx.org/vscode/asset/{publisher}/{name}/{version}/Microsoft.VisualStudio.Code.WebResources/{path}",
|
||||
+ controlUrl: "",
|
||||
+ recommendationsUrl: "",
|
||||
+ }),
|
||||
});
|
||||
}
|
||||
|
||||
Index: code-server/lib/vscode/src/vs/server/node/webClientServer.ts
|
||||
===================================================================
|
||||
--- code-server.orig/lib/vscode/src/vs/server/node/webClientServer.ts
|
||||
+++ code-server/lib/vscode/src/vs/server/node/webClientServer.ts
|
||||
@@ -111,7 +111,7 @@ export class WebClientServer {
|
||||
const serverRootPath = getRemoteServerRootPath(_productService);
|
||||
this._staticRoute = `${serverRootPath}/static`;
|
||||
this._callbackRoute = `${serverRootPath}/callback`;
|
||||
- this._webExtensionRoute = `${serverRootPath}/web-extension-resource`;
|
||||
+ this._webExtensionRoute = `/web-extension-resource`;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -308,14 +308,7 @@ export class WebClientServer {
|
||||
codeServerVersion: this._productService.codeServerVersion,
|
||||
rootEndpoint: base,
|
||||
embedderIdentifier: 'server-distro',
|
||||
- extensionsGallery: this._webExtensionResourceUrlTemplate ? {
|
||||
- ...this._productService.extensionsGallery,
|
||||
- 'resourceUrlTemplate': this._webExtensionResourceUrlTemplate.with({
|
||||
- scheme: 'http',
|
||||
- authority: remoteAuthority,
|
||||
- path: `${this._webExtensionRoute}/${this._webExtensionResourceUrlTemplate.authority}${this._webExtensionResourceUrlTemplate.path}`
|
||||
- }).toString(true)
|
||||
- } : undefined
|
||||
+ extensionsGallery: this._productService.extensionsGallery,
|
||||
},
|
||||
callbackRoute: this._callbackRoute
|
||||
};
|
||||
Index: code-server/lib/vscode/src/vs/workbench/services/extensionResourceLoader/common/extensionResourceLoader.ts
|
||||
===================================================================
|
||||
--- code-server.orig/lib/vscode/src/vs/workbench/services/extensionResourceLoader/common/extensionResourceLoader.ts
|
||||
+++ code-server/lib/vscode/src/vs/workbench/services/extensionResourceLoader/common/extensionResourceLoader.ts
|
||||
@@ -16,7 +16,6 @@ import { getServiceMachineId } from 'vs/
|
||||
import { IStorageService } from 'vs/platform/storage/common/storage';
|
||||
import { TelemetryLevel } from 'vs/platform/telemetry/common/telemetry';
|
||||
import { getTelemetryLevel, supportsTelemetry } from 'vs/platform/telemetry/common/telemetryUtils';
|
||||
-import { getRemoteServerRootPath } from 'vs/platform/remote/common/remoteHosts';
|
||||
|
||||
export const WEB_EXTENSION_RESOURCE_END_POINT = 'web-extension-resource';
|
||||
|
||||
@@ -60,7 +59,7 @@ export abstract class AbstractExtensionR
|
||||
private readonly _environmentService: IEnvironmentService,
|
||||
private readonly _configurationService: IConfigurationService,
|
||||
) {
|
||||
- this._webExtensionResourceEndPoint = `${getRemoteServerRootPath(_productService)}/${WEB_EXTENSION_RESOURCE_END_POINT}/`;
|
||||
+ this._webExtensionResourceEndPoint = `/${WEB_EXTENSION_RESOURCE_END_POINT}/`;
|
||||
if (_productService.extensionsGallery) {
|
||||
this._extensionGalleryResourceUrlTemplate = _productService.extensionsGallery.resourceUrlTemplate;
|
||||
this._extensionGalleryAuthority = this._extensionGalleryResourceUrlTemplate ? this._getExtensionGalleryAuthority(URI.parse(this._extensionGalleryResourceUrlTemplate)) : undefined;
|
||||
24
patches/parent-origin.diff
Normal file
24
patches/parent-origin.diff
Normal file
@@ -0,0 +1,24 @@
|
||||
Remove parentOriginHash checko
|
||||
|
||||
This fixes webviews from not working properly due to a change upstream.
|
||||
Upstream added a check to ensure parent authority is encoded into the webview
|
||||
origin. Since our webview origin is the parent authority, we can bypass this
|
||||
check.
|
||||
|
||||
Index: code-server/lib/vscode/src/vs/workbench/contrib/webview/browser/pre/main.js
|
||||
===================================================================
|
||||
--- code-server.orig/lib/vscode/src/vs/workbench/contrib/webview/browser/pre/main.js
|
||||
+++ code-server/lib/vscode/src/vs/workbench/contrib/webview/browser/pre/main.js
|
||||
@@ -317,6 +317,12 @@ const hostMessaging = new class HostMess
|
||||
const id = searchParams.get('id');
|
||||
|
||||
const hostname = location.hostname;
|
||||
+
|
||||
+ // It is safe to run if we are on the same host.
|
||||
+ const parent = new URL(parentOrigin)
|
||||
+ if (parent.hostname == location.hostname) {
|
||||
+ return start(parentOrigin)
|
||||
+ }
|
||||
|
||||
if (!crypto.subtle) {
|
||||
// cannot validate, not running in a secure context
|
||||
36
patches/proposed-api.diff
Normal file
36
patches/proposed-api.diff
Normal file
@@ -0,0 +1,36 @@
|
||||
Unconditionally enable the proposed API
|
||||
|
||||
To test run an extension that uses the proposed API.
|
||||
|
||||
We also override isProposedApiEnabled in case an extension does not declare the
|
||||
APIs it needs correctly (the Jupyter extension had this issue).
|
||||
|
||||
Index: code-server/lib/vscode/src/vs/workbench/services/extensions/common/abstractExtensionService.ts
|
||||
===================================================================
|
||||
--- code-server.orig/lib/vscode/src/vs/workbench/services/extensions/common/abstractExtensionService.ts
|
||||
+++ code-server/lib/vscode/src/vs/workbench/services/extensions/common/abstractExtensionService.ts
|
||||
@@ -1451,7 +1451,7 @@ class ProposedApiController {
|
||||
|
||||
this._envEnabledExtensions = new Set((_environmentService.extensionEnabledProposedApi ?? []).map(id => ExtensionIdentifier.toKey(id)));
|
||||
|
||||
- this._envEnablesProposedApiForAll =
|
||||
+ this._envEnablesProposedApiForAll = true ||
|
||||
!_environmentService.isBuilt || // always allow proposed API when running out of sources
|
||||
(_environmentService.isExtensionDevelopment && productService.quality !== 'stable') || // do not allow proposed API against stable builds when developing an extension
|
||||
(this._envEnabledExtensions.size === 0 && Array.isArray(_environmentService.extensionEnabledProposedApi)); // always allow proposed API if --enable-proposed-api is provided without extension ID
|
||||
Index: code-server/lib/vscode/src/vs/workbench/services/extensions/common/extensions.ts
|
||||
===================================================================
|
||||
--- code-server.orig/lib/vscode/src/vs/workbench/services/extensions/common/extensions.ts
|
||||
+++ code-server/lib/vscode/src/vs/workbench/services/extensions/common/extensions.ts
|
||||
@@ -359,10 +359,7 @@ function extensionDescriptionArrayToMap(
|
||||
}
|
||||
|
||||
export function isProposedApiEnabled(extension: IExtensionDescription, proposal: ApiProposalName): boolean {
|
||||
- if (!extension.enabledApiProposals) {
|
||||
- return false;
|
||||
- }
|
||||
- return extension.enabledApiProposals.includes(proposal);
|
||||
+ return true
|
||||
}
|
||||
|
||||
export function checkProposedApiEnabled(extension: IExtensionDescription, proposal: ApiProposalName): void {
|
||||
104
patches/proxy-uri.diff
Normal file
104
patches/proxy-uri.diff
Normal file
@@ -0,0 +1,104 @@
|
||||
Add VSCODE_PROXY_URI environment variable
|
||||
|
||||
This can be used by extensions to open a port and access it through the proxy.
|
||||
|
||||
It is available in the terminal as well.
|
||||
|
||||
This can be tested using printenv in the terminal and by using the
|
||||
codeServerTest.proxyUri command through the test extension (copy it into your
|
||||
extensions, use --extensions-dir, or symlink it).
|
||||
|
||||
This has e2e tests.
|
||||
|
||||
Index: code-server/lib/vscode/src/vs/base/common/product.ts
|
||||
===================================================================
|
||||
--- code-server.orig/lib/vscode/src/vs/base/common/product.ts
|
||||
+++ code-server/lib/vscode/src/vs/base/common/product.ts
|
||||
@@ -35,6 +35,7 @@ export interface IProductConfiguration {
|
||||
readonly rootEndpoint?: string
|
||||
readonly updateEndpoint?: string
|
||||
readonly logoutEndpoint?: string
|
||||
+ readonly proxyEndpointTemplate?: string
|
||||
|
||||
readonly version: string;
|
||||
readonly date?: string;
|
||||
Index: code-server/lib/vscode/src/vs/platform/remote/browser/remoteAuthorityResolverService.ts
|
||||
===================================================================
|
||||
--- code-server.orig/lib/vscode/src/vs/platform/remote/browser/remoteAuthorityResolverService.ts
|
||||
+++ code-server/lib/vscode/src/vs/platform/remote/browser/remoteAuthorityResolverService.ts
|
||||
@@ -8,7 +8,7 @@ import { Disposable } from 'vs/base/comm
|
||||
import { RemoteAuthorities } from 'vs/base/common/network';
|
||||
import { URI } from 'vs/base/common/uri';
|
||||
import { IProductService } from 'vs/platform/product/common/productService';
|
||||
-import { IRemoteAuthorityResolverService, IRemoteConnectionData, ResolvedAuthority, ResolverResult } from 'vs/platform/remote/common/remoteAuthorityResolver';
|
||||
+import { IRemoteAuthorityResolverService, IRemoteConnectionData, ResolvedAuthority, ResolvedOptions, ResolverResult } from 'vs/platform/remote/common/remoteAuthorityResolver';
|
||||
import { getRemoteServerRootPath } from 'vs/platform/remote/common/remoteHosts';
|
||||
|
||||
export class RemoteAuthorityResolverService extends Disposable implements IRemoteAuthorityResolverService {
|
||||
@@ -22,7 +22,7 @@ export class RemoteAuthorityResolverServ
|
||||
private readonly _connectionToken: string | undefined;
|
||||
private readonly _connectionTokens: Map<string, string>;
|
||||
|
||||
- constructor(@IProductService productService: IProductService, connectionToken: string | undefined, resourceUriProvider: ((uri: URI) => URI) | undefined) {
|
||||
+ constructor(@IProductService productService: IProductService, connectionToken: string | undefined, resourceUriProvider: ((uri: URI) => URI) | undefined, private readonly proxyEndpointTemplate?: string) {
|
||||
super();
|
||||
this._cache = new Map<string, ResolverResult>();
|
||||
this._connectionToken = connectionToken;
|
||||
@@ -62,12 +62,17 @@ export class RemoteAuthorityResolverServ
|
||||
|
||||
private _doResolveAuthority(authority: string): ResolverResult {
|
||||
const connectionToken = this._connectionTokens.get(authority) || this._connectionToken;
|
||||
+ let options: ResolvedOptions | undefined
|
||||
+ if (this.proxyEndpointTemplate) {
|
||||
+ const proxyUrl = new URL(this.proxyEndpointTemplate, window.location.href);
|
||||
+ options = { extensionHostEnv: { VSCODE_PROXY_URI: decodeURIComponent(proxyUrl.toString()) }}
|
||||
+ }
|
||||
if (authority.indexOf(':') >= 0) {
|
||||
const pieces = authority.split(':');
|
||||
- return { authority: { authority, host: pieces[0], port: parseInt(pieces[1], 10), connectionToken } };
|
||||
+ return { authority: { authority, host: pieces[0], port: parseInt(pieces[1], 10), connectionToken }, options };
|
||||
}
|
||||
const port = (/^https:/.test(window.location.href) ? 443 : 80);
|
||||
- return { authority: { authority, host: authority, port: port, connectionToken } };
|
||||
+ return { authority: { authority, host: authority, port: port, connectionToken }, options };
|
||||
}
|
||||
|
||||
_clearResolvedAuthority(authority: string): void {
|
||||
Index: code-server/lib/vscode/src/vs/server/node/webClientServer.ts
|
||||
===================================================================
|
||||
--- code-server.orig/lib/vscode/src/vs/server/node/webClientServer.ts
|
||||
+++ code-server/lib/vscode/src/vs/server/node/webClientServer.ts
|
||||
@@ -310,6 +310,7 @@ export class WebClientServer {
|
||||
rootEndpoint: base,
|
||||
updateEndpoint: !this._environmentService.args['disable-update-check'] ? base + '/update/check' : undefined,
|
||||
logoutEndpoint: this._environmentService.args['auth'] ? base + '/logout' : undefined,
|
||||
+ proxyEndpointTemplate: base + '/proxy/{{port}}',
|
||||
embedderIdentifier: 'server-distro',
|
||||
extensionsGallery: this._productService.extensionsGallery,
|
||||
},
|
||||
Index: code-server/lib/vscode/src/vs/workbench/browser/web.main.ts
|
||||
===================================================================
|
||||
--- code-server.orig/lib/vscode/src/vs/workbench/browser/web.main.ts
|
||||
+++ code-server/lib/vscode/src/vs/workbench/browser/web.main.ts
|
||||
@@ -209,7 +209,7 @@ export class BrowserMain extends Disposa
|
||||
|
||||
// Remote
|
||||
const connectionToken = environmentService.options.connectionToken || getCookieValue(connectionTokenCookieName);
|
||||
- const remoteAuthorityResolverService = new RemoteAuthorityResolverService(productService, connectionToken, this.configuration.resourceUriProvider);
|
||||
+ const remoteAuthorityResolverService = new RemoteAuthorityResolverService(productService, connectionToken, this.configuration.resourceUriProvider, this.configuration.productConfiguration?.proxyEndpointTemplate);
|
||||
serviceCollection.set(IRemoteAuthorityResolverService, remoteAuthorityResolverService);
|
||||
|
||||
// Signing
|
||||
Index: code-server/lib/vscode/src/vs/workbench/contrib/terminal/common/terminalEnvironment.ts
|
||||
===================================================================
|
||||
--- code-server.orig/lib/vscode/src/vs/workbench/contrib/terminal/common/terminalEnvironment.ts
|
||||
+++ code-server/lib/vscode/src/vs/workbench/contrib/terminal/common/terminalEnvironment.ts
|
||||
@@ -388,7 +388,7 @@ export async function createTerminalEnvi
|
||||
|
||||
// Sanitize the environment, removing any undesirable VS Code and Electron environment
|
||||
// variables
|
||||
- sanitizeProcessEnvironment(env, 'VSCODE_IPC_HOOK_CLI');
|
||||
+ sanitizeProcessEnvironment(env, 'VSCODE_IPC_HOOK_CLI', 'VSCODE_PROXY_URI');
|
||||
|
||||
// Merge config (settings) and ShellLaunchConfig environments
|
||||
mergeEnvironments(env, allowedEnvFromConfig);
|
||||
21
patches/series
Normal file
21
patches/series
Normal file
@@ -0,0 +1,21 @@
|
||||
integration.diff
|
||||
base-path.diff
|
||||
proposed-api.diff
|
||||
marketplace.diff
|
||||
webview.diff
|
||||
disable-builtin-ext-update.diff
|
||||
insecure-notification.diff
|
||||
update-check.diff
|
||||
logout.diff
|
||||
store-socket.diff
|
||||
proxy-uri.diff
|
||||
github-auth.diff
|
||||
unique-db.diff
|
||||
log-level.diff
|
||||
local-storage.diff
|
||||
service-worker.diff
|
||||
connection-type.diff
|
||||
sourcemaps.diff
|
||||
disable-downloads.diff
|
||||
telemetry.diff
|
||||
display-language.diff
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user