mirror of
https://github.com/cdr/code-server.git
synced 2025-12-26 10:26:38 +01:00
Compare commits
668 commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
ac7322ce56 | ||
|
|
68ac95b84e | ||
|
|
0de7cf5679 | ||
|
|
ea9a3a5ab2 | ||
|
|
472bf8a5fa | ||
|
|
eccb1eb537 | ||
|
|
f128a7ac11 | ||
|
|
80996d2e08 | ||
|
|
9819b91c74 | ||
|
|
2ed1098c1e | ||
|
|
85042e2910 | ||
|
|
904942a194 | ||
|
|
9a24e467b2 | ||
|
|
24a777491b | ||
|
|
93c1f4f10c | ||
|
|
339c3926c2 | ||
|
|
897b5f13bc | ||
|
|
282f74d9f5 | ||
|
|
7a2a5eb055 | ||
|
|
af397f71e2 | ||
|
|
9d89b17fd7 | ||
|
|
35e7b09a85 | ||
|
|
7beb05d04f | ||
|
|
add51d5c5b | ||
|
|
db8a41bce1 | ||
|
|
811ec6c1d6 | ||
|
|
30321abfcd | ||
|
|
cd40509fbb | ||
|
|
9fd98d58e7 | ||
|
|
b0992ddb3e | ||
|
|
af19dedfa9 | ||
|
|
d1066af558 | ||
|
|
ba774d989b | ||
|
|
1a7b770f5b | ||
|
|
626145cf66 | ||
|
|
b59a4f7366 | ||
|
|
54b33a75e0 | ||
|
|
3c5deac16d | ||
|
|
fbaadbcfbc | ||
|
|
2bbb6e8cca | ||
|
|
f1236d80b9 | ||
|
|
b27d982c67 | ||
|
|
3f23840756 | ||
|
|
e54467fb85 | ||
|
|
8f738d29f2 | ||
|
|
5c0ff5013f | ||
|
|
8a378df6e5 | ||
|
|
a7e77ce4af | ||
|
|
794def9a77 | ||
|
|
b5a2ce2522 | ||
|
|
bc15fa461c | ||
|
|
1805daed07 | ||
|
|
6f3d0a7e5a | ||
|
|
b1ad6ffcb9 | ||
|
|
9f6d18ea26 | ||
|
|
fe7db4900a | ||
|
|
84728f0b21 | ||
|
|
aaf2d91a21 | ||
|
|
47e9d43922 | ||
|
|
f26309a23c | ||
|
|
0f9a0e8fb3 | ||
|
|
4029c1ec8f | ||
|
|
bbe1b7fecb | ||
|
|
740a2d3aa3 | ||
|
|
92fca0dcc3 | ||
|
|
8b3d9b9e0a | ||
|
|
cdac5bff64 | ||
|
|
70be9fe541 | ||
|
|
729456b10d | ||
|
|
aff005e196 | ||
|
|
53dccbb5ca | ||
|
|
1b1440ffd2 | ||
|
|
c5c764d78f | ||
|
|
3a8fbeb4da | ||
|
|
bd34cd510f | ||
|
|
27a112c3a7 | ||
|
|
74cc50d5e6 | ||
|
|
85ee441006 | ||
|
|
a56769b2c3 | ||
|
|
05d8904ec5 | ||
|
|
3669c96c9c | ||
|
|
37357b0142 | ||
|
|
405eb0f511 | ||
|
|
6e26dad1b1 | ||
|
|
1671bf1c18 | ||
|
|
1face85ad9 | ||
|
|
9ec786b62a | ||
|
|
409c64e0df | ||
|
|
35e78fe35b | ||
|
|
cade03e321 | ||
|
|
9dd999ba78 | ||
|
|
1aca01f8d8 | ||
|
|
e05219d9c0 | ||
|
|
d0e20d514d | ||
|
|
9bd3b83ef5 | ||
|
|
2c9b4e7fd5 | ||
|
|
7af90ea623 | ||
|
|
8b55b5003d | ||
|
|
e5b8d447e5 | ||
|
|
c8257a3074 | ||
|
|
0c72b20fa7 | ||
|
|
ea2caf00ac | ||
|
|
3f2e3340d8 | ||
|
|
47d6d3ada5 | ||
|
|
dded82bb47 | ||
|
|
5d5b7b1944 | ||
|
|
c36b2d3edd | ||
|
|
3b7634c578 | ||
|
|
ec0899a81b | ||
|
|
bbf2e24648 | ||
|
|
9045919d2b | ||
|
|
cb29e65982 | ||
|
|
7eb8f4be87 | ||
|
|
cd4d1b614d | ||
|
|
5051c0f9e4 | ||
|
|
b07335a0f1 | ||
|
|
e3c09efcbc | ||
|
|
e0c960b30e | ||
|
|
55b311a954 | ||
|
|
0a92b76304 | ||
|
|
400ac7b8d0 | ||
|
|
53722c5361 | ||
|
|
e2c489dd00 | ||
|
|
e1c84998d7 | ||
|
|
cc3c22deee | ||
|
|
727555b414 | ||
|
|
4b7bca38e2 | ||
|
|
50c3e4bb1b | ||
|
|
2809245dda | ||
|
|
949aed1cef | ||
|
|
db5f99dc78 | ||
|
|
fd761b4e8b | ||
|
|
611798650f | ||
|
|
0db3cbe4e7 | ||
|
|
31c211aded | ||
|
|
6f8493ebc6 | ||
|
|
34b8d2ed69 | ||
|
|
3172cb16b8 | ||
|
|
9b89774ff6 | ||
|
|
626d2cf1c3 | ||
|
|
ebf2df63f5 | ||
|
|
ac65db2c88 | ||
|
|
33aa21fd0f | ||
|
|
d23d1a9541 | ||
|
|
a6fad66e5e | ||
|
|
18cd97dc12 | ||
|
|
ef713bde58 | ||
|
|
1c3fcf2a83 | ||
|
|
96800cc521 | ||
|
|
0b7c044857 | ||
|
|
7cc61ab1f4 | ||
|
|
b7ef8f9bd7 | ||
|
|
b60985e53b | ||
|
|
b18a647d0a | ||
|
|
f4f02655a1 | ||
|
|
08cbdfbdf1 | ||
|
|
339a448471 | ||
|
|
272e28abc6 | ||
|
|
c187e5e782 | ||
|
|
318c582043 | ||
|
|
db311e6ff5 | ||
|
|
ccd2a30dfc | ||
|
|
99e1f63d76 | ||
|
|
25c2183be0 | ||
|
|
8f00c2e289 | ||
|
|
9b0340a092 | ||
|
|
ccded68cd4 | ||
|
|
4af06de4c3 | ||
|
|
b0c935a6e0 | ||
|
|
912a7a9d89 | ||
|
|
9a5726f250 | ||
|
|
fc97e248c3 | ||
|
|
fff3b896de | ||
|
|
578b5f22c4 | ||
|
|
2c1981bfb9 | ||
|
|
344df3875f | ||
|
|
952523f288 | ||
|
|
8789dec68b | ||
|
|
b7398bad11 | ||
|
|
8194dbf5bc | ||
|
|
2ade2afdc7 | ||
|
|
494a3e0c2b | ||
|
|
dd2e9fce27 | ||
|
|
bea906f90b | ||
|
|
15752526bd | ||
|
|
7c298653f1 | ||
|
|
fc6064dcd3 | ||
|
|
6b4b3e0c89 | ||
|
|
13d4cd6489 | ||
|
|
a0c2780c50 | ||
|
|
aea7ba2a51 | ||
|
|
69df01185c | ||
|
|
3542bd157b | ||
|
|
50c6abf3a8 | ||
|
|
9286e0002d | ||
|
|
90f8135c68 | ||
|
|
8dbfe2273b | ||
|
|
e05a3f4ce2 | ||
|
|
e05d88007f | ||
|
|
534a1866e5 | ||
|
|
907e583309 | ||
|
|
639a005867 | ||
|
|
4a703893b0 | ||
|
|
39ce82a44d | ||
|
|
7f893234ab | ||
|
|
de65bfc947 | ||
|
|
34c6751bf8 | ||
|
|
461d4cba59 | ||
|
|
31bc0c6b1a | ||
|
|
0f9436e7b9 | ||
|
|
1962f48b7f | ||
|
|
6467c60166 | ||
|
|
d9812a5970 | ||
|
|
f2c326147d | ||
|
|
37a72ce63b | ||
|
|
6a14070664 | ||
|
|
a9eb923790 | ||
|
|
2b33ca8a3f | ||
|
|
8accfcc8ec | ||
|
|
2e098a2b90 | ||
|
|
97bcc3b934 | ||
|
|
c86c4e8bb6 | ||
|
|
3031f8599c | ||
|
|
d83ba4b46f | ||
|
|
fb3e3e1546 | ||
|
|
901191e0f9 | ||
|
|
dd79446b00 | ||
|
|
090e0fad76 | ||
|
|
6514ba4bf3 | ||
|
|
250281d071 | ||
|
|
93f31e6a74 | ||
|
|
603e467f38 | ||
|
|
c7d88abf9f | ||
|
|
26c763485b | ||
|
|
d431c9cd9d | ||
|
|
c26ac35b25 | ||
|
|
d449729e18 | ||
|
|
ed069310a4 | ||
|
|
dce1d6e172 | ||
|
|
a73549539b | ||
|
|
e7ca9cd6ac | ||
|
|
9da9f2029c | ||
|
|
0c802ba165 | ||
|
|
1bd2b9cf08 | ||
|
|
3b467dec95 | ||
|
|
6d9530aa6b | ||
|
|
fc47b4f1c5 | ||
|
|
479eb5bfa5 | ||
|
|
095c072a43 | ||
|
|
4ff509d8db | ||
|
|
efc6edf536 | ||
|
|
3b6ad479a6 | ||
|
|
effc6e95b4 | ||
|
|
ab4b36f573 | ||
|
|
0f4791b816 | ||
|
|
97653152dd | ||
|
|
2633bca30b | ||
|
|
125a972c81 | ||
|
|
7050002fb6 | ||
|
|
4563517d90 | ||
|
|
b8cdab2184 | ||
|
|
264e023ab8 | ||
|
|
ea815df22d | ||
|
|
6757907c8b | ||
|
|
2adb215d03 | ||
|
|
1a7265b392 | ||
|
|
e6dd7fe228 | ||
|
|
fb2afbd9d6 | ||
|
|
3d8d544f89 | ||
|
|
323a1f3234 | ||
|
|
b8d830b826 | ||
|
|
417c1f36cb | ||
|
|
3eb9cf7a08 | ||
|
|
f81fe3030a | ||
|
|
4bc9956537 | ||
|
|
9a28bc29db | ||
|
|
deebb21345 | ||
|
|
73e615da4e | ||
|
|
bec6ab2678 | ||
|
|
ebd79ed958 | ||
|
|
30d343c0bd | ||
|
|
71780f6f00 | ||
|
|
93f9dfcb1d | ||
|
|
1abb2ee567 | ||
|
|
1c5bfeeb99 | ||
|
|
bae68548d0 | ||
|
|
0cca7c67a4 | ||
|
|
45e96ec3b0 | ||
|
|
66364429e3 | ||
|
|
0e384d5442 | ||
|
|
760d1318e9 | ||
|
|
c65b1f2870 | ||
|
|
132f7d1470 | ||
|
|
8c65ff8d0d | ||
|
|
f9c0624f85 | ||
|
|
4c4c566d86 | ||
|
|
720d14db3e | ||
|
|
5453d02872 | ||
|
|
9f2c776a77 | ||
|
|
66c7f7d8b1 | ||
|
|
107a3fd410 | ||
|
|
56b5992280 | ||
|
|
275c130845 | ||
|
|
223ecf7c30 | ||
|
|
e5d145fdf3 | ||
|
|
2248c8bdd4 | ||
|
|
d2dfeedb2f | ||
|
|
460a4564c3 | ||
|
|
963fcfc3a5 | ||
|
|
75611411b4 | ||
|
|
1e5666b68e | ||
|
|
9d70cbc8b2 | ||
|
|
853ab407de | ||
|
|
c31d2a0e37 | ||
|
|
45164bf749 | ||
|
|
a2d35ad815 | ||
|
|
76e6f75758 | ||
|
|
413c47a86d | ||
|
|
5b62943216 | ||
|
|
84ca27278b | ||
|
|
1471a152ff | ||
|
|
6adbfc461b | ||
|
|
2a55212027 | ||
|
|
b63fda4bf7 | ||
|
|
ab17495e3a | ||
|
|
53b0fda510 | ||
|
|
63beaaabd7 | ||
|
|
2db0184c4a | ||
|
|
dd9cefab66 | ||
|
|
1d774d01bf | ||
|
|
d6ef385de2 | ||
|
|
e76afa4a2b | ||
|
|
fdb46d3fe5 | ||
|
|
d49b3bf159 | ||
|
|
e87499c301 | ||
|
|
cc68c0fb0f | ||
|
|
749e105cd9 | ||
|
|
94f759a53c | ||
|
|
2786f60752 | ||
|
|
aea28cb499 | ||
|
|
2cabe799e2 | ||
|
|
c1be39abc7 | ||
|
|
21e798ccdf | ||
|
|
871030e997 | ||
|
|
a143dcf111 | ||
|
|
5214555683 | ||
|
|
ff0fcf6cde | ||
|
|
07901026a0 | ||
|
|
d0215eca88 | ||
|
|
d6c5a4af9c | ||
|
|
0b84523121 | ||
|
|
45694d38c4 | ||
|
|
d9fe46a6be | ||
|
|
6f078a48a6 | ||
|
|
7649b6e6ca | ||
|
|
9622830518 | ||
|
|
26a3437849 | ||
|
|
1fac50d6f6 | ||
|
|
3e8100b70e | ||
|
|
0c98611e6b | ||
|
|
73cb236535 | ||
|
|
9ba66ec468 | ||
|
|
09dd5fe44d | ||
|
|
958c5203ec | ||
|
|
edf078d1d2 | ||
|
|
984fb135dc | ||
|
|
9658969084 | ||
|
|
da254c39ee | ||
|
|
239df56634 | ||
|
|
c285b99c74 | ||
|
|
f64bc022e9 | ||
|
|
22c54c3b2e | ||
|
|
ae75f76e30 | ||
|
|
53d856d3c6 | ||
|
|
4e4d510238 | ||
|
|
3a0f4a2773 | ||
|
|
cbc17516fd | ||
|
|
c4efcaf079 | ||
|
|
f44b57393c | ||
|
|
3fc30cae3e | ||
|
|
91f8ec6295 | ||
|
|
11e6e656c0 | ||
|
|
d7a2b4936a | ||
|
|
c2d79d94f9 | ||
|
|
9fec2d7cad | ||
|
|
80dfb2b2a9 | ||
|
|
27e7b931e7 | ||
|
|
db9f678477 | ||
|
|
c095c26dbc | ||
|
|
262f66abf6 | ||
|
|
8ee45686b0 | ||
|
|
512d97f22f | ||
|
|
897e0ae1da | ||
|
|
f4bf492051 | ||
|
|
2eba7af117 | ||
|
|
0dc59c0da2 | ||
|
|
6275520348 | ||
|
|
2bb51a25a9 | ||
|
|
7a213161f2 | ||
|
|
a1131fadf2 | ||
|
|
468cf5c6ce | ||
|
|
800bf364d6 | ||
|
|
5428442628 | ||
|
|
020f280458 | ||
|
|
58f6e24a07 | ||
|
|
7868f4db23 | ||
|
|
acc50a5d36 | ||
|
|
47ee7ae670 | ||
|
|
70d0c603cc | ||
|
|
2e29c233ea | ||
|
|
331a017309 | ||
|
|
f915d1e2c8 | ||
|
|
95bcf101d7 | ||
|
|
d80568df20 | ||
|
|
03dc8cd808 | ||
|
|
3e1c00e017 | ||
|
|
a76e5241b6 | ||
|
|
913fc30866 | ||
|
|
eb498b0d6d | ||
|
|
eb8099ff89 | ||
|
|
56d3548fa2 | ||
|
|
2d335bd1ea | ||
|
|
291682e1c0 | ||
|
|
97aeb77abe | ||
|
|
76fd2389e4 | ||
|
|
3cb92edc76 | ||
|
|
94ef3776ad | ||
|
|
a82f1ceaa5 | ||
|
|
25254214fb | ||
|
|
feb5e6770c | ||
|
|
e37b35278d | ||
|
|
2ffbcfdfcb | ||
|
|
74da5167a2 | ||
|
|
daac46b3cf | ||
|
|
ea3c79ffd1 | ||
|
|
93e60f7b0e | ||
|
|
7926647058 | ||
|
|
d27cd43dce | ||
|
|
1befd37310 | ||
|
|
2b3b5e7051 | ||
|
|
788da5d495 | ||
|
|
070a5a3179 | ||
|
|
7cbb6a8b09 | ||
|
|
7fb54073db | ||
|
|
e72e8bb6b5 | ||
|
|
411846528b | ||
|
|
7f024eda6e | ||
|
|
2617623ed6 | ||
|
|
70aa1b7722 | ||
|
|
90a4147381 | ||
|
|
5c19962930 | ||
|
|
56d10d82bf | ||
|
|
cef2aa22dc | ||
|
|
b5a9ef80e7 | ||
|
|
5d3c9edce4 | ||
|
|
9955cd91a4 | ||
|
|
fdeaba9581 | ||
|
|
40ff2e6049 | ||
|
|
73d42f7ea0 | ||
|
|
fb73742b2b | ||
|
|
ccb0d3a34f | ||
|
|
4a121edd16 | ||
|
|
f6db985712 | ||
|
|
6d00fc7f46 | ||
|
|
ee024f3f2d | ||
|
|
0703ef008c | ||
|
|
2109d1cf6a | ||
|
|
74af05dfbe | ||
|
|
2798322b03 | ||
|
|
b3b971480f | ||
|
|
6745a46034 | ||
|
|
43ef50b404 | ||
|
|
45c89856fd | ||
|
|
5f4ae75431 | ||
|
|
521ff44aed | ||
|
|
5708e6ce32 | ||
|
|
3f7db15fde | ||
|
|
8c99f41b90 | ||
|
|
e02d56dbfd | ||
|
|
aac5efa046 | ||
|
|
ff2764f7b1 | ||
|
|
bda6b631ab | ||
|
|
9bac70ea0d | ||
|
|
7722ef1437 | ||
|
|
951d8ac45e | ||
|
|
2e17735795 | ||
|
|
1da7cda39e | ||
|
|
c829d74203 | ||
|
|
39075b2cf3 | ||
|
|
aed1fc0119 | ||
|
|
6e411adb01 | ||
|
|
36ba646bcb | ||
|
|
278d0f2184 | ||
|
|
b954250018 | ||
|
|
2b72da22e6 | ||
|
|
3c838e2d02 | ||
|
|
f8d563c49b | ||
|
|
39e63af359 | ||
|
|
c995988b70 | ||
|
|
a44bd71043 | ||
|
|
19bcd043d7 | ||
|
|
c32a31d802 | ||
|
|
45ca68c362 | ||
|
|
8f1a70339d | ||
|
|
35209aa5b5 | ||
|
|
87f44599e5 | ||
|
|
71f01ec0f0 | ||
|
|
f8e2d00099 | ||
|
|
a485fec27c | ||
|
|
aa2276293a | ||
|
|
72eae01684 | ||
|
|
bca733de3d | ||
|
|
78282a1fd6 | ||
|
|
dbdd2edb62 | ||
|
|
a9d61daa91 | ||
|
|
6c08466b05 | ||
|
|
85e083580d | ||
|
|
b0431069a1 | ||
|
|
f9cc07926b | ||
|
|
be40eca5d9 | ||
|
|
9ba08907da | ||
|
|
d477972c68 | ||
|
|
a47cd81d8c | ||
|
|
c9fbcffd53 | ||
|
|
befa76d09d | ||
|
|
e0ece195c1 | ||
|
|
ac1fba8bde | ||
|
|
6d8ed77fb0 | ||
|
|
4fb87f920f | ||
|
|
36daac3031 | ||
|
|
45aef719d3 | ||
|
|
6d6c5e18d1 | ||
|
|
17bca521af | ||
|
|
82073743b1 | ||
|
|
71ff747c48 | ||
|
|
e5a2537aee | ||
|
|
bce6239801 | ||
|
|
93589edb61 | ||
|
|
bfcca5fcc0 | ||
|
|
a76c0c5742 | ||
|
|
6e1b9131e9 | ||
|
|
776d57b12b | ||
|
|
026879b78c | ||
|
|
401d423dfd | ||
|
|
96d9c5eb0f | ||
|
|
134e9b40b7 | ||
|
|
7c2aa8c417 | ||
|
|
d40a9742c0 | ||
|
|
67416b7b79 | ||
|
|
9e266db379 | ||
|
|
834d16df2a | ||
|
|
d835cb9865 | ||
|
|
9e9cbd846d | ||
|
|
077a8f6a6b | ||
|
|
4e280811f9 | ||
|
|
3eb35979f0 | ||
|
|
8377bd23df | ||
|
|
930791d249 | ||
|
|
5c21015dbe | ||
|
|
fa39d4761a | ||
|
|
87f606db2a | ||
|
|
06483bc59d | ||
|
|
9012ddfe79 | ||
|
|
1efc5f104e | ||
|
|
ef5865f506 | ||
|
|
48588ee542 | ||
|
|
ac6b5bd4e6 | ||
|
|
0ca6620ee6 | ||
|
|
907747d394 | ||
|
|
d8995ec0b8 | ||
|
|
c088e73063 | ||
|
|
83c3453f50 | ||
|
|
3182be634e | ||
|
|
1297e9ac88 | ||
|
|
1484bee621 | ||
|
|
f43082e142 | ||
|
|
b6adcf50c6 | ||
|
|
df49838739 | ||
|
|
2cbb1135e1 | ||
|
|
43e8c439bf | ||
|
|
74edfe7c43 | ||
|
|
69d469b714 | ||
|
|
e2f585f368 | ||
|
|
3367e1ad4e | ||
|
|
c885c96644 | ||
|
|
b978655c07 | ||
|
|
5a8bb2b8e8 | ||
|
|
77c3cd3aa1 | ||
|
|
ff8ea36b27 | ||
|
|
f56ce5b66d | ||
|
|
2530a0d265 | ||
|
|
a432a0d697 | ||
|
|
505f07a9bc | ||
|
|
ee47293cf6 | ||
|
|
5c751f26ee | ||
|
|
7c0c0b0c29 | ||
|
|
649985af8e | ||
|
|
ca182b9fb5 | ||
|
|
cc8ce3b3c6 | ||
|
|
ba44f6cc97 | ||
|
|
e6d2d72f9c | ||
|
|
005fa87699 | ||
|
|
b19996176e | ||
|
|
1134ee1c79 | ||
|
|
606811fbfd | ||
|
|
2f583b082e | ||
|
|
59ef715d8b | ||
|
|
bbf18cc6b0 | ||
|
|
031e903979 | ||
|
|
430b567e69 | ||
|
|
efce00582b | ||
|
|
4a06d97f84 | ||
|
|
514dbf315e | ||
|
|
690e0aff45 | ||
|
|
714afe0cc7 | ||
|
|
71a127a62b | ||
|
|
d4707d1d24 | ||
|
|
f61ec4a41c | ||
|
|
ba68656353 | ||
|
|
b2f043ab41 | ||
|
|
b562d4a880 | ||
|
|
3a9eb312b1 | ||
|
|
77bbed4831 | ||
|
|
3ac2307b5c | ||
|
|
8629d6a474 | ||
|
|
7f0c4d785f | ||
|
|
b6aeb4bfab | ||
|
|
acdbefb986 | ||
|
|
05289d3eb6 | ||
|
|
3264187419 | ||
|
|
3256157a3f | ||
|
|
fdec34cf85 | ||
|
|
7e98628167 | ||
|
|
42c21c9684 | ||
|
|
51677f0819 | ||
|
|
4223cf6e2b | ||
|
|
987c68a32a | ||
|
|
7ecfb95569 | ||
|
|
309a3b2c6e | ||
|
|
b440054613 | ||
|
|
dbe87c5494 | ||
|
|
04f1080451 | ||
|
|
5028169e63 | ||
|
|
3fb38414dd | ||
|
|
b486354d6e | ||
|
|
a1cf4b9ea5 | ||
|
|
64822d0f64 | ||
|
|
74017ecc65 | ||
|
|
da03a648c2 | ||
|
|
6742e945cc | ||
|
|
4e9ed56580 | ||
|
|
8a227d9fa1 | ||
|
|
f9bfd58cf4 | ||
|
|
ef3f4e82b2 | ||
|
|
6262c7a0bf | ||
|
|
101d4ee4ad | ||
|
|
d1acfad2a8 | ||
|
|
ccbf0bebb7 | ||
|
|
f5a1e3a3fa | ||
|
|
3db08fdf51 | ||
|
|
bc05a2f3b9 | ||
|
|
90f603549a | ||
|
|
8352a22e33 | ||
|
|
33ee184ed7 | ||
|
|
6a7c3220b0 | ||
|
|
9d8588b2ed | ||
|
|
61e2a9ac41 | ||
|
|
61673b5918 |
228 changed files with 20920 additions and 13846 deletions
|
|
@ -1,43 +0,0 @@
|
|||
parser: "@typescript-eslint/parser"
|
||||
env:
|
||||
browser: true
|
||||
es6: true # Map, etc.
|
||||
jest: true
|
||||
node: true
|
||||
|
||||
parserOptions:
|
||||
ecmaVersion: 2018
|
||||
sourceType: module
|
||||
|
||||
extends:
|
||||
- eslint:recommended
|
||||
- plugin:@typescript-eslint/recommended
|
||||
- plugin:import/recommended
|
||||
- plugin:import/typescript
|
||||
- plugin:prettier/recommended
|
||||
# Prettier should always be last
|
||||
# Removes eslint rules that conflict with prettier.
|
||||
- prettier
|
||||
|
||||
rules:
|
||||
# Sometimes you need to add args to implement a function signature even
|
||||
# if they are unused.
|
||||
"@typescript-eslint/no-unused-vars": ["error", { "args": "none" }]
|
||||
# For overloads.
|
||||
no-dupe-class-members: off
|
||||
"@typescript-eslint/no-use-before-define": off
|
||||
"@typescript-eslint/no-non-null-assertion": off
|
||||
"@typescript-eslint/ban-types": off
|
||||
"@typescript-eslint/no-var-requires": off
|
||||
"@typescript-eslint/explicit-module-boundary-types": off
|
||||
"@typescript-eslint/no-explicit-any": off
|
||||
"@typescript-eslint/no-extra-semi": off
|
||||
eqeqeq: error
|
||||
import/order:
|
||||
[error, { alphabetize: { order: "asc" }, groups: [["builtin", "external", "internal"], "parent", "sibling"] }]
|
||||
no-async-promise-executor: off
|
||||
|
||||
settings:
|
||||
import/resolver:
|
||||
typescript:
|
||||
alwaysTryTypes: true
|
||||
2
.git-blame-ignore-revs
Normal file
2
.git-blame-ignore-revs
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
# Prettier 3.4.2
|
||||
9b0340a09276f93c054d705d1b9a5f24cc5dbc97
|
||||
4
.github/CODEOWNERS
vendored
4
.github/CODEOWNERS
vendored
|
|
@ -1,5 +1,7 @@
|
|||
* @coder/code-server-reviewers
|
||||
* @coder/code-server
|
||||
|
||||
ci/helm-chart/ @Matthew-Beckett @alexgorbatchev
|
||||
|
||||
docs/install.md @GNUxeava
|
||||
|
||||
src/node/i18n/locales/zh-cn.json @zhaozhiming
|
||||
|
|
|
|||
76
.github/ISSUE_TEMPLATE/bug-report.yml
vendored
76
.github/ISSUE_TEMPLATE/bug-report.yml
vendored
|
|
@ -1,6 +1,5 @@
|
|||
name: Bug report
|
||||
description: File a bug report
|
||||
title: "[Bug]: "
|
||||
labels: ["bug", "triage"]
|
||||
body:
|
||||
- type: checkboxes
|
||||
|
|
@ -10,6 +9,7 @@ body:
|
|||
options:
|
||||
- label: I have searched the existing issues
|
||||
required: true
|
||||
|
||||
- type: textarea
|
||||
attributes:
|
||||
label: OS/Web Information
|
||||
|
|
@ -20,6 +20,8 @@ body:
|
|||
- **Remote OS**: Ubuntu
|
||||
- **Remote Architecture**: amd64
|
||||
- **`code-server --version`**: 4.0.1
|
||||
|
||||
Please do not just put "latest" for the version.
|
||||
value: |
|
||||
- Web Browser:
|
||||
- Local OS:
|
||||
|
|
@ -28,58 +30,94 @@ body:
|
|||
- `code-server --version`:
|
||||
validations:
|
||||
required: true
|
||||
|
||||
- type: textarea
|
||||
attributes:
|
||||
label: Steps to Reproduce
|
||||
description: |
|
||||
1. open code-server
|
||||
2. install extension
|
||||
3. run command
|
||||
Please describe exactly how to reproduce the bug. For example:
|
||||
1. Open code-server in Firefox
|
||||
2. Install extension `foo.bar` from the extensions sidebar
|
||||
3. Run command `foo.bar.baz`
|
||||
value: |
|
||||
1.
|
||||
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`).
|
||||
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 `npm install -g code-server`).
|
||||
render: shell
|
||||
|
||||
- type: textarea
|
||||
attributes:
|
||||
label: Screenshot/Video
|
||||
description: Please include a screenshot, gif or screen recording of your issue.
|
||||
validations:
|
||||
required: false
|
||||
|
||||
- type: dropdown
|
||||
attributes:
|
||||
label: Does this bug reproduce in native VS Code?
|
||||
description: If the bug reproduces in native VS Code, submit the issue upstream instead (https://github.com/microsoft/vscode).
|
||||
options:
|
||||
- Yes, this is also broken in native VS Code
|
||||
- No, this works as expected in native VS Code
|
||||
- This cannot be tested in native VS Code
|
||||
- I did not test native VS Code
|
||||
validations:
|
||||
required: true
|
||||
|
||||
- type: dropdown
|
||||
attributes:
|
||||
label: Does this bug reproduce in VS Code web?
|
||||
description: If the bug reproduces in VS Code web, submit the issue upstream instead (https://github.com/microsoft/vscode). You can run VS Code web with `code serve-web`.
|
||||
options:
|
||||
- Yes, this is also broken in VS Code web
|
||||
- No, this works as expected in VS Code web
|
||||
- This cannot be tested in VS Code web
|
||||
- I did not test VS Code web
|
||||
validations:
|
||||
required: true
|
||||
|
||||
- type: dropdown
|
||||
attributes:
|
||||
label: Does this bug reproduce in GitHub Codespaces?
|
||||
description: If the bug reproduces in GitHub Codespaces, submit the issue upstream instead (https://github.com/microsoft/vscode).
|
||||
options:
|
||||
- Yes, this is also broken in GitHub Codespaces
|
||||
- No, this works as expected in GitHub Codespaces
|
||||
- This cannot be tested in GitHub Codespaces
|
||||
- I did not test GitHub Codespaces
|
||||
validations:
|
||||
required: true
|
||||
|
||||
- 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
|
||||
label: Are you accessing code-server over a secure context?
|
||||
description: code-server relies on service workers (which only work in secure contexts) for many features. Double-check that you are using a secure context like HTTPS or localhost.
|
||||
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
|
||||
- label: I am using a secure context.
|
||||
required: false
|
||||
|
||||
- type: textarea
|
||||
attributes:
|
||||
label: Notes
|
||||
|
|
|
|||
2
.github/ISSUE_TEMPLATE/doc.md
vendored
2
.github/ISSUE_TEMPLATE/doc.md
vendored
|
|
@ -1,9 +1,7 @@
|
|||
---
|
||||
name: Documentation improvement
|
||||
about: Suggest a documentation improvement
|
||||
title: "[Docs]: "
|
||||
labels: "docs"
|
||||
assignees: "@jsjoeio"
|
||||
---
|
||||
|
||||
## What is your suggestion?
|
||||
|
|
|
|||
2
.github/ISSUE_TEMPLATE/feature-request.md
vendored
2
.github/ISSUE_TEMPLATE/feature-request.md
vendored
|
|
@ -1,9 +1,7 @@
|
|||
---
|
||||
name: Feature request
|
||||
about: Suggest an idea to improve code-server
|
||||
title: "[Feat]: "
|
||||
labels: enhancement
|
||||
assignees: ""
|
||||
---
|
||||
|
||||
## What is your suggestion?
|
||||
|
|
|
|||
|
|
@ -1,16 +0,0 @@
|
|||
<!-- Note: this variable $CODE_SERVER_VERSION_TO_UPDATE will be set when you run the release-prep.sh script with `yarn release:prep` -->
|
||||
|
||||
This PR is to generate a new release of `code-server` at `$CODE_SERVER_VERSION_TO_UPDATE`
|
||||
|
||||
## Screenshot
|
||||
|
||||
TODO
|
||||
|
||||
## TODOs
|
||||
|
||||
Follow "Publishing a release" steps in `ci/README.md`
|
||||
|
||||
<!-- Note some of these steps below are redundant since they're listed in the "Publishing a release" docs -->
|
||||
|
||||
- [ ] publish release and merge PR
|
||||
- [ ] update the AUR package
|
||||
31
.github/dependabot.yaml
vendored
Normal file
31
.github/dependabot.yaml
vendored
Normal file
|
|
@ -0,0 +1,31 @@
|
|||
version: 2
|
||||
updates:
|
||||
- package-ecosystem: "github-actions"
|
||||
directory: "/"
|
||||
schedule:
|
||||
interval: "monthly"
|
||||
time: "06:00"
|
||||
timezone: "America/Chicago"
|
||||
labels: []
|
||||
commit-message:
|
||||
prefix: "chore"
|
||||
|
||||
- package-ecosystem: "npm"
|
||||
directory: "/"
|
||||
schedule:
|
||||
interval: "monthly"
|
||||
time: "06:00"
|
||||
timezone: "America/Chicago"
|
||||
commit-message:
|
||||
prefix: "chore"
|
||||
labels: []
|
||||
ignore:
|
||||
# Ignore patch updates for all dependencies
|
||||
- dependency-name: "*"
|
||||
update-types:
|
||||
- version-update:semver-patch
|
||||
# Ignore major updates to Node.js types, because they need to
|
||||
# correspond to the Node.js engine version
|
||||
- dependency-name: "@types/node"
|
||||
update-types:
|
||||
- version-update:semver-major
|
||||
29
.github/ranger.yml
vendored
29
.github/ranger.yml
vendored
|
|
@ -1,29 +0,0 @@
|
|||
# Configuration for the repo ranger bot
|
||||
# See docs: https://www.notion.so/Documentation-8d7627bb1f3c42b7b1820e8d6f157a57#9879d1374fab4d1f9c607c230fd5123d
|
||||
default:
|
||||
close:
|
||||
# Default time to wait before closing the label. Can either be a number in milliseconds
|
||||
# or a string specified by the `ms` package (https://www.npmjs.com/package/ms)
|
||||
delay: "2 days"
|
||||
|
||||
# Default comment to post when an issue is first marked with a closing label
|
||||
comment: "⚠️ This issue has been marked $LABEL and will be closed in $DELAY."
|
||||
|
||||
labels:
|
||||
duplicate: close
|
||||
wontfix: close
|
||||
"squash when passing": merge
|
||||
"rebase when passing": merge
|
||||
"merge when passing": merge
|
||||
"new contributor":
|
||||
action: comment
|
||||
delay: 5s
|
||||
message: "Thanks for making your first contribution! :slightly_smiling_face:"
|
||||
"upstream:vscode":
|
||||
action: close
|
||||
delay: 5s
|
||||
comment: >
|
||||
This issue has been marked as 'upstream:vscode'.
|
||||
Please file this upstream: [link to open issue](https://github.com/microsoft/vscode/issues/new/choose)
|
||||
|
||||
This issue will automatically close in $DELAY.
|
||||
311
.github/workflows/build.yaml
vendored
Normal file
311
.github/workflows/build.yaml
vendored
Normal file
|
|
@ -0,0 +1,311 @@
|
|||
name: Build
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
pull_request:
|
||||
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.
|
||||
|
||||
# if: steps.cache-node-modules.outputs.cache-hit != 'true'
|
||||
# will skip running `npm install` if it successfully fetched from cache
|
||||
|
||||
jobs:
|
||||
changes:
|
||||
runs-on: ubuntu-latest
|
||||
outputs:
|
||||
ci: ${{ steps.filter.outputs.ci }}
|
||||
code: ${{ steps.filter.outputs.code }}
|
||||
deps: ${{ steps.filter.outputs.deps }}
|
||||
docs: ${{ steps.filter.outputs.docs }}
|
||||
helm: ${{ steps.filter.outputs.helm }}
|
||||
steps:
|
||||
- name: Checkout repo
|
||||
uses: actions/checkout@v6
|
||||
- name: Check changed files
|
||||
uses: dorny/paths-filter@v3
|
||||
id: filter
|
||||
with:
|
||||
filters: |
|
||||
ci:
|
||||
- ".github/**"
|
||||
- "ci/**"
|
||||
docs:
|
||||
- "docs/**"
|
||||
- "README.md"
|
||||
- "CHANGELOG.md"
|
||||
helm:
|
||||
- "ci/helm-chart/**"
|
||||
code:
|
||||
- "src/**"
|
||||
- "test/**"
|
||||
deps:
|
||||
- "lib/**"
|
||||
- "patches/**"
|
||||
- "package-lock.json"
|
||||
- "test/package-lock.json"
|
||||
- id: debug
|
||||
run: |
|
||||
echo "${{ toJSON(steps.filter )}}"
|
||||
|
||||
prettier:
|
||||
name: Run prettier check
|
||||
runs-on: ubuntu-22.04
|
||||
timeout-minutes: 5
|
||||
steps:
|
||||
- uses: actions/checkout@v6
|
||||
- uses: actions/setup-node@v6
|
||||
with:
|
||||
node-version-file: .node-version
|
||||
cache: npm
|
||||
cache-dependency-path: |
|
||||
package-lock.json
|
||||
test/package-lock.json
|
||||
- run: SKIP_SUBMODULE_DEPS=1 npm ci
|
||||
- run: npx prettier --check .
|
||||
|
||||
doctoc:
|
||||
name: Doctoc markdown files
|
||||
runs-on: ubuntu-22.04
|
||||
timeout-minutes: 5
|
||||
needs: changes
|
||||
if: needs.changes.outputs.docs == 'true'
|
||||
steps:
|
||||
- uses: actions/checkout@v6
|
||||
- uses: actions/setup-node@v6
|
||||
with:
|
||||
node-version-file: .node-version
|
||||
cache: npm
|
||||
cache-dependency-path: |
|
||||
package-lock.json
|
||||
test/package-lock.json
|
||||
- run: SKIP_SUBMODULE_DEPS=1 npm ci
|
||||
- run: npm run doctoc
|
||||
|
||||
lint-helm:
|
||||
name: Lint Helm chart
|
||||
runs-on: ubuntu-22.04
|
||||
timeout-minutes: 5
|
||||
needs: changes
|
||||
if: needs.changes.outputs.helm == 'true'
|
||||
steps:
|
||||
- uses: actions/checkout@v6
|
||||
- uses: azure/setup-helm@v4
|
||||
with:
|
||||
token: ${{ secrets.GITHUB_TOKEN }}
|
||||
- run: helm plugin install https://github.com/instrumenta/helm-kubeval
|
||||
- run: helm kubeval ci/helm-chart
|
||||
|
||||
lint-ts:
|
||||
name: Lint TypeScript files
|
||||
runs-on: ubuntu-22.04
|
||||
timeout-minutes: 5
|
||||
needs: changes
|
||||
if: needs.changes.outputs.code == 'true'
|
||||
steps:
|
||||
- uses: actions/checkout@v6
|
||||
- uses: actions/setup-node@v6
|
||||
with:
|
||||
node-version-file: .node-version
|
||||
cache: npm
|
||||
cache-dependency-path: |
|
||||
package-lock.json
|
||||
test/package-lock.json
|
||||
- run: SKIP_SUBMODULE_DEPS=1 npm ci
|
||||
- run: npm run lint:ts
|
||||
|
||||
lint-actions:
|
||||
name: Lint GitHub Actions
|
||||
runs-on: ubuntu-latest
|
||||
needs: changes
|
||||
if: needs.changes.outputs.ci == 'true'
|
||||
steps:
|
||||
- name: Checkout repo
|
||||
uses: actions/checkout@v6
|
||||
- name: Check workflow files
|
||||
run: |
|
||||
bash <(curl https://raw.githubusercontent.com/rhysd/actionlint/main/scripts/download-actionlint.bash) 1.7.9
|
||||
./actionlint -color -shellcheck= -ignore "softprops/action-gh-release"
|
||||
shell: bash
|
||||
|
||||
test-unit:
|
||||
name: Run unit tests
|
||||
runs-on: ubuntu-22.04
|
||||
timeout-minutes: 5
|
||||
needs: changes
|
||||
if: needs.changes.outputs.code == 'true'
|
||||
steps:
|
||||
- uses: actions/checkout@v6
|
||||
- uses: actions/setup-node@v6
|
||||
with:
|
||||
node-version-file: .node-version
|
||||
cache: npm
|
||||
cache-dependency-path: |
|
||||
package-lock.json
|
||||
test/package-lock.json
|
||||
- run: SKIP_SUBMODULE_DEPS=1 npm ci
|
||||
- run: npm run test:unit
|
||||
- uses: codecov/codecov-action@v5
|
||||
if: success()
|
||||
with:
|
||||
token: ${{ secrets.CODECOV_TOKEN }}
|
||||
|
||||
build:
|
||||
name: Build code-server
|
||||
runs-on: ubuntu-22.04
|
||||
timeout-minutes: 70
|
||||
env:
|
||||
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
|
||||
DISABLE_V8_COMPILE_CACHE: 1
|
||||
steps:
|
||||
- uses: actions/checkout@v6
|
||||
with:
|
||||
submodules: true
|
||||
- run: sudo apt update && sudo apt install -y libkrb5-dev
|
||||
- uses: awalsh128/cache-apt-pkgs-action@latest
|
||||
with:
|
||||
packages: quilt
|
||||
version: 1.0
|
||||
- run: quilt push -a
|
||||
- uses: actions/setup-node@v6
|
||||
with:
|
||||
node-version-file: .node-version
|
||||
cache: npm
|
||||
cache-dependency-path: |
|
||||
package-lock.json
|
||||
test/package-lock.json
|
||||
- run: SKIP_SUBMODULE_DEPS=1 npm ci
|
||||
- run: npm run build
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
# 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 "rev=$(git rev-parse HEAD:./lib/vscode)" >> $GITHUB_OUTPUT
|
||||
# We need to rebuild when we have a new version of Code, when any of
|
||||
# the patches changed, or when the code-server version changes (since
|
||||
# it gets embedded into the code). Use VSCODE_CACHE_VERSION to
|
||||
# force a rebuild.
|
||||
- name: Fetch prebuilt Code package from cache
|
||||
id: cache-vscode
|
||||
uses: actions/cache@v4
|
||||
with:
|
||||
path: lib/vscode-reh-web-*
|
||||
key: vscode-reh-package-${{ secrets.VSCODE_CACHE_VERSION }}-${{ steps.vscode-rev.outputs.rev }}-${{ hashFiles('patches/*.diff', 'ci/build/build-vscode.sh') }}
|
||||
- name: Build vscode
|
||||
env:
|
||||
VERSION: "0.0.0"
|
||||
if: steps.cache-vscode.outputs.cache-hit != 'true'
|
||||
run: |
|
||||
pushd lib/vscode
|
||||
npm ci
|
||||
popd
|
||||
npm run build:vscode
|
||||
# The release package does not contain any native modules
|
||||
# and is neutral to architecture/os/libc version.
|
||||
- run: npm run release
|
||||
if: success()
|
||||
# https://github.com/actions/upload-artifact/issues/38
|
||||
- run: tar -czf package.tar.gz release
|
||||
- uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: npm-package
|
||||
path: ./package.tar.gz
|
||||
|
||||
test-e2e:
|
||||
name: Run e2e tests
|
||||
runs-on: ubuntu-22.04
|
||||
timeout-minutes: 25
|
||||
needs: [changes, build]
|
||||
if: needs.changes.outputs.code == 'true' || needs.changes.outputs.deps == 'true'
|
||||
steps:
|
||||
- uses: actions/checkout@v6
|
||||
- run: sudo apt update && sudo apt install -y libkrb5-dev
|
||||
- uses: actions/setup-node@v6
|
||||
with:
|
||||
node-version-file: .node-version
|
||||
cache: npm
|
||||
cache-dependency-path: |
|
||||
package-lock.json
|
||||
test/package-lock.json
|
||||
- run: SKIP_SUBMODULE_DEPS=1 npm ci
|
||||
- uses: actions/download-artifact@v5
|
||||
with:
|
||||
name: npm-package
|
||||
- run: tar -xzf package.tar.gz
|
||||
- run: cd release && npm install --unsafe-perm --omit=dev
|
||||
- name: Install Playwright OS dependencies
|
||||
run: |
|
||||
./test/node_modules/.bin/playwright install-deps
|
||||
./test/node_modules/.bin/playwright install
|
||||
- run: CODE_SERVER_TEST_ENTRY=./release npm run test:e2e
|
||||
- uses: actions/upload-artifact@v4
|
||||
if: always()
|
||||
with:
|
||||
name: failed-test-videos
|
||||
path: ./test/test-results
|
||||
- run: rm -rf ./release ./test/test-results
|
||||
|
||||
test-e2e-proxy:
|
||||
name: Run e2e tests behind proxy
|
||||
runs-on: ubuntu-22.04
|
||||
timeout-minutes: 25
|
||||
needs: [changes, build]
|
||||
if: needs.changes.outputs.code == 'true' || needs.changes.outputs.deps == 'true'
|
||||
steps:
|
||||
- uses: actions/checkout@v6
|
||||
- run: sudo apt update && sudo apt install -y libkrb5-dev
|
||||
- uses: actions/setup-node@v6
|
||||
with:
|
||||
node-version-file: .node-version
|
||||
cache: npm
|
||||
cache-dependency-path: |
|
||||
package-lock.json
|
||||
test/package-lock.json
|
||||
- run: SKIP_SUBMODULE_DEPS=1 npm ci
|
||||
- uses: actions/download-artifact@v5
|
||||
with:
|
||||
name: npm-package
|
||||
- run: tar -xzf package.tar.gz
|
||||
- run: cd release && npm install --unsafe-perm --omit=dev
|
||||
- name: Install Playwright OS dependencies
|
||||
run: |
|
||||
./test/node_modules/.bin/playwright install-deps
|
||||
./test/node_modules/.bin/playwright install
|
||||
- name: Cache Caddy
|
||||
uses: actions/cache@v4
|
||||
id: caddy-cache
|
||||
with:
|
||||
path: |
|
||||
~/.cache/caddy
|
||||
key: cache-caddy-2.5.2
|
||||
- name: Install Caddy
|
||||
env:
|
||||
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
if: steps.caddy-cache.outputs.cache-hit != 'true'
|
||||
run: |
|
||||
gh release download v2.5.2 --repo caddyserver/caddy --pattern "caddy_2.5.2_linux_amd64.tar.gz"
|
||||
mkdir -p ~/.cache/caddy
|
||||
tar -xzf caddy_2.5.2_linux_amd64.tar.gz --directory ~/.cache/caddy
|
||||
- run: ~/.cache/caddy/caddy start --config ./ci/Caddyfile
|
||||
- run: CODE_SERVER_TEST_ENTRY=./release npm run test:e2e:proxy
|
||||
- run: ~/.cache/caddy/caddy stop --config ./ci/Caddyfile
|
||||
if: always()
|
||||
|
||||
- uses: actions/upload-artifact@v4
|
||||
if: always()
|
||||
with:
|
||||
name: failed-test-videos-proxy
|
||||
path: ./test/test-results
|
||||
625
.github/workflows/ci.yaml
vendored
625
.github/workflows/ci.yaml
vendored
|
|
@ -1,625 +0,0 @@
|
|||
name: Build
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
pull_request:
|
||||
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.
|
||||
|
||||
# if: steps.cache-yarn.outputs.cache-hit != 'true'
|
||||
# will skip running `yarn install` if it successfully fetched from cache
|
||||
|
||||
jobs:
|
||||
prebuild:
|
||||
name: Pre-build checks
|
||||
runs-on: ubuntu-latest
|
||||
timeout-minutes: 15
|
||||
steps:
|
||||
- name: Checkout repo
|
||||
uses: actions/checkout@v3
|
||||
with:
|
||||
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@v3.3
|
||||
|
||||
- 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'
|
||||
run: yarn --frozen-lockfile
|
||||
|
||||
- name: Run yarn fmt
|
||||
run: yarn fmt
|
||||
if: success()
|
||||
|
||||
- name: Run yarn lint
|
||||
run: yarn lint
|
||||
if: success()
|
||||
|
||||
audit-ci:
|
||||
name: Run audit-ci
|
||||
needs: prebuild
|
||||
runs-on: ubuntu-latest
|
||||
timeout-minutes: 15
|
||||
steps:
|
||||
- name: Checkout repo
|
||||
uses: actions/checkout@v3
|
||||
with:
|
||||
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@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'
|
||||
run: yarn --frozen-lockfile
|
||||
|
||||
- name: Audit for vulnerabilities
|
||||
run: yarn _audit
|
||||
if: success()
|
||||
|
||||
build:
|
||||
name: Build
|
||||
needs: prebuild
|
||||
runs-on: ubuntu-latest
|
||||
timeout-minutes: 30
|
||||
env:
|
||||
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
|
||||
steps:
|
||||
- name: Checkout repo
|
||||
uses: actions/checkout@v3
|
||||
with:
|
||||
fetch-depth: 0
|
||||
submodules: true
|
||||
|
||||
- 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: "16"
|
||||
|
||||
- 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'
|
||||
run: yarn --frozen-lockfile
|
||||
|
||||
- name: Build code-server
|
||||
run: yarn build
|
||||
|
||||
# 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::$(git rev-parse HEAD:./lib/vscode)"
|
||||
|
||||
- name: Get version
|
||||
id: version
|
||||
run: echo "::set-output name=version::$(jq -r .version package.json)"
|
||||
|
||||
# We need to rebuild when we have a new version of Code, when any of
|
||||
# the patches changed, or when the code-server version changes (since
|
||||
# it gets embedded into the code). Use VSCODE_CACHE_VERSION to
|
||||
# force a rebuild.
|
||||
- name: Fetch prebuilt Code package from cache
|
||||
id: cache-vscode
|
||||
uses: actions/cache@v3
|
||||
with:
|
||||
path: lib/vscode-reh-web-*
|
||||
key: vscode-reh-package-${{ secrets.VSCODE_CACHE_VERSION }}-${{ steps.vscode-rev.outputs.rev }}-${{ steps.version.outputs.version }}-${{ hashFiles('patches/*.diff', 'ci/build/build-vscode.sh') }}
|
||||
|
||||
- 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
|
||||
run: yarn release
|
||||
if: success()
|
||||
|
||||
# https://github.com/actions/upload-artifact/issues/38
|
||||
- name: Compress release package
|
||||
run: tar -czf package.tar.gz release
|
||||
|
||||
- name: Upload npm package artifact
|
||||
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 or event is not a PR
|
||||
# Reason: forks cannot access secrets and this will always fail
|
||||
if: github.event.pull_request.head.repo.full_name == github.repository || github.event_name != 'pull_request'
|
||||
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
|
||||
package-linux-amd64:
|
||||
name: x86-64 Linux build
|
||||
needs: build
|
||||
runs-on: ubuntu-latest
|
||||
timeout-minutes: 15
|
||||
container: "centos:7"
|
||||
|
||||
steps:
|
||||
- name: Checkout repo
|
||||
uses: actions/checkout@v3
|
||||
with:
|
||||
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 python3
|
||||
|
||||
- name: Install nfpm and envsubst
|
||||
run: |
|
||||
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
|
||||
|
||||
- name: Install yarn
|
||||
run: npm install -g yarn
|
||||
|
||||
- name: Download npm package
|
||||
uses: actions/download-artifact@v3
|
||||
with:
|
||||
name: npm-package
|
||||
|
||||
- name: Decompress npm package
|
||||
run: tar -xzf package.tar.gz
|
||||
|
||||
# NOTE: && here is deliberate - GitHub puts each line in its own `.sh`
|
||||
# file when running inside a docker container.
|
||||
- name: Build standalone release
|
||||
run: source scl_source enable devtoolset-9 && yarn release:standalone
|
||||
|
||||
- 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@v3
|
||||
with:
|
||||
name: release-packages
|
||||
path: ./release-packages
|
||||
|
||||
# NOTE@oxy:
|
||||
# We use Ubuntu 16.04 here, so that our build is more compatible
|
||||
# with older libc versions. We used to (Q1'20) use CentOS 7 here,
|
||||
# but it has a full update EOL of Q4'20 and a 'critical security'
|
||||
# update EOL of 2024. We're dropping full support a few years before
|
||||
# the final EOL, but I don't believe CentOS 7 has a large arm64 userbase.
|
||||
# It is not feasible to cross-compile with CentOS.
|
||||
|
||||
# Cross-compile notes: To compile native dependencies for arm64,
|
||||
# we install the aarch64/armv7l cross toolchain and then set it as the default
|
||||
# compiler/linker/etc. with the AR/CC/CXX/LINK environment variables.
|
||||
# qemu-user-static on ubuntu-16.04 currently doesn't run Node correctly,
|
||||
# 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-18.04
|
||||
timeout-minutes: 15
|
||||
strategy:
|
||||
matrix:
|
||||
include:
|
||||
- prefix: aarch64-linux-gnu
|
||||
arch: arm64
|
||||
- prefix: arm-linux-gnueabihf
|
||||
arch: armv7l
|
||||
|
||||
env:
|
||||
AR: ${{ format('{0}-ar', matrix.prefix) }}
|
||||
CC: ${{ format('{0}-gcc', matrix.prefix) }}
|
||||
CXX: ${{ format('{0}-g++', matrix.prefix) }}
|
||||
LINK: ${{ format('{0}-g++', matrix.prefix) }}
|
||||
NPM_CONFIG_ARCH: ${{ matrix.arch }}
|
||||
NODE_VERSION: v16.13.0
|
||||
|
||||
steps:
|
||||
- name: Checkout repo
|
||||
uses: actions/checkout@v3
|
||||
with:
|
||||
fetch-depth: 0
|
||||
|
||||
- name: Install Node.js v16
|
||||
uses: actions/setup-node@v3
|
||||
with:
|
||||
node-version: "16"
|
||||
|
||||
- name: Install nfpm
|
||||
run: |
|
||||
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 update && sudo apt install $PACKAGE
|
||||
env:
|
||||
PACKAGE: ${{ format('g++-{0}', matrix.prefix) }}
|
||||
|
||||
- name: Download npm package
|
||||
uses: actions/download-artifact@v3
|
||||
with:
|
||||
name: npm-package
|
||||
|
||||
- name: Decompress npm package
|
||||
run: tar -xzf package.tar.gz
|
||||
|
||||
- name: Build standalone release
|
||||
run: yarn release:standalone
|
||||
|
||||
- name: Replace node with cross-compile equivalent
|
||||
run: |
|
||||
wget https://nodejs.org/dist/${NODE_VERSION}/node-${NODE_VERSION}-linux-${NPM_CONFIG_ARCH}.tar.xz
|
||||
tar -xf node-${NODE_VERSION}-linux-${NPM_CONFIG_ARCH}.tar.xz node-${NODE_VERSION}-linux-${NPM_CONFIG_ARCH}/bin/node --strip-components=2
|
||||
mv ./node ./release-standalone/lib/node
|
||||
|
||||
- name: Build packages with nfpm
|
||||
run: yarn package ${NPM_CONFIG_ARCH}
|
||||
|
||||
- name: Upload release artifacts
|
||||
uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: release-packages
|
||||
path: ./release-packages
|
||||
|
||||
package-macos-amd64:
|
||||
name: x86-64 macOS build
|
||||
needs: build
|
||||
runs-on: macos-latest
|
||||
timeout-minutes: 15
|
||||
steps:
|
||||
- name: Checkout repo
|
||||
uses: actions/checkout@v3
|
||||
with:
|
||||
fetch-depth: 0
|
||||
|
||||
- name: Install Node.js v16
|
||||
uses: actions/setup-node@v3
|
||||
with:
|
||||
node-version: "16"
|
||||
|
||||
- name: Install nfpm
|
||||
run: |
|
||||
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@v3
|
||||
with:
|
||||
name: npm-package
|
||||
|
||||
- name: Decompress npm package
|
||||
run: tar -xzf package.tar.gz
|
||||
|
||||
- name: Build standalone release
|
||||
run: yarn release:standalone
|
||||
|
||||
- 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@v3
|
||||
with:
|
||||
name: release-packages
|
||||
path: ./release-packages
|
||||
|
||||
test-e2e:
|
||||
name: End-to-end tests
|
||||
needs: package-linux-amd64
|
||||
runs-on: ubuntu-latest
|
||||
timeout-minutes: 15
|
||||
env:
|
||||
# Since we build code-server we might as well run tests from the release
|
||||
# since VS Code will load faster due to the bundling.
|
||||
CODE_SERVER_TEST_ENTRY: "./release-packages/code-server-linux-amd64"
|
||||
steps:
|
||||
- name: Checkout repo
|
||||
uses: actions/checkout@v3
|
||||
with:
|
||||
fetch-depth: 0
|
||||
|
||||
- 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@v3
|
||||
with:
|
||||
path: "**/node_modules"
|
||||
key: yarn-build-${{ hashFiles('**/yarn.lock') }}
|
||||
restore-keys: |
|
||||
yarn-build-
|
||||
|
||||
- name: Download release packages
|
||||
uses: actions/download-artifact@v3
|
||||
with:
|
||||
name: release-packages
|
||||
path: ./release-packages
|
||||
|
||||
- name: Untar code-server release
|
||||
run: |
|
||||
cd release-packages
|
||||
tar -xzf code-server*-linux-amd64.tar.gz
|
||||
mv code-server*-linux-amd64 code-server-linux-amd64
|
||||
|
||||
- name: Install dependencies
|
||||
if: steps.cache-yarn.outputs.cache-hit != 'true'
|
||||
run: SKIP_SUBMODULE_DEPS=1 yarn --frozen-lockfile
|
||||
|
||||
- name: Install Playwright OS dependencies
|
||||
run: |
|
||||
./test/node_modules/.bin/playwright install-deps
|
||||
./test/node_modules/.bin/playwright install
|
||||
|
||||
- name: Run end-to-end tests
|
||||
run: yarn test:e2e --global-timeout 840000
|
||||
|
||||
- name: Upload test artifacts
|
||||
if: always()
|
||||
uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: failed-test-videos
|
||||
path: ./test/test-results
|
||||
|
||||
- name: Remove release packages and test artifacts
|
||||
run: rm -rf ./release-packages ./test/test-results
|
||||
|
||||
test-e2e-proxy:
|
||||
name: End-to-end tests behind proxy
|
||||
needs: package-linux-amd64
|
||||
runs-on: ubuntu-latest
|
||||
timeout-minutes: 25
|
||||
env:
|
||||
# Since we build code-server we might as well run tests from the release
|
||||
# since VS Code will load faster due to the bundling.
|
||||
CODE_SERVER_TEST_ENTRY: "./release-packages/code-server-linux-amd64"
|
||||
steps:
|
||||
- name: Checkout repo
|
||||
uses: actions/checkout@v3
|
||||
with:
|
||||
fetch-depth: 0
|
||||
|
||||
- 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@v3
|
||||
with:
|
||||
path: "**/node_modules"
|
||||
key: yarn-build-${{ hashFiles('**/yarn.lock') }}
|
||||
restore-keys: |
|
||||
yarn-build-
|
||||
|
||||
- name: Download release packages
|
||||
uses: actions/download-artifact@v3
|
||||
with:
|
||||
name: release-packages
|
||||
path: ./release-packages
|
||||
|
||||
- name: Untar code-server release
|
||||
run: |
|
||||
cd release-packages
|
||||
tar -xzf code-server*-linux-amd64.tar.gz
|
||||
mv code-server*-linux-amd64 code-server-linux-amd64
|
||||
|
||||
- name: Install dependencies
|
||||
if: steps.cache-yarn.outputs.cache-hit != 'true'
|
||||
run: SKIP_SUBMODULE_DEPS=1 yarn --frozen-lockfile
|
||||
|
||||
- name: Install Playwright OS dependencies
|
||||
run: |
|
||||
./test/node_modules/.bin/playwright install-deps
|
||||
./test/node_modules/.bin/playwright install
|
||||
|
||||
- name: Cache Caddy
|
||||
uses: actions/cache@v2
|
||||
id: caddy-cache
|
||||
with:
|
||||
path: |
|
||||
~/.cache/caddy
|
||||
key: cache-caddy-2.5.2
|
||||
|
||||
- name: Install Caddy
|
||||
env:
|
||||
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
if: steps.caddy-cache.outputs.cache-hit != 'true'
|
||||
run: |
|
||||
gh release download v2.5.2 --repo caddyserver/caddy --pattern "caddy_2.5.2_linux_amd64.tar.gz"
|
||||
mkdir -p ~/.cache/caddy
|
||||
tar -xzf caddy_2.5.2_linux_amd64.tar.gz --directory ~/.cache/caddy
|
||||
|
||||
- name: Start Caddy
|
||||
run: sudo ~/.cache/caddy/caddy start --config ./ci/Caddyfile
|
||||
|
||||
- name: Run end-to-end tests
|
||||
run: yarn test:e2e:proxy
|
||||
|
||||
- name: Stop Caddy
|
||||
if: always()
|
||||
run: sudo ~/.cache/caddy/caddy stop --config ./ci/Caddyfile
|
||||
|
||||
- name: Upload test artifacts
|
||||
if: always()
|
||||
uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: failed-test-videos-proxy
|
||||
path: ./test/test-results
|
||||
|
||||
- name: Remove release packages and test artifacts
|
||||
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 repo
|
||||
uses: actions/checkout@v3
|
||||
with:
|
||||
fetch-depth: 0
|
||||
|
||||
- name: Run Trivy vulnerability scanner in repo mode
|
||||
uses: aquasecurity/trivy-action@12814ff8bcb32c97f4d963e6e7903674b1692fa0
|
||||
with:
|
||||
scan-type: "fs"
|
||||
scan-ref: "."
|
||||
ignore-unfixed: true
|
||||
format: "template"
|
||||
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@v2
|
||||
with:
|
||||
sarif_file: "trivy-repo-results.sarif"
|
||||
47
.github/workflows/codeql-analysis.yml
vendored
47
.github/workflows/codeql-analysis.yml
vendored
|
|
@ -1,47 +0,0 @@
|
|||
name: "Code Scanning"
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [main]
|
||||
pull_request:
|
||||
# The branches below must be a subset of the branches above
|
||||
branches: [main]
|
||||
schedule:
|
||||
# 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@v3
|
||||
|
||||
# Initializes the CodeQL tools for scanning.
|
||||
- name: Initialize CodeQL
|
||||
uses: github/codeql-action/init@v2
|
||||
with:
|
||||
config-file: ./.github/codeql-config.yml
|
||||
languages: javascript
|
||||
|
||||
- name: Autobuild
|
||||
uses: github/codeql-action/autobuild@v2
|
||||
|
||||
- name: Perform CodeQL Analysis
|
||||
uses: github/codeql-action/analyze@v2
|
||||
60
.github/workflows/docker.yaml
vendored
60
.github/workflows/docker.yaml
vendored
|
|
@ -1,60 +0,0 @@
|
|||
name: Publish on Docker
|
||||
|
||||
on:
|
||||
# Shows the manual trigger in GitHub UI
|
||||
# helpful as a back-up in case the GitHub Actions Workflow fails
|
||||
workflow_dispatch:
|
||||
|
||||
release:
|
||||
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-20.04
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v3
|
||||
|
||||
- name: Set up QEMU
|
||||
uses: docker/setup-qemu-action@v2
|
||||
|
||||
- name: Set up Docker Buildx
|
||||
uses: docker/setup-buildx-action@v2
|
||||
|
||||
- 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: ${{ github.token }}
|
||||
46
.github/workflows/docs-preview.yaml
vendored
46
.github/workflows/docs-preview.yaml
vendored
|
|
@ -1,46 +0,0 @@
|
|||
name: Docs preview
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
branches:
|
||||
- main
|
||||
paths:
|
||||
- "docs/**"
|
||||
|
||||
permissions:
|
||||
actions: none
|
||||
checks: none
|
||||
contents: read
|
||||
deployments: none
|
||||
issues: none
|
||||
packages: none
|
||||
pull-requests: write
|
||||
repository-projects: none
|
||||
security-events: none
|
||||
statuses: none
|
||||
|
||||
jobs:
|
||||
preview:
|
||||
name: Docs preview
|
||||
runs-on: ubuntu-20.04
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
|
||||
- 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
|
||||
# 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: |
|
||||
✨ 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 }}
|
||||
|
|
@ -6,11 +6,13 @@ on:
|
|||
- main
|
||||
paths:
|
||||
- "install.sh"
|
||||
- ".github/workflows/installer.yaml"
|
||||
pull_request:
|
||||
branches:
|
||||
- main
|
||||
paths:
|
||||
- "install.sh"
|
||||
- ".github/workflows/installer.yaml"
|
||||
|
||||
# Cancel in-progress runs for pull requests when developers push
|
||||
# additional changes, and serialize builds in branches.
|
||||
|
|
@ -28,21 +30,21 @@ jobs:
|
|||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout repo
|
||||
uses: actions/checkout@v3
|
||||
uses: actions/checkout@v6
|
||||
|
||||
- name: Install code-server
|
||||
run: ./install.sh
|
||||
|
||||
- name: Test code-server
|
||||
run: CODE_SERVER_PATH="code-server" yarn test:integration
|
||||
- name: Test code-server was installed globally
|
||||
run: code-server --help
|
||||
|
||||
alpine:
|
||||
name: Test installer on Alpine
|
||||
runs-on: ubuntu-latest
|
||||
container: "alpine:3.16"
|
||||
container: "alpine:3.17"
|
||||
steps:
|
||||
- name: Checkout repo
|
||||
uses: actions/checkout@v3
|
||||
uses: actions/checkout@v6
|
||||
|
||||
- name: Install curl
|
||||
run: apk add curl
|
||||
|
|
@ -54,16 +56,21 @@ jobs:
|
|||
- name: Test standalone to a non-existent prefix
|
||||
run: su coder -c "./install.sh --method standalone --prefix /tmp/does/not/yet/exist"
|
||||
|
||||
# We do not actually have Alpine standalone builds so running code-server
|
||||
# will not work.
|
||||
- name: Test code-server was installed to prefix
|
||||
run: test -f /tmp/does/not/yet/exist/bin/code-server
|
||||
|
||||
macos:
|
||||
name: Test installer on macOS
|
||||
runs-on: macos-latest
|
||||
|
||||
steps:
|
||||
- name: Checkout repo
|
||||
uses: actions/checkout@v3
|
||||
uses: actions/checkout@v6
|
||||
|
||||
- name: Install code-server
|
||||
run: ./install.sh
|
||||
|
||||
- name: Test code-server
|
||||
run: CODE_SERVER_PATH="code-server" yarn test:integration
|
||||
- name: Test code-server was installed globally
|
||||
run: code-server --help
|
||||
69
.github/workflows/npm-brew.yaml
vendored
69
.github/workflows/npm-brew.yaml
vendored
|
|
@ -1,69 +0,0 @@
|
|||
name: Publish on npm and brew
|
||||
|
||||
on:
|
||||
# Shows the manual trigger in GitHub UI
|
||||
# helpful as a back-up in case the GitHub Actions Workflow fails
|
||||
workflow_dispatch:
|
||||
|
||||
release:
|
||||
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
|
||||
# All of them are included in ubuntu-latest.
|
||||
npm:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
|
||||
- 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: release/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:
|
||||
needs: npm
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
# Ensure things are up to date
|
||||
# Suggested by homebrew maintainers
|
||||
# https://github.com/Homebrew/discussions/discussions/1532#discussioncomment-782633
|
||||
- name: Set up Homebrew
|
||||
id: set-up-homebrew
|
||||
uses: Homebrew/actions/setup-homebrew@master
|
||||
|
||||
- name: Checkout code-server
|
||||
uses: actions/checkout@v3
|
||||
|
||||
- name: Configure git
|
||||
run: |
|
||||
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}}
|
||||
run: ./ci/steps/brew-bump.sh
|
||||
166
.github/workflows/publish.yaml
vendored
Normal file
166
.github/workflows/publish.yaml
vendored
Normal file
|
|
@ -0,0 +1,166 @@
|
|||
name: Publish code-server
|
||||
|
||||
on:
|
||||
# Shows the manual trigger in GitHub UI
|
||||
# helpful as a back-up in case the GitHub Actions Workflow fails
|
||||
workflow_dispatch:
|
||||
inputs:
|
||||
version:
|
||||
description: The version to publish (include "v", i.e. "v4.9.1").
|
||||
type: string
|
||||
required: true
|
||||
|
||||
release:
|
||||
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:
|
||||
npm:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout code-server
|
||||
uses: actions/checkout@v6
|
||||
|
||||
- name: Install Node.js
|
||||
uses: actions/setup-node@v6
|
||||
with:
|
||||
node-version-file: .node-version
|
||||
|
||||
- name: Download npm package from release artifacts
|
||||
uses: robinraju/release-downloader@v1.12
|
||||
with:
|
||||
repository: "coder/code-server"
|
||||
tag: ${{ github.event.inputs.version || github.ref_name }}
|
||||
fileName: "package.tar.gz"
|
||||
out-file-path: "release-npm-package"
|
||||
|
||||
# Strip out the v (v4.9.1 -> 4.9.1).
|
||||
- name: Get and set VERSION
|
||||
run: |
|
||||
TAG="${{ github.event.inputs.version || github.ref_name }}"
|
||||
echo "VERSION=${TAG#v}" >> $GITHUB_ENV
|
||||
|
||||
- run: npm run publish:npm
|
||||
env:
|
||||
VERSION: ${{ env.VERSION }}
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
|
||||
NPM_ENVIRONMENT: "production"
|
||||
|
||||
aur:
|
||||
runs-on: ubuntu-latest
|
||||
timeout-minutes: 10
|
||||
env:
|
||||
GH_TOKEN: ${{ secrets.HOMEBREW_GITHUB_API_TOKEN }}
|
||||
|
||||
steps:
|
||||
# We need to checkout code-server so we can get the version
|
||||
- name: Checkout code-server
|
||||
uses: actions/checkout@v6
|
||||
with:
|
||||
fetch-depth: 0
|
||||
path: "./code-server"
|
||||
|
||||
- name: Checkout code-server-aur repo
|
||||
uses: actions/checkout@v6
|
||||
with:
|
||||
repository: "cdrci/code-server-aur"
|
||||
token: ${{ secrets.HOMEBREW_GITHUB_API_TOKEN }}
|
||||
ref: "master"
|
||||
|
||||
- name: Merge in master
|
||||
run: |
|
||||
git remote add upstream https://github.com/coder/code-server-aur.git
|
||||
git fetch upstream
|
||||
git merge upstream/master
|
||||
|
||||
- name: Configure git
|
||||
run: |
|
||||
git config --global user.name cdrci
|
||||
git config --global user.email opensource@coder.com
|
||||
|
||||
# Strip out the v (v4.9.1 -> 4.9.1).
|
||||
- name: Get and set VERSION
|
||||
run: |
|
||||
TAG="${{ github.event.inputs.version || github.ref_name }}"
|
||||
echo "VERSION=${TAG#v}" >> $GITHUB_ENV
|
||||
|
||||
- name: Validate package
|
||||
uses: heyhusen/archlinux-package-action@v2.4.0
|
||||
env:
|
||||
VERSION: ${{ env.VERSION }}
|
||||
with:
|
||||
pkgver: ${{ env.VERSION }}
|
||||
updpkgsums: true
|
||||
srcinfo: true
|
||||
|
||||
- name: Open PR
|
||||
# We need to git push -u otherwise gh will prompt
|
||||
# asking where to push the branch.
|
||||
env:
|
||||
VERSION: ${{ env.VERSION }}
|
||||
run: |
|
||||
git checkout -b update-version-${{ env.VERSION }}
|
||||
git add .
|
||||
git commit -m "chore: updating version to ${{ env.VERSION }}"
|
||||
git push -u origin $(git branch --show)
|
||||
gh pr create --repo coder/code-server-aur --title "chore: bump version to ${{ env.VERSION }}" --body "PR opened by @$GITHUB_ACTOR" --assignee $GITHUB_ACTOR
|
||||
|
||||
docker:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout code-server
|
||||
uses: actions/checkout@v6
|
||||
|
||||
- name: Set up QEMU
|
||||
uses: docker/setup-qemu-action@v3
|
||||
|
||||
- name: Set up Docker Buildx
|
||||
uses: docker/setup-buildx-action@v3
|
||||
|
||||
- name: Login to Docker Hub
|
||||
uses: docker/login-action@v3
|
||||
with:
|
||||
username: ${{ secrets.DOCKER_USERNAME }}
|
||||
password: ${{ secrets.DOCKER_PASSWORD }}
|
||||
|
||||
- name: Login to GHCR
|
||||
uses: docker/login-action@v3
|
||||
with:
|
||||
registry: ghcr.io
|
||||
username: ${{ github.actor }}
|
||||
password: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
||||
# Strip out the v (v4.9.1 -> 4.9.1).
|
||||
- name: Get and set VERSION
|
||||
run: |
|
||||
TAG="${{ github.event.inputs.version || github.ref_name }}"
|
||||
echo "VERSION=${TAG#v}" >> $GITHUB_ENV
|
||||
|
||||
- name: Download deb artifacts
|
||||
uses: robinraju/release-downloader@v1.12
|
||||
with:
|
||||
repository: "coder/code-server"
|
||||
tag: v${{ env.VERSION }}
|
||||
fileName: "*.deb"
|
||||
out-file-path: "release-packages"
|
||||
|
||||
- name: Download rpm artifacts
|
||||
uses: robinraju/release-downloader@v1.12
|
||||
with:
|
||||
repository: "coder/code-server"
|
||||
tag: v${{ env.VERSION }}
|
||||
fileName: "*.rpm"
|
||||
out-file-path: "release-packages"
|
||||
|
||||
- name: Publish to Docker
|
||||
run: ./ci/steps/docker-buildx-push.sh
|
||||
env:
|
||||
VERSION: ${{ env.VERSION }}
|
||||
GITHUB_TOKEN: ${{ github.token }}
|
||||
309
.github/workflows/release.yaml
vendored
Normal file
309
.github/workflows/release.yaml
vendored
Normal file
|
|
@ -0,0 +1,309 @@
|
|||
name: Draft release
|
||||
|
||||
on:
|
||||
workflow_dispatch:
|
||||
inputs:
|
||||
version:
|
||||
description: The version to publish (include "v", i.e. "v4.9.1").
|
||||
type: string
|
||||
required: true
|
||||
|
||||
permissions:
|
||||
contents: write # For creating releases.
|
||||
discussions: write # For creating a discussion.
|
||||
|
||||
# Cancel in-progress runs for pull requests when developers push
|
||||
# additional changes
|
||||
concurrency:
|
||||
group: ${{ github.workflow }}-${{ github.ref }}
|
||||
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
|
||||
|
||||
jobs:
|
||||
package-linux-cross:
|
||||
name: ${{ matrix.prefix }}
|
||||
runs-on: ubuntu-latest
|
||||
timeout-minutes: 15
|
||||
needs: npm-version
|
||||
container: "python:3.8-slim-buster"
|
||||
strategy:
|
||||
matrix:
|
||||
include:
|
||||
- prefix: x86_64-linux-gnu
|
||||
npm_arch: x64
|
||||
apt_arch: amd64
|
||||
package_arch: amd64
|
||||
- prefix: aarch64-linux-gnu
|
||||
npm_arch: arm64
|
||||
apt_arch: arm64
|
||||
package_arch: arm64
|
||||
- prefix: arm-linux-gnueabihf
|
||||
npm_arch: armv7l
|
||||
apt_arch: armhf
|
||||
package_arch: armv7l
|
||||
|
||||
env:
|
||||
AR: ${{ format('{0}-ar', matrix.prefix) }}
|
||||
AS: ${{ format('{0}-as', matrix.prefix) }}
|
||||
CC: ${{ format('{0}-gcc', matrix.prefix) }}
|
||||
CPP: ${{ format('{0}-cpp', matrix.prefix) }}
|
||||
CXX: ${{ format('{0}-g++', matrix.prefix) }}
|
||||
FC: ${{ format('{0}-gfortran', matrix.prefix) }}
|
||||
LD: ${{ format('{0}-ld', matrix.prefix) }}
|
||||
STRIP: ${{ format('{0}-strip', matrix.prefix) }}
|
||||
PKG_CONFIG_PATH: ${{ format('/usr/lib/{0}/pkgconfig', matrix.prefix) }}
|
||||
TARGET_ARCH: ${{ matrix.apt_arch }}
|
||||
npm_config_arch: ${{ matrix.npm_arch }}
|
||||
PKG_ARCH: ${{ matrix.package_arch }}
|
||||
# Not building from source results in an x86_64 argon2, as if
|
||||
# npm_config_arch is being ignored.
|
||||
npm_config_build_from_source: true
|
||||
|
||||
steps:
|
||||
- name: Checkout repo
|
||||
uses: actions/checkout@v6
|
||||
|
||||
- name: Install Node.js
|
||||
uses: actions/setup-node@v6
|
||||
with:
|
||||
node-version-file: .node-version
|
||||
cache: npm
|
||||
cache-dependency-path: |
|
||||
package-lock.json
|
||||
test/package-lock.json
|
||||
|
||||
- name: Install cross-compiler and system dependencies
|
||||
run: |
|
||||
sed -i 's/deb\.debian\.org/archive.debian.org/g' /etc/apt/sources.list
|
||||
dpkg --add-architecture $TARGET_ARCH
|
||||
apt update && apt install -y --no-install-recommends \
|
||||
crossbuild-essential-$TARGET_ARCH \
|
||||
libx11-dev:$TARGET_ARCH \
|
||||
libx11-xcb-dev:$TARGET_ARCH \
|
||||
libxkbfile-dev:$TARGET_ARCH \
|
||||
libsecret-1-dev:$TARGET_ARCH \
|
||||
libkrb5-dev:$TARGET_ARCH \
|
||||
ca-certificates \
|
||||
curl wget rsync gettext-base
|
||||
|
||||
- run: SKIP_SUBMODULE_DEPS=1 npm ci
|
||||
|
||||
- name: Install nfpm
|
||||
run: |
|
||||
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@v5
|
||||
with:
|
||||
name: npm-release-package
|
||||
|
||||
- run: tar -xzf package.tar.gz
|
||||
- run: npm run release:standalone
|
||||
|
||||
- name: Replace node with cross-compile equivalent
|
||||
run: |
|
||||
node_version=$(node --version)
|
||||
wget https://nodejs.org/dist/${node_version}/node-${node_version}-linux-${npm_config_arch}.tar.xz
|
||||
tar -xf node-${node_version}-linux-${npm_config_arch}.tar.xz node-${node_version}-linux-${npm_config_arch}/bin/node --strip-components=2
|
||||
mv ./node ./release-standalone/lib/node
|
||||
|
||||
# Strip out the v (v4.9.1 -> 4.9.1).
|
||||
- name: Get and set VERSION
|
||||
run: |
|
||||
TAG="${{ inputs.version || github.ref_name }}"
|
||||
echo "VERSION=${TAG#v}" >> $GITHUB_ENV
|
||||
|
||||
- env:
|
||||
VERSION: ${{ env.VERSION }}
|
||||
run: npm run package $PKG_ARCH
|
||||
|
||||
- uses: softprops/action-gh-release@v1
|
||||
with:
|
||||
draft: true
|
||||
discussion_category_name: "📣 Announcements"
|
||||
files: ./release-packages/*
|
||||
|
||||
package-macos-amd64:
|
||||
name: x86-64 macOS build
|
||||
runs-on: macos-15-intel
|
||||
timeout-minutes: 15
|
||||
needs: npm-version
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
||||
steps:
|
||||
- name: Checkout repo
|
||||
uses: actions/checkout@v6
|
||||
|
||||
- name: Install Node.js
|
||||
uses: actions/setup-node@v6
|
||||
with:
|
||||
node-version-file: .node-version
|
||||
cache: npm
|
||||
cache-dependency-path: |
|
||||
package-lock.json
|
||||
test/package-lock.json
|
||||
|
||||
- run: SKIP_SUBMODULE_DEPS=1 npm ci
|
||||
|
||||
- name: Install nfpm
|
||||
run: |
|
||||
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
|
||||
|
||||
# The version of node-gyp we use depends on distutils but it was removed
|
||||
# in Python 3.12. It seems to be fixed in the latest node-gyp so when we
|
||||
# next update Node we can probably remove this. For now, install
|
||||
# setuptools since it contains distutils.
|
||||
- run: brew install python-setuptools
|
||||
|
||||
- name: Download npm package
|
||||
uses: actions/download-artifact@v5
|
||||
with:
|
||||
name: npm-release-package
|
||||
|
||||
- run: tar -xzf package.tar.gz
|
||||
- run: npm run release:standalone
|
||||
- run: npm run test:native
|
||||
|
||||
# Strip out the v (v4.9.1 -> 4.9.1).
|
||||
- name: Get and set VERSION
|
||||
run: |
|
||||
TAG="${{ inputs.version || github.ref_name }}"
|
||||
echo "VERSION=${TAG#v}" >> $GITHUB_ENV
|
||||
|
||||
- name: Build packages with nfpm
|
||||
env:
|
||||
VERSION: ${{ env.VERSION }}
|
||||
run: npm run package
|
||||
|
||||
- uses: softprops/action-gh-release@v1
|
||||
with:
|
||||
draft: true
|
||||
discussion_category_name: "📣 Announcements"
|
||||
files: ./release-packages/*
|
||||
|
||||
package-macos-arm64:
|
||||
name: arm64 macOS build
|
||||
runs-on: macos-latest
|
||||
timeout-minutes: 15
|
||||
needs: npm-version
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
||||
steps:
|
||||
- name: Checkout repo
|
||||
uses: actions/checkout@v6
|
||||
|
||||
- name: Install Node.js
|
||||
uses: actions/setup-node@v6
|
||||
with:
|
||||
node-version-file: .node-version
|
||||
cache: npm
|
||||
cache-dependency-path: |
|
||||
package-lock.json
|
||||
test/package-lock.json
|
||||
|
||||
- run: SKIP_SUBMODULE_DEPS=1 npm ci
|
||||
|
||||
- name: Install nfpm
|
||||
run: |
|
||||
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
|
||||
|
||||
# The version of node-gyp we use depends on distutils but it was removed
|
||||
# in Python 3.12. It seems to be fixed in the latest node-gyp so when we
|
||||
# next update Node we can probably remove this. For now, install
|
||||
# setuptools since it contains distutils.
|
||||
- run: brew install python-setuptools
|
||||
|
||||
- name: Download npm package
|
||||
uses: actions/download-artifact@v5
|
||||
with:
|
||||
name: npm-release-package
|
||||
|
||||
- run: tar -xzf package.tar.gz
|
||||
- run: npm run release:standalone
|
||||
- run: npm run test:native
|
||||
|
||||
# Strip out the v (v4.9.1 -> 4.9.1).
|
||||
- name: Get and set VERSION
|
||||
run: |
|
||||
TAG="${{ inputs.version || github.ref_name }}"
|
||||
echo "VERSION=${TAG#v}" >> $GITHUB_ENV
|
||||
|
||||
- name: Build packages with nfpm
|
||||
env:
|
||||
VERSION: ${{ env.VERSION }}
|
||||
run: npm run package
|
||||
|
||||
- uses: softprops/action-gh-release@v1
|
||||
with:
|
||||
draft: true
|
||||
discussion_category_name: "📣 Announcements"
|
||||
files: ./release-packages/*
|
||||
|
||||
npm-package:
|
||||
name: Upload npm package
|
||||
runs-on: ubuntu-latest
|
||||
timeout-minutes: 15
|
||||
needs: npm-version
|
||||
steps:
|
||||
- name: Download npm package
|
||||
uses: actions/download-artifact@v5
|
||||
with:
|
||||
name: npm-release-package
|
||||
|
||||
- uses: softprops/action-gh-release@v1
|
||||
with:
|
||||
draft: true
|
||||
discussion_category_name: "📣 Announcements"
|
||||
files: ./package.tar.gz
|
||||
|
||||
npm-version:
|
||||
name: Modify package.json version
|
||||
runs-on: ubuntu-latest
|
||||
timeout-minutes: 15
|
||||
steps:
|
||||
- name: Download artifacts
|
||||
uses: dawidd6/action-download-artifact@v11
|
||||
id: download
|
||||
with:
|
||||
branch: ${{ github.ref }}
|
||||
workflow: build.yaml
|
||||
workflow_conclusion: completed
|
||||
name: npm-package
|
||||
check_artifacts: false
|
||||
if_no_artifact_found: fail
|
||||
|
||||
- run: tar -xzf package.tar.gz
|
||||
|
||||
# Strip out the v (v4.9.1 -> 4.9.1).
|
||||
- name: Get and set VERSION
|
||||
run: |
|
||||
TAG="${{ inputs.version || github.ref_name }}"
|
||||
echo "VERSION=${TAG#v}" >> $GITHUB_ENV
|
||||
|
||||
- name: Modify version
|
||||
env:
|
||||
VERSION: ${{ env.VERSION }}
|
||||
run: |
|
||||
echo "Updating version in root package.json"
|
||||
npm version --prefix release "$VERSION"
|
||||
|
||||
echo "Updating version in lib/vscode/product.json"
|
||||
tmp=$(mktemp)
|
||||
jq ".codeServerVersion = \"$VERSION\"" release/lib/vscode/product.json > "$tmp" && mv "$tmp" release/lib/vscode/product.json
|
||||
# Ensure it has the same permissions as before
|
||||
chmod 644 release/lib/vscode/product.json
|
||||
|
||||
- run: tar -czf package.tar.gz release
|
||||
|
||||
- name: Upload npm package artifact
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: npm-release-package
|
||||
path: ./package.tar.gz
|
||||
|
|
@ -38,10 +38,10 @@ jobs:
|
|||
name: Run script unit tests
|
||||
runs-on: ubuntu-latest
|
||||
# This runs on Alpine to make sure we're testing with actual sh.
|
||||
container: "alpine:3.16"
|
||||
container: "alpine:3.17"
|
||||
steps:
|
||||
- name: Checkout repo
|
||||
uses: actions/checkout@v3
|
||||
uses: actions/checkout@v6
|
||||
|
||||
- name: Install test utilities
|
||||
run: apk add bats checkbashisms
|
||||
|
|
@ -51,3 +51,17 @@ jobs:
|
|||
|
||||
- name: Run script unit tests
|
||||
run: ./ci/dev/test-scripts.sh
|
||||
|
||||
lint:
|
||||
name: Lint shell files
|
||||
runs-on: ubuntu-latest
|
||||
timeout-minutes: 5
|
||||
steps:
|
||||
- name: Checkout repo
|
||||
uses: actions/checkout@v6
|
||||
|
||||
- name: Install lint utilities
|
||||
run: sudo apt install shellcheck
|
||||
|
||||
- name: Lint shell files
|
||||
run: ./ci/dev/lint-scripts.sh
|
||||
92
.github/workflows/security.yaml
vendored
Normal file
92
.github/workflows/security.yaml
vendored
Normal file
|
|
@ -0,0 +1,92 @@
|
|||
name: Security
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [main]
|
||||
paths:
|
||||
- "package.json"
|
||||
pull_request:
|
||||
paths:
|
||||
- "package.json"
|
||||
schedule:
|
||||
# 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.
|
||||
concurrency:
|
||||
group: ${{ github.workflow }}-${{ github.ref }}
|
||||
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
|
||||
|
||||
jobs:
|
||||
audit:
|
||||
name: Audit node modules
|
||||
runs-on: ubuntu-latest
|
||||
timeout-minutes: 15
|
||||
steps:
|
||||
- name: Checkout repo
|
||||
uses: actions/checkout@v6
|
||||
with:
|
||||
fetch-depth: 0
|
||||
|
||||
- name: Install Node.js
|
||||
uses: actions/setup-node@v6
|
||||
with:
|
||||
node-version-file: .node-version
|
||||
|
||||
- name: Audit npm for vulnerabilities
|
||||
run: npm audit
|
||||
if: success()
|
||||
|
||||
trivy-scan-repo:
|
||||
name: Scan repo with Trivy
|
||||
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-22.04
|
||||
steps:
|
||||
- name: Checkout repo
|
||||
uses: actions/checkout@v6
|
||||
with:
|
||||
fetch-depth: 0
|
||||
|
||||
- name: Run Trivy vulnerability scanner in repo mode
|
||||
uses: aquasecurity/trivy-action@b6643a29fecd7f34b3597bc6acb0a98b03d33ff8
|
||||
with:
|
||||
scan-type: "fs"
|
||||
scan-ref: "."
|
||||
ignore-unfixed: true
|
||||
format: "template"
|
||||
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@v3
|
||||
with:
|
||||
sarif_file: "trivy-repo-results.sarif"
|
||||
|
||||
codeql-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 with CodeQL
|
||||
runs-on: ubuntu-22.04
|
||||
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v6
|
||||
|
||||
# Initializes the CodeQL tools for scanning.
|
||||
- name: Initialize CodeQL
|
||||
uses: github/codeql-action/init@v3
|
||||
with:
|
||||
config-file: ./.github/codeql-config.yml
|
||||
languages: javascript
|
||||
|
||||
- name: Autobuild
|
||||
uses: github/codeql-action/autobuild@v3
|
||||
|
||||
- name: Perform CodeQL Analysis
|
||||
uses: github/codeql-action/analyze@v3
|
||||
8
.github/workflows/trivy-docker.yaml
vendored
8
.github/workflows/trivy-docker.yaml
vendored
|
|
@ -44,14 +44,14 @@ concurrency:
|
|||
|
||||
jobs:
|
||||
trivy-scan-image:
|
||||
runs-on: ubuntu-20.04
|
||||
runs-on: ubuntu-22.04
|
||||
|
||||
steps:
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v3
|
||||
uses: actions/checkout@v6
|
||||
|
||||
- name: Run Trivy vulnerability scanner in image mode
|
||||
uses: aquasecurity/trivy-action@12814ff8bcb32c97f4d963e6e7903674b1692fa0
|
||||
uses: aquasecurity/trivy-action@b6643a29fecd7f34b3597bc6acb0a98b03d33ff8
|
||||
with:
|
||||
image-ref: "docker.io/codercom/code-server:latest"
|
||||
ignore-unfixed: true
|
||||
|
|
@ -60,6 +60,6 @@ jobs:
|
|||
severity: "HIGH,CRITICAL"
|
||||
|
||||
- name: Upload Trivy scan results to GitHub Security tab
|
||||
uses: github/codeql-action/upload-sarif@v2
|
||||
uses: github/codeql-action/upload-sarif@v3
|
||||
with:
|
||||
sarif_file: "trivy-image-results.sarif"
|
||||
|
|
|
|||
|
|
@ -1 +1 @@
|
|||
16
|
||||
22.21.1
|
||||
|
|
|
|||
|
|
@ -1 +1,10 @@
|
|||
lib/vscode
|
||||
lib/vscode
|
||||
lib/vscode-reh-web-linux-x64
|
||||
release-standalone
|
||||
release-packages
|
||||
release
|
||||
helm-chart
|
||||
test/scripts
|
||||
test/e2e/extensions/test-extension
|
||||
.pc
|
||||
package-lock.json
|
||||
|
|
|
|||
|
|
@ -1,2 +0,0 @@
|
|||
extends:
|
||||
- stylelint-config-recommended
|
||||
|
|
@ -5,7 +5,7 @@
|
|||
{
|
||||
"file": "package.json",
|
||||
"line": 31,
|
||||
"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"
|
||||
"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>> npm\n\n3. Start development mode (and watch for changes):\n>> npm run 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/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)"
|
||||
"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 `npm run 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)"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
|
|
|
|||
879
CHANGELOG.md
879
CHANGELOG.md
|
|
@ -20,6 +20,884 @@ Code v99.99.999
|
|||
|
||||
-->
|
||||
|
||||
## Unreleased
|
||||
|
||||
Code v1.107.0
|
||||
|
||||
### Changed
|
||||
|
||||
- Update to Code 1.107.0
|
||||
|
||||
### Added
|
||||
|
||||
- New `--cookie-suffix` flag that can be used to add a suffix to the cookie when
|
||||
using the built-in password authentication. You can use this to avoid
|
||||
collisions with other instances of code-server.
|
||||
- Support a new property `authorizationHeaderToken` on the extension gallery
|
||||
configuration. This will be added to marketplace requests as a bearer token
|
||||
using the `Authorization` header.
|
||||
|
||||
## [4.106.3](https://github.com/coder/code-server/releases/tag/v4.106.3) - 2025-12-01
|
||||
|
||||
Code v1.106.3
|
||||
|
||||
### Changed
|
||||
|
||||
- Update to Code 1.106.3
|
||||
|
||||
## [4.106.2](https://github.com/coder/code-server/releases/tag/v4.106.2) - 2025-11-19
|
||||
|
||||
Code v1.106.2
|
||||
|
||||
### Changed
|
||||
|
||||
- Update to Code 1.106.2
|
||||
|
||||
## [4.106.0](https://github.com/coder/code-server/releases/tag/v4.106.0) - 2025-11-19
|
||||
|
||||
Code v1.106.0
|
||||
|
||||
### Changed
|
||||
|
||||
- Update to Code 1.106.0
|
||||
|
||||
## [4.105.1](https://github.com/coder/code-server/releases/tag/v4.105.1) - 2025-10-20
|
||||
|
||||
Code v1.105.1
|
||||
|
||||
### Changed
|
||||
|
||||
- Update to Code 1.105.1
|
||||
|
||||
## [4.105.0](https://github.com/coder/code-server/releases/tag/v4.105.0) - 2025-10-17
|
||||
|
||||
Code v1.105.0
|
||||
|
||||
### Changed
|
||||
|
||||
- Update to Code 1.105.0
|
||||
|
||||
## [4.104.3](https://github.com/coder/code-server/releases/tag/v4.104.3) - 2025-10-07
|
||||
|
||||
Code v1.104.3
|
||||
|
||||
### Changed
|
||||
|
||||
- Update to Code 1.104.3.
|
||||
|
||||
## [4.104.2](https://github.com/coder/code-server/releases/tag/v4.104.2) - 2025-09-26
|
||||
|
||||
Code v1.104.2
|
||||
|
||||
### Changed
|
||||
|
||||
- Update to Code 1.104.2.
|
||||
|
||||
## [4.104.1](https://github.com/coder/code-server/releases/tag/v4.104.1) - 2025-09-19
|
||||
|
||||
Code v1.104.1
|
||||
|
||||
### Changed
|
||||
|
||||
- Update to Code 1.104.1.
|
||||
|
||||
## [4.104.0](https://github.com/coder/code-server/releases/tag/v4.104.0) - 2025-09-15
|
||||
|
||||
Code v1.104.0
|
||||
|
||||
### Fixed
|
||||
|
||||
- Fix "extension not found" errors from Open VSX when trying to install the
|
||||
latest version of an extension.
|
||||
|
||||
### Changed
|
||||
|
||||
- Update to Code 1.104.0.
|
||||
|
||||
## [4.103.2](https://github.com/coder/code-server/releases/tag/v4.103.2) - 2025-08-25
|
||||
|
||||
Code v1.103.2
|
||||
|
||||
### Changed
|
||||
|
||||
- Update to Code 1.103.2.
|
||||
|
||||
## [4.103.1](https://github.com/coder/code-server/releases/tag/v4.103.1) - 2025-08-15
|
||||
|
||||
Code v1.103.1
|
||||
|
||||
### Changed
|
||||
|
||||
- Update to Code 1.103.1.
|
||||
|
||||
## [4.103.0](https://github.com/coder/code-server/releases/tag/v4.103.0) - 2025-08-12
|
||||
|
||||
Code v1.103.0
|
||||
|
||||
### Changed
|
||||
|
||||
- Update to Code 1.103.0.
|
||||
|
||||
## [4.102.2](https://github.com/coder/code-server/releases/tag/v4.102.2) - 2025-07-24
|
||||
|
||||
Code v1.102.2
|
||||
|
||||
### Changed
|
||||
|
||||
- Update to Code 1.102.2.
|
||||
|
||||
## [4.102.1](https://github.com/coder/code-server/releases/tag/v4.102.1) - 2025-07-17
|
||||
|
||||
Code v1.102.1
|
||||
|
||||
### Changed
|
||||
|
||||
- Update to Code 1.102.1.
|
||||
|
||||
## [4.102.0](https://github.com/coder/code-server/releases/tag/v4.102.0) - 2025-07-16
|
||||
|
||||
Code v1.102.0
|
||||
|
||||
### Changed
|
||||
|
||||
- Update to Code 1.102.0.
|
||||
|
||||
### Added
|
||||
|
||||
- Custom strings can be configured using the `--i18n` flag set to a JSON
|
||||
file. This can be used for either translation (and can be used alongside
|
||||
`--locale`) or for customizing the strings. See
|
||||
[./src/node/i18n/locales/en.json](./src/node/i18n/locales/en.json) for the
|
||||
available keys.
|
||||
|
||||
## [4.101.2](https://github.com/coder/code-server/releases/tag/v4.101.2) - 2025-06-25
|
||||
|
||||
Code v1.101.2
|
||||
|
||||
### Changed
|
||||
|
||||
- Update to Code 1.101.2.
|
||||
|
||||
### Fixed
|
||||
|
||||
- Fix web views not loading due to 401 when requesting the service worker.
|
||||
|
||||
## [4.101.1](https://github.com/coder/code-server/releases/tag/v4.101.1) - 2025-06-20
|
||||
|
||||
Code v1.101.1
|
||||
|
||||
### Changed
|
||||
|
||||
- Update to Code 1.101.1.
|
||||
|
||||
## [4.101.0](https://github.com/coder/code-server/releases/tag/v4.101.0) - 2025-06-20
|
||||
|
||||
Code v1.101.0
|
||||
|
||||
### Changed
|
||||
|
||||
- Update to Code 1.101.0.
|
||||
|
||||
## [4.100.3](https://github.com/coder/code-server/releases/tag/v4.100.3) - 2025-06-03
|
||||
|
||||
Code v1.100.3
|
||||
|
||||
### Changed
|
||||
|
||||
- Update to Code 1.100.3.
|
||||
|
||||
## [4.100.2](https://github.com/coder/code-server/releases/tag/v4.100.2) - 2025-05-15
|
||||
|
||||
Code v1.100.2
|
||||
|
||||
### Changed
|
||||
|
||||
- Update to Code 1.100.2.
|
||||
|
||||
## [4.100.1](https://github.com/coder/code-server/releases/tag/v4.100.1) - 2025-05-13
|
||||
|
||||
Code v1.100.1
|
||||
|
||||
### Changed
|
||||
|
||||
- Update to Code 1.100.1.
|
||||
|
||||
## [4.100.0](https://github.com/coder/code-server/releases/tag/v4.100.0) - 2025-05-12
|
||||
|
||||
Code v1.100.0
|
||||
|
||||
### Added
|
||||
|
||||
- Trusted domains for links can now be set at run-time by configuring
|
||||
`linkProtectionTrustedDomains` in the `lib/vscode/product.json` file or via
|
||||
the `--link-protection-trusted-domains` flag.
|
||||
|
||||
### Changed
|
||||
|
||||
- Update to Code 1.100.0.
|
||||
- Disable extension signature verification, which previously was skipped by
|
||||
default (the package used for verification is not available to OSS builds of
|
||||
VS Code) but now reportedly throws hard errors making it impossible to install
|
||||
extensions.
|
||||
|
||||
### Fixed
|
||||
|
||||
- Flags with repeatable options now work via the config file.
|
||||
|
||||
## [4.99.4](https://github.com/coder/code-server/releases/tag/v4.99.4) - 2025-05-02
|
||||
|
||||
Code v1.99.3
|
||||
|
||||
### Security
|
||||
|
||||
- Validate that ports in the path proxy are numbers, to prevent proxying to
|
||||
arbitrary domains.
|
||||
|
||||
## [4.99.3](https://github.com/coder/code-server/releases/tag/v4.99.3) - 2025-04-17
|
||||
|
||||
Code v1.99.3
|
||||
|
||||
### Added
|
||||
|
||||
- Added `--skip-auth-preflight` flag to let preflight requests through the
|
||||
proxy.
|
||||
|
||||
### Changed
|
||||
|
||||
- Update to Code 1.99.3.
|
||||
|
||||
## [4.99.2](https://github.com/coder/code-server/releases/tag/v4.99.2) - 2025-04-10
|
||||
|
||||
Code v1.99.2
|
||||
|
||||
### Changed
|
||||
|
||||
- Update to Code 1.99.2.
|
||||
|
||||
## [4.99.1](https://github.com/coder/code-server/releases/tag/v4.99.1) - 2025-04-08
|
||||
|
||||
Code v1.99.1
|
||||
|
||||
### Changed
|
||||
|
||||
- Update to Code 1.99.1.
|
||||
|
||||
## [4.99.0](https://github.com/coder/code-server/releases/tag/v4.99.0) - 2025-04-07
|
||||
|
||||
Code v1.99.0
|
||||
|
||||
### Changed
|
||||
|
||||
- Update to Code 1.99.0.
|
||||
|
||||
## [4.98.0](https://github.com/coder/code-server/releases/tag/v4.98.0) - 2025-03-07
|
||||
|
||||
Code v1.98.0
|
||||
|
||||
### Changed
|
||||
|
||||
- Update to Code 1.98.0.
|
||||
|
||||
## [4.97.2](https://github.com/coder/code-server/releases/tag/v4.96.4) - 2025-02-18
|
||||
|
||||
Code v1.97.2
|
||||
|
||||
### Added
|
||||
|
||||
- Added back macOS amd64 builds.
|
||||
|
||||
### Changed
|
||||
|
||||
- Update to Code 1.97.2.
|
||||
- Softened dark mode login page colors.
|
||||
|
||||
## [4.96.4](https://github.com/coder/code-server/releases/tag/v4.96.4) - 2025-01-20
|
||||
|
||||
Code v1.96.4
|
||||
|
||||
### Changed
|
||||
|
||||
- Update to Code 1.96.4.
|
||||
|
||||
## [4.96.2](https://github.com/coder/code-server/releases/tag/v4.96.2) - 2024-12-20
|
||||
|
||||
Code v1.96.2
|
||||
|
||||
### Changed
|
||||
|
||||
- Update to Code 1.96.2.
|
||||
|
||||
## [4.96.1](https://github.com/coder/code-server/releases/tag/v4.96.1) - 2024-12-18
|
||||
|
||||
Code v1.96.1
|
||||
|
||||
### Added
|
||||
|
||||
- Dark color scheme for login and error pages.
|
||||
|
||||
### Changed
|
||||
|
||||
- Update to Code 1.96.1.
|
||||
|
||||
## [4.95.3](https://github.com/coder/code-server/releases/tag/v4.95.3) - 2024-11-18
|
||||
|
||||
Code v1.95.3
|
||||
|
||||
### Changed
|
||||
|
||||
- Update to Code 1.95.3.
|
||||
|
||||
## [4.95.2](https://github.com/coder/code-server/releases/tag/v4.95.2) - 2024-11-12
|
||||
|
||||
Code v1.95.2
|
||||
|
||||
### Changed
|
||||
|
||||
- Update to Code 1.95.2.
|
||||
|
||||
## [4.95.1](https://github.com/coder/code-server/releases/tag/v4.95.1) - 2024-11-06
|
||||
|
||||
Code v1.95.1
|
||||
|
||||
### Changed
|
||||
|
||||
- Update to Code 1.95.1.
|
||||
|
||||
## [4.93.1](https://github.com/coder/code-server/releases/tag/v4.93.1) - 2024-09-23
|
||||
|
||||
Code v1.93.1
|
||||
|
||||
### Changed
|
||||
|
||||
- Updated to Code 1.93.1.
|
||||
|
||||
### Added
|
||||
|
||||
- Added `--abs-proxy-base-path` flag for when code-server is not at the root.
|
||||
|
||||
## [4.92.2](https://github.com/coder/code-server/releases/tag/v4.92.2) - 2024-08-19
|
||||
|
||||
Code v1.92.2
|
||||
|
||||
### Breaking changes
|
||||
|
||||
- Dropped a patch that changed the compile target from es2022 to es2020 because
|
||||
it no longer works with the way VS Code uses static properties. This may break
|
||||
older browsers, so those browsers will either have to be updated or use an
|
||||
older version of code-server.
|
||||
|
||||
### Changed
|
||||
|
||||
- Updated to Code 1.92.2.
|
||||
|
||||
## [4.91.0](https://github.com/coder/code-server/releases/tag/v4.91.0) - 2024-07-10
|
||||
|
||||
Code v1.91.0
|
||||
|
||||
### Changed
|
||||
|
||||
- Updated to Code 1.91.0.
|
||||
|
||||
## [4.90.3](https://github.com/coder/code-server/releases/tag/v4.90.3) - 2024-06-21
|
||||
|
||||
Code v1.90.2
|
||||
|
||||
### Changed
|
||||
|
||||
- Updated to Code 1.90.2.
|
||||
|
||||
### Fixed
|
||||
|
||||
- When the log gets rotated it will no longer incorrectly be moved to a new
|
||||
directory created in the current working directory named with a date.
|
||||
Instead, the file itself is prepended with the date and kept in the same
|
||||
directory, as originally intended.
|
||||
|
||||
## [4.90.2](https://github.com/coder/code-server/releases/tag/v4.90.2) - 2024-06-14
|
||||
|
||||
Code v1.90.1
|
||||
|
||||
### Changed
|
||||
|
||||
- Updated to Code 1.90.1.
|
||||
|
||||
## [4.90.1](https://github.com/coder/code-server/releases/tag/v4.90.1) - 2024-06-12
|
||||
|
||||
Code v1.90.0
|
||||
|
||||
### Fixed
|
||||
|
||||
- Cache a call to get CPU information used in telemetry that could result in a
|
||||
lack responsiveness if it was particularly slow.
|
||||
|
||||
## [4.90.0](https://github.com/coder/code-server/releases/tag/v4.90.0) - 2024-06-11
|
||||
|
||||
Code v1.90.0
|
||||
|
||||
### Changed
|
||||
|
||||
- Updated to Code 1.90.0.
|
||||
- Updated Node to 20.11.1.
|
||||
|
||||
### Added
|
||||
|
||||
- Send contents to the clipboard in the integrated terminal by piping to
|
||||
`code-server --stdin-to-clipboard` or `code-server -c`.
|
||||
|
||||
You may want to make this an alias:
|
||||
|
||||
```
|
||||
alias xclip="code-server --stdin-to-clipboard"
|
||||
echo -n "hello world" | xclip
|
||||
```
|
||||
|
||||
## [4.89.1](https://github.com/coder/code-server/releases/tag/v4.89.1) - 2024-04-14
|
||||
|
||||
Code v1.89.1
|
||||
|
||||
### Changed
|
||||
|
||||
- Updated to Code 1.89.1.
|
||||
|
||||
## [4.89.0](https://github.com/coder/code-server/releases/tag/v4.89.0) - 2024-04-08
|
||||
|
||||
Code v1.89.0
|
||||
|
||||
### Changed
|
||||
|
||||
- Updated to Code 1.89.0.
|
||||
|
||||
## [4.23.1](https://github.com/coder/code-server/releases/tag/v4.23.1) - 2024-04-15
|
||||
|
||||
Code v1.88.1
|
||||
|
||||
### Changed
|
||||
|
||||
- Updated to Code 1.88.1.
|
||||
|
||||
## [4.23.0](https://github.com/coder/code-server/releases/tag/v4.23.0) - 2024-04-08
|
||||
|
||||
Code v1.88.0
|
||||
|
||||
### Changed
|
||||
|
||||
- Updated to Code 1.88.0.
|
||||
- Updated Node to 18.18.2.
|
||||
|
||||
### Fixed
|
||||
|
||||
- Fix masking the exit code when failing to install extensions on the command
|
||||
line outside the integrated terminal. Installing extensions inside the
|
||||
integrated terminal still masks the exit code and is an upstream bug.
|
||||
|
||||
## [4.22.1](https://github.com/coder/code-server/releases/tag/v4.22.1) - 2024-03-14
|
||||
|
||||
Code v1.87.2
|
||||
|
||||
### Changed
|
||||
|
||||
- Updated to Code 1.87.2.
|
||||
- Enable keep-alive for proxy agent.
|
||||
|
||||
## [4.22.0](https://github.com/coder/code-server/releases/tag/v4.22.0) - 2024-03-03
|
||||
|
||||
Code v1.87.0
|
||||
|
||||
### Changed
|
||||
|
||||
- Updated to Code 1.87.0.
|
||||
|
||||
## [4.21.2](https://github.com/coder/code-server/releases/tag/v4.21.2) - 2024-02-28
|
||||
|
||||
Code v1.86.2
|
||||
|
||||
### Changed
|
||||
|
||||
- Updated to Code 1.86.2.
|
||||
|
||||
## [4.21.1](https://github.com/coder/code-server/releases/tag/v4.21.1) - 2024-02-09
|
||||
|
||||
Code v1.86.1
|
||||
|
||||
### Changed
|
||||
|
||||
- Updated to Code 1.86.1.
|
||||
- Updated to Node 18.17.1.
|
||||
|
||||
### Added
|
||||
|
||||
- Docker images for Fedora and openSUSE.
|
||||
|
||||
## [4.21.0](https://github.com/coder/code-server/releases/tag/v4.21.0) - 2024-02-05
|
||||
|
||||
Code v1.86.0
|
||||
|
||||
### Changed
|
||||
|
||||
- Updated to Code 1.86.0.
|
||||
|
||||
## [4.20.1](https://github.com/coder/code-server/releases/tag/v4.20.1) - 2024-01-22
|
||||
|
||||
Code v1.85.2
|
||||
|
||||
### Changed
|
||||
|
||||
- Updated to Code 1.85.2.
|
||||
|
||||
### Fixed
|
||||
|
||||
- Query variables are no longer double-encoded when going over the path proxy.
|
||||
|
||||
## [4.20.0](https://github.com/coder/code-server/releases/tag/v4.20.0) - 2023-12-21
|
||||
|
||||
Code v1.85.1
|
||||
|
||||
### Added
|
||||
|
||||
- New flag `--disable-file-uploads` to disable uploading files to the remote by
|
||||
drag and drop and to disable opening local files via the "show local" button
|
||||
in the file open prompt. Note that you can still open local files by drag and
|
||||
dropping the file onto the editor pane.
|
||||
- Added `wget` to the release image.
|
||||
|
||||
### Changed
|
||||
|
||||
- Updated to Code 1.85.1.
|
||||
- The `--disable-file-downloads` flag will now disable the "show local" button
|
||||
in the file save prompt as well.
|
||||
- Debian release image updated to use Bookworm.
|
||||
|
||||
## [4.19.1](https://github.com/coder/code-server/releases/tag/v4.19.1) - 2023-11-29
|
||||
|
||||
Code v1.84.2
|
||||
|
||||
### Fixed
|
||||
|
||||
- Fixed an issue where parts of the editor would not load (like the file
|
||||
explorer, source control, etc) when using a workspace file.
|
||||
|
||||
## [4.19.0](https://github.com/coder/code-server/releases/tag/v4.19.0) - 2023-11-18
|
||||
|
||||
Code v1.84.2
|
||||
|
||||
### Changed
|
||||
|
||||
- Updated to Code 1.84.2.
|
||||
|
||||
## [4.18.0](https://github.com/coder/code-server/releases/tag/v4.18.0) - 2023-10-20
|
||||
|
||||
Code v1.83.1
|
||||
|
||||
### Changed
|
||||
|
||||
- Updated to Code 1.83.1.
|
||||
|
||||
## [4.17.1](https://github.com/coder/code-server/releases/tag/v4.17.1) - 2023-09-29
|
||||
|
||||
Code v1.82.2
|
||||
|
||||
### Fixed
|
||||
|
||||
- Make secret storage persistent. For example, logging in with GitHub should
|
||||
persist between browser refreshes and code-server restarts.
|
||||
- Issues with argon2 on arm builds should be fixed now.
|
||||
|
||||
## [4.17.0](https://github.com/coder/code-server/releases/tag/v4.17.0) - 2023-09-22
|
||||
|
||||
Code v1.82.2
|
||||
|
||||
### Added
|
||||
|
||||
- Japanese locale.
|
||||
- `CODE_SERVER_HOST` environment variable.
|
||||
|
||||
### Changed
|
||||
|
||||
- Update to Code 1.82.2. This includes an update to Node 18, which also means
|
||||
that the minimum glibc is now 2.28. If you need to maintain a lower glibc then
|
||||
you can take a version of Node 18 that is compiled with a lower glibc and use
|
||||
that to build code-server (or at a minimum rebuild the native modules).
|
||||
- Display paths to config files in full rather than abbreviated. If you have
|
||||
trouble with the password not working please update and make sure the
|
||||
displayed config paths are what you expect.
|
||||
|
||||
### Fixed
|
||||
|
||||
- Fix some dependency issues for the standalone arm64 and armv7l releases. If
|
||||
you had issues with missing or failing modules please try these new builds.
|
||||
|
||||
## [4.16.1](https://github.com/coder/code-server/releases/tag/v4.16.1) - 2023-07-31
|
||||
|
||||
Code v1.80.2
|
||||
|
||||
### Changed
|
||||
|
||||
- Updated to Code 1.80.2.
|
||||
|
||||
## [4.16.0](https://github.com/coder/code-server/releases/tag/v4.16.0) - 2023-07-28
|
||||
|
||||
Code v1.80.1
|
||||
|
||||
### Added
|
||||
|
||||
- `--disable-proxy` flag. This disables the domain and path proxies but it does
|
||||
not disable the ports panel in Code. That can be disabled by using
|
||||
`remote.autoForwardPorts=false` in your settings.
|
||||
|
||||
## [4.15.0](https://github.com/coder/code-server/releases/tag/v4.15.0) - 2023-07-21
|
||||
|
||||
Code v1.80.1
|
||||
|
||||
### Changed
|
||||
|
||||
- Updated to Code 1.80.1.
|
||||
|
||||
### Added
|
||||
|
||||
- `--trusted-origin` flag for specifying origins that you trust but do not
|
||||
control (for example a reverse proxy).
|
||||
|
||||
Code v1.79.2
|
||||
|
||||
## [4.14.1](https://github.com/coder/code-server/releases/tag/v4.14.1) - 2023-06-26
|
||||
|
||||
Code v1.79.2
|
||||
|
||||
### Security
|
||||
|
||||
- Remove extra write permissions on the Node binary bundled with the linux-amd64
|
||||
tarball. If you extract the tar without a umask this could mean the Node
|
||||
binary would be unexpectedly writable.
|
||||
|
||||
### Fixed
|
||||
|
||||
- Inability to launch multiple instances of code-server for different users.
|
||||
|
||||
### Added
|
||||
|
||||
- `--session-socket` CLI flag to configure the location of the session socket.
|
||||
By default it will be placed in `<user data dir>/code-server-ipc.sock`.
|
||||
|
||||
## [4.14.0](https://github.com/coder/code-server/releases/tag/v4.14.0) - 2023-06-16
|
||||
|
||||
Code v1.79.2
|
||||
|
||||
### Added
|
||||
|
||||
- `--domain-proxy` now supports `{{port}}` and `{{host}}` template variables.
|
||||
|
||||
### Changed
|
||||
|
||||
- Updated to Code 1.79.2
|
||||
- Files opened from an external terminal will now open in the most closely
|
||||
related window rather than in the last opened window.
|
||||
|
||||
## [4.13.0](https://github.com/coder/code-server/releases/tag/v4.13.0) - 2023-05-19
|
||||
|
||||
Code v1.78.2
|
||||
|
||||
### Changed
|
||||
|
||||
- Updated to Code 1.78.2.
|
||||
|
||||
### Fixed
|
||||
|
||||
- Proxying files that contain non-ASCII characters.
|
||||
- Origin check when X-Forwarded-Host contains comma-separated hosts.
|
||||
|
||||
## [4.12.0](https://github.com/coder/code-server/releases/tag/v4.12.0) - 2023-04-21
|
||||
|
||||
Code v1.77.3
|
||||
|
||||
### Changed
|
||||
|
||||
- Updated to Code 1.77.3
|
||||
- Ports panel will use domain-based proxy (instead of the default path-based
|
||||
proxy) when set via --proxy-domain.
|
||||
- Apply --app-name to the PWA title.
|
||||
|
||||
### Added
|
||||
|
||||
- Thai translation for login page.
|
||||
- Debug logs around the origin security check. If you are getting forbidden
|
||||
errors on web sockets please run code-server with `--log debug` to see why the
|
||||
requests are being blocked.
|
||||
|
||||
## [4.11.0](https://github.com/coder/code-server/releases/tag/v4.11.0) - 2023-03-16
|
||||
|
||||
Code v1.76.1
|
||||
|
||||
### Changed
|
||||
|
||||
- Updated to Code 1.76.1
|
||||
|
||||
## [4.10.1](https://github.com/coder/code-server/releases/tag/v4.10.1) - 2023-03-04
|
||||
|
||||
Code v1.75.1
|
||||
|
||||
### Security
|
||||
|
||||
Added an origin check to web sockets to prevent cross-site hijacking attacks on
|
||||
users using older or niche browser that do not support SameSite cookies and
|
||||
attacks across sub-domains that share the same root domain.
|
||||
|
||||
The check requires the host header to be set so if you use a reverse proxy
|
||||
ensure it forwards that information otherwise web sockets will be blocked.
|
||||
|
||||
## [4.10.0](https://github.com/coder/code-server/releases/tag/v4.10.0) - 2023-02-15
|
||||
|
||||
Code v1.75.1
|
||||
|
||||
### Changed
|
||||
|
||||
- Updated to Code 1.75.1
|
||||
|
||||
### Removed
|
||||
|
||||
- Removed `--link` (was deprecated over thirteen months ago in 4.0.1).
|
||||
|
||||
## [4.9.1](https://github.com/coder/code-server/releases/tag/v4.9.1) - 2022-12-15
|
||||
|
||||
Code v1.73.1
|
||||
|
||||
### Changed
|
||||
|
||||
- Updated a couple steps in the build and release process to ensure we're using
|
||||
`npm` and `yarn` consistently depending on the step.
|
||||
|
||||
### Fixed
|
||||
|
||||
- Fixed an issue with code-server version not displaying in the Help > About window.
|
||||
- Fixed terminal not loading on macOS clients.
|
||||
|
||||
## [4.9.0](https://github.com/coder/code-server/releases/tag/v4.9.0) - 2022-12-06
|
||||
|
||||
Code v1.73.1
|
||||
|
||||
### Changed
|
||||
|
||||
- Upgraded to Code 1.73.1
|
||||
|
||||
### Added
|
||||
|
||||
- `/security.txt` added as a route with info on our security policy information thanks to @ghuntley
|
||||
|
||||
### Fixed
|
||||
|
||||
- Installing on majaro images should now work thanks to @MrPeacockNLB for
|
||||
adding the `--noconfirm` flag in `install.sh`
|
||||
|
||||
### Known Issues
|
||||
|
||||
- `--cert` on Ubuntu 22.04: OpenSSL v3 is used which breaks `pem` meaning the
|
||||
`--cert` feature will not work. [Reference](https://github.com/adobe/fetch/pull/318#issuecomment-1306070259)
|
||||
|
||||
## [4.8.3](https://github.com/coder/code-server/releases/tag/v4.8.3) - 2022-11-07
|
||||
|
||||
Code v1.72.1
|
||||
|
||||
### Added
|
||||
|
||||
- install script now supports arch-like (i.e. manjaro, endeavourous, etc.)
|
||||
architectures
|
||||
|
||||
### Changed
|
||||
|
||||
- Updated text in the Getting Started page.
|
||||
|
||||
## [4.8.2](https://github.com/coder/code-server/releases/tag/v4.8.2) - 2022-11-02
|
||||
|
||||
Code v1.72.1
|
||||
|
||||
### Added
|
||||
|
||||
- New text in the Getting Started page with info about
|
||||
`coder/coder`. This is enabled by default but can be disabled by passing the CLI
|
||||
flag `--disable-getting-started-override` or setting
|
||||
`CS_DISABLE_GETTING_STARTED_OVERRIDE=1` or
|
||||
`CS_DISABLE_GETTING_STARTED_OVERRIDE=true`.
|
||||
|
||||
## [4.8.1](https://github.com/coder/code-server/releases/tag/v4.8.1) - 2022-10-28
|
||||
|
||||
Code v1.72.1
|
||||
|
||||
### Fixed
|
||||
|
||||
- Fixed CSP error introduced in 4.8.0 that caused issues with webviews and most
|
||||
extensions.
|
||||
|
||||
## [4.8.0](https://github.com/coder/code-server/releases/tag/v4.8.0) - 2022-10-24
|
||||
|
||||
Code v1.72.1
|
||||
|
||||
### Added
|
||||
|
||||
- Support for the Ports panel which leverages code-server's built-in proxy. It
|
||||
also uses `VSCODE_PROXY_URI` where `{{port}}` is replace when forwarding a port.
|
||||
Example: `VSCODE_PROXY_URI=https://{{port}}.kyle.dev` would forward an
|
||||
application running on localhost:3000 to https://3000.kyle.dev
|
||||
- Support for `--disable-workspace-trust` CLI flag
|
||||
- Support for `--goto` flag to open file @ line:column
|
||||
- Added Ubuntu-based images for Docker releases. If you run into issues with
|
||||
`PATH` being overwritten in Docker please try the Ubuntu image as this is a
|
||||
problem in the Debian base image.
|
||||
|
||||
### Changed
|
||||
|
||||
- Updated Code to 1.72.1
|
||||
|
||||
### Fixed
|
||||
|
||||
- Enabled `BROWSER` environment variable
|
||||
- Patched `asExternalUri` to work so now extensions run inside code-server can use it
|
||||
|
||||
## [4.7.1](https://github.com/coder/code-server/releases/tag/v4.7.1) - 2022-09-30
|
||||
|
||||
Code v1.71.2
|
||||
|
||||
### Changed
|
||||
|
||||
- Updated Code to 1.71.2
|
||||
|
||||
### Fixed
|
||||
|
||||
- Fixed install script not upgrading code-server when already installed on RPM-based machines
|
||||
- Fixed install script failing to gain root permissions on FreeBSD
|
||||
|
||||
## [4.7.0](https://github.com/coder/code-server/releases/tag/v4.7.0) - 2022-09-09
|
||||
|
||||
Code v1.71.0
|
||||
|
||||
### Changed
|
||||
|
||||
- Updated Code to 1.71.0
|
||||
|
||||
### Removed
|
||||
|
||||
- Dropped heartbeat patch because it was implemented upstream
|
||||
|
||||
### Fixed
|
||||
|
||||
- Add flags --unsafe-perm --legacy-peer-deps in `npm-postinstall.sh` which ensures installing with npm works correctly
|
||||
|
||||
## [4.6.1](https://github.com/coder/code-server/releases/tag/v4.6.1) - 2022-09-31
|
||||
|
||||
Code v1.70.2
|
||||
|
||||
### Changed
|
||||
|
||||
- Updated Code to 1.70.2
|
||||
- Updated `argon2` to 0.29.0 which should fix issues on FreeBSD
|
||||
- Updated docs to suggest using `npm` instead of `yarn`
|
||||
|
||||
### Removed
|
||||
|
||||
- Dropped database migration patch affected to 4.0.2 versions and earlier.
|
||||
|
||||
### Fixed
|
||||
|
||||
- Fixed preservation of `process.execArgv` which means you can pass `--prof` to profile code-server
|
||||
|
||||
## [4.6.0](https://github.com/coder/code-server/releases/tag/v4.6.0) - 2022-08-17
|
||||
|
||||
Code v1.70.1
|
||||
|
|
@ -48,7 +926,6 @@ Code v1.68.1
|
|||
would be accessible at `my.domain/proxy/8000/` without any authentication.
|
||||
|
||||
If all of the following apply to you please update as soon as possible:
|
||||
|
||||
- You run code-server with the built-in password authentication.
|
||||
- You run unprotected HTTP services on ports accessible by code-server.
|
||||
|
||||
|
|
|
|||
44
ci/README.md
44
ci/README.md
|
|
@ -16,20 +16,18 @@ This directory contains scripts used for the development of code-server.
|
|||
|
||||
- [./ci/dev/image](./dev/image)
|
||||
- See [./docs/CONTRIBUTING.md](../docs/CONTRIBUTING.md) for docs on the development container.
|
||||
- [./ci/dev/fmt.sh](./dev/fmt.sh) (`yarn fmt`)
|
||||
- [./ci/dev/fmt.sh](./dev/fmt.sh) (`npm run fmt`)
|
||||
- Runs formatters.
|
||||
- [./ci/dev/lint.sh](./dev/lint.sh) (`yarn lint`)
|
||||
- [./ci/dev/lint.sh](./dev/lint.sh) (`npm run lint`)
|
||||
- Runs linters.
|
||||
- [./ci/dev/test-unit.sh](./dev/test-unit.sh) (`yarn test:unit`)
|
||||
- [./ci/dev/test-unit.sh](./dev/test-unit.sh) (`npm run test:unit`)
|
||||
- Runs unit tests.
|
||||
- [./ci/dev/test-e2e.sh](./dev/test-e2e.sh) (`yarn test:e2e`)
|
||||
- [./ci/dev/test-e2e.sh](./dev/test-e2e.sh) (`npm run test:e2e`)
|
||||
- Runs end-to-end tests.
|
||||
- [./ci/dev/ci.sh](./dev/ci.sh) (`yarn ci`)
|
||||
- Runs `yarn fmt`, `yarn lint` and `yarn test`.
|
||||
- [./ci/dev/watch.ts](./dev/watch.ts) (`yarn watch`)
|
||||
- [./ci/dev/watch.ts](./dev/watch.ts) (`npm run watch`)
|
||||
- Starts a process to build and launch code-server and restart on any code changes.
|
||||
- Example usage in [./docs/CONTRIBUTING.md](../docs/CONTRIBUTING.md).
|
||||
- [./ci/dev/gen_icons.sh](./ci/dev/gen_icons.sh) (`yarn icons`)
|
||||
- [./ci/dev/gen_icons.sh](./dev/gen_icons.sh) (`npm run icons`)
|
||||
- Generates the various icons from a single `.svg` favicon in
|
||||
`src/browser/media/favicon.svg`.
|
||||
- Requires [imagemagick](https://imagemagick.org/index.php)
|
||||
|
|
@ -39,20 +37,20 @@ This directory contains scripts used for the development of code-server.
|
|||
This directory contains the scripts used to build and release code-server.
|
||||
You can disable minification by setting `MINIFY=`.
|
||||
|
||||
- [./ci/build/build-code-server.sh](./build/build-code-server.sh) (`yarn build`)
|
||||
- [./ci/build/build-code-server.sh](./build/build-code-server.sh) (`npm run build`)
|
||||
- Builds code-server into `./out` and bundles the frontend into `./dist`.
|
||||
- [./ci/build/build-vscode.sh](./build/build-vscode.sh) (`yarn build:vscode`)
|
||||
- [./ci/build/build-vscode.sh](./build/build-vscode.sh) (`npm run build:vscode`)
|
||||
- Builds vscode into `./lib/vscode/out-vscode`.
|
||||
- [./ci/build/build-release.sh](./build/build-release.sh) (`yarn release`)
|
||||
- [./ci/build/build-release.sh](./build/build-release.sh) (`npm run release`)
|
||||
- Bundles the output of the above two scripts into a single node module at `./release`.
|
||||
- [./ci/build/clean.sh](./build/clean.sh) (`yarn clean`)
|
||||
- [./ci/build/clean.sh](./build/clean.sh) (`npm run clean`)
|
||||
- Removes all build artifacts.
|
||||
- Useful to do a clean build.
|
||||
- [./ci/build/code-server.sh](./build/code-server.sh)
|
||||
- Copied into standalone releases to run code-server with the bundled node binary.
|
||||
- [./ci/build/test-standalone-release.sh](./build/test-standalone-release.sh) (`yarn test:standalone-release`)
|
||||
- [./ci/build/test-standalone-release.sh](./build/test-standalone-release.sh) (`npm run test:standalone-release`)
|
||||
- Ensures code-server in the `./release-standalone` directory works by installing an extension.
|
||||
- [./ci/build/build-packages.sh](./build/build-packages.sh) (`yarn package`)
|
||||
- [./ci/build/build-packages.sh](./build/build-packages.sh) (`npm run package`)
|
||||
- Packages `./release-standalone` into a `.tar.gz` archive in `./release-packages`.
|
||||
- If on linux, [nfpm](https://github.com/goreleaser/nfpm) is used to generate `.deb` and `.rpm`.
|
||||
- [./ci/build/nfpm.yaml](./build/nfpm.yaml)
|
||||
|
|
@ -61,21 +59,21 @@ You can disable minification by setting `MINIFY=`.
|
|||
- Entrypoint script for code-server for `.deb` and `.rpm`.
|
||||
- [./ci/build/code-server.service](./build/code-server.service)
|
||||
- systemd user service packaged into the `.deb` and `.rpm`.
|
||||
- [./ci/build/release-github-draft.sh](./build/release-github-draft.sh) (`yarn release:github-draft`)
|
||||
- [./ci/build/release-github-draft.sh](./build/release-github-draft.sh) (`npm run release:github-draft`)
|
||||
- Uses [gh](https://github.com/cli/cli) to create a draft release with a template description.
|
||||
- [./ci/build/release-github-assets.sh](./build/release-github-assets.sh) (`yarn release:github-assets`)
|
||||
- [./ci/build/release-github-assets.sh](./build/release-github-assets.sh) (`npm run release:github-assets`)
|
||||
- Downloads the release-package artifacts for the current commit from CI.
|
||||
- Uses [gh](https://github.com/cli/cli) to upload the artifacts to the release
|
||||
specified in `package.json`.
|
||||
- [./ci/build/npm-postinstall.sh](./build/npm-postinstall.sh)
|
||||
- Post install script for the npm package.
|
||||
- Bundled by`yarn release`.
|
||||
- Bundled by`npm run release`.
|
||||
|
||||
## release-image
|
||||
|
||||
This directory contains the release docker container image.
|
||||
|
||||
- [./ci/steps/build-docker-buildx-push.sh](./ci/steps/docker-buildx-push.sh)
|
||||
- [./ci/steps/build-docker-buildx-push.sh](./steps/docker-buildx-push.sh)
|
||||
- Builds the release containers with tags `codercom/code-server-$ARCH:$VERSION` for amd64 and arm64 with `docker buildx` and pushes them.
|
||||
- Assumes debian releases are ready in `./release-packages`.
|
||||
|
||||
|
|
@ -89,15 +87,15 @@ This directory contains the scripts used in CI.
|
|||
Helps avoid clobbering the CI configuration.
|
||||
|
||||
- [./steps/fmt.sh](./steps/fmt.sh)
|
||||
- Runs `yarn fmt`.
|
||||
- Runs `npm run fmt`.
|
||||
- [./steps/lint.sh](./steps/lint.sh)
|
||||
- Runs `yarn lint`.
|
||||
- Runs `npm run lint`.
|
||||
- [./steps/test-unit.sh](./steps/test-unit.sh)
|
||||
- Runs `yarn test:unit`.
|
||||
- Runs `npm run test:unit`.
|
||||
- [./steps/test-integration.sh](./steps/test-integration.sh)
|
||||
- Runs `yarn test:integration`.
|
||||
- Runs `npm run test:integration`.
|
||||
- [./steps/test-e2e.sh](./steps/test-e2e.sh)
|
||||
- Runs `yarn test:e2e`.
|
||||
- Runs `npm run test:e2e`.
|
||||
- [./steps/release.sh](./steps/release.sh)
|
||||
- Runs the release process.
|
||||
- Generates the npm package at `./release`.
|
||||
|
|
|
|||
|
|
@ -14,22 +14,6 @@ main() {
|
|||
sed -i.bak "1s;^;#!/usr/bin/env node\n;" out/node/entry.js && rm out/node/entry.js.bak
|
||||
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..."
|
||||
|
||||
set +e
|
||||
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
|
||||
}
|
||||
|
||||
main "$@"
|
||||
|
|
|
|||
|
|
@ -1,8 +1,10 @@
|
|||
#!/usr/bin/env bash
|
||||
set -euo pipefail
|
||||
|
||||
# Packages code-server for the current OS and architecture into ./release-packages.
|
||||
# This script assumes that a standalone release is built already into ./release-standalone
|
||||
# Given a platform-specific release found in ./release-standalone, generate an
|
||||
# compressed archives and bundles (as appropriate for the platform) named after
|
||||
# the platform's architecture and OS and place them in ./release-packages and
|
||||
# ./release-gcp.
|
||||
|
||||
main() {
|
||||
cd "$(dirname "${0}")/../.."
|
||||
|
|
@ -27,7 +29,7 @@ main() {
|
|||
release_archive() {
|
||||
local release_name="code-server-$VERSION-$OS-$ARCH"
|
||||
if [[ $OS == "linux" ]]; then
|
||||
tar -czf "release-packages/$release_name.tar.gz" --transform "s/^\.\/release-standalone/$release_name/" ./release-standalone
|
||||
tar -czf "release-packages/$release_name.tar.gz" --owner=0 --group=0 --transform "s/^\.\/release-standalone/$release_name/" ./release-standalone
|
||||
else
|
||||
tar -czf "release-packages/$release_name.tar.gz" -s "/^release-standalone/$release_name/" release-standalone
|
||||
fi
|
||||
|
|
@ -50,11 +52,6 @@ release_nfpm() {
|
|||
|
||||
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 $PKG_FORMAT "$ARCH")"
|
||||
nfpm_config="$(envsubst < ./ci/build/nfpm.yaml)"
|
||||
|
|
|
|||
|
|
@ -1,13 +1,16 @@
|
|||
#!/usr/bin/env bash
|
||||
set -euo pipefail
|
||||
|
||||
# This script requires vscode to be built with matching MINIFY.
|
||||
# Once both code-server and VS Code have been built, use this script to copy
|
||||
# them into a single directory (./release), prepare the package.json and
|
||||
# product.json, and add shrinkwraps. This results in a generic NPM package that
|
||||
# we published to NPM and also use to compile platform-specific packages.
|
||||
|
||||
# MINIFY controls whether minified vscode is bundled.
|
||||
# MINIFY controls whether minified VS Code is bundled. It must match the value
|
||||
# used when VS Code was built.
|
||||
MINIFY="${MINIFY-true}"
|
||||
|
||||
# KEEP_MODULES controls whether the script cleans all node_modules requiring a yarn install
|
||||
# to run first.
|
||||
# node_modules are not copied by default. Set KEEP_MODULES=1 to copy them.
|
||||
KEEP_MODULES="${KEEP_MODULES-0}"
|
||||
|
||||
main() {
|
||||
|
|
@ -18,6 +21,8 @@ main() {
|
|||
VSCODE_SRC_PATH="lib/vscode"
|
||||
VSCODE_OUT_PATH="$RELEASE_PATH/lib/vscode"
|
||||
|
||||
create_shrinkwraps
|
||||
|
||||
mkdir -p "$RELEASE_PATH"
|
||||
|
||||
bundle_code_server
|
||||
|
|
@ -39,12 +44,8 @@ bundle_code_server() {
|
|||
rsync src/browser/pages/*.css "$RELEASE_PATH/src/browser/pages"
|
||||
rsync src/browser/robots.txt "$RELEASE_PATH/src/browser"
|
||||
|
||||
# Add typings for plugins
|
||||
mkdir -p "$RELEASE_PATH/typings"
|
||||
rsync typings/pluginapi.d.ts "$RELEASE_PATH/typings"
|
||||
|
||||
# Adds the commit to package.json
|
||||
jq --slurp '.[0] * .[1]' package.json <(
|
||||
jq --slurp '(.[0] | del(.scripts,.jest,.devDependencies)) * .[1]' package.json <(
|
||||
cat << EOF
|
||||
{
|
||||
"commit": "$(git rev-parse HEAD)",
|
||||
|
|
@ -54,24 +55,12 @@ bundle_code_server() {
|
|||
}
|
||||
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
|
||||
rsync node_modules/ "$RELEASE_PATH/node_modules"
|
||||
mkdir -p "$RELEASE_PATH/lib"
|
||||
rsync ./lib/coder-cloud-agent "$RELEASE_PATH/lib"
|
||||
fi
|
||||
}
|
||||
|
||||
|
|
@ -98,18 +87,50 @@ bundle_vscode() {
|
|||
|
||||
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}' \
|
||||
# Merge the package.json for the web/remote server so we can include
|
||||
# dependencies, since we want to ship this via NPM.
|
||||
jq --slurp '.[0] * .[1]' \
|
||||
"$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"
|
||||
"$VSCODE_OUT_PATH/package.json" > "$VSCODE_OUT_PATH/package.json.merged"
|
||||
mv "$VSCODE_OUT_PATH/package.json.merged" "$VSCODE_OUT_PATH/package.json"
|
||||
cp "$VSCODE_SRC_PATH/remote/npm-shrinkwrap.json" "$VSCODE_OUT_PATH/npm-shrinkwrap.json"
|
||||
|
||||
# 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"
|
||||
cp "$VSCODE_SRC_PATH/extensions/npm-shrinkwrap.json" "$VSCODE_OUT_PATH/extensions/npm-shrinkwrap.json"
|
||||
rsync "$VSCODE_SRC_PATH/extensions/postinstall.mjs" "$VSCODE_OUT_PATH/extensions/postinstall.mjs"
|
||||
}
|
||||
|
||||
create_shrinkwraps() {
|
||||
# package-lock.json files (used to ensure deterministic versions of
|
||||
# dependencies) are not packaged when publishing to the NPM registry.
|
||||
#
|
||||
# To ensure deterministic dependency versions (even when code-server is
|
||||
# installed with NPM), we create an npm-shrinkwrap.json file from the
|
||||
# currently installed node_modules. This ensures the versions used from
|
||||
# development (that the package-lock.json guarantees) are also the ones
|
||||
# installed by end-users. These will include devDependencies, but those will
|
||||
# be ignored when installing globally (for code-server), and because we use
|
||||
# --omit=dev (for VS Code).
|
||||
|
||||
# We first generate the shrinkwrap file for code-server itself - which is the
|
||||
# current directory.
|
||||
cp package-lock.json package-lock.json.temp
|
||||
npm shrinkwrap
|
||||
mv package-lock.json.temp package-lock.json
|
||||
|
||||
# Then the shrinkwrap files for the bundled VS Code.
|
||||
pushd "$VSCODE_SRC_PATH/remote/"
|
||||
cp package-lock.json package-lock.json.temp
|
||||
npm shrinkwrap
|
||||
mv package-lock.json.temp package-lock.json
|
||||
popd
|
||||
|
||||
pushd "$VSCODE_SRC_PATH/extensions/"
|
||||
cp package-lock.json package-lock.json.temp
|
||||
npm shrinkwrap
|
||||
mv package-lock.json.temp package-lock.json
|
||||
popd
|
||||
}
|
||||
|
||||
main "$@"
|
||||
|
|
|
|||
|
|
@ -1,9 +1,9 @@
|
|||
#!/usr/bin/env bash
|
||||
set -euo pipefail
|
||||
|
||||
# This is due to an upstream issue with RHEL7/CentOS 7 comptability with node-argon2
|
||||
# See: https://github.com/cdr/code-server/pull/3422#pullrequestreview-677765057
|
||||
export npm_config_build_from_source=true
|
||||
# Once we have an NPM package, use this script to copy it to a separate
|
||||
# directory (./release-standalone) and install the dependencies. This new
|
||||
# directory can then be packaged as a platform-specific release.
|
||||
|
||||
main() {
|
||||
cd "$(dirname "${0}")/../.."
|
||||
|
|
@ -13,22 +13,24 @@ main() {
|
|||
rsync "$RELEASE_PATH/" "$RELEASE_PATH-standalone"
|
||||
RELEASE_PATH+=-standalone
|
||||
|
||||
# We cannot find the path to node from $PATH because yarn shims a script to ensure
|
||||
# we use the same version it's using so we instead run a script with yarn that
|
||||
# will print the path to node.
|
||||
# Package managers may shim their own "node" wrapper into the PATH, so run
|
||||
# node and ask it for its true path.
|
||||
local node_path
|
||||
node_path="$(yarn -s node <<< 'console.info(process.execPath)')"
|
||||
node_path="$(node -p process.execPath)"
|
||||
|
||||
mkdir -p "$RELEASE_PATH/bin"
|
||||
mkdir -p "$RELEASE_PATH/lib"
|
||||
rsync ./ci/build/code-server.sh "$RELEASE_PATH/bin/code-server"
|
||||
rsync "$node_path" "$RELEASE_PATH/lib/node"
|
||||
|
||||
ln -s "./bin/code-server" "$RELEASE_PATH/code-server"
|
||||
ln -s "./lib/node" "$RELEASE_PATH/node"
|
||||
chmod 755 "$RELEASE_PATH/lib/node"
|
||||
|
||||
pushd "$RELEASE_PATH"
|
||||
yarn --production --frozen-lockfile
|
||||
npm install --unsafe-perm --omit=dev
|
||||
# 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 "./lib/vscode/extensions/node_modules/.bin"
|
||||
popd
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -15,7 +15,7 @@ copy-bin-script() {
|
|||
local dest="lib/vscode-reh-web-linux-x64/bin/$script"
|
||||
cp "lib/vscode/resources/server/bin/$script" "$dest"
|
||||
sed -i.bak "s/@@VERSION@@/$(vscode_version)/g" "$dest"
|
||||
sed -i.bak "s/@@COMMIT@@/$VSCODE_DISTRO_COMMIT/g" "$dest"
|
||||
sed -i.bak "s/@@COMMIT@@/$BUILD_SOURCEVERSION/g" "$dest"
|
||||
sed -i.bak "s/@@APPNAME@@/code-server/g" "$dest"
|
||||
|
||||
# Fix Node path on Darwin and Linux.
|
||||
|
|
@ -23,6 +23,9 @@ copy-bin-script() {
|
|||
# shellcheck disable=SC2016
|
||||
sed -i.bak 's/^ROOT=\(.*\)$/VSROOT=\1\nROOT="$(dirname "$(dirname "$VSROOT")")"/g' "$dest"
|
||||
sed -i.bak 's/ROOT\/out/VSROOT\/out/g' "$dest"
|
||||
# We do not want expansion here; this text should make it to the file as-is.
|
||||
# shellcheck disable=SC2016
|
||||
sed -i.bak 's/$ROOT\/node/${NODE_EXEC_PATH:-$ROOT\/lib\/node}/g' "$dest"
|
||||
|
||||
# Fix Node path on Windows.
|
||||
sed -i.bak 's/^set ROOT_DIR=\(.*\)$/set ROOT_DIR=%~dp0..\\..\\..\\..\r\nset VSROOT_DIR=\1/g' "$dest"
|
||||
|
|
@ -37,16 +40,29 @@ main() {
|
|||
|
||||
source ./ci/lib.sh
|
||||
|
||||
pushd 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)
|
||||
#
|
||||
# Also, we use code-server's commit rather than VS Code's otherwise it would
|
||||
# not update when only our patch files change, and that will cause caching
|
||||
# issues where the browser keeps using outdated code.
|
||||
export BUILD_SOURCEVERSION
|
||||
BUILD_SOURCEVERSION=$(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).
|
||||
pushd lib/vscode
|
||||
|
||||
if [[ ! ${VERSION-} ]]; then
|
||||
echo "VERSION not set. Please set before running this script:"
|
||||
echo "VERSION='0.0.0' npm run build:vscode"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Add the date, our name, links, enable telemetry (this just makes telemetry
|
||||
# available; telemetry can still be disabled by flag or setting), and
|
||||
# configure trusted extensions (since some, like github.copilot-chat, never
|
||||
# ask to be trusted and this is the only way to get auth working).
|
||||
#
|
||||
# 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.
|
||||
|
|
@ -79,7 +95,15 @@ main() {
|
|||
"newsletterSignupUrl": "https://www.research.net/r/vsc-newsletter",
|
||||
"linkProtectionTrustedDomains": [
|
||||
"https://open-vsx.org"
|
||||
]
|
||||
],
|
||||
"trustedExtensionAuthAccess": [
|
||||
"vscode.git", "vscode.github",
|
||||
"github.vscode-pull-request-github",
|
||||
"github.copilot", "github.copilot-chat"
|
||||
],
|
||||
"aiConfig": {
|
||||
"ariaKey": "code-server"
|
||||
}
|
||||
}
|
||||
EOF
|
||||
) > product.json
|
||||
|
|
@ -88,7 +112,9 @@ EOF
|
|||
# this because we have an NPM package that could be installed on any platform.
|
||||
# The correct platform dependencies and scripts will be installed as part of
|
||||
# the post-install during `npm install` or when building a standalone release.
|
||||
yarn gulp "vscode-reh-web-linux-x64${MINIFY:+-min}"
|
||||
node --max-old-space-size=16384 --optimize-for-size \
|
||||
./node_modules/gulp/bin/gulp.js \
|
||||
"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
|
||||
|
|
@ -97,6 +123,15 @@ EOF
|
|||
|
||||
popd
|
||||
|
||||
pushd lib/vscode-reh-web-linux-x64
|
||||
# Make sure Code took the version we set in the environment variable. Not
|
||||
# having a version will break display languages.
|
||||
if ! jq -e .commit product.json; then
|
||||
echo "'commit' is missing from product.json"
|
||||
exit 1
|
||||
fi
|
||||
popd
|
||||
|
||||
# These provide a `code-server` command in the integrated terminal to open
|
||||
# files in the current instance.
|
||||
delete-bin-script remote-cli/code-server
|
||||
|
|
|
|||
|
|
@ -11,14 +11,6 @@ _realpath() {
|
|||
cd "$(dirname "$script")"
|
||||
|
||||
while [ -L "$(basename "$script")" ]; do
|
||||
if [ -L "./node" ] && [ -L "./code-server" ] \
|
||||
&& [ -f "package.json" ] \
|
||||
&& 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/coder/code-server/releases/tag/v3.4.0" >&2
|
||||
fi
|
||||
|
||||
script="$(readlink "$(basename "$script")")"
|
||||
cd "$(dirname "$script")"
|
||||
done
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@ platform: "linux"
|
|||
version: "v${VERSION}"
|
||||
section: "devel"
|
||||
priority: "optional"
|
||||
maintainer: "Anmol Sethi <hi@nhooyr.io>"
|
||||
maintainer: "Joe Previte <joe@coder.com>"
|
||||
description: |
|
||||
Run VS Code in the browser.
|
||||
vendor: "Coder"
|
||||
|
|
@ -22,4 +22,4 @@ contents:
|
|||
dst: /usr/lib/systemd/user/code-server.service
|
||||
|
||||
- src: ./release-standalone/*
|
||||
dst: /usr/lib/code-server/
|
||||
dst: /usr/lib/code-server
|
||||
|
|
|
|||
|
|
@ -1,18 +1,8 @@
|
|||
#!/usr/bin/env sh
|
||||
set -eu
|
||||
|
||||
# Copied from ../lib.sh.
|
||||
arch() {
|
||||
cpu="$(uname -m)"
|
||||
case "$cpu" in
|
||||
aarch64) cpu=arm64 ;;
|
||||
x86_64) cpu=amd64 ;;
|
||||
esac
|
||||
echo "$cpu"
|
||||
}
|
||||
|
||||
# Copied from ../lib.sh except we do not rename Darwin since the cloud agent
|
||||
# uses "darwin" in the release names and we do not need to detect Alpine.
|
||||
# Copied from ../lib.sh except we do not rename Darwin and we do not need to
|
||||
# detect Alpine.
|
||||
os() {
|
||||
osname=$(uname | tr '[:upper:]' '[:lower:]')
|
||||
case $osname in
|
||||
|
|
@ -61,12 +51,19 @@ symlink_bin_script() {
|
|||
cd "$oldpwd"
|
||||
}
|
||||
|
||||
ARCH="${NPM_CONFIG_ARCH:-$(arch)}"
|
||||
OS="$(os)"
|
||||
command_exists() {
|
||||
if [ ! "$1" ]; then return 1; fi
|
||||
command -v "$@" > /dev/null
|
||||
}
|
||||
|
||||
# This is due to an upstream issue with RHEL7/CentOS 7 comptability with node-argon2
|
||||
# See: https://github.com/cdr/code-server/pull/3422#pullrequestreview-677765057
|
||||
export npm_config_build_from_source=true
|
||||
is_root() {
|
||||
if command_exists id && [ "$(id -u)" = 0 ]; then
|
||||
return 0
|
||||
fi
|
||||
return 1
|
||||
}
|
||||
|
||||
OS="$(os)"
|
||||
|
||||
main() {
|
||||
# Grabs the major version of node from $npm_config_user_agent which looks like
|
||||
|
|
@ -79,8 +76,8 @@ main() {
|
|||
echo "USE AT YOUR OWN RISK!"
|
||||
fi
|
||||
|
||||
if [ "$major_node_version" -ne "${FORCE_NODE_VERSION:-16}" ]; then
|
||||
echo "ERROR: code-server currently requires node v16."
|
||||
if [ "$major_node_version" -ne "${FORCE_NODE_VERSION:-22}" ]; then
|
||||
echo "ERROR: code-server currently requires node v22."
|
||||
if [ -n "$FORCE_NODE_VERSION" ]; then
|
||||
echo "However, you have overrided the version check to use v$FORCE_NODE_VERSION."
|
||||
fi
|
||||
|
|
@ -90,27 +87,22 @@ main() {
|
|||
exit 1
|
||||
fi
|
||||
|
||||
case "${npm_config_user_agent-}" in npm*)
|
||||
# We are running under npm.
|
||||
if [ "${npm_config_unsafe_perm-}" != "true" ]; then
|
||||
echo "Please pass --unsafe-perm to npm to install code-server"
|
||||
echo "Otherwise the postinstall script does not have permissions to run"
|
||||
echo "See https://docs.npmjs.com/misc/config#unsafe-perm"
|
||||
echo "See https://stackoverflow.com/questions/49084929/npm-sudo-global-installation-unsafe-perm"
|
||||
exit 1
|
||||
fi
|
||||
;;
|
||||
esac
|
||||
|
||||
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"
|
||||
# Under npm, if we are running as root, we need --unsafe-perm otherwise
|
||||
# post-install scripts will not have sufficient permissions to do their thing.
|
||||
if is_root; then
|
||||
case "${npm_config_user_agent-}" in npm*)
|
||||
if [ "${npm_config_unsafe_perm-}" != "true" ]; then
|
||||
echo "Please pass --unsafe-perm to npm to install code-server"
|
||||
echo "Otherwise post-install scripts will not have permissions to run"
|
||||
echo "See https://docs.npmjs.com/misc/config#unsafe-perm"
|
||||
echo "See https://stackoverflow.com/questions/49084929/npm-sudo-global-installation-unsafe-perm"
|
||||
exit 1
|
||||
fi
|
||||
;;
|
||||
esac
|
||||
fi
|
||||
|
||||
if ! vscode_yarn; then
|
||||
if ! vscode_install; then
|
||||
echo "You may not have the required dependencies to build the native modules."
|
||||
echo "Please see https://github.com/coder/code-server/blob/main/docs/npm.md"
|
||||
exit 1
|
||||
|
|
@ -123,17 +115,46 @@ main() {
|
|||
fi
|
||||
}
|
||||
|
||||
vscode_yarn() {
|
||||
install_with_yarn_or_npm() {
|
||||
echo "User agent: ${npm_config_user_agent-none}"
|
||||
# For development we enforce npm, but for installing the package as an
|
||||
# end-user we want to keep using whatever package manager is in use.
|
||||
case "${npm_config_user_agent-}" in
|
||||
npm*)
|
||||
if ! npm install --unsafe-perm --omit=dev; then
|
||||
return 1
|
||||
fi
|
||||
;;
|
||||
yarn*)
|
||||
if ! yarn --production --frozen-lockfile --no-default-rc; then
|
||||
return 1
|
||||
fi
|
||||
;;
|
||||
*)
|
||||
echo "Could not determine which package manager is being used to install code-server"
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
return 0
|
||||
}
|
||||
|
||||
vscode_install() {
|
||||
echo 'Installing Code dependencies...'
|
||||
cd lib/vscode
|
||||
yarn --production --frozen-lockfile --no-default-rc
|
||||
if ! install_with_yarn_or_npm; then
|
||||
return 1
|
||||
fi
|
||||
|
||||
symlink_asar
|
||||
symlink_bin_script remote-cli code code-server
|
||||
symlink_bin_script helpers browser browser .sh
|
||||
|
||||
cd extensions
|
||||
yarn --production --frozen-lockfile
|
||||
if ! install_with_yarn_or_npm; then
|
||||
return 1
|
||||
fi
|
||||
|
||||
return 0
|
||||
}
|
||||
|
||||
main "$@"
|
||||
|
|
|
|||
|
|
@ -1,28 +0,0 @@
|
|||
#!/usr/bin/env bash
|
||||
set -euo pipefail
|
||||
|
||||
# Downloads the release artifacts from CI for the current
|
||||
# commit and then uploads them to the release with the version
|
||||
# in package.json.
|
||||
# You will need $GITHUB_TOKEN set.
|
||||
|
||||
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[@]}" --clobber
|
||||
}
|
||||
|
||||
main "$@"
|
||||
|
|
@ -1,50 +0,0 @@
|
|||
#!/usr/bin/env bash
|
||||
set -euo pipefail
|
||||
|
||||
# Creates a draft release with the template for the version in package.json
|
||||
|
||||
main() {
|
||||
cd "$(dirname "$0")/../.."
|
||||
source ./ci/lib.sh
|
||||
|
||||
gh release create "v$VERSION" \
|
||||
--notes-file - \
|
||||
--target "$(git rev-parse HEAD)" \
|
||||
--draft << EOF
|
||||
v$VERSION
|
||||
|
||||
VS Code v$(vscode_version)
|
||||
|
||||
Upgrading is as easy as installing the new version over the old one. code-server
|
||||
maintains all user data in \`~/.local/share/code-server\` so that it is preserved in between
|
||||
installations.
|
||||
|
||||
## New Features
|
||||
|
||||
⭐ Summarize new features here with references to issues
|
||||
|
||||
- item
|
||||
|
||||
## Bug Fixes
|
||||
|
||||
⭐ Summarize bug fixes here with references to issues
|
||||
|
||||
- item
|
||||
|
||||
## Documentation
|
||||
|
||||
⭐ Summarize doc changes here with references to issues
|
||||
|
||||
- item
|
||||
|
||||
## Development
|
||||
|
||||
⭐ Summarize development/testing changes here with references to issues
|
||||
|
||||
- item
|
||||
|
||||
Cheers! 🍻
|
||||
EOF
|
||||
}
|
||||
|
||||
main "$@"
|
||||
|
|
@ -1,99 +0,0 @@
|
|||
#!/usr/bin/env bash
|
||||
# Description: This is a script to make the release process easier
|
||||
# Run it with `yarn release:prep` and it will do the following:
|
||||
# 1. Check that you have gh installed and that you're signed in
|
||||
# 2. Update the version of code-server (package.json, docs, etc.)
|
||||
# 3. Update the code coverage badge in the README
|
||||
# 4. Open a draft PR using the release_template.md and view in browser
|
||||
# If you want to perform a dry run of this script run DRY_RUN=1 yarn release:prep
|
||||
|
||||
set -euo pipefail
|
||||
|
||||
main() {
|
||||
if [ "${DRY_RUN-}" = 1 ]; then
|
||||
echo "Performing a dry run..."
|
||||
CMD="echo"
|
||||
else
|
||||
CMD=''
|
||||
fi
|
||||
|
||||
cd "$(dirname "$0")/../.."
|
||||
|
||||
# Check that gh is installed
|
||||
if ! command -v gh &> /dev/null; then
|
||||
echo "gh could not be found."
|
||||
echo "We use this with the release-github-draft.sh and release-github-assets.sh scripts."
|
||||
echo -e "See docs here: https://github.com/cli/cli#installation"
|
||||
exit
|
||||
fi
|
||||
|
||||
# Check that they have jq installed
|
||||
if ! command -v jq &> /dev/null; then
|
||||
echo "jq could not be found."
|
||||
echo "We use this to parse the package.json and grab the current version of code-server."
|
||||
echo -e "See docs here: https://stedolan.github.io/jq/download/"
|
||||
exit
|
||||
fi
|
||||
|
||||
# Check that they have rg installed
|
||||
if ! command -v rg &> /dev/null; then
|
||||
echo "rg could not be found."
|
||||
echo "We use this when updating files across the codebase."
|
||||
echo -e "See docs here: https://github.com/BurntSushi/ripgrep#installation"
|
||||
exit
|
||||
fi
|
||||
|
||||
# Check that they have node installed
|
||||
if ! command -v node &> /dev/null; then
|
||||
echo "node could not be found."
|
||||
echo "That's surprising..."
|
||||
echo "We use it in this script for getting the package.json version"
|
||||
echo -e "See docs here: https://nodejs.org/en/download/"
|
||||
exit
|
||||
fi
|
||||
|
||||
# Check that gh is authenticated
|
||||
if ! gh auth status -h github.com &> /dev/null; then
|
||||
echo "gh isn't authenticated to github.com."
|
||||
echo "This is needed for our scripts that use gh."
|
||||
echo -e "See docs regarding authentication: https://cli.github.com/manual/gh_auth_login"
|
||||
exit
|
||||
fi
|
||||
|
||||
# Note: we need to set upstream as well or the gh pr create step will fail
|
||||
# See: https://github.com/cli/cli/issues/575
|
||||
CURRENT_BRANCH=$(git branch | grep '\*' | cut -d' ' -f2-)
|
||||
if [[ -z $(git config "branch.${CURRENT_BRANCH}.remote") ]]; then
|
||||
echo "Doesn't look like you've pushed this branch to remote"
|
||||
# Note: we need to set upstream as well or the gh pr create step will fail
|
||||
# See: https://github.com/cli/cli/issues/575
|
||||
echo "Please set the upstream and then run the script"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# credit to jakwuh for this solution
|
||||
# https://gist.github.com/DarrenN/8c6a5b969481725a4413#gistcomment-1971123
|
||||
CODE_SERVER_CURRENT_VERSION=$(node -pe "require('./package.json').version")
|
||||
# Ask which version we should update to
|
||||
# In the future, we'll automate this and determine the latest version automatically
|
||||
echo "Current version: ${CODE_SERVER_CURRENT_VERSION}"
|
||||
# The $'\n' adds a line break. See: https://stackoverflow.com/a/39581815/3015595
|
||||
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' -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 --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 @coder/code-server-reviewers --repo coder/code-server --draft --assignee "@me"
|
||||
|
||||
# Open PR in browser
|
||||
$CMD gh pr view --web
|
||||
}
|
||||
|
||||
main "$@"
|
||||
|
|
@ -1,12 +0,0 @@
|
|||
#!/usr/bin/env bash
|
||||
set -euo pipefail
|
||||
|
||||
main() {
|
||||
cd "$(dirname "$0")/../.."
|
||||
|
||||
# Prevents integration with moderate or higher vulnerabilities
|
||||
# Docs: https://github.com/IBM/audit-ci#options
|
||||
yarn audit-ci --moderate
|
||||
}
|
||||
|
||||
main "$@"
|
||||
13
ci/dev/ci.sh
13
ci/dev/ci.sh
|
|
@ -1,13 +0,0 @@
|
|||
#!/usr/bin/env bash
|
||||
set -euo pipefail
|
||||
|
||||
main() {
|
||||
cd "$(dirname "$0")/../.."
|
||||
|
||||
yarn fmt
|
||||
yarn lint
|
||||
yarn _audit
|
||||
yarn test:unit
|
||||
}
|
||||
|
||||
main "$@"
|
||||
|
|
@ -4,24 +4,6 @@ set -euo pipefail
|
|||
main() {
|
||||
cd "$(dirname "$0")/../.."
|
||||
|
||||
local prettierExts
|
||||
prettierExts=(
|
||||
"*.js"
|
||||
"*.ts"
|
||||
"*.tsx"
|
||||
"*.html"
|
||||
"*.json"
|
||||
"*.css"
|
||||
"*.md"
|
||||
"*.toml"
|
||||
"*.yaml"
|
||||
"*.yml"
|
||||
"*.sh"
|
||||
)
|
||||
prettier --write --loglevel=warn $(
|
||||
git ls-files "${prettierExts[@]}" | grep -v "lib/vscode" | grep -v 'helm-chart'
|
||||
)
|
||||
|
||||
doctoc --title '# FAQ' docs/FAQ.md > /dev/null
|
||||
doctoc --title '# Setup Guide' docs/guide.md > /dev/null
|
||||
doctoc --title '# Install' docs/install.md > /dev/null
|
||||
|
|
@ -32,12 +14,11 @@ main() {
|
|||
doctoc --title '# iPad' docs/ipad.md > /dev/null
|
||||
doctoc --title '# Termux' docs/termux.md > /dev/null
|
||||
|
||||
# TODO: replace with a method that generates fewer false positives.
|
||||
if [[ ${CI-} && $(git ls-files --other --modified --exclude-standard) ]]; then
|
||||
echo "Files need generation or are formatted incorrectly:"
|
||||
git -c color.ui=always status | grep --color=no '\[31m'
|
||||
echo "Please run the following locally:"
|
||||
echo " yarn fmt"
|
||||
echo " npm run doctoc"
|
||||
exit 1
|
||||
fi
|
||||
}
|
||||
|
|
@ -1,44 +1,50 @@
|
|||
#!/bin/sh
|
||||
set -eu
|
||||
|
||||
# Generate icons from a single favicon.svg. favicon.svg should have no fill
|
||||
# colors set.
|
||||
main() {
|
||||
cd src/browser/media
|
||||
|
||||
# We need .ico for backwards compatibility.
|
||||
# The other two are the only icon sizes required by Chrome and
|
||||
# we use them for stuff like apple-touch-icon as well.
|
||||
# https://web.dev/add-manifest/
|
||||
# We need .ico for backwards compatibility. The other two are the only icon
|
||||
# sizes required by Chrome and we use them for stuff like apple-touch-icon as
|
||||
# well. https://web.dev/add-manifest/
|
||||
#
|
||||
# This should be enough and we can always add more if there are problems.
|
||||
|
||||
#
|
||||
# -quiet to avoid https://github.com/ImageMagick/ImageMagick/issues/884
|
||||
# -background defaults to white but we want it transparent.
|
||||
# -density somehow makes the image both sharper and smaller in file size.
|
||||
#
|
||||
# https://imagemagick.org/script/command-line-options.php#background
|
||||
convert -quiet -background transparent -resize 256x256 favicon.svg favicon.ico
|
||||
# We do not generate the pwa-icon from the favicon as they are slightly different
|
||||
# designs and sizes.
|
||||
# See favicon.afdesign and #2401 for details on the differences.
|
||||
convert -quiet -background transparent -resize 192x192 pwa-icon.png pwa-icon-192.png
|
||||
convert -quiet -background transparent -resize 512x512 pwa-icon.png pwa-icon-512.png
|
||||
convert -quiet -background transparent \
|
||||
-resize 256x256 -density 256x256 \
|
||||
favicon.svg favicon.ico
|
||||
|
||||
# We use -quiet above to avoid https://github.com/ImageMagick/ImageMagick/issues/884
|
||||
# Generate PWA icons. There should be enough padding to support masking.
|
||||
convert -quiet -border 60x60 -bordercolor white -background white \
|
||||
-resize 192x192 -density 192x192 \
|
||||
favicon.svg pwa-icon-maskable-192.png
|
||||
convert -quiet -border 160x160 -bordercolor white -background white \
|
||||
-resize 512x512 -density 512x512 \
|
||||
favicon.svg pwa-icon-maskable-512.png
|
||||
|
||||
# The following adds dark mode support for the favicon as favicon-dark-support.svg
|
||||
# There is no similar capability for pwas or .ico so we can only add support to the svg.
|
||||
favicon_dark_style="<style>
|
||||
@media (prefers-color-scheme: dark) {
|
||||
* {
|
||||
fill: white;
|
||||
}
|
||||
}
|
||||
</style>"
|
||||
# See https://stackoverflow.com/a/22901380/4283659
|
||||
# This escapes all newlines so that sed will accept them.
|
||||
favicon_dark_style="$(printf "%s\n" "$favicon_dark_style" | sed -e ':a' -e 'N' -e '$!ba' -e 's/\n/\\n/g')"
|
||||
sed "$(
|
||||
cat -n << EOF
|
||||
s%<rect id="favicon"%$favicon_dark_style<rect id="favicon"%
|
||||
EOF
|
||||
)" favicon.svg > favicon-dark-support.svg
|
||||
# Generate non-maskable PWA icons.
|
||||
magick pwa-icon-maskable-192.png \
|
||||
\( +clone -threshold 101% -fill white -draw "roundRectangle 0,0 %[fx:int(w)],%[fx:int(h)] 50,50" \) \
|
||||
-channel-fx "| gray=>alpha" \
|
||||
pwa-icon-192.png
|
||||
magick pwa-icon-maskable-512.png \
|
||||
\( +clone -threshold 101% -fill white -draw "roundRectangle 0,0 %[fx:int(w)],%[fx:int(h)] 100,100" \) \
|
||||
-channel-fx "| gray=>alpha" \
|
||||
pwa-icon-512.png
|
||||
|
||||
# The following adds dark mode support for the favicon as
|
||||
# favicon-dark-support.svg There is no similar capability for pwas or .ico so
|
||||
# we can only add support to the svg.
|
||||
favicon_dark_style="<style>@media (prefers-color-scheme: dark) {* { fill: white; }}</style>"
|
||||
cp favicon.svg favicon-dark-support.svg
|
||||
sed "s%<path%$favicon_dark_style\n <path%" favicon.svg > favicon-dark-support.svg
|
||||
}
|
||||
|
||||
main "$@"
|
||||
|
|
|
|||
9
ci/dev/lint-scripts.sh
Executable file
9
ci/dev/lint-scripts.sh
Executable file
|
|
@ -0,0 +1,9 @@
|
|||
#!/usr/bin/env bash
|
||||
set -euo pipefail
|
||||
|
||||
main() {
|
||||
cd "$(dirname "$0")/../.."
|
||||
shellcheck -e SC2046,SC2164,SC2154,SC1091,SC1090,SC2002 $(git ls-files '*.sh' | grep -v 'lib/vscode')
|
||||
}
|
||||
|
||||
main "$@"
|
||||
|
|
@ -1,18 +0,0 @@
|
|||
#!/usr/bin/env bash
|
||||
set -euo pipefail
|
||||
|
||||
main() {
|
||||
cd "$(dirname "$0")/../.."
|
||||
|
||||
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 "lib/vscode")
|
||||
if command -v helm && helm kubeval --help > /dev/null; then
|
||||
helm kubeval ci/helm-chart
|
||||
fi
|
||||
|
||||
cd "$OLDPWD"
|
||||
}
|
||||
|
||||
main "$@"
|
||||
|
|
@ -3,14 +3,13 @@ set -euo pipefail
|
|||
|
||||
# Install dependencies in $1.
|
||||
install-deps() {
|
||||
local args=(install)
|
||||
local args=()
|
||||
if [[ ${CI-} ]]; then
|
||||
args+=(--frozen-lockfile)
|
||||
args+=(ci)
|
||||
else
|
||||
args+=(install)
|
||||
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
|
||||
# If there is no package.json then npm 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
|
||||
|
|
@ -19,7 +18,7 @@ install-deps() {
|
|||
fi
|
||||
pushd "$1"
|
||||
echo "Installing dependencies for $PWD"
|
||||
yarn "${args[@]}"
|
||||
npm "${args[@]}"
|
||||
popd
|
||||
}
|
||||
|
||||
|
|
|
|||
3
ci/dev/preinstall.js
Normal file
3
ci/dev/preinstall.js
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
if (process.env.npm_execpath.includes("yarn")) {
|
||||
throw new Error("`yarn` is no longer supported; please use `npm install` instead")
|
||||
}
|
||||
|
|
@ -2,9 +2,9 @@
|
|||
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 build with 'npm run watch' or you can build a release"
|
||||
echo >&2 " For example: 'npm run build && npm run build:vscode && KEEP_MODULES=1 npm run release'"
|
||||
echo >&2 " Then 'CODE_SERVER_TEST_ENTRY=./release npm run test:e2e'"
|
||||
echo >&2 " You can manually run that release with 'node ./release'"
|
||||
}
|
||||
|
||||
|
|
@ -15,7 +15,7 @@ main() {
|
|||
|
||||
pushd test/e2e/extensions/test-extension
|
||||
echo "Building test extension"
|
||||
yarn build
|
||||
npm run build
|
||||
popd
|
||||
|
||||
local dir="$PWD"
|
||||
|
|
@ -44,7 +44,7 @@ main() {
|
|||
fi
|
||||
|
||||
cd test
|
||||
yarn playwright test "$@"
|
||||
./node_modules/.bin/playwright test "$@"
|
||||
}
|
||||
|
||||
main "$@"
|
||||
|
|
|
|||
|
|
@ -2,9 +2,9 @@
|
|||
set -euo pipefail
|
||||
|
||||
help() {
|
||||
echo >&2 " You can build the standalone release with 'yarn release:standalone'"
|
||||
echo >&2 " You can build the standalone release with 'npm run 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"
|
||||
echo >&2 " CODE_SERVER_PATH='/var/tmp/coder/code-server/bin/code-server' npm run test:integration"
|
||||
}
|
||||
|
||||
# Make sure a code-server release works. You can pass in the path otherwise it
|
||||
|
|
@ -33,7 +33,7 @@ main() {
|
|||
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"
|
||||
CODE_SERVER_PATH="$path" ./test/node_modules/.bin/jest "$@" --coverage=false --testRegex "./test/integration" --testPathIgnorePatterns "./test/integration/fixtures"
|
||||
}
|
||||
|
||||
main "$@"
|
||||
|
|
|
|||
39
ci/dev/test-native.sh
Executable file
39
ci/dev/test-native.sh
Executable file
|
|
@ -0,0 +1,39 @@
|
|||
#!/usr/bin/env bash
|
||||
set -euo pipefail
|
||||
|
||||
help() {
|
||||
echo >&2 " You can build the standalone release with 'npm run 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' npm run 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" ./test/node_modules/.bin/jest "$@" --coverage=false --testRegex "./test/integration/help.test.ts"
|
||||
}
|
||||
|
||||
main "$@"
|
||||
|
|
@ -6,31 +6,10 @@ main() {
|
|||
|
||||
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.
|
||||
CS_DISABLE_PLUGINS=true ./test/node_modules/.bin/jest "$@" --testRegex "./test/unit/.*ts" --testPathIgnorePatterns "./test/unit/node/test-plugin"
|
||||
./test/node_modules/.bin/jest "$@" --testRegex "./test/unit/.*ts"
|
||||
}
|
||||
|
||||
main "$@"
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
import { spawn, fork, ChildProcess } from "child_process"
|
||||
import { spawn, ChildProcess } from "child_process"
|
||||
import * as path from "path"
|
||||
import { onLine, OnLineCallback } from "../../src/node/util"
|
||||
|
||||
|
|
@ -30,12 +30,13 @@ class Watcher {
|
|||
|
||||
// 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)
|
||||
this.webServer = spawn("node", [path.join(this.rootPath, "out/node/entry.js"), ...args])
|
||||
onLine(this.webServer, (line) => console.log("[code-server]", line))
|
||||
const { pid } = this.webServer
|
||||
|
||||
this.webServer.on("exit", () => console.log("[Code Server]", `Web process ${pid} exited`))
|
||||
this.webServer.on("exit", () => console.log("[code-server]", `Web process ${pid} exited`))
|
||||
|
||||
console.log("\n[Code Server]", `Spawned web server process ${pid}`)
|
||||
console.log("\n[code-server]", `Spawned web server process ${pid}`)
|
||||
}
|
||||
|
||||
//#endregion
|
||||
|
|
@ -44,9 +45,11 @@ class Watcher {
|
|||
|
||||
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,
|
||||
vscode: spawn("npm", ["run", "watch"], { cwd: this.paths.vscodeDir }),
|
||||
vscodeWebExtensions: spawn("npm", ["run", "watch-web"], { cwd: this.paths.vscodeDir }),
|
||||
plugins: this.paths.pluginDir
|
||||
? spawn("npm", ["run", "build", "--watch"], { cwd: this.paths.pluginDir })
|
||||
: undefined,
|
||||
}
|
||||
|
||||
public async initialize(): Promise<void> {
|
||||
|
|
@ -82,10 +85,10 @@ class Watcher {
|
|||
private parseVSCodeLine: OnLineCallback = (strippedLine, originalLine) => {
|
||||
if (!strippedLine.length) return
|
||||
|
||||
console.log("[VS Code]", originalLine)
|
||||
console.log("[Code OSS]", originalLine)
|
||||
|
||||
if (strippedLine.includes("Finished compilation with")) {
|
||||
console.log("[VS Code] ✨ Finished compiling! ✨", "(Refresh your web browser ♻️)")
|
||||
console.log("[Code OSS] ✨ Finished compiling! ✨", "(Refresh your web browser ♻️)")
|
||||
this.reloadWebServer()
|
||||
}
|
||||
}
|
||||
|
|
@ -93,10 +96,10 @@ class Watcher {
|
|||
private parseCodeServerLine: OnLineCallback = (strippedLine, originalLine) => {
|
||||
if (!strippedLine.length) return
|
||||
|
||||
console.log("[Compiler][Code Server]", originalLine)
|
||||
console.log("[Compiler][code-server]", originalLine)
|
||||
|
||||
if (strippedLine.includes("Watching for file changes")) {
|
||||
console.log("[Compiler][Code Server]", "Finished compiling!", "(Refresh your web browser ♻️)")
|
||||
console.log("[Compiler][code-server]", "Finished compiling!", "(Refresh your web browser ♻️)")
|
||||
this.reloadWebServer()
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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: 3.2.0
|
||||
version: 3.31.2
|
||||
|
||||
# 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: 4.6.0
|
||||
appVersion: 4.104.2
|
||||
|
|
|
|||
|
|
@ -7,8 +7,11 @@ metadata:
|
|||
helm.sh/chart: {{ include "code-server.chart" . }}
|
||||
app.kubernetes.io/instance: {{ .Release.Name }}
|
||||
app.kubernetes.io/managed-by: {{ .Release.Service }}
|
||||
{{- if .Values.annotations }}
|
||||
annotations: {{- toYaml .Values.annotations | nindent 4 }}
|
||||
{{- end }}
|
||||
spec:
|
||||
replicas: 1
|
||||
replicas: {{ .Values.replicaCount | default 1 }}
|
||||
strategy:
|
||||
type: Recreate
|
||||
selector:
|
||||
|
|
@ -20,6 +23,9 @@ spec:
|
|||
labels:
|
||||
app.kubernetes.io/name: {{ include "code-server.name" . }}
|
||||
app.kubernetes.io/instance: {{ .Release.Name }}
|
||||
{{- if .Values.podAnnotations }}
|
||||
annotations: {{- toYaml .Values.podAnnotations | nindent 8 }}
|
||||
{{- end }}
|
||||
spec:
|
||||
imagePullSecrets: {{- toYaml .Values.imagePullSecrets | nindent 8 }}
|
||||
{{- if .Values.hostnameOverride }}
|
||||
|
|
@ -32,8 +38,9 @@ spec:
|
|||
securityContext:
|
||||
fsGroup: {{ .Values.securityContext.fsGroup }}
|
||||
{{- end }}
|
||||
{{- if and .Values.volumePermissions.enabled .Values.persistence.enabled }}
|
||||
{{- if or (and .Values.volumePermissions.enabled .Values.persistence.enabled) .Values.extraInitContainers }}
|
||||
initContainers:
|
||||
{{- if and .Values.volumePermissions.enabled .Values.persistence.enabled }}
|
||||
- name: init-chmod-data
|
||||
image: busybox:latest
|
||||
imagePullPolicy: IfNotPresent
|
||||
|
|
@ -47,6 +54,7 @@ spec:
|
|||
volumeMounts:
|
||||
- name: data
|
||||
mountPath: /home/coder
|
||||
{{- end }}
|
||||
{{- if .Values.extraInitContainers }}
|
||||
{{ tpl .Values.extraInitContainers . | indent 6}}
|
||||
{{- end }}
|
||||
|
|
@ -102,6 +110,7 @@ spec:
|
|||
{{- range .Values.extraSecretMounts }}
|
||||
- name: {{ .name }}
|
||||
mountPath: {{ .mountPath }}
|
||||
subPath: {{ .subPath | default "" }}
|
||||
readOnly: {{ .readOnly }}
|
||||
{{- end }}
|
||||
{{- range .Values.extraVolumeMounts }}
|
||||
|
|
@ -114,6 +123,11 @@ spec:
|
|||
- name: http
|
||||
containerPort: 8080
|
||||
protocol: TCP
|
||||
{{- range .Values.extraPorts }}
|
||||
- name: {{ .name }}
|
||||
containerPort: {{ .port }}
|
||||
protocol: {{ .protocol }}
|
||||
{{- end }}
|
||||
livenessProbe:
|
||||
httpGet:
|
||||
path: /
|
||||
|
|
@ -168,9 +182,12 @@ spec:
|
|||
{{- if .existingClaim }}
|
||||
persistentVolumeClaim:
|
||||
claimName: {{ .existingClaim }}
|
||||
{{- else }}
|
||||
{{- else if .hostPath }}
|
||||
hostPath:
|
||||
path: {{ .hostPath }}
|
||||
type: Directory
|
||||
{{- else }}
|
||||
emptyDir:
|
||||
{{- toYaml .emptyDir | nindent 10 }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
|
|
|
|||
|
|
@ -1,3 +1,4 @@
|
|||
{{- if not .Values.existingSecret }}
|
||||
apiVersion: v1
|
||||
kind: Secret
|
||||
metadata:
|
||||
|
|
@ -11,8 +12,9 @@ metadata:
|
|||
app.kubernetes.io/managed-by: {{ .Release.Service }}
|
||||
type: Opaque
|
||||
data:
|
||||
{{ if .Values.password }}
|
||||
{{- if .Values.password }}
|
||||
password: "{{ .Values.password | b64enc }}"
|
||||
{{ else }}
|
||||
{{- else }}
|
||||
password: "{{ randAlphaNum 24 | b64enc }}"
|
||||
{{ end }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
|
|
|
|||
|
|
@ -14,6 +14,12 @@ spec:
|
|||
targetPort: http
|
||||
protocol: TCP
|
||||
name: http
|
||||
{{- range .Values.extraPorts }}
|
||||
- port: {{ .port }}
|
||||
targetPort: {{ .port }}
|
||||
protocol: {{ .protocol }}
|
||||
name: {{ .name }}
|
||||
{{- end }}
|
||||
selector:
|
||||
app.kubernetes.io/name: {{ include "code-server.name" . }}
|
||||
app.kubernetes.io/instance: {{ .Release.Name }}
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@ replicaCount: 1
|
|||
|
||||
image:
|
||||
repository: codercom/code-server
|
||||
tag: '4.6.0'
|
||||
tag: '4.104.2'
|
||||
pullPolicy: Always
|
||||
|
||||
# Specifies one or more secrets to be used when pulling images from a
|
||||
|
|
@ -19,6 +19,9 @@ nameOverride: ""
|
|||
fullnameOverride: ""
|
||||
hostnameOverride: ""
|
||||
|
||||
# The existing secret to use for code-server authentication in the frontend. the password is stored in the secret under the key `password`
|
||||
# existingSecret: ""
|
||||
|
||||
serviceAccount:
|
||||
# Specifies whether a service account should be created
|
||||
create: true
|
||||
|
|
@ -28,6 +31,9 @@ serviceAccount:
|
|||
# If not set and create is true, a name is generated using the fullname template
|
||||
name: ""
|
||||
|
||||
# Specifies annotations for deployment
|
||||
annotations: {}
|
||||
|
||||
podAnnotations: {}
|
||||
|
||||
podSecurityContext: {}
|
||||
|
|
@ -71,9 +77,10 @@ extraArgs: []
|
|||
# Optional additional environment variables
|
||||
extraVars: []
|
||||
# - name: DISABLE_TELEMETRY
|
||||
# value: true
|
||||
# value: "true"
|
||||
# if dind is desired:
|
||||
# - name: DOCKER_HOST
|
||||
# value: "tcp://localhost:2375"
|
||||
# value: "tcp://localhost:2376"
|
||||
|
||||
##
|
||||
## Init containers parameters:
|
||||
|
|
@ -136,25 +143,39 @@ lifecycle:
|
|||
# - -c
|
||||
# - curl -s -L SOME_SCRIPT | bash
|
||||
|
||||
# for dind, the following may be helpful
|
||||
# postStart:
|
||||
# exec:
|
||||
# command:
|
||||
# - /bin/sh
|
||||
# - -c
|
||||
# - |
|
||||
# sudo apt-get update \
|
||||
# && sudo apt-get install -y docker.io
|
||||
|
||||
## 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
|
||||
# resources:
|
||||
# requests:
|
||||
# cpu: 250m
|
||||
# memory: 256M
|
||||
# securityContext:
|
||||
# privileged: true
|
||||
# procMount: Default
|
||||
# env:
|
||||
# - name: DOCKER_TLS_CERTDIR
|
||||
# value: ""
|
||||
# - name: DOCKER_DRIVER
|
||||
# value: "overlay2"
|
||||
# - name: docker-dind
|
||||
# image: docker:28.3.2-dind
|
||||
# imagePullPolicy: IfNotPresent
|
||||
# resources:
|
||||
# requests:
|
||||
# cpu: 1
|
||||
# ephemeral-storage: "50Gi"
|
||||
# memory: 10Gi
|
||||
# securityContext:
|
||||
# privileged: true
|
||||
# procMount: Default
|
||||
# env:
|
||||
# - name: DOCKER_TLS_CERTDIR
|
||||
# value: "" # disable TLS setup
|
||||
# command:
|
||||
# - dockerd
|
||||
# - --host=unix:///var/run/docker.sock
|
||||
# - --host=tcp://0.0.0.0:2376
|
||||
|
||||
|
||||
extraInitContainers: |
|
||||
# - name: customization
|
||||
|
|
@ -179,6 +200,7 @@ extraInitContainers: |
|
|||
extraSecretMounts: []
|
||||
# - name: secret-files
|
||||
# mountPath: /etc/secrets
|
||||
# subPath: private.key # (optional)
|
||||
# secretName: code-server-secret-files
|
||||
# readOnly: true
|
||||
|
||||
|
|
@ -189,6 +211,7 @@ extraVolumeMounts: []
|
|||
# readOnly: true
|
||||
# existingClaim: volume-claim
|
||||
# hostPath: ""
|
||||
# emptyDir: {}
|
||||
|
||||
extraConfigmapMounts: []
|
||||
# - name: certs-configmap
|
||||
|
|
@ -196,3 +219,8 @@ extraConfigmapMounts: []
|
|||
# subPath: certificates.crt # (optional)
|
||||
# configMap: certs-configmap
|
||||
# readOnly: true
|
||||
|
||||
extraPorts: []
|
||||
# - name: minecraft
|
||||
# port: 25565
|
||||
# protocol: tcp
|
||||
|
|
|
|||
47
ci/lib.sh
47
ci/lib.sh
|
|
@ -9,10 +9,6 @@ popd() {
|
|||
builtin popd > /dev/null
|
||||
}
|
||||
|
||||
pkg_json_version() {
|
||||
jq -r .version package.json
|
||||
}
|
||||
|
||||
vscode_version() {
|
||||
jq -r .version lib/vscode/package.json
|
||||
}
|
||||
|
|
@ -44,53 +40,10 @@ arch() {
|
|||
echo "$cpu"
|
||||
}
|
||||
|
||||
# Grabs the most recent ci.yaml github workflow run that was triggered from the
|
||||
# pull request of the release branch for this version (regardless of whether
|
||||
# that run succeeded or failed). The release branch name must be in semver
|
||||
# format with a v prepended.
|
||||
# This will contain the artifacts we want.
|
||||
# https://developer.github.com/v3/actions/workflow-runs/#list-workflow-runs
|
||||
get_artifacts_url() {
|
||||
local artifacts_url
|
||||
local version_branch="release/v$VERSION"
|
||||
local workflow_runs_url="repos/:owner/:repo/actions/workflows/ci.yaml/runs?event=pull_request&branch=$version_branch"
|
||||
artifacts_url=$(gh api "$workflow_runs_url" | jq -r ".workflow_runs[] | select(.head_branch == \"$version_branch\") | .artifacts_url" | head -n 1)
|
||||
if [[ -z "$artifacts_url" ]]; then
|
||||
echo >&2 "ERROR: artifacts_url came back empty"
|
||||
echo >&2 "We looked for a successful run triggered by a pull_request with for code-server version: $VERSION and a branch named $version_branch"
|
||||
echo >&2 "URL used for gh API call: $workflow_runs_url"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo "$artifacts_url"
|
||||
}
|
||||
|
||||
# Grabs the artifact's download url.
|
||||
# https://developer.github.com/v3/actions/artifacts/#list-workflow-run-artifacts
|
||||
get_artifact_url() {
|
||||
local artifact_name="$1"
|
||||
gh api "$(get_artifacts_url)" | jq -r ".artifacts[] | select(.name == \"$artifact_name\") | .archive_download_url" | head -n 1
|
||||
}
|
||||
|
||||
# Uses the above two functions to download a artifact into a directory.
|
||||
download_artifact() {
|
||||
local artifact_name="$1"
|
||||
local dst="$2"
|
||||
|
||||
local tmp_file
|
||||
tmp_file="$(mktemp)"
|
||||
|
||||
gh api "$(get_artifact_url "$artifact_name")" > "$tmp_file"
|
||||
unzip -q -o "$tmp_file" -d "$dst"
|
||||
rm "$tmp_file"
|
||||
}
|
||||
|
||||
rsync() {
|
||||
command rsync -a --del "$@"
|
||||
}
|
||||
|
||||
VERSION="$(pkg_json_version)"
|
||||
export VERSION
|
||||
ARCH="$(arch)"
|
||||
export ARCH
|
||||
OS=$(os)
|
||||
|
|
|
|||
|
|
@ -1,26 +1,28 @@
|
|||
# syntax=docker/dockerfile:experimental
|
||||
|
||||
ARG BASE=debian:12
|
||||
FROM scratch AS packages
|
||||
COPY release-packages/code-server*.deb /tmp/
|
||||
|
||||
FROM debian:11
|
||||
FROM $BASE
|
||||
|
||||
RUN apt-get update \
|
||||
&& apt-get install -y \
|
||||
&& apt-get install -y \
|
||||
curl \
|
||||
dumb-init \
|
||||
zsh \
|
||||
htop \
|
||||
locales \
|
||||
man \
|
||||
nano \
|
||||
git \
|
||||
git-lfs \
|
||||
procps \
|
||||
openssh-client \
|
||||
sudo \
|
||||
vim.tiny \
|
||||
htop \
|
||||
locales \
|
||||
lsb-release \
|
||||
man-db \
|
||||
nano \
|
||||
openssh-client \
|
||||
procps \
|
||||
sudo \
|
||||
vim-tiny \
|
||||
wget \
|
||||
zsh \
|
||||
&& git lfs install \
|
||||
&& rm -rf /var/lib/apt/lists/*
|
||||
|
||||
|
|
@ -29,15 +31,18 @@ RUN sed -i "s/# en_US.UTF-8/en_US.UTF-8/" /etc/locale.gen \
|
|||
&& locale-gen
|
||||
ENV LANG=en_US.UTF-8
|
||||
|
||||
RUN adduser --gecos '' --disabled-password coder && \
|
||||
echo "coder ALL=(ALL) NOPASSWD:ALL" >> /etc/sudoers.d/nopasswd
|
||||
RUN if grep -q 1000 /etc/passwd; then \
|
||||
userdel -r "$(id -un 1000)"; \
|
||||
fi \
|
||||
&& adduser --gecos '' --disabled-password coder \
|
||||
&& echo "coder ALL=(ALL) NOPASSWD:ALL" >> /etc/sudoers.d/nopasswd
|
||||
|
||||
RUN ARCH="$(dpkg --print-architecture)" && \
|
||||
curl -fsSL "https://github.com/boxboat/fixuid/releases/download/v0.5/fixuid-0.5-linux-$ARCH.tar.gz" | tar -C /usr/local/bin -xzf - && \
|
||||
chown root:root /usr/local/bin/fixuid && \
|
||||
chmod 4755 /usr/local/bin/fixuid && \
|
||||
mkdir -p /etc/fixuid && \
|
||||
printf "user: coder\ngroup: coder\n" > /etc/fixuid/config.yml
|
||||
RUN ARCH="$(dpkg --print-architecture)" \
|
||||
&& curl -fsSL "https://github.com/boxboat/fixuid/releases/download/v0.6.0/fixuid-0.6.0-linux-$ARCH.tar.gz" | tar -C /usr/local/bin -xzf - \
|
||||
&& chown root:root /usr/local/bin/fixuid \
|
||||
&& chmod 4755 /usr/local/bin/fixuid \
|
||||
&& mkdir -p /etc/fixuid \
|
||||
&& printf "user: coder\ngroup: coder\n" > /etc/fixuid/config.yml
|
||||
|
||||
COPY ci/release-image/entrypoint.sh /usr/bin/entrypoint.sh
|
||||
RUN --mount=from=packages,src=/tmp,dst=/tmp/packages dpkg -i /tmp/packages/code-server*$(dpkg --print-architecture).deb
|
||||
|
|
|
|||
51
ci/release-image/Dockerfile.fedora
Normal file
51
ci/release-image/Dockerfile.fedora
Normal file
|
|
@ -0,0 +1,51 @@
|
|||
# syntax=docker/dockerfile:experimental
|
||||
|
||||
ARG BASE=fedora:39
|
||||
FROM scratch AS packages
|
||||
COPY release-packages/code-server*.rpm /tmp/
|
||||
|
||||
FROM $BASE
|
||||
|
||||
RUN dnf update -y \
|
||||
&& dnf install -y \
|
||||
curl \
|
||||
git \
|
||||
git-lfs \
|
||||
htop \
|
||||
nano \
|
||||
openssh-clients \
|
||||
procps \
|
||||
wget \
|
||||
zsh \
|
||||
dumb-init \
|
||||
glibc-langpack-en \
|
||||
&& rm -rf /var/cache/dnf
|
||||
RUN git lfs install
|
||||
|
||||
ENV LANG=en_US.UTF-8
|
||||
RUN echo 'LANG="en_US.UTF-8"' > /etc/locale.conf
|
||||
|
||||
RUN useradd -u 1000 coder && echo "coder ALL=(ALL) NOPASSWD:ALL" >> /etc/sudoers.d/nopasswd
|
||||
|
||||
RUN ARCH="$(uname -m | sed 's/x86_64/amd64/g' | sed 's/aarch64/arm64/g')" \
|
||||
&& curl -fsSL "https://github.com/boxboat/fixuid/releases/download/v0.6.0/fixuid-0.6.0-linux-$ARCH.tar.gz" | tar -C /usr/local/bin -xzf - \
|
||||
&& chown root:root /usr/local/bin/fixuid \
|
||||
&& chmod 4755 /usr/local/bin/fixuid \
|
||||
&& mkdir -p /etc/fixuid \
|
||||
&& printf "user: coder\ngroup: coder\n" > /etc/fixuid/config.yml
|
||||
|
||||
COPY ci/release-image/entrypoint.sh /usr/bin/entrypoint.sh
|
||||
RUN --mount=from=packages,src=/tmp,dst=/tmp/packages rpm -i /tmp/packages/code-server*$(uname -m | sed 's/x86_64/amd64/g' | sed 's/aarch64/arm64/g').rpm
|
||||
|
||||
# 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
|
||||
# the uid will remain the same. note: only relevant if -u isn't passed to
|
||||
# docker-run.
|
||||
USER 1000
|
||||
ENV USER=coder
|
||||
WORKDIR /home/coder
|
||||
ENTRYPOINT ["/usr/bin/entrypoint.sh", "--bind-addr", "0.0.0.0:8080", "."]
|
||||
51
ci/release-image/Dockerfile.opensuse
Normal file
51
ci/release-image/Dockerfile.opensuse
Normal file
|
|
@ -0,0 +1,51 @@
|
|||
# syntax=docker/dockerfile:experimental
|
||||
|
||||
ARG BASE=opensuse/tumbleweed
|
||||
FROM scratch AS packages
|
||||
COPY release-packages/code-server*.rpm /tmp/
|
||||
|
||||
FROM $BASE
|
||||
|
||||
RUN zypper dup -y \
|
||||
&& zypper in -y \
|
||||
curl \
|
||||
git \
|
||||
git-lfs \
|
||||
htop \
|
||||
nano \
|
||||
openssh-clients \
|
||||
procps \
|
||||
wget \
|
||||
zsh \
|
||||
sudo \
|
||||
catatonit \
|
||||
&& rm -rf /var/cache/zypp /var/cache/zypper
|
||||
RUN git lfs install
|
||||
|
||||
ENV LANG=en_US.UTF-8
|
||||
RUN echo 'LANG="en_US.UTF-8"' > /etc/locale.conf
|
||||
|
||||
RUN useradd -u 1000 coder && echo "coder ALL=(ALL) NOPASSWD:ALL" >> /etc/sudoers.d/nopasswd
|
||||
|
||||
RUN ARCH="$(uname -m | sed 's/x86_64/amd64/g' | sed 's/aarch64/arm64/g')" \
|
||||
&& curl -fsSL "https://github.com/boxboat/fixuid/releases/download/v0.6.0/fixuid-0.6.0-linux-$ARCH.tar.gz" | tar -C /usr/local/bin -xzf - \
|
||||
&& chown root:root /usr/local/bin/fixuid \
|
||||
&& chmod 4755 /usr/local/bin/fixuid \
|
||||
&& mkdir -p /etc/fixuid \
|
||||
&& printf "user: coder\ngroup: coder\n" > /etc/fixuid/config.yml
|
||||
|
||||
COPY ci/release-image/entrypoint-catatonit.sh /usr/bin/entrypoint-catatonit.sh
|
||||
RUN --mount=from=packages,src=/tmp,dst=/tmp/packages rpm -i /tmp/packages/code-server*$(uname -m | sed 's/x86_64/amd64/g' | sed 's/aarch64/arm64/g').rpm
|
||||
|
||||
# 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
|
||||
# the uid will remain the same. note: only relevant if -u isn't passed to
|
||||
# docker-run.
|
||||
USER 1000
|
||||
ENV USER=coder
|
||||
WORKDIR /home/coder
|
||||
ENTRYPOINT ["/usr/bin/entrypoint-catatonit.sh", "--bind-addr", "0.0.0.0:8080", "."]
|
||||
|
|
@ -6,17 +6,101 @@ variable "VERSION" {
|
|||
default = "latest"
|
||||
}
|
||||
|
||||
group "default" {
|
||||
targets = ["code-server"]
|
||||
variable "DOCKER_REGISTRY" {
|
||||
default = "docker.io/codercom/code-server"
|
||||
}
|
||||
|
||||
target "code-server" {
|
||||
dockerfile = "ci/release-image/Dockerfile"
|
||||
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}" : "",
|
||||
variable "GITHUB_REGISTRY" {
|
||||
default = "ghcr.io/coder/code-server"
|
||||
}
|
||||
|
||||
group "default" {
|
||||
targets = [
|
||||
"code-server-debian-12",
|
||||
"code-server-ubuntu-focal",
|
||||
"code-server-ubuntu-noble",
|
||||
"code-server-fedora-39",
|
||||
"code-server-opensuse-tumbleweed",
|
||||
]
|
||||
}
|
||||
|
||||
function "prepend_hyphen_if_not_null" {
|
||||
params = [tag]
|
||||
result = notequal("","${tag}") ? "-${tag}" : "${tag}"
|
||||
}
|
||||
|
||||
# use empty tag (tag="") to generate default tags
|
||||
function "gen_tags" {
|
||||
params = [registry, tag]
|
||||
result = notequal("","${registry}") ? [
|
||||
notequal("", "${tag}") ? "${registry}:${tag}" : "${registry}:latest",
|
||||
notequal("latest",VERSION) ? "${registry}:${VERSION}${prepend_hyphen_if_not_null(tag)}" : "",
|
||||
] : []
|
||||
}
|
||||
|
||||
# helper function to generate tags for docker registry and github registry.
|
||||
# set (DOCKER|GITHUB)_REGISTRY="" to disable corresponding registry
|
||||
function "gen_tags_for_docker_and_ghcr" {
|
||||
params = [tag]
|
||||
result = concat(
|
||||
gen_tags("${DOCKER_REGISTRY}", "${tag}"),
|
||||
gen_tags("${GITHUB_REGISTRY}", "${tag}"),
|
||||
)
|
||||
}
|
||||
|
||||
target "code-server-debian-12" {
|
||||
dockerfile = "ci/release-image/Dockerfile"
|
||||
tags = concat(
|
||||
gen_tags_for_docker_and_ghcr(""),
|
||||
gen_tags_for_docker_and_ghcr("debian"),
|
||||
gen_tags_for_docker_and_ghcr("bookworm"),
|
||||
)
|
||||
platforms = ["linux/amd64", "linux/arm64"]
|
||||
}
|
||||
|
||||
target "code-server-ubuntu-focal" {
|
||||
dockerfile = "ci/release-image/Dockerfile"
|
||||
tags = concat(
|
||||
gen_tags_for_docker_and_ghcr("ubuntu"),
|
||||
gen_tags_for_docker_and_ghcr("focal"),
|
||||
)
|
||||
args = {
|
||||
BASE = "ubuntu:focal"
|
||||
}
|
||||
platforms = ["linux/amd64", "linux/arm64"]
|
||||
}
|
||||
|
||||
target "code-server-ubuntu-noble" {
|
||||
dockerfile = "ci/release-image/Dockerfile"
|
||||
tags = concat(
|
||||
gen_tags_for_docker_and_ghcr("noble"),
|
||||
)
|
||||
args = {
|
||||
BASE = "ubuntu:noble"
|
||||
}
|
||||
platforms = ["linux/amd64", "linux/arm64"]
|
||||
}
|
||||
|
||||
target "code-server-fedora-39" {
|
||||
dockerfile = "ci/release-image/Dockerfile.fedora"
|
||||
tags = concat(
|
||||
gen_tags_for_docker_and_ghcr("fedora"),
|
||||
gen_tags_for_docker_and_ghcr("39"),
|
||||
)
|
||||
args = {
|
||||
BASE = "fedora:39"
|
||||
}
|
||||
platforms = ["linux/amd64", "linux/arm64"]
|
||||
}
|
||||
|
||||
target "code-server-opensuse-tumbleweed" {
|
||||
dockerfile = "ci/release-image/Dockerfile.opensuse"
|
||||
tags = concat(
|
||||
gen_tags_for_docker_and_ghcr("opensuse"),
|
||||
gen_tags_for_docker_and_ghcr("tumbleweed"),
|
||||
)
|
||||
args = {
|
||||
BASE = "opensuse/tumbleweed"
|
||||
}
|
||||
platforms = ["linux/amd64", "linux/arm64"]
|
||||
}
|
||||
|
|
|
|||
27
ci/release-image/entrypoint-catatonit.sh
Executable file
27
ci/release-image/entrypoint-catatonit.sh
Executable file
|
|
@ -0,0 +1,27 @@
|
|||
#!/bin/sh
|
||||
set -eu
|
||||
|
||||
# We do this first to ensure sudo works below when renaming the user.
|
||||
# Otherwise the current container UID may not exist in the passwd database.
|
||||
eval "$(fixuid -q)"
|
||||
|
||||
if [ "${DOCKER_USER-}" ]; then
|
||||
USER="$DOCKER_USER"
|
||||
if [ "$DOCKER_USER" != "$(whoami)" ]; then
|
||||
echo "$DOCKER_USER ALL=(ALL) NOPASSWD:ALL" | sudo tee -a /etc/sudoers.d/nopasswd > /dev/null
|
||||
# Unfortunately we cannot change $HOME as we cannot move any bind mounts
|
||||
# nor can we bind mount $HOME into a new home as that requires a privileged container.
|
||||
sudo usermod --login "$DOCKER_USER" coder
|
||||
sudo groupmod -n "$DOCKER_USER" coder
|
||||
|
||||
sudo sed -i "/coder/d" /etc/sudoers.d/nopasswd
|
||||
fi
|
||||
fi
|
||||
|
||||
# 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 catatonit -- /usr/bin/code-server "$@"
|
||||
|
|
@ -7,7 +7,7 @@ eval "$(fixuid -q)"
|
|||
|
||||
if [ "${DOCKER_USER-}" ]; then
|
||||
USER="$DOCKER_USER"
|
||||
if [ "$DOCKER_USER" != "$(whoami)" ]; then
|
||||
if [ -z "$(id -u "$DOCKER_USER" 2>/dev/null)" ]; then
|
||||
echo "$DOCKER_USER ALL=(ALL) NOPASSWD:ALL" | sudo tee -a /etc/sudoers.d/nopasswd > /dev/null
|
||||
# Unfortunately we cannot change $HOME as we cannot move any bind mounts
|
||||
# nor can we bind mount $HOME into a new home as that requires a privileged container.
|
||||
|
|
|
|||
|
|
@ -3,9 +3,8 @@ set -euo pipefail
|
|||
|
||||
main() {
|
||||
cd "$(dirname "$0")/../.."
|
||||
# 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
|
||||
# NOTE@jsjoeio - this script assumes VERSION exists as an
|
||||
# environment variable.
|
||||
|
||||
# NOTE@jsjoeio - this script assumes that you've downloaded
|
||||
# the release-packages artifact to ./release-packages before
|
||||
|
|
|
|||
|
|
@ -19,12 +19,6 @@ main() {
|
|||
# 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."
|
||||
|
|
@ -59,13 +53,14 @@ main() {
|
|||
# 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>`
|
||||
# a developer to install this version with `npm install code-server@<pr-number>`
|
||||
# "staging" - this means we tag with `beta`, allowing
|
||||
# a developer to install this version with `yarn add code-server@beta`
|
||||
# a developer to install this version with `npm install code-server@beta`
|
||||
# "production" - this means we tag with `latest` (default), allowing
|
||||
# a developer to install this version with `yarn add code-server@latest`
|
||||
# a developer to install this version with `npm install 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."
|
||||
echo "NPM_ENVIRONMENT is not set."
|
||||
echo "Determining in script based on GITHUB environment variables."
|
||||
|
||||
if [[ "$GITHUB_EVENT_NAME" == 'push' && "$GITHUB_REF" == 'refs/heads/main' ]]; then
|
||||
NPM_ENVIRONMENT="staging"
|
||||
|
|
@ -73,7 +68,6 @@ main() {
|
|||
NPM_ENVIRONMENT="development"
|
||||
fi
|
||||
|
||||
echo "Using npm environment: $NPM_ENVIRONMENT"
|
||||
fi
|
||||
|
||||
# NOTE@jsjoeio - this script assumes we have the artifact downloaded on disk
|
||||
|
|
@ -92,19 +86,17 @@ main() {
|
|||
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`
|
||||
# and installed when a user runs `npm 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`
|
||||
# and installed when a user runs `npm install code-server@beta`
|
||||
NPM_TAG="beta"
|
||||
PACKAGE_NAME="@coder/code-server-pr"
|
||||
fi
|
||||
|
||||
if [[ "$NPM_ENVIRONMENT" == "development" ]]; then
|
||||
|
|
@ -113,12 +105,14 @@ main() {
|
|||
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>`
|
||||
# and installed when a user runs `npm install code-server@<pr number>`
|
||||
NPM_TAG="$PR_NUMBER"
|
||||
fi
|
||||
|
||||
echo "using tag: $NPM_TAG"
|
||||
echo "using package name: $PACKAGE_NAME"
|
||||
echo "- tag: $NPM_TAG"
|
||||
echo "- version: $NPM_VERSION"
|
||||
echo "- package name: $PACKAGE_NAME"
|
||||
echo "- npm environment: $NPM_ENVIRONMENT"
|
||||
|
||||
# We modify the version in the package.json
|
||||
# to be the current version + the PR number + commit SHA
|
||||
|
|
@ -126,10 +120,7 @@ main() {
|
|||
# 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.
|
||||
|
|
@ -141,19 +132,18 @@ main() {
|
|||
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.
|
||||
# If we get error, continue with script because we want to publish
|
||||
# If version is valid, we check if we're publishing the same one
|
||||
local hasVersion
|
||||
hasVersion=$(npm view "code-server@$NPM_VERSION" version)
|
||||
if [[ $hasVersion == "$NPM_VERSION" ]]; then
|
||||
echo "$NPM_VERSION is already published"
|
||||
if hasVersion=$(npm view "$PACKAGE_NAME@$NPM_VERSION" version 2> /dev/null) && [[ $hasVersion == "$NPM_VERSION" ]]; then
|
||||
echo "$NPM_VERSION is already published under $PACKAGE_NAME"
|
||||
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
|
||||
cd release
|
||||
npm publish --tag "$NPM_TAG" --access public
|
||||
}
|
||||
|
||||
main "$@"
|
||||
|
|
|
|||
|
|
@ -1,5 +1,18 @@
|
|||
<!-- prettier-ignore-start -->
|
||||
<!-- START doctoc generated TOC please keep comment here to allow auto update -->
|
||||
<!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE -->
|
||||
# Contributor Covenant Code of Conduct
|
||||
|
||||
- [Contributor Covenant Code of Conduct](#contributor-covenant-code-of-conduct)
|
||||
- [Our Pledge](#our-pledge)
|
||||
- [Our Standards](#our-standards)
|
||||
- [Our Responsibilities](#our-responsibilities)
|
||||
- [Scope](#scope)
|
||||
- [Enforcement](#enforcement)
|
||||
- [Attribution](#attribution)
|
||||
|
||||
<!-- END doctoc generated TOC please keep comment here to allow auto update -->
|
||||
<!-- prettier-ignore-end -->
|
||||
|
||||
# Contributor Covenant Code of Conduct
|
||||
|
||||
|
|
|
|||
|
|
@ -1,18 +1,18 @@
|
|||
<!-- prettier-ignore-start -->
|
||||
<!-- START doctoc generated TOC please keep comment here to allow auto update -->
|
||||
<!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE -->
|
||||
# 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)
|
||||
- [Version updates to Code](#version-updates-to-code)
|
||||
- [Patching Code](#patching-code)
|
||||
- [Build](#build)
|
||||
- [Creating a Standalone Release](#creating-a-standalone-release)
|
||||
- [Troubleshooting](#troubleshooting)
|
||||
- [I see "Forbidden access" when I load code-server in the browser](#i-see-forbidden-access-when-i-load-code-server-in-the-browser)
|
||||
- ["Can only have one anonymous define call per script"](#can-only-have-one-anonymous-define-call-per-script)
|
||||
- ["Can only have one anonymous define call per script"](#can-only-have-one-anonymous-define-call-per-script)
|
||||
- [Help](#help)
|
||||
- [Test](#test)
|
||||
- [Unit tests](#unit-tests)
|
||||
|
|
@ -24,20 +24,18 @@
|
|||
- [Currently Known Issues](#currently-known-issues)
|
||||
|
||||
<!-- END doctoc generated TOC please keep comment here to allow auto update -->
|
||||
|
||||
- [Detailed CI and build process docs](../ci)
|
||||
<!-- prettier-ignore-end -->
|
||||
|
||||
## Requirements
|
||||
|
||||
The prerequisites for contributing to code-server are almost the same as those
|
||||
for [VS
|
||||
Code](https://github.com/Microsoft/vscode/wiki/How-to-Contribute#prerequisites).
|
||||
for [VS Code](https://github.com/Microsoft/vscode/wiki/How-to-Contribute#prerequisites).
|
||||
Here is what is needed:
|
||||
|
||||
- `node` v16.x
|
||||
- `node` v22.x
|
||||
- `git` v2.x or greater
|
||||
- [`git-lfs`](https://git-lfs.github.com)
|
||||
- [`yarn`](https://classic.yarnpkg.com/en/)
|
||||
- [`npm`](https://www.npmjs.com/)
|
||||
- Used to install JS packages and run scripts
|
||||
- [`nfpm`](https://nfpm.goreleaser.com/)
|
||||
- Used to build `.deb` and `.rpm` packages
|
||||
|
|
@ -57,38 +55,23 @@ Here is what is needed:
|
|||
|
||||
### Linux-specific requirements
|
||||
|
||||
If you're developing code-server on Linux, make sure you have installed or install the following dependencies:
|
||||
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
|
||||
sudo apt-get install build-essential g++ libx11-dev libxkbfile-dev libsecret-1-dev libkrb5-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/coder/code-server/issues) that
|
||||
includes context for issues that you see. You can skip this if the proposed fix
|
||||
is minor.
|
||||
|
||||
In your pull requests (PR), link to the issue that the PR solves.
|
||||
|
||||
Please ensure that the base of your PR is the **main** branch.
|
||||
|
||||
### Commits and commit history
|
||||
|
||||
We prefer a clean commit history. This means you should squash all fixups and
|
||||
fixup-type commits before asking for a review (e.g., clean up, squash, then force
|
||||
push). If you need help with this, feel free to leave a comment in your PR, and
|
||||
we'll guide you.
|
||||
These are required by Code. See [their Wiki](https://github.com/microsoft/vscode/wiki/How-to-Contribute#prerequisites)
|
||||
for more information.
|
||||
|
||||
## Development workflow
|
||||
|
||||
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
|
||||
4. `npm install` - Install dependencies
|
||||
5. `npm run watch` - Launch code-server localhost:8080. code-server will be live
|
||||
reloaded when changes are made; the browser needs to be refreshed manually.
|
||||
|
||||
When pulling down changes that include modifications to the patches you will
|
||||
|
|
@ -96,84 +79,121 @@ 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.
|
||||
|
||||
When you make a change that affects people deploying the marketplace please
|
||||
update the changelog as part of your PR.
|
||||
|
||||
Note that building code-server takes a very, very long time, and loading it in
|
||||
the browser in development mode also takes a very, very long time.
|
||||
|
||||
Display language (Spanish, etc) support only works in a full build; it will not
|
||||
work in development mode.
|
||||
|
||||
Generally we prefer that PRs be squashed into `main` but you can rebase or merge
|
||||
if it is important to keep the individual commits (make sure to clean up the
|
||||
commits first if you are doing this).
|
||||
|
||||
### Version updates to Code
|
||||
|
||||
1. Update the `lib/vscode` submodule to the desired upstream version branch.
|
||||
1. Remove any patches with `quilt pop -a`.
|
||||
2. 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.
|
||||
2. `git add lib && git commit -m "chore: update to Code <version>"`
|
||||
3. Apply the patches one at a time (`quilt push`). If the application succeeds
|
||||
but the lines changed, update the patch with `quilt refresh`. If there are
|
||||
conflicts, then force apply with `quilt push -f`, manually add back the
|
||||
rejected code, then run `quilt refresh`.
|
||||
4. From the code-server **project root**, run `npm install`.
|
||||
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.
|
||||
6. Commit the updated submodule and patches to `code-server`.
|
||||
7. Open a PR.
|
||||
Code. If necessary, update our version of Node.js to match.
|
||||
|
||||
### 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
|
||||
1. You can go through the patch stack with `quilt push` and `quilt pop`.
|
||||
2. Create a new patch (`quilt new {name}.diff`) or use an existing patch.
|
||||
3. 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
|
||||
4. 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
|
||||
5. Add your changes to the patch (`quilt refresh`)
|
||||
6. 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
|
||||
|
||||
You can build as follows:
|
||||
You can build a full production as follows:
|
||||
|
||||
```shell
|
||||
yarn build
|
||||
yarn build:vscode
|
||||
yarn release
|
||||
git submodule update --init
|
||||
quilt push -a
|
||||
npm install
|
||||
npm run build
|
||||
VERSION=0.0.0 npm run build:vscode
|
||||
npm run 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)_
|
||||
This does not keep `node_modules`. If you want them to be kept, use
|
||||
`KEEP_MODULES=1 npm run release`
|
||||
|
||||
Run your build:
|
||||
|
||||
```shell
|
||||
cd release
|
||||
yarn --production # Skip if you used KEEP_MODULES=1
|
||||
npm install --omit=dev # Skip if you used KEEP_MODULES=1
|
||||
# Runs the built JavaScript with Node.
|
||||
node .
|
||||
```
|
||||
|
||||
Build the release packages (make sure that you run `yarn release` first):
|
||||
Then, to build the release package:
|
||||
|
||||
```shell
|
||||
yarn release:standalone
|
||||
yarn test:integration
|
||||
yarn package
|
||||
npm run release:standalone
|
||||
npm run test:integration
|
||||
npm run package
|
||||
```
|
||||
|
||||
> On Linux, the currently running distro will become the minimum supported
|
||||
> version. In our GitHub Actions CI, we use CentOS 7 for maximum compatibility.
|
||||
> version. In our GitHub Actions CI, we use CentOS 8 for maximum compatibility.
|
||||
> If you need your builds to support older distros, run the build commands
|
||||
> inside a Docker container with all the build requirements installed.
|
||||
|
||||
#### Creating a Standalone Release
|
||||
|
||||
Part of the build process involves creating standalone releases. At the time of
|
||||
writing, we do this for the following platforms/architectures:
|
||||
|
||||
- Linux amd64 (.tar.gz, .deb, and .rpm)
|
||||
- Linux arm64 (.tar.gz, .deb, and .rpm)
|
||||
- Linux arm7l (.tar.gz)
|
||||
- Linux armhf.deb
|
||||
- Linux armhf.rpm
|
||||
- macOS arm64.tar.gz
|
||||
|
||||
Currently, these are compiled in CI using the `npm run release:standalone`
|
||||
command in the `release.yaml` workflow. We then upload them to the draft release
|
||||
and distribute via GitHub Releases.
|
||||
|
||||
### Troubleshooting
|
||||
|
||||
#### I see "Forbidden access" when I load code-server in the browser
|
||||
|
||||
This means your patches didn't apply correctly. We have a patch to remove the auth from vanilla Code because we use our own.
|
||||
This means your patches didn't apply correctly. We have a patch to remove the
|
||||
auth from vanilla Code because we use our own.
|
||||
|
||||
Try popping off the patches with `quilt pop -a` and reapplying with `quilt push -a`.
|
||||
Try popping off the patches with `quilt pop -a` and reapplying with `quilt push
|
||||
-a`.
|
||||
|
||||
### "Can only have one anonymous define call per script"
|
||||
#### "Can only have one anonymous define call per script"
|
||||
|
||||
Code might be trying to use a dev or prod HTML in the wrong context. You can try re-running code-server and setting `VSCODE_DEV=1`.
|
||||
Code might be trying to use a dev or prod HTML in the wrong context. You can try
|
||||
re-running code-server and setting `VSCODE_DEV=1`.
|
||||
|
||||
### Help
|
||||
|
||||
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.
|
||||
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
|
||||
|
||||
|
|
@ -191,7 +211,9 @@ Our unit tests are written in TypeScript and run using
|
|||
|
||||
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.
|
||||
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
|
||||
|
||||
|
|
@ -199,12 +221,14 @@ Our script tests are written in bash and run using [bats](https://github.com/bat
|
|||
|
||||
These tests live under `test/scripts`.
|
||||
|
||||
We use these to test anything related to our scripts (most of which live under `ci`).
|
||||
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 tests with `yarn test:integration`, which ensures that code-server builds work on their respective
|
||||
platforms.
|
||||
These are a work in progress. We build code-server and run tests with `npm run
|
||||
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.
|
||||
|
|
@ -225,15 +249,10 @@ Take a look at `codeServer.test.ts` to see how you would use it (see
|
|||
We also have a model where you can create helpers to use within tests. See
|
||||
[models/CodeServer.ts](../test/e2e/models/CodeServer.ts) for an example.
|
||||
|
||||
Generally speaking, e2e means testing code-server while running in the browser
|
||||
and interacting with it in a way that's similar to how a user would interact
|
||||
with it. When running these tests with `yarn test:e2e`, you must have
|
||||
code-server running locally. In CI, this is taken care of for you.
|
||||
|
||||
## Structure
|
||||
|
||||
The `code-server` script serves as an HTTP API for login and starting a remote
|
||||
Code process.
|
||||
code-server essentially serves as an HTTP API for logging in 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).
|
||||
|
|
|
|||
149
docs/FAQ.md
149
docs/FAQ.md
|
|
@ -1,3 +1,4 @@
|
|||
<!-- prettier-ignore-start -->
|
||||
<!-- START doctoc generated TOC please keep comment here to allow auto update -->
|
||||
<!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE -->
|
||||
# FAQ
|
||||
|
|
@ -13,6 +14,7 @@
|
|||
- [How do I install an extension manually?](#how-do-i-install-an-extension-manually)
|
||||
- [How do I use my own extensions marketplace?](#how-do-i-use-my-own-extensions-marketplace)
|
||||
- [Where are extensions stored?](#where-are-extensions-stored)
|
||||
- [Where is VS Code configuration stored?](#where-is-vs-code-configuration-stored)
|
||||
- [How can I reuse my VS Code configuration?](#how-can-i-reuse-my-vs-code-configuration)
|
||||
- [How does code-server decide what workspace or folder to open?](#how-does-code-server-decide-what-workspace-or-folder-to-open)
|
||||
- [How do I access my Documents/Downloads/Desktop folders in code-server on macOS?](#how-do-i-access-my-documentsdownloadsdesktop-folders-in-code-server-on-macos)
|
||||
|
|
@ -25,14 +27,21 @@
|
|||
- [Is multi-tenancy possible?](#is-multi-tenancy-possible)
|
||||
- [Can I use Docker in a code-server container?](#can-i-use-docker-in-a-code-server-container)
|
||||
- [How do I disable telemetry?](#how-do-i-disable-telemetry)
|
||||
- [What's the difference between code-server and Coder?](#whats-the-difference-between-code-server-and-coder)
|
||||
- [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 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)
|
||||
- [What's the difference between code-server and VS Code web?](#whats-the-difference-between-code-server-and-vs-code-web)
|
||||
- [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)
|
||||
- [How do I hide the coder/coder promotion in Help: Getting Started?](#how-do-i-hide-the-codercoder-promotion-in-help-getting-started)
|
||||
- [How do I disable the proxy?](#how-do-i-disable-the-proxy)
|
||||
- [How do I disable file download?](#how-do-i-disable-file-download)
|
||||
- [Why do web views not work?](#why-do-web-views-not-work)
|
||||
|
||||
<!-- END doctoc generated TOC please keep comment here to allow auto update -->
|
||||
<!-- prettier-ignore-end -->
|
||||
|
||||
## Questions?
|
||||
|
||||
|
|
@ -83,6 +92,12 @@ app (PWA):
|
|||
1. Start the editor
|
||||
2. Click the **plus** icon in the URL toolbar to install the PWA
|
||||
|
||||
If you use Firefox, you can use the appropriate extension to install PWA.
|
||||
|
||||
1. Go to the installation [website](https://addons.mozilla.org/en-US/firefox/addon/pwas-for-firefox/) of the add-on
|
||||
2. Add the add-on to Firefox
|
||||
3. Follow the os-specific instructions on how to install the runtime counterpart
|
||||
|
||||
For other browsers, you'll have to remap keybindings for shortcuts to work.
|
||||
|
||||
## Why can't code-server use Microsoft's extension marketplace?
|
||||
|
|
@ -164,10 +179,10 @@ If you own a marketplace that implements the VS Code Extension Gallery API, you
|
|||
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 the legacy Coder extensions marketplace:
|
||||
For example:
|
||||
|
||||
```bash
|
||||
export EXTENSIONS_GALLERY='{"serviceUrl": "https://extensions.coder.com/api"}'
|
||||
export EXTENSIONS_GALLERY='{"serviceUrl": "https://my-extensions/api"}'
|
||||
```
|
||||
|
||||
Though you can technically use Microsoft's marketplace in this manner, we
|
||||
|
|
@ -180,10 +195,20 @@ docs](https://github.com/VSCodium/vscodium/blob/master/DOCS.md#extensions--marke
|
|||
|
||||
## Where are extensions stored?
|
||||
|
||||
Extensions are store, by default, to `~/.local/share/code-server/extensions`.
|
||||
Extensions are stored in `~/.local/share/code-server/extensions` by default.
|
||||
|
||||
If you set the `XDG_DATA_HOME` environment variable, the data directory will be
|
||||
`$XDG_DATA_HOME/code-server/extensions`. In general, we try to follow the XDG directory spec.
|
||||
On Linux and macOS if you set the `XDG_DATA_HOME` environment variable, the
|
||||
extensions directory will be `$XDG_DATA_HOME/code-server/extensions`. In
|
||||
general, we try to follow the XDG directory spec.
|
||||
|
||||
## Where is VS Code configuration stored?
|
||||
|
||||
VS Code configuration such as settings and keybindings are stored in
|
||||
`~/.local/share/code-server` by default.
|
||||
|
||||
On Linux and macOS if you set the `XDG_DATA_HOME` environment variable, the data
|
||||
directory will be `$XDG_DATA_HOME/code-server`. In general, we try to follow the
|
||||
XDG directory spec.
|
||||
|
||||
## How can I reuse my VS Code configuration?
|
||||
|
||||
|
|
@ -298,12 +323,8 @@ As long as there is an active browser connection, code-server touches
|
|||
`~/.local/share/code-server/heartbeat` once a minute.
|
||||
|
||||
If you want to shutdown code-server if there hasn't been an active connection
|
||||
after a predetermined amount of time, you can do so by checking continuously for
|
||||
the last modified time on the heartbeat file. If it is older than X minutes (or
|
||||
whatever amount of time you'd like), you can kill code-server.
|
||||
|
||||
Eventually, [#1636](https://github.com/coder/code-server/issues/1636) will make
|
||||
this process better.
|
||||
after a predetermined amount of time, you can use the --idle-timeout-seconds flag
|
||||
or set an `CODE_SERVER_IDLE_TIMEOUT_SECONDS` environment variable.
|
||||
|
||||
## How do I change the password?
|
||||
|
||||
|
|
@ -333,6 +354,12 @@ hashed-password: "$argon2i$v=19$m=4096,t=3,p=1$wST5QhBgk2lu1ih4DMuxvg$LS1alrVdIW
|
|||
|
||||
The `hashed-password` field takes precedence over `password`.
|
||||
|
||||
If you're using Docker Compose file, in order to make this work, you need to change all the single $ to $$. For example:
|
||||
|
||||
```yaml
|
||||
- HASHED_PASSWORD=$$argon2i$$v=19$$m=4096,t=3,p=1$$wST5QhBgk2lu1ih4DMuxvg$$LS1alrVdIWtvZHwnzCM1DUGg+5DTO3Dt1d5v9XtLws4
|
||||
```
|
||||
|
||||
## Is multi-tenancy possible?
|
||||
|
||||
If you want to run multiple code-servers on shared infrastructure, we recommend
|
||||
|
|
@ -353,12 +380,24 @@ mount into `/home/coder/myproject` from inside the `code-server` container. You
|
|||
need to make sure the Docker daemon's `/home/coder/myproject` is the same as the
|
||||
one mounted inside the `code-server` container, and the mount will work.
|
||||
|
||||
If you want Docker enabled when deploying on Kubernetes, look at the `values.yaml`
|
||||
file for the 3 fields: `extraVars`, `lifecycle.postStart`, and `extraContainers`.
|
||||
|
||||
## How do I disable telemetry?
|
||||
|
||||
Use the `--disable-telemetry` flag to disable telemetry.
|
||||
|
||||
> We use the data collected only to improve code-server.
|
||||
|
||||
## What's the difference between code-server and Coder?
|
||||
|
||||
code-server and Coder are both applications that can be installed on any
|
||||
machine. The main difference is who they serve. Out of the box, code-server is
|
||||
simply VS Code in the browser while Coder is a tool for provisioning remote
|
||||
development environments via Terraform.
|
||||
|
||||
code-server was built for individuals while Coder was built for teams. In Coder, you create Workspaces which can have applications like code-server. If you're looking for a team solution, you should reach for [Coder](https://github.com/coder/coder).
|
||||
|
||||
## What's the difference between code-server and Theia?
|
||||
|
||||
At a high level, code-server is a patched fork of VS Code that runs in the
|
||||
|
|
@ -376,19 +415,13 @@ Theia doesn't allow you to reuse your existing VS Code config.
|
|||
## What's the difference between code-server and OpenVSCode-Server?
|
||||
|
||||
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.
|
||||
browser. OpenVSCode-Server is a direct fork of VS Code with changes comitted
|
||||
directly while code-server pulls VS Code in via a submodule and makes changes
|
||||
via patch files.
|
||||
|
||||
However, OpenVSCode-Server is scoped at only making VS Code available in the web browser.
|
||||
code-server includes some other features:
|
||||
|
||||
- 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).
|
||||
However, OpenVSCode-Server is scoped at only making VS Code available as-is in
|
||||
the web browser. code-server contains additional changes to make the self-hosted
|
||||
experience better (see the next section for details).
|
||||
|
||||
## What's the difference between code-server and GitHub Codespaces?
|
||||
|
||||
|
|
@ -396,8 +429,32 @@ 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.
|
||||
On the other hand, code-server is self-hosted, free, open-source, and can be run
|
||||
on any machine with few limitations.
|
||||
|
||||
Specific changes include:
|
||||
|
||||
- Password authentication
|
||||
- The ability to host at sub-paths
|
||||
- Self-contained web views that do not call out to Microsoft's servers
|
||||
- The ability to use your own marketplace and collect your own telemetry
|
||||
- Built-in proxy for accessing ports on the remote machine integrated into
|
||||
VS Code's ports panel
|
||||
- Settings are stored on disk like desktop VS Code, instead of in browser
|
||||
storage (note that state is still stored in browser storage).
|
||||
- Wrapper process that spawns VS Code on-demand and has a separate CLI
|
||||
- Notification when updates are available
|
||||
- [Some other things](https://github.com/coder/code-server/tree/main/patches)
|
||||
|
||||
Some of these changes appear very unlikely to ever be adopted by Microsoft.
|
||||
Some may make their way upstream, further closing the gap, but at the moment it
|
||||
looks like there will always be some subtle differences.
|
||||
|
||||
## What's the difference between code-server and VS Code web?
|
||||
|
||||
VS Code web (which can be ran using `code serve-web`) has the same differences
|
||||
as the Codespaces section above. VS Code web can be a better choice if you need
|
||||
access to the official Microsoft marketplace.
|
||||
|
||||
## Does code-server have any security login validation?
|
||||
|
||||
|
|
@ -416,3 +473,45 @@ There are two ways to change the port on which code-server runs:
|
|||
|
||||
1. with an environment variable e.g. `PORT=3000 code-server`
|
||||
2. using the flag `--bind-addr` e.g. `code-server --bind-addr localhost:3000`
|
||||
|
||||
## How do I hide the coder/coder promotion in Help: Getting Started?
|
||||
|
||||
You can pass the flag `--disable-getting-started-override` to `code-server` or
|
||||
you can set the environment variable `CS_DISABLE_GETTING_STARTED_OVERRIDE=1` or
|
||||
`CS_DISABLE_GETTING_STARTED_OVERRIDE=true`.
|
||||
|
||||
## How do I disable the proxy?
|
||||
|
||||
You can pass the flag `--disable-proxy` to `code-server` or
|
||||
you can set the environment variable `CS_DISABLE_PROXY=1` or
|
||||
`CS_DISABLE_PROXY=true`.
|
||||
|
||||
Note, this option currently only disables the proxy routes to forwarded ports, including
|
||||
the domain and path proxy routes over HTTP and WebSocket; however, it does not
|
||||
disable the automatic port forwarding in the VS Code workbench itself. In other words,
|
||||
user will still see the Ports tab and notifications, but will not be able to actually
|
||||
use access the ports. It is recommended to set `remote.autoForwardPorts` to `false`
|
||||
when using the option.
|
||||
|
||||
## How do I disable file download?
|
||||
|
||||
You can pass the flag `--disable-file-downloads` to `code-server`
|
||||
|
||||
## Why do web views not work?
|
||||
|
||||
Web views rely on service workers, and service workers are only available in a
|
||||
secure context, so most likely the answer is that you are using an insecure
|
||||
context (for example an IP address).
|
||||
|
||||
If this happens, in the browser log you will see something like:
|
||||
|
||||
> Error loading webview: Error: Could not register service workers: SecurityError: Failed to register a ServiceWorker for scope with script: An SSL certificate error occurred when fetching the script..
|
||||
|
||||
To fix this, you must either:
|
||||
|
||||
- Access over localhost/127.0.0.1 which is always considered secure.
|
||||
- Use a domain with a real certificate (for example with Let's Encrypt).
|
||||
- Use a trusted self-signed certificate with [mkcert](https://mkcert.dev) (or
|
||||
create and trust a certificate manually).
|
||||
- Disable security if your browser allows it. For example, in Chromium see
|
||||
`chrome://flags/#unsafely-treat-insecure-origin-as-secure`
|
||||
|
|
|
|||
|
|
@ -1,193 +1,57 @@
|
|||
<!-- prettier-ignore-start -->
|
||||
<!-- START doctoc generated TOC please keep comment here to allow auto update -->
|
||||
<!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE -->
|
||||
# Maintaining
|
||||
|
||||
- [Team](#team)
|
||||
- [Onboarding](#onboarding)
|
||||
- [Offboarding](#offboarding)
|
||||
- [Workflow](#workflow)
|
||||
- [Milestones](#milestones)
|
||||
- [Triage](#triage)
|
||||
- [Project boards](#project-boards)
|
||||
- [Versioning](#versioning)
|
||||
- [Pull requests](#pull-requests)
|
||||
- [Merge strategies](#merge-strategies)
|
||||
- [Changelog](#changelog)
|
||||
- [Releases](#releases)
|
||||
- [Publishing a release](#publishing-a-release)
|
||||
- [Releasing](#releasing)
|
||||
- [Release Candidates](#release-candidates)
|
||||
- [AUR](#aur)
|
||||
- [Docker](#docker)
|
||||
- [Homebrew](#homebrew)
|
||||
- [nixpkgs](#nixpkgs)
|
||||
- [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 -->
|
||||
<!-- prettier-ignore-end -->
|
||||
|
||||
This document is meant to serve current and future maintainers of code-server,
|
||||
as well as share our workflow for maintaining the project.
|
||||
We keep code-server up to date with VS Code releases (there are usually two or
|
||||
three a month) but we are not generally actively developing code-server aside
|
||||
from fixing regressions.
|
||||
|
||||
## Team
|
||||
Most of the work is keeping on top of issues and discussions.
|
||||
|
||||
Current maintainers:
|
||||
## Releasing
|
||||
|
||||
- @code-asher
|
||||
- @jsjoeio
|
||||
1. Check that the changelog lists all the important changes.
|
||||
2. Make sure the changelog entry lists the current version of VS Code.
|
||||
3. Update the changelog with the release date.
|
||||
4. Go to GitHub Actions > Draft release > Run workflow on the commit you want to
|
||||
release. Make sure CI has finished the build workflow on that commit or this
|
||||
will fail. For the version we match VS Code's minor and patch version. The
|
||||
patch number may become temporarily out of sync if we need to put out a
|
||||
patch, but if we make our own minor change then we will not release it until
|
||||
the next minor VS Code release.
|
||||
5. CI will automatically grab the build artifact on that commit (which is why CI
|
||||
has to have completed), inject the provided version into the `package.json`,
|
||||
put together platform-specific packages, and upload those packages to a draft
|
||||
release.
|
||||
6. Update the resulting draft release with the changelog contents.
|
||||
7. Publish the draft release after validating it.
|
||||
8. Bump the Helm chart version once the Docker images have published.
|
||||
|
||||
Occasionally, other Coder employees may step in time to time to assist with code-server.
|
||||
#### Release Candidates
|
||||
|
||||
### Onboarding
|
||||
We prefer to do release candidates so the community can test things before a
|
||||
full-blown release. To do this follow the same steps as above but:
|
||||
|
||||
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
|
||||
|
||||
The workflow used by code-server maintainers aims to be easy to understood by
|
||||
the community and easy enough for new maintainers to jump in and start
|
||||
contributing on day one.
|
||||
|
||||
### Milestones
|
||||
|
||||
We operate mainly using
|
||||
[milestones](https://github.com/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:
|
||||
|
||||
- "Backlog" -> Work not yet planned for a specific release.
|
||||
- "On Deck" -> Work under consideration for upcoming milestones.
|
||||
- "Backlog Candidates" -> Work that is not yet accepted for the backlog. We wait
|
||||
for the community to weigh in.
|
||||
- "<0.0.0>" -> Work to be done for a specific version.
|
||||
|
||||
With this flow, any un-assigned issues are essentially in triage state. Once
|
||||
triaged, issues are either "Backlog" or "Backlog Candidates". They will
|
||||
eventually move to "On Deck" (or be closed). Lastly, they will end up on a
|
||||
version milestone where they will be worked on.
|
||||
|
||||
### Triage
|
||||
|
||||
We use the following process for triaging GitHub issues:
|
||||
|
||||
1. Create an issue
|
||||
1. Add appropriate labels to the issue (including "needs-investigation" if we
|
||||
should look into it further)
|
||||
1. Add the issue to a milestone
|
||||
1. If it should be fixed soon, add to version milestone or "On Deck"
|
||||
2. If not urgent, add to "Backlog"
|
||||
3. Otherwise, add to "Backlog Candidate" for future consideration
|
||||
|
||||
### Project boards
|
||||
|
||||
We use project boards for projects or goals that span multiple milestones.
|
||||
|
||||
Think of this as a place to put miscellaneous things (like testing, clean up
|
||||
stuff, etc). As a maintainer, random tasks may come up here and there. The
|
||||
project boards give you places to add temporary notes before opening a new
|
||||
issue. Given that our release milestones function off of issues, we believe
|
||||
tasks should have dedicated issues.
|
||||
|
||||
Project boards also give us a way to separate the issue triage from
|
||||
bigger-picture, long-term work.
|
||||
|
||||
## Versioning
|
||||
|
||||
`<major.minor.patch>`
|
||||
|
||||
The code-server project follows traditional [semantic
|
||||
versioning](https://semver.org/), with the objective of minimizing major changes
|
||||
that break backward compatibility. We increment the patch level for all
|
||||
releases, except when the upstream Visual Studio Code project increments its
|
||||
minor version or we change the plugin API in a backward-compatible manner. In
|
||||
those cases, we increment the minor version rather than the patch level.
|
||||
|
||||
## Pull requests
|
||||
|
||||
Ideally, every PR should fix an issue. If it doesn't, make sure it's associated
|
||||
with a version milestone.
|
||||
|
||||
If a PR does fix an issue, don't add it to the version milestone. Otherwise, the
|
||||
version milestone will have duplicate information: the issue and the PR fixing
|
||||
the issue.
|
||||
|
||||
### Merge strategies
|
||||
|
||||
For most things, we recommend the **squash and merge** strategy. There
|
||||
may be times where **creating a merge commit** makes sense as well. Use your
|
||||
best judgment. If you're unsure, you can always discuss in the PR with the team.
|
||||
|
||||
### Changelog
|
||||
|
||||
To save time when creating a new release for code-server, we keep a running
|
||||
changelog at `CHANGELOG.md`.
|
||||
|
||||
If either the author or reviewer of a PR believes the change should be mentioned
|
||||
in the changelog, then it should be added.
|
||||
|
||||
If there is not a **Next Version** when you modify `CHANGELOG.md`, please add it
|
||||
using the template you see near the top of the changelog.
|
||||
|
||||
When writing your changelog item, ask yourself:
|
||||
|
||||
1. How do these changes affect code-server users?
|
||||
2. What actions do they need to take (if any)?
|
||||
|
||||
If you need inspiration, we suggest looking at the [Emacs
|
||||
changelog](https://github.com/emacs-mirror/emacs/blob/master/etc/NEWS).
|
||||
|
||||
## Releases
|
||||
|
||||
With each release, we rotate the role of release manager to ensure every
|
||||
maintainer goes through the process. This helps us keep documentation up-to-date
|
||||
and encourages us to continually review and improve the flow.
|
||||
|
||||
If you're the current release manager, follow these steps:
|
||||
|
||||
1. Create a [release issue](../.github/ISSUE_TEMPLATE/release.md)
|
||||
1. Fill out checklist
|
||||
1. Publish the release
|
||||
1. After release is published, close release milestone
|
||||
|
||||
### Publishing a release
|
||||
|
||||
1. Create a new branch called `release/v0.0.0` (replace 0s with actual version aka v4.5.0)
|
||||
1. If you don't do this, the `npm-brew` GitHub workflow will fail. It looks for the release artifacts under the branch pattern.
|
||||
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. 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: release/v3.9.0`
|
||||
1. Wait for the `npm-package`, `release-packages` and `release-images` artifacts
|
||||
to build.
|
||||
1. Run `yarn release:github-assets` to download the `release-packages` artifact.
|
||||
They will upload them to the draft release.
|
||||
1. Run some basic sanity tests on one of the released packages (pay special
|
||||
attention to making sure the terminal works).
|
||||
1. Publish the release and merge the PR. CI will automatically grab the
|
||||
artifacts, publish the NPM package from `npm-package`, and publish the Docker
|
||||
Hub image from `release-images`.
|
||||
1. Update the AUR package. Instructions for updating the AUR package are at
|
||||
[coder/code-server-aur](https://github.com/coder/code-server-aur).
|
||||
1. Wait for the npm package to be published.
|
||||
1. Add a `-rc.<number>` suffix to the version.
|
||||
2. When you publish the release select "pre-release". CI will not automatically
|
||||
publish pre-releases.
|
||||
3. Do not update the chart version or merge in the changelog until the final
|
||||
release.
|
||||
|
||||
#### AUR
|
||||
|
||||
|
|
@ -195,7 +59,7 @@ We publish to AUR as a package [here](https://aur.archlinux.org/packages/code-se
|
|||
|
||||
#### 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.
|
||||
We publish code-server as a Docker image [here](https://hub.docker.com/r/codercom/code-server), tagging it both with the version and latest.
|
||||
|
||||
This is currently automated with the release process.
|
||||
|
||||
|
|
@ -210,37 +74,44 @@ This is currently automated with the release process (but may fail occasionally)
|
|||
brew bump-formula-pr --version="${VERSION}" code-server --no-browse --no-audit
|
||||
```
|
||||
|
||||
#### nixpkgs
|
||||
|
||||
We publish code-server in nixpkgs but it must be updated manually.
|
||||
|
||||
#### 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.
|
||||
- run `npm run 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.
|
||||
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.
|
||||
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/coder/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,11 +1,12 @@
|
|||
# code-server
|
||||
|
||||
[](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)
|
||||
[](https://github.com/coder/code-server/discussions) [](https://coder.com/community) [](https://twitter.com/coderhq) [](https://discord.com/invite/coder) [](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.
|
||||
|
||||

|
||||

|
||||

|
||||
|
||||
## Highlights
|
||||
|
||||
|
|
@ -16,14 +17,14 @@ access it in the browser.
|
|||
|
||||
## Requirements
|
||||
|
||||
See [requirements](requirements.md) for minimum specs, as well as instructions
|
||||
See [requirements](https://coder.com/docs/code-server/latest/requirements) for minimum specs, as well as instructions
|
||||
on how to set up a Google VM on which you can install code-server.
|
||||
|
||||
**TL;DR:** Linux machine with WebSockets enabled, 1 GB RAM, and 2 vCPUs
|
||||
|
||||
## Getting started
|
||||
|
||||
There are four ways to get started:
|
||||
There are five ways to get started:
|
||||
|
||||
1. Using the [install
|
||||
script](https://github.com/coder/code-server/blob/main/install.sh), which
|
||||
|
|
@ -34,6 +35,9 @@ There are four ways to get started:
|
|||
3. Deploy code-server to your team with [coder/coder](https://cdr.co/coder-github)
|
||||
4. Using our one-click buttons and guides to [deploy code-server to a cloud
|
||||
provider](https://github.com/coder/deploy-code-server) ⚡
|
||||
5. Using the [code-server feature for
|
||||
devcontainers](https://github.com/coder/devcontainer-features/blob/main/src/code-server/README.md),
|
||||
if you already use devcontainers in your project.
|
||||
|
||||
If you use the install script, you can preview what occurs during the install
|
||||
process:
|
||||
|
|
@ -72,7 +76,7 @@ details.
|
|||
Interested in [working at Coder](https://coder.com/careers)? Check out [our open
|
||||
positions](https://coder.com/careers#openings)!
|
||||
|
||||
## For Organizations
|
||||
## For Teams
|
||||
|
||||
Want remote development for your organization or enterprise? Visit [our
|
||||
website](https://coder.com) to learn more about Coder.
|
||||
We develop [coder/coder](https://cdr.co/coder-github) to help teams to
|
||||
adopt remote development.
|
||||
|
|
|
|||
|
|
@ -16,11 +16,9 @@ We use the following tools to help us stay on top of vulnerability mitigation.
|
|||
- [trivy](https://github.com/aquasecurity/trivy)
|
||||
- Comprehensive vulnerability scanner that runs on PRs into the default
|
||||
branch and scans both our container image and repository code (see
|
||||
`trivy-scan-repo` and `trivy-scan-image` jobs in `ci.yaml`)
|
||||
- [`audit-ci`](https://github.com/IBM/audit-ci)
|
||||
- Audits npm and Yarn dependencies in CI (see `Audit for vulnerabilities` step
|
||||
in `ci.yaml`) on PRs into the default branch and fails CI if moderate or
|
||||
higher vulnerabilities (see the `audit.sh` script) are present.
|
||||
`trivy-scan-repo` and `trivy-scan-image` jobs in `build.yaml`)
|
||||
- `npm audit`
|
||||
- Audits NPM dependencies.
|
||||
|
||||
## Supported Versions
|
||||
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@
|
|||
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`
|
||||
4. Install Node.js and `curl` using `sudo apt install nodejs npm curl -y`
|
||||
5. Install `nvm`:
|
||||
|
||||
```shell
|
||||
|
|
@ -11,13 +11,21 @@ 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:
|
||||
7. Install and use Node.js 22:
|
||||
|
||||
```shell
|
||||
nvm install 16
|
||||
nvm use 16
|
||||
nvm install 22
|
||||
nvm use 22
|
||||
```
|
||||
|
||||
8. Install code-server globally on device with: `npm i -g code-server`
|
||||
8. Install code-server globally on device with: `npm install --global code-server`
|
||||
9. Run code-server with `code-server`
|
||||
10. Access on localhost:8080 in your browser
|
||||
|
||||
# Running code-server using Nix-on-Droid
|
||||
|
||||
1. Install Nix-on-Droid from [F-Droid](https://f-droid.org/packages/com.termux.nix/)
|
||||
2. Start app
|
||||
3. Spawn a shell with code-server by running `nix-shell -p code-server`
|
||||
4. Run code-server with `code-server`
|
||||
5. Access on localhost:8080 in your browser
|
||||
|
|
|
|||
BIN
docs/assets/screenshot-1.png
Normal file
BIN
docs/assets/screenshot-1.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 114 KiB |
BIN
docs/assets/screenshot-2.png
Normal file
BIN
docs/assets/screenshot-2.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 267 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 357 KiB |
48
docs/coder.md
Normal file
48
docs/coder.md
Normal file
|
|
@ -0,0 +1,48 @@
|
|||
# Coder
|
||||
|
||||
To install and run code-server in a Coder workspace, we suggest using the `install.sh`
|
||||
script in your template like so:
|
||||
|
||||
```terraform
|
||||
resource "coder_agent" "dev" {
|
||||
arch = "amd64"
|
||||
os = "linux"
|
||||
startup_script = <<EOF
|
||||
#!/bin/sh
|
||||
set -x
|
||||
# install and start code-server
|
||||
curl -fsSL https://code-server.dev/install.sh | sh -s -- --version 4.8.3
|
||||
code-server --auth none --port 13337 &
|
||||
EOF
|
||||
}
|
||||
|
||||
resource "coder_app" "code-server" {
|
||||
agent_id = coder_agent.dev.id
|
||||
slug = "code-server"
|
||||
display_name = "code-server"
|
||||
url = "http://localhost:13337/"
|
||||
icon = "/icon/code.svg"
|
||||
subdomain = false
|
||||
share = "owner"
|
||||
|
||||
healthcheck {
|
||||
url = "http://localhost:13337/healthz"
|
||||
interval = 3
|
||||
threshold = 10
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
Or use our official [`code-server`](https://registry.coder.com/modules/code-server) module from the Coder [module registry](htpps://registry.coder.com/modules):
|
||||
|
||||
```terraform
|
||||
module "code-server" {
|
||||
source = "registry.coder.com/modules/code-server/coder"
|
||||
version = "1.0.5"
|
||||
agent_id = coder_agent.example.id
|
||||
extensions = ["dracula-theme.theme-dracula", "ms-azuretools.vscode-docker"]
|
||||
}
|
||||
```
|
||||
|
||||
If you run into issues, ask for help on the `coder/coder` [Discussions
|
||||
here](https://github.com/coder/coder/discussions).
|
||||
|
|
@ -60,6 +60,6 @@ As `code-server` is based on VS Code, you can follow the steps described on Duck
|
|||
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/v4.6.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/latest/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.
|
||||
|
|
|
|||
245
docs/guide.md
245
docs/guide.md
|
|
@ -1,3 +1,4 @@
|
|||
<!-- prettier-ignore-start -->
|
||||
<!-- 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
|
||||
|
|
@ -13,15 +14,20 @@
|
|||
- [Accessing web services](#accessing-web-services)
|
||||
- [Using a subdomain](#using-a-subdomain)
|
||||
- [Using a subpath](#using-a-subpath)
|
||||
- [Using your own proxy](#using-your-own-proxy)
|
||||
- [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)
|
||||
- [Proxying to an Angular app](#proxying-to-an-angular-app)
|
||||
- [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)
|
||||
- [Proxying to a Svelte app](#proxying-to-a-svelte-app)
|
||||
- [Prefixing `/absproxy/<port>` with a path](#prefixing-absproxyport-with-a-path)
|
||||
- [Preflight requests](#preflight-requests)
|
||||
- [Internationalization and customization](#internationalization-and-customization)
|
||||
- [Available keys and placeholders](#available-keys-and-placeholders)
|
||||
- [Legacy flag](#legacy-flag)
|
||||
|
||||
<!-- END doctoc generated TOC please keep comment here to allow auto update -->
|
||||
<!-- prettier-ignore-end -->
|
||||
|
||||
This article will walk you through exposing code-server securely once you've
|
||||
completed the [installation process](install.md).
|
||||
|
|
@ -89,11 +95,10 @@ we recommend using another method, such as [Let's Encrypt](#let-encrypt) instead
|
|||
using [mutagen](https://mutagen.io/documentation/introduction/installation)
|
||||
to do so. Once you've installed mutagen, you can port forward as follows:
|
||||
|
||||
```console
|
||||
```shell
|
||||
# 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
|
||||
```
|
||||
|
||||
|
|
@ -118,27 +123,27 @@ 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/HTTPS traffic.
|
||||
|
||||
1. You'll need a domain name (if you don't have one, you can purchase one from
|
||||
2. 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
|
||||
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):
|
||||
3. 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/gpg.key' | sudo gpg --dearmor -o /usr/share/keyrings/caddy-stable-archive-keyring.gpg
|
||||
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
|
||||
```
|
||||
```console
|
||||
sudo apt install -y debian-keyring debian-archive-keyring apt-transport-https
|
||||
curl -1sLf 'https://dl.cloudsmith.io/public/caddy/stable/gpg.key' | sudo gpg --dearmor -o /usr/share/keyrings/caddy-stable-archive-keyring.gpg
|
||||
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
|
||||
```
|
||||
|
||||
1. Replace `/etc/caddy/Caddyfile` using `sudo` so that the file looks like this:
|
||||
4. Replace `/etc/caddy/Caddyfile` using `sudo` so that the file looks like this:
|
||||
|
||||
```text
|
||||
mydomain.com
|
||||
|
||||
reverse_proxy 127.0.0.1:8080
|
||||
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:
|
||||
|
|
@ -152,7 +157,7 @@ sudo apt install caddy
|
|||
|
||||
Remember to replace `mydomain.com` with your domain name!
|
||||
|
||||
1. Reload Caddy:
|
||||
5. Reload Caddy:
|
||||
|
||||
```console
|
||||
sudo systemctl reload caddy
|
||||
|
|
@ -163,21 +168,22 @@ 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/HTTPS 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
|
||||
2. 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
|
||||
choice). Once you have a domain name, add an A record to your domain that contains your
|
||||
instance's IP address.
|
||||
|
||||
1. Install NGINX:
|
||||
3. 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
|
||||
4. Update `/etc/nginx/sites-available/code-server` using sudo with the following
|
||||
configuration:
|
||||
|
||||
```text
|
||||
|
|
@ -188,7 +194,7 @@ At this point, you should be able to access code-server via
|
|||
|
||||
location / {
|
||||
proxy_pass http://localhost:8080/;
|
||||
proxy_set_header Host $host;
|
||||
proxy_set_header Host $http_host;
|
||||
proxy_set_header Upgrade $http_upgrade;
|
||||
proxy_set_header Connection upgrade;
|
||||
proxy_set_header Accept-Encoding gzip;
|
||||
|
|
@ -198,13 +204,11 @@ At this point, you should be able to access code-server via
|
|||
|
||||
Be sure to replace `mydomain.com` with your domain name!
|
||||
|
||||
1. Enable the config:
|
||||
|
||||
5. 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
|
||||
|
|
@ -270,9 +274,9 @@ should see OSSStatus: 9836 in the browser console.
|
|||
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)
|
||||
- [Pomerium](https://www.pomerium.com/docs/guides/code-server.html)
|
||||
- [oauth2-proxy](https://oauth2-proxy.github.io/oauth2-proxy/)
|
||||
- [Cloudflare Access](https://www.cloudflare.com/zero-trust/products/access/)
|
||||
|
||||
## HTTPS and self-signed certificates
|
||||
|
||||
|
|
@ -291,7 +295,9 @@ 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.
|
||||
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
|
||||
|
||||
|
|
@ -315,12 +321,32 @@ To set your domain, start code-server with the `--proxy-domain` flag:
|
|||
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.
|
||||
For instance, if you have code-server exposed on `domain.tld` and a Python
|
||||
server running on port 8080 of the same machine code-server is running on, you
|
||||
could run code-server with `--proxy-domain domain.tld` and access the Python
|
||||
server via `8080.domain.tld`.
|
||||
|
||||
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>/`.
|
||||
Simply browse to `/proxy/<port>/`. For instance, if you have code-server
|
||||
exposed on `domain.tld` and a Python server running on port 8080 of the same
|
||||
machine code-server is running on, you could access the Python server via
|
||||
`domain.tld/proxy/8000`.
|
||||
|
||||
### Using your own proxy
|
||||
|
||||
You can make extensions and the ports panel use your own proxy by setting
|
||||
`VSCODE_PROXY_URI`. For example if you set
|
||||
`VSCODE_PROXY_URI=https://{{port}}.kyle.dev` when an application is detected
|
||||
running on port 3000 of the same machine code-server is running on the ports
|
||||
panel will create a link to https://3000.kyle.dev instead of pointing to the
|
||||
built-in subpath-based proxy.
|
||||
|
||||
Note: relative paths are also supported i.e.
|
||||
`VSCODE_PROXY_URI=./proxy/{{port}}`
|
||||
|
||||
### Stripping `/proxy/<port>` from the request path
|
||||
|
||||
|
|
@ -357,14 +383,16 @@ PUBLIC_URL=/absproxy/3000 \
|
|||
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!
|
||||
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.
|
||||
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):
|
||||
|
|
@ -385,99 +413,100 @@ Read more about `publicPath` in the [Vue.js docs](https://cli.vuejs.org/config/#
|
|||
|
||||
### Proxying to an Angular app
|
||||
|
||||
In order to use code-server's built-in proxy with Angular, you need to make the following changes in your app:
|
||||
In order to use code-server's built-in proxy with Angular, you need to make the
|
||||
following changes in your app:
|
||||
|
||||
1. use `<base href="./.">` in `src/index.html`
|
||||
2. add `--serve-path /absproxy/4200` to `ng serve` in your `package.json`
|
||||
|
||||
For additional context, see [this GitHub Discussion](https://github.com/coder/code-server/discussions/5439#discussioncomment-3371983).
|
||||
|
||||
## SSH into code-server on VS Code
|
||||
### Proxying to a Svelte app
|
||||
|
||||
[](https://ohmyz.sh/) [](https://img.shields.io/badge/Terminal-2E2E2E?style=for-the-badge&logo=Windows+Terminal&logoColor=ffffff) [](vscode:extension/ms-vscode-remote.remote-ssh)
|
||||
In order to use code-server's built-in proxy with Svelte, you need to make the
|
||||
following changes in your app:
|
||||
|
||||
Follow these steps where code-server is running:
|
||||
1. Add `svelte.config.js` if you don't already have one
|
||||
2. Update the values to match this (you can use any free port):
|
||||
|
||||
1. Install `openssh-server`, `wget`, and `unzip`.
|
||||
|
||||
```bash
|
||||
# example for Debian and Ubuntu operating systems
|
||||
sudo apt update
|
||||
sudo apt install wget unzip openssh-server
|
||||
```js
|
||||
const config = {
|
||||
kit: {
|
||||
paths: {
|
||||
base: "/absproxy/5173",
|
||||
},
|
||||
},
|
||||
}
|
||||
```
|
||||
|
||||
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),
|
||||
3. Access app at `<code-server-root>/absproxy/5173/` e.g. `http://localhost:8080/absproxy/5173/
|
||||
|
||||
```bash
|
||||
sudo service ssh start
|
||||
sudo passwd {user} # replace user with your code-server user
|
||||
For additional context, see [this Github Issue](https://github.com/sveltejs/kit/issues/2958)
|
||||
|
||||
### Prefixing `/absproxy/<port>` with a path
|
||||
|
||||
This is a case where you need to serve an application via `absproxy` as
|
||||
explained above while serving code-server itself from a path other than the root
|
||||
in your domain.
|
||||
|
||||
For example: `http://my-code-server.com/user/123/workspace/my-app`. To achieve
|
||||
this result:
|
||||
|
||||
1. Start code-server with the switch `--abs-proxy-base-path=/user/123/workspace`
|
||||
2. Follow one of the instructions above for your framework.
|
||||
|
||||
### Preflight requests
|
||||
|
||||
By default, if you have auth enabled, code-server will authenticate all proxied
|
||||
requests including preflight requests. This can cause issues because preflight
|
||||
requests do not typically include credentials. To allow all preflight requests
|
||||
through the proxy without authentication, use `--skip-auth-preflight`.
|
||||
|
||||
## Internationalization and customization
|
||||
|
||||
code-server allows you to provide a JSON file to configure certain strings. This
|
||||
can be used for both internationalization and customization.
|
||||
|
||||
Create a JSON file with your custom strings:
|
||||
|
||||
```json
|
||||
{
|
||||
"WELCOME": "Welcome to {{app}}",
|
||||
"LOGIN_TITLE": "{{app}} Access Portal",
|
||||
"LOGIN_BELOW": "Please log in to continue",
|
||||
"PASSWORD_PLACEHOLDER": "Enter Password"
|
||||
}
|
||||
```
|
||||
|
||||
### Option 1: cloudflared tunnel
|
||||
|
||||
[](https://github.com/cloudflare/cloudflared)
|
||||
|
||||
1. Install [cloudflared](https://github.com/cloudflare/cloudflared#installing-cloudflared) on your local computer
|
||||
2. Then go to `~/.ssh/config` and add the following:
|
||||
Then reference the file:
|
||||
|
||||
```shell
|
||||
Host *.trycloudflare.com
|
||||
HostName %h
|
||||
User root
|
||||
Port 22
|
||||
ProxyCommand "cloudflared location" access ssh --hostname %h
|
||||
code-server --i18n /path/to/custom-strings.json
|
||||
```
|
||||
|
||||
3. Run `cloudflared tunnel --url ssh://localhost:22` on the remote server
|
||||
Or this can be done in the config file:
|
||||
|
||||
4. Finally on VS Code or any IDE that supports SSH, run `ssh coder@https://your-link.trycloudflare.com` or `ssh coder@your-link.trycloudflare.com`
|
||||
|
||||
### Option 2: ngrok tunnel
|
||||
|
||||
[](https://ngrok.com/)
|
||||
|
||||
1. Make a new account for ngrok [here](https://dashboard.ngrok.com/login)
|
||||
|
||||
2. Now, get the ngrok binary with `wget` and unzip it with `unzip`:
|
||||
|
||||
```bash
|
||||
wget "https://bin.equinox.io/c/4VmDzA7iaHb/ngrok-stable-linux-amd64.zip"
|
||||
unzip "ngrok-stable-linux-amd64.zip"
|
||||
```yaml
|
||||
i18n: /path/to/custom-strings.json
|
||||
```
|
||||
|
||||
5. Then, go to [dashboard.ngrok.com](https://dashboard.ngrok.com) and go to the `Your Authtoken` section.
|
||||
6. Copy the Authtoken shown there.
|
||||
7. Now, go to the folder where you unzipped ngrok and store the Authtoken from the ngrok Dashboard.
|
||||
You can combine this with the `--locale` flag to configure language support for
|
||||
both code-server and VS Code in cases where code-server has no support but VS
|
||||
Code does. If you are using this for internationalization, please consider
|
||||
sending us a pull request to contribute it to `src/node/i18n/locales`.
|
||||
|
||||
```bash
|
||||
./ngrok authtoken YOUR_AUTHTOKEN # replace YOUR_AUTHTOKEN with the ngrok authtoken.
|
||||
```
|
||||
### Available keys and placeholders
|
||||
|
||||
8. Now, forward port 22, which is the SSH port with this command:
|
||||
Refer to [../src/node/i18n/locales/en.json](../src/node/i18n/locales/en.json)
|
||||
for a full list of the available keys for translations. Note that the only
|
||||
placeholders supported for each key are the ones used in the default string.
|
||||
|
||||
```bash
|
||||
./ngrok tcp 22
|
||||
```
|
||||
The `--app-name` flag controls the `{{app}}` placeholder in templates. If you
|
||||
want to change the name, you can either:
|
||||
|
||||
Now, you get a screen in the terminal like this:
|
||||
1. Set `--app-name` (potentially alongside `--i18n`)
|
||||
2. Use `--i18n` and hardcode the name in your strings
|
||||
|
||||
```console
|
||||
ngrok by @inconshreveable(Ctrl+C to quit)
|
||||
### Legacy flag
|
||||
|
||||
Session Status online
|
||||
Account {Your name} (Plan: Free)
|
||||
Version 2.3.40
|
||||
Region United States (us)
|
||||
Web Interface http://127.0.0.1:4040
|
||||
Forwarding tcp://0.tcp.ngrok.io:19028 -> localhost:22
|
||||
```
|
||||
|
||||
In this case, copy the forwarded link `0.tcp.ngrok.io` and remember the port number `19028`. Type this on your local Visual Studio Code:
|
||||
|
||||
```bash
|
||||
ssh user@0.tcp.ngrok.io -p 19028
|
||||
```
|
||||
|
||||
The port redirects you to the default SSH port 22, and you can then successfully connect to code-server by entering the password you set for the user.
|
||||
|
||||
Note: the port and the url provided by ngrok will change each time you run it so modify as needed.
|
||||
The `--welcome-text` flag is now deprecated. Use the `WELCOME` key instead.
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
# 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-4.6.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.8.0-informational?style=flat-square)
|
||||
|
||||
[code-server](https://github.com/coder/code-server) code-server is VS Code running
|
||||
on a remote server, accessible through the browser.
|
||||
|
|
@ -73,7 +73,7 @@ and their default values.
|
|||
| hostnameOverride | string | `""` |
|
||||
| image.pullPolicy | string | `"Always"` |
|
||||
| image.repository | string | `"codercom/code-server"` |
|
||||
| image.tag | string | `"4.6.0"` |
|
||||
| image.tag | string | `"4.8.0"` |
|
||||
| imagePullSecrets | list | `[]` |
|
||||
| ingress.enabled | bool | `false` |
|
||||
| nameOverride | string | `""` |
|
||||
|
|
|
|||
|
|
@ -1,10 +1,11 @@
|
|||
<!-- prettier-ignore-start -->
|
||||
<!-- START doctoc generated TOC please keep comment here to allow auto update -->
|
||||
<!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE -->
|
||||
# Install
|
||||
|
||||
- [install.sh](#installsh)
|
||||
- [Detection reference](#detection-reference)
|
||||
- [yarn, npm](#yarn-npm)
|
||||
- [npm](#npm)
|
||||
- [Standalone releases](#standalone-releases)
|
||||
- [Debian, Ubuntu](#debian-ubuntu)
|
||||
- [Fedora, CentOS, RHEL, SUSE](#fedora-centos-rhel-suse)
|
||||
|
|
@ -20,10 +21,11 @@
|
|||
- [Uninstall](#uninstall)
|
||||
- [install.sh](#installsh-1)
|
||||
- [Homebrew](#homebrew)
|
||||
- [yarn, npm](#yarn-npm-1)
|
||||
- [npm](#npm-1)
|
||||
- [Debian, Ubuntu](#debian-ubuntu-1)
|
||||
|
||||
<!-- END doctoc generated TOC please keep comment here to allow auto update -->
|
||||
<!-- prettier-ignore-end -->
|
||||
|
||||
This document demonstrates how to install `code-server` on various distros and
|
||||
operating systems.
|
||||
|
|
@ -57,6 +59,7 @@ following flags:
|
|||
- `--prefix=/usr/local`: install a standalone release archive system-wide.
|
||||
- `--version=X.X.X`: install version `X.X.X` instead of latest version.
|
||||
- `--help`: see usage docs.
|
||||
- `--edge`: install the latest edge version (i.e. pre-release)
|
||||
|
||||
When done, the install script prints out instructions for running and starting
|
||||
code-server.
|
||||
|
|
@ -79,38 +82,34 @@ _exact_ same commands presented in the rest of this document.
|
|||
- For Arch Linux, code-server will install the AUR package.
|
||||
- For any unrecognized Linux operating system, code-server will install the
|
||||
latest standalone release into `~/.local`.
|
||||
|
||||
- Ensure that you add `~/.local/bin` to your `$PATH` to run code-server.
|
||||
|
||||
- For macOS, code-server will install the Homebrew package (if you don't have
|
||||
Homebrew installed, code-server will install the latest standalone release
|
||||
into `~/.local`).
|
||||
|
||||
- Ensure that you add `~/.local/bin` to your `$PATH` to run code-server.
|
||||
|
||||
- For FreeBSD, code-server will install the [npm package](#yarn-npm) with `yarn`
|
||||
or `npm`.
|
||||
- For FreeBSD, code-server will install the [npm package](#npm) with `npm`
|
||||
|
||||
- If you're installing code-server onto architecture with no releases,
|
||||
code-server will install the [npm package](#yarn-npm) with `yarn` or `npm`
|
||||
code-server will install the [npm package](#npm) with `npm`
|
||||
- We currently offer releases for amd64 and arm64.
|
||||
- The [npm package](#yarn-npm) builds the native modules on post-install.
|
||||
- The [npm package](#npm) builds the native modules on post-install.
|
||||
|
||||
## yarn, npm
|
||||
## npm
|
||||
|
||||
We recommend installing with `yarn` or `npm` when:
|
||||
We recommend installing with `npm` when:
|
||||
|
||||
1. You aren't using a machine with `amd64` or `arm64`.
|
||||
1. You are installing code-server on Windows
|
||||
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
|
||||
2. You are installing code-server on Windows.
|
||||
3. You're on Linux with `glibc` < v2.28 or `glibcxx` < v3.4.21.
|
||||
4. You're running Alpine Linux or are using a non-glibc libc. See
|
||||
[#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.
|
||||
Installing code-server with `npm` builds native modules on install.
|
||||
|
||||
This process requires C dependencies; see our guide on [installing with yarn and npm][./npm.md](./npm.md) for more information.
|
||||
This process requires C dependencies; see our guide on [installing with npm](./npm.md) for more information.
|
||||
|
||||
## Standalone releases
|
||||
|
||||
|
|
@ -118,11 +117,11 @@ We publish self-contained `.tar.gz` archives for every release on
|
|||
[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
|
||||
We create the standalone releases using the [npm package](#npm), and we
|
||||
then create the remaining releases using the standalone version.
|
||||
|
||||
The only requirement to use the standalone release is `glibc` >= 2.17 and
|
||||
`glibcxx` >= v3.4.18 on Linux (for macOS, there is no minimum system
|
||||
The only requirement to use the standalone release is `glibc` >= 2.28 and
|
||||
`glibcxx` >= v3.4.21 on Linux (for macOS, there is no minimum system
|
||||
requirement).
|
||||
|
||||
To use a standalone release:
|
||||
|
|
@ -152,11 +151,11 @@ code-server
|
|||
## Debian, Ubuntu
|
||||
|
||||
> The standalone arm64 .deb does not support Ubuntu 16.04 or earlier. Please
|
||||
> upgrade or [build with yarn](#yarn-npm).
|
||||
> upgrade or [build with npm](#npm).
|
||||
|
||||
```bash
|
||||
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
|
||||
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
|
||||
```
|
||||
|
|
@ -164,7 +163,7 @@ sudo systemctl enable --now code-server@$USER
|
|||
## Fedora, CentOS, RHEL, SUSE
|
||||
|
||||
> The standalone arm64 .rpm does not support CentOS 7. Please upgrade or [build
|
||||
> with yarn](#yarn-npm).
|
||||
> with npm](#npm).
|
||||
|
||||
```bash
|
||||
curl -fOL https://github.com/coder/code-server/releases/download/v$VERSION/code-server-$VERSION-amd64.rpm
|
||||
|
|
@ -278,6 +277,7 @@ brew services start code-server
|
|||
# outside the container.
|
||||
mkdir -p ~/.config
|
||||
docker run -it --name code-server -p 127.0.0.1:8080:8080 \
|
||||
-v "$HOME/.local:/home/coder/.local" \
|
||||
-v "$HOME/.config:/home/coder/.config" \
|
||||
-v "$PWD:/home/coder/project" \
|
||||
-u "$(id -u):$(id -g)" \
|
||||
|
|
@ -295,14 +295,13 @@ 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/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 coder/cloud-agent manually](https://github.com/coder/cloud-agent/issues/17) if you would like to use `code-server --link` on Windows.
|
||||
We currently [do not publish Windows
|
||||
releases](https://github.com/coder/code-server/issues/1397). We recommend
|
||||
installing code-server onto Windows with [`npm`](#npm).
|
||||
|
||||
## Raspberry Pi
|
||||
|
||||
We recommend installing code-server onto Raspberry Pi with [`yarn` or
|
||||
`npm`](#yarn-npm).
|
||||
We recommend installing code-server onto Raspberry Pi with [`npm`](#npm).
|
||||
|
||||
If you see an error related to `node-gyp` during installation, See [#5174](https://github.com/coder/code-server/issues/5174) for more information.
|
||||
|
||||
|
|
@ -346,18 +345,12 @@ brew remove code-server
|
|||
brew uninstall code-server
|
||||
```
|
||||
|
||||
### yarn, npm
|
||||
### npm
|
||||
|
||||
To remove the code-server global module, run:
|
||||
|
||||
```shell
|
||||
yarn global remove code-server
|
||||
```
|
||||
|
||||
or
|
||||
|
||||
```shell
|
||||
npm uninstall -g code-server
|
||||
npm uninstall --global code-server
|
||||
```
|
||||
|
||||
### Debian, Ubuntu
|
||||
|
|
|
|||
|
|
@ -1,3 +1,4 @@
|
|||
<!-- prettier-ignore-start -->
|
||||
<!-- START doctoc generated TOC please keep comment here to allow auto update -->
|
||||
<!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE -->
|
||||
# iPad
|
||||
|
|
@ -13,6 +14,7 @@
|
|||
- [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 -->
|
||||
<!-- prettier-ignore-end -->
|
||||
|
||||
Once you've installed code-server, you can access it from an iPad.
|
||||
|
||||
|
|
|
|||
11
docs/link.md
11
docs/link.md
|
|
@ -1,11 +0,0 @@
|
|||
# code-server --link
|
||||
|
||||
> 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.coder.co
|
||||
```
|
||||
|
|
@ -1,5 +1,5 @@
|
|||
{
|
||||
"versions": ["v4.6.0"],
|
||||
"versions": ["v4.8.0"],
|
||||
"routes": [
|
||||
{
|
||||
"title": "Home",
|
||||
|
|
@ -21,7 +21,7 @@
|
|||
"children": [
|
||||
{
|
||||
"title": "npm",
|
||||
"description": "How to install code-server using npm or yarn",
|
||||
"description": "How to install code-server using npm",
|
||||
"path": "./npm.md"
|
||||
},
|
||||
{
|
||||
|
|
@ -38,9 +38,9 @@
|
|||
"path": "./guide.md",
|
||||
"children": [
|
||||
{
|
||||
"title": "--link",
|
||||
"description": "How to run code-server --link",
|
||||
"path": "./link.md"
|
||||
"title": "Coder",
|
||||
"description": "How to run code-server in Coder",
|
||||
"path": "./coder.md"
|
||||
},
|
||||
{
|
||||
"title": "iPad",
|
||||
|
|
|
|||
33
docs/npm.md
33
docs/npm.md
|
|
@ -1,3 +1,4 @@
|
|||
<!-- prettier-ignore-start -->
|
||||
<!-- START doctoc generated TOC please keep comment here to allow auto update -->
|
||||
<!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE -->
|
||||
# npm Install Requirements
|
||||
|
|
@ -15,15 +16,21 @@
|
|||
- [Debugging install issues with npm](#debugging-install-issues-with-npm)
|
||||
|
||||
<!-- END doctoc generated TOC please keep comment here to allow auto update -->
|
||||
<!-- prettier-ignore-end -->
|
||||
|
||||
If you're installing code-server via `npm`, you'll need to install additional
|
||||
dependencies required to build the native modules used by VS Code. This article
|
||||
includes installing instructions based on your operating system.
|
||||
|
||||
> **WARNING**: Do not use `yarn` to install code-server. Unlike `npm`, it does not respect
|
||||
> lockfiles for distributed applications. It will instead use the latest version
|
||||
> available at installation time - which might not be the one used for a given
|
||||
> code-server release, and [might lead to unexpected behavior](https://github.com/coder/code-server/issues/4927).
|
||||
|
||||
## Node.js version
|
||||
|
||||
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
|
||||
currently `22.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
|
||||
|
|
@ -55,8 +62,7 @@ Proceed to [installing](#installing)
|
|||
## Alpine
|
||||
|
||||
```bash
|
||||
apk add alpine-sdk bash libstdc++ libc6-compat
|
||||
npm config set python python3
|
||||
apk add alpine-sdk bash libstdc++ libc6-compat python3 krb5-dev
|
||||
```
|
||||
|
||||
Proceed to [installing](#installing)
|
||||
|
|
@ -72,7 +78,7 @@ Proceed to [installing](#installing)
|
|||
## FreeBSD
|
||||
|
||||
```sh
|
||||
pkg install -y git python npm-node16 yarn-node16 pkgconf
|
||||
pkg install -y git python npm-node22 pkgconf
|
||||
pkg install -y libinotify
|
||||
```
|
||||
|
||||
|
|
@ -85,19 +91,17 @@ Installing code-server requires all of the [prerequisites for VS Code developmen
|
|||
Next, install code-server with:
|
||||
|
||||
```bash
|
||||
yarn global add code-server
|
||||
# Or: npm install -g code-server
|
||||
npm install --global code-server
|
||||
code-server
|
||||
# Now visit http://127.0.0.1:8080. Your password is in ~/.config/code-server/config.yaml
|
||||
```
|
||||
|
||||
A `postinstall.sh` script will attempt to run. Select your terminal (e.g., Git bash) as the default application for `.sh` files. If an additional dialog does not appear, run the install command again.
|
||||
A `postinstall.sh` script will attempt to run. Select your terminal (e.g., Git bash) as the default shell for npm run-scripts. If an additional dialog does not appear, run the install command again.
|
||||
|
||||
If the `code-server` command is not found, you'll need to [add a directory to your PATH](https://www.architectryan.com/2018/03/17/add-to-the-path-on-windows-10/). To find the directory, use the following command:
|
||||
|
||||
```shell
|
||||
yarn global bin
|
||||
# Or: npm config get prefix
|
||||
npm config get prefix
|
||||
```
|
||||
|
||||
For help and additional troubleshooting, see [#1397](https://github.com/coder/code-server/issues/1397).
|
||||
|
|
@ -107,8 +111,7 @@ For help and additional troubleshooting, see [#1397](https://github.com/coder/co
|
|||
After adding the dependencies for your OS, install the code-server package globally:
|
||||
|
||||
```bash
|
||||
yarn global add code-server
|
||||
# Or: npm install -g code-server
|
||||
npm install --global code-server
|
||||
code-server
|
||||
# Now visit http://127.0.0.1:8080. Your password is in ~/.config/code-server/config.yaml
|
||||
```
|
||||
|
|
@ -122,7 +125,7 @@ page](https://github.com/coder/code-server/discussions).
|
|||
|
||||
Occasionally, you may run into issues with Node.js.
|
||||
|
||||
If you install code-server using `yarn` or `npm`, and you upgrade your Node.js
|
||||
If you install code-server using `npm`, and you upgrade your Node.js
|
||||
version, you may need to reinstall code-server to recompile native modules.
|
||||
Sometimes, you can get around this by navigating into code-server's `lib/vscode`
|
||||
directory and running `npm rebuild` to recompile the modules.
|
||||
|
|
@ -136,12 +139,12 @@ A step-by-step example of how you might do this is:
|
|||
|
||||
### Debugging install issues with npm
|
||||
|
||||
`yarn` suppresses logs when running `yarn global add`, so to debug installation issues, install with `npm` instead:
|
||||
To debug installation issues, install with `npm`:
|
||||
|
||||
```shell
|
||||
# Uninstall
|
||||
npm uninstall -g --unsafe-perm code-server > /dev/null 2>&1
|
||||
npm uninstall --global code-server > /dev/null 2>&1
|
||||
|
||||
# Install with logging
|
||||
npm install --loglevel verbose -g --unsafe-perm code-server
|
||||
npm install --loglevel verbose --global code-server
|
||||
```
|
||||
|
|
|
|||
|
|
@ -22,7 +22,7 @@ The following steps walk you through setting up a VM running Debian using Google
|
|||
Cloud (though you are welcome to use any machine or VM provider).
|
||||
|
||||
If you're [signing up with Google](https://console.cloud.google.com/getting-started) for the first time, you should get a 3-month trial with
|
||||
$300 of credits.
|
||||
\$300 of credits.
|
||||
|
||||
After you sign up and create a new Google Cloud Provider (GCP) project, create a
|
||||
new Compute Engine VM instance:
|
||||
|
|
|
|||
144
docs/termux.md
144
docs/termux.md
|
|
@ -1,72 +1,31 @@
|
|||
<!-- prettier-ignore-start -->
|
||||
<!-- START doctoc generated TOC please keep comment here to allow auto update -->
|
||||
<!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE -->
|
||||
# Termux
|
||||
|
||||
- [Install](#install)
|
||||
- [Yarn Installation](#yarn-installation)
|
||||
- [NPM Installation](#npm-installation)
|
||||
- [Upgrade](#upgrade)
|
||||
- [Known Issues](#known-issues)
|
||||
- [Git won't work in `/sdcard`](#git-wont-work-in-sdcard)
|
||||
- [Many extensions including language packs fail to install](#many-extensions-including-language-packs-fail-to-install)
|
||||
- [Extra](#extra)
|
||||
- [Keyboard Shortcuts and Tab Key](#keyboard-shortcuts-and-tab-key)
|
||||
- [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 -->
|
||||
<!-- prettier-ignore-end -->
|
||||
|
||||
## Install
|
||||
|
||||
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`.
|
||||
2. Run `pkg install tur-repo`
|
||||
3. Run `pkg install code-server`
|
||||
4. You can now start code server by simply running `code-server`.
|
||||
|
||||
```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).
|
||||
|
||||
## Yarn Installation
|
||||
## NPM Installation
|
||||
|
||||
1. Get [Termux](https://f-droid.org/en/packages/com.termux/) from **F-Droid**.
|
||||
|
||||
|
|
@ -93,19 +52,14 @@ pkg install -y \
|
|||
binutils \
|
||||
pkg-config \
|
||||
python3 \
|
||||
yarn \
|
||||
nodejs-lts
|
||||
npm config set python python3
|
||||
node -v
|
||||
```
|
||||
|
||||
you will get node version `v16.15.0`
|
||||
you will get Node version `v22`
|
||||
|
||||
5. Now install code-server
|
||||
|
||||
```sh
|
||||
yarn global add code-server
|
||||
```
|
||||
5. Now install code-server following our guide on [installing with npm](./npm.md)
|
||||
|
||||
6. Congratulation code-server is installed on your device using the following command.
|
||||
|
||||
|
|
@ -116,7 +70,7 @@ code-server --auth none
|
|||
7. If already installed then use the following command for upgradation.
|
||||
|
||||
```
|
||||
yarn upgrade code-server
|
||||
npm update --global code-server
|
||||
```
|
||||
|
||||
## Upgrade
|
||||
|
|
@ -135,8 +89,50 @@ Potential Workaround :
|
|||
1. Create a soft-link from the debian-fs to your folder in `/sdcard`
|
||||
2. Use git from termux (preferred)
|
||||
|
||||
### Many extensions including language packs fail to install
|
||||
|
||||
Issue: Android is not seen as a Linux environment but as a separate, unsupported platform, so code-server only allows [Web Extensions](https://code.visualstudio.com/api/extension-guides/web-extensions), refusing to download extensions that run on the server.\
|
||||
Fix: None\
|
||||
Potential workarounds :
|
||||
|
||||
Either
|
||||
|
||||
- Manually download extensions as `.vsix` file and install them via `Extensions: Install from VSIX...` in the Command Palette.
|
||||
|
||||
- Use an override to pretend the platform is Linux:
|
||||
|
||||
Create a JS script that patches `process.platform`:
|
||||
|
||||
```js
|
||||
// android-as-linux.js
|
||||
Object.defineProperty(process, "platform", {
|
||||
get() {
|
||||
return "linux"
|
||||
},
|
||||
})
|
||||
```
|
||||
|
||||
Then use Node's `--require` option to make sure it is loaded before `code-server` starts:
|
||||
|
||||
```sh
|
||||
NODE_OPTIONS="--require /path/to/android-as-linux.js" code-server
|
||||
```
|
||||
|
||||
⚠️ Note that Android and Linux are not 100% compatible, so use these workarounds at your own risk. Extensions that have native dependencies other than Node or that directly interact with the OS might cause issues.
|
||||
|
||||
## Extra
|
||||
|
||||
### Keyboard Shortcuts and Tab Key
|
||||
|
||||
In order to support the tab key and use keyboard shortcuts, add this to your
|
||||
settings.json:
|
||||
|
||||
```json
|
||||
{
|
||||
"keyboard.dispatch": "keyCode"
|
||||
}
|
||||
```
|
||||
|
||||
### Create a new user
|
||||
|
||||
To create a new user follow these simple steps -
|
||||
|
|
@ -205,35 +201,3 @@ eval "$(pyenv virtualenv-init -)"
|
|||
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).
|
||||
|
|
|
|||
84
eslint.config.mjs
Normal file
84
eslint.config.mjs
Normal file
|
|
@ -0,0 +1,84 @@
|
|||
import { fixupConfigRules } from "@eslint/compat"
|
||||
import globals from "globals"
|
||||
import tsParser from "@typescript-eslint/parser"
|
||||
import path from "node:path"
|
||||
import { fileURLToPath } from "node:url"
|
||||
import js from "@eslint/js"
|
||||
import { FlatCompat } from "@eslint/eslintrc"
|
||||
|
||||
const __filename = fileURLToPath(import.meta.url)
|
||||
const __dirname = path.dirname(__filename)
|
||||
const compat = new FlatCompat({
|
||||
baseDirectory: __dirname,
|
||||
recommendedConfig: js.configs.recommended,
|
||||
allConfig: js.configs.all,
|
||||
})
|
||||
|
||||
export default [
|
||||
...fixupConfigRules(
|
||||
compat.extends(
|
||||
"eslint:recommended",
|
||||
"plugin:@typescript-eslint/recommended",
|
||||
"plugin:import/recommended",
|
||||
"plugin:import/typescript",
|
||||
"plugin:prettier/recommended",
|
||||
"prettier",
|
||||
),
|
||||
),
|
||||
{
|
||||
languageOptions: {
|
||||
globals: {
|
||||
...globals.browser,
|
||||
...globals.jest,
|
||||
...globals.node,
|
||||
},
|
||||
|
||||
parser: tsParser,
|
||||
ecmaVersion: 2018,
|
||||
sourceType: "module",
|
||||
},
|
||||
|
||||
settings: {
|
||||
"import/resolver": {
|
||||
typescript: {
|
||||
alwaysTryTypes: true,
|
||||
},
|
||||
},
|
||||
},
|
||||
|
||||
rules: {
|
||||
"@typescript-eslint/no-unused-vars": [
|
||||
"error",
|
||||
{
|
||||
args: "none",
|
||||
},
|
||||
],
|
||||
|
||||
"no-dupe-class-members": "off",
|
||||
"@typescript-eslint/no-use-before-define": "off",
|
||||
"@typescript-eslint/no-non-null-assertion": "off",
|
||||
"@typescript-eslint/ban-types": "off",
|
||||
"@typescript-eslint/no-var-requires": "off",
|
||||
"@typescript-eslint/explicit-module-boundary-types": "off",
|
||||
"@typescript-eslint/no-explicit-any": "off",
|
||||
"@typescript-eslint/no-extra-semi": "off",
|
||||
"@typescript-eslint/no-require-imports": "off",
|
||||
"@typescript-eslint/no-unused-vars": "off", // TODO: Fix these.
|
||||
"@typescript-eslint/no-empty-object-type": "off",
|
||||
eqeqeq: "error",
|
||||
|
||||
"import/order": [
|
||||
"error",
|
||||
{
|
||||
alphabetize: {
|
||||
order: "asc",
|
||||
},
|
||||
|
||||
groups: [["builtin", "external", "internal"], "parent", "sibling"],
|
||||
},
|
||||
],
|
||||
|
||||
"no-async-promise-executor": "off",
|
||||
},
|
||||
},
|
||||
]
|
||||
61
flake.lock
Normal file
61
flake.lock
Normal file
|
|
@ -0,0 +1,61 @@
|
|||
{
|
||||
"nodes": {
|
||||
"flake-utils": {
|
||||
"inputs": {
|
||||
"systems": "systems"
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1731533236,
|
||||
"narHash": "sha256-l0KFg5HjrsfsO/JpG+r7fRrqm12kzFHyUHqHCVpMMbI=",
|
||||
"owner": "numtide",
|
||||
"repo": "flake-utils",
|
||||
"rev": "11707dc2f618dd54ca8739b309ec4fc024de578b",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "numtide",
|
||||
"repo": "flake-utils",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"nixpkgs": {
|
||||
"locked": {
|
||||
"lastModified": 1739303263,
|
||||
"narHash": "sha256-c/Z/6gZLN8BIpYh1B3qMzEn0TArjf4F2lmy59lDLVBM=",
|
||||
"owner": "nixos",
|
||||
"repo": "nixpkgs",
|
||||
"rev": "6cc4213488e886db863878a1e3dc26cc932d38b8",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "nixos",
|
||||
"ref": "nixos-unstable-small",
|
||||
"repo": "nixpkgs",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"root": {
|
||||
"inputs": {
|
||||
"flake-utils": "flake-utils",
|
||||
"nixpkgs": "nixpkgs"
|
||||
}
|
||||
},
|
||||
"systems": {
|
||||
"locked": {
|
||||
"lastModified": 1681028828,
|
||||
"narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=",
|
||||
"owner": "nix-systems",
|
||||
"repo": "default",
|
||||
"rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "nix-systems",
|
||||
"repo": "default",
|
||||
"type": "github"
|
||||
}
|
||||
}
|
||||
},
|
||||
"root": "root",
|
||||
"version": 7
|
||||
}
|
||||
37
flake.nix
Normal file
37
flake.nix
Normal file
|
|
@ -0,0 +1,37 @@
|
|||
{
|
||||
description = "code-server";
|
||||
|
||||
inputs = {
|
||||
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable-small";
|
||||
flake-utils.url = "github:numtide/flake-utils";
|
||||
};
|
||||
|
||||
outputs = { self, nixpkgs, flake-utils }:
|
||||
flake-utils.lib.eachDefaultSystem
|
||||
(system:
|
||||
let pkgs = nixpkgs.legacyPackages.${system};
|
||||
nodejs = pkgs.nodejs_22;
|
||||
in {
|
||||
devShells.default = pkgs.mkShell {
|
||||
nativeBuildInputs = with pkgs; [
|
||||
imagemagick
|
||||
nodejs
|
||||
python3
|
||||
pkg-config
|
||||
git
|
||||
rsync
|
||||
jq
|
||||
moreutils
|
||||
quilt
|
||||
bats
|
||||
openssl
|
||||
];
|
||||
buildInputs = with pkgs; (lib.optionals (!stdenv.isDarwin) [ libsecret libkrb5 ]
|
||||
++ (with xorg; [ libX11 libxkbfile ])
|
||||
++ lib.optionals stdenv.isDarwin (with pkgs.darwin.apple_sdk.frameworks; [
|
||||
AppKit Cocoa CoreServices Security xcbuild
|
||||
]));
|
||||
};
|
||||
}
|
||||
);
|
||||
}
|
||||
36
install.sh
36
install.sh
|
|
@ -46,7 +46,7 @@ Usage:
|
|||
Sets the prefix used by standalone release archives. Defaults to ~/.local
|
||||
The release is unarchived into ~/.local/lib/code-server-X.X.X
|
||||
and the binary symlinked into ~/.local/bin/code-server
|
||||
To install system wide pass ---prefix=/usr/local
|
||||
To install system wide pass --prefix=/usr/local
|
||||
|
||||
--rsh <bin>
|
||||
Specifies the remote shell for remote installation. Defaults to ssh.
|
||||
|
|
@ -131,6 +131,11 @@ Or, if you don't want/need a background service you can run:
|
|||
EOF
|
||||
}
|
||||
|
||||
echo_coder_postinstall() {
|
||||
echoh
|
||||
echoh "Deploy code-server for your team with Coder: https://github.com/coder/coder"
|
||||
}
|
||||
|
||||
main() {
|
||||
if [ "${TRACE-}" ]; then
|
||||
set -x
|
||||
|
|
@ -243,6 +248,7 @@ main() {
|
|||
if [ "$METHOD" = standalone ]; then
|
||||
if has_standalone; then
|
||||
install_standalone
|
||||
echo_coder_postinstall
|
||||
exit 0
|
||||
else
|
||||
echoerr "There are no standalone releases for $ARCH"
|
||||
|
|
@ -286,6 +292,8 @@ main() {
|
|||
npm_fallback install_standalone
|
||||
;;
|
||||
esac
|
||||
|
||||
echo_coder_postinstall
|
||||
}
|
||||
|
||||
parse_arg() {
|
||||
|
|
@ -364,7 +372,7 @@ install_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"
|
||||
sudo_sh_c rpm -U "$CACHE_DIR/code-server-$VERSION-$ARCH.rpm"
|
||||
|
||||
echo_systemd_postinstall rpm
|
||||
}
|
||||
|
|
@ -379,7 +387,7 @@ install_aur() {
|
|||
if [ ! "${DRY_RUN-}" ]; then
|
||||
cd "$CACHE_DIR/code-server-aur"
|
||||
fi
|
||||
sh_c makepkg -si
|
||||
sh_c makepkg -si --noconfirm
|
||||
|
||||
echo_systemd_postinstall AUR
|
||||
}
|
||||
|
|
@ -416,7 +424,7 @@ install_standalone() {
|
|||
}
|
||||
|
||||
install_npm() {
|
||||
echoh "Installing latest from npm."
|
||||
echoh "Installing v$VERSION from npm."
|
||||
echoh
|
||||
|
||||
NPM_PATH="${YARN_PATH-npm}"
|
||||
|
|
@ -428,12 +436,12 @@ install_npm() {
|
|||
fi
|
||||
echoh "Installing with npm."
|
||||
echoh
|
||||
"$sh_c" "$NPM_PATH" install -g code-server --unsafe-perm
|
||||
"$sh_c" "$NPM_PATH" install -g "code-server@$VERSION" --unsafe-perm
|
||||
NPM_BIN_DIR="\$($NPM_PATH bin -g)" echo_npm_postinstall
|
||||
return
|
||||
fi
|
||||
echoerr "Please install npm to install code-server!"
|
||||
echoerr "You will need at least node v12 and a few C dependencies."
|
||||
echoerr "You will need at least node v20 and a few C dependencies."
|
||||
echoerr "See the docs https://coder.com/docs/code-server/latest/install#npm"
|
||||
|
||||
exit 1
|
||||
|
|
@ -453,9 +461,9 @@ npm_fallback() {
|
|||
# Determine if we have standalone releases on GitHub for the system's arch.
|
||||
has_standalone() {
|
||||
case $ARCH in
|
||||
amd64) return 0 ;;
|
||||
# We only have amd64 for macOS.
|
||||
arm64)
|
||||
arm64) return 0 ;;
|
||||
# We only have arm64 for macOS.
|
||||
amd64)
|
||||
[ "$(distro)" != macos ]
|
||||
return
|
||||
;;
|
||||
|
|
@ -482,7 +490,7 @@ os() {
|
|||
# - amzn, centos, rhel, fedora, ... -> fedora
|
||||
# - opensuse-{leap,tumbleweed} -> opensuse
|
||||
# - alpine -> alpine
|
||||
# - arch -> arch
|
||||
# - arch, manjaro, endeavouros, ... -> arch
|
||||
#
|
||||
# Inspired by https://github.com/docker/docker-install/blob/26ff363bcf3b3f5a00498ac43694bf1c7d9ce16c/install.sh#L111-L120.
|
||||
distro() {
|
||||
|
|
@ -496,7 +504,7 @@ distro() {
|
|||
. /etc/os-release
|
||||
if [ "${ID_LIKE-}" ]; then
|
||||
for id_like in $ID_LIKE; do
|
||||
case "$id_like" in debian | fedora | opensuse)
|
||||
case "$id_like" in debian | fedora | opensuse | arch)
|
||||
echo "$id_like"
|
||||
return
|
||||
;;
|
||||
|
|
@ -553,15 +561,17 @@ sh_c() {
|
|||
sudo_sh_c() {
|
||||
if [ "$(id -u)" = 0 ]; then
|
||||
sh_c "$@"
|
||||
elif command_exists doas; then
|
||||
sh_c "doas $*"
|
||||
elif command_exists sudo; then
|
||||
sh_c "sudo $*"
|
||||
elif command_exists su; then
|
||||
sh_c "su - -c '$*'"
|
||||
sh_c "su root -c '$*'"
|
||||
else
|
||||
echoh
|
||||
echoerr "This script needs to run the following command as root."
|
||||
echoerr " $*"
|
||||
echoerr "Please install sudo or su."
|
||||
echoerr "Please install doas, sudo, or su."
|
||||
exit 1
|
||||
fi
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1 +1 @@
|
|||
Subproject commit 2062a59ca1a586d8a6e7bf483841085a94c440a4
|
||||
Subproject commit 302ff6a2e235c95b88e587d4a4b6eeb1b6613297
|
||||
6750
package-lock.json
generated
Normal file
6750
package-lock.json
generated
Normal file
File diff suppressed because it is too large
Load diff
135
package.json
135
package.json
|
|
@ -1,7 +1,7 @@
|
|||
{
|
||||
"name": "code-server",
|
||||
"license": "MIT",
|
||||
"version": "4.6.0",
|
||||
"version": "0.0.0",
|
||||
"description": "Run VS Code on a remote server.",
|
||||
"homepage": "https://github.com/coder/code-server",
|
||||
"bugs": {
|
||||
|
|
@ -12,104 +12,84 @@
|
|||
"clean": "./ci/build/clean.sh",
|
||||
"build": "./ci/build/build-code-server.sh",
|
||||
"build:vscode": "./ci/build/build-vscode.sh",
|
||||
"doctoc": "./ci/dev/doctoc.sh",
|
||||
"release": "./ci/build/build-release.sh",
|
||||
"release:standalone": "./ci/build/build-standalone-release.sh",
|
||||
"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": "VSCODE_IPC_HOOK_CLI= ./ci/dev/test-e2e.sh",
|
||||
"test:e2e:proxy": "USE_PROXY=1 ./ci/dev/test-e2e.sh",
|
||||
"test:unit": "./ci/dev/test-unit.sh --forceExit --detectOpenHandles",
|
||||
"test:integration": "./ci/dev/test-integration.sh",
|
||||
"test:native": "./ci/dev/test-native.sh",
|
||||
"test:scripts": "./ci/dev/test-scripts.sh",
|
||||
"package": "./ci/build/build-packages.sh",
|
||||
"prettier": "prettier --write --log-level=warn --cache .",
|
||||
"preinstall": "node ./ci/dev/preinstall.js",
|
||||
"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",
|
||||
"fmt": "npm run prettier && ./ci/dev/doctoc.sh",
|
||||
"lint:scripts": "./ci/dev/lint-scripts.sh",
|
||||
"lint:ts": "eslint --max-warnings=0 --fix $(git ls-files '*.ts' '*.js' | grep -v 'lib/vscode')",
|
||||
"test": "echo 'Run npm run test:unit or npm run test:e2e' && exit 1",
|
||||
"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/compression": "^1.7.0",
|
||||
"@types/cookie-parser": "^1.4.2",
|
||||
"@types/express": "^4.17.8",
|
||||
"@types/http-proxy": "^1.17.4",
|
||||
"@types/js-yaml": "^4.0.0",
|
||||
"@types/node": "^16.0.0",
|
||||
"@types/pem": "^1.9.5",
|
||||
"@eslint/compat": "^1.2.0",
|
||||
"@eslint/eslintrc": "^3.1.0",
|
||||
"@eslint/js": "^9.12.0",
|
||||
"@schemastore/package": "^0.0.10",
|
||||
"@types/compression": "^1.7.3",
|
||||
"@types/cookie-parser": "^1.4.4",
|
||||
"@types/eslint__js": "^8.42.3",
|
||||
"@types/express": "^5.0.0",
|
||||
"@types/http-proxy": "1.17.7",
|
||||
"@types/js-yaml": "^4.0.6",
|
||||
"@types/node": "22.x",
|
||||
"@types/pem": "^1.14.1",
|
||||
"@types/proxy-from-env": "^1.0.1",
|
||||
"@types/safe-compare": "^1.1.0",
|
||||
"@types/semver": "^7.1.0",
|
||||
"@types/split2": "^3.2.0",
|
||||
"@types/trusted-types": "^2.0.2",
|
||||
"@types/ws": "^8.5.3",
|
||||
"@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-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.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.6.2"
|
||||
},
|
||||
"resolutions": {
|
||||
"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",
|
||||
"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",
|
||||
"glob-parent": "^6.0.1",
|
||||
"@types/node": "^16.0.0"
|
||||
"@types/semver": "^7.5.2",
|
||||
"@types/trusted-types": "^2.0.4",
|
||||
"@types/ws": "^8.5.5",
|
||||
"doctoc": "^2.2.1",
|
||||
"eslint": "^9.12.0",
|
||||
"eslint-config-prettier": "^9.0.0",
|
||||
"eslint-import-resolver-typescript": "^4.4.4",
|
||||
"eslint-plugin-import": "^2.28.1",
|
||||
"eslint-plugin-prettier": "^5.0.0",
|
||||
"globals": "^16.1.0",
|
||||
"prettier": "3.6.2",
|
||||
"prettier-plugin-sh": "^0.14.0",
|
||||
"ts-node": "^10.9.1",
|
||||
"typescript": "^5.6.2",
|
||||
"typescript-eslint": "^8.8.0"
|
||||
},
|
||||
"dependencies": {
|
||||
"@coder/logger": "1.1.16",
|
||||
"argon2": "^0.28.0",
|
||||
"@coder/logger": "^3.0.1",
|
||||
"argon2": "^0.31.1",
|
||||
"compression": "^1.7.4",
|
||||
"cookie-parser": "^1.4.5",
|
||||
"env-paths": "^2.2.0",
|
||||
"express": "5.0.0-alpha.8",
|
||||
"http-proxy": "^1.18.0",
|
||||
"cookie-parser": "^1.4.6",
|
||||
"env-paths": "^2.2.1",
|
||||
"express": "^5.0.1",
|
||||
"http-proxy": "^1.18.1",
|
||||
"httpolyglot": "^0.1.2",
|
||||
"js-yaml": "^4.0.0",
|
||||
"limiter": "^1.1.5",
|
||||
"pem": "^1.14.2",
|
||||
"proxy-agent": "^5.0.0",
|
||||
"qs": "6.11.0",
|
||||
"rotating-file-stream": "^3.0.0",
|
||||
"safe-buffer": "^5.1.1",
|
||||
"i18next": "^25.3.0",
|
||||
"js-yaml": "^4.1.0",
|
||||
"limiter": "^2.1.0",
|
||||
"pem": "^1.14.8",
|
||||
"proxy-agent": "^6.3.1",
|
||||
"qs": "6.14.0",
|
||||
"rotating-file-stream": "^3.1.1",
|
||||
"safe-compare": "^1.1.4",
|
||||
"semver": "^7.1.3",
|
||||
"split2": "^4.0.0",
|
||||
"ws": "^8.0.0",
|
||||
"xdg-basedir": "^4.0.0",
|
||||
"yarn": "^1.22.4"
|
||||
"semver": "^7.5.4",
|
||||
"ws": "^8.14.2",
|
||||
"xdg-basedir": "^4.0.0"
|
||||
},
|
||||
"resolutions": {
|
||||
"@types/node": "22.x"
|
||||
},
|
||||
"bin": {
|
||||
"code-server": "out/node/entry.js"
|
||||
|
|
@ -120,10 +100,11 @@
|
|||
"ide",
|
||||
"coder",
|
||||
"vscode-remote",
|
||||
"browser-ide"
|
||||
"browser-ide",
|
||||
"remote-development"
|
||||
],
|
||||
"engines": {
|
||||
"node": "16"
|
||||
"node": "22"
|
||||
},
|
||||
"jest": {
|
||||
"transform": {
|
||||
|
|
|
|||
|
|
@ -10,7 +10,7 @@ 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
|
||||
@@ -162,7 +162,9 @@ class RemoteAuthoritiesImpl {
|
||||
@@ -237,7 +237,9 @@ class RemoteAuthoritiesImpl {
|
||||
return URI.from({
|
||||
scheme: platform.isWeb ? this._preferredWebSchema : Schemas.vscodeRemoteResource,
|
||||
authority: `${host}:${port}`,
|
||||
|
|
@ -46,18 +46,18 @@ Index: code-server/lib/vscode/src/vs/code/browser/workbench/workbench-dev.html
|
|||
+ <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>
|
||||
<style id="vscode-css-modules" type="text/css" media="screen"></style>
|
||||
|
||||
<body aria-label="">
|
||||
</head>
|
||||
@@ -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>
|
||||
|
||||
<!-- Startup (do not modify order of script tags!) -->
|
||||
<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]}`;
|
||||
});
|
||||
globalThis._VSCODE_FILE_ROOT = baseUrl + '/out/';
|
||||
</script>
|
||||
<script>
|
||||
Index: code-server/lib/vscode/src/vs/code/browser/workbench/workbench.html
|
||||
===================================================================
|
||||
--- code-server.orig/lib/vscode/src/vs/code/browser/workbench/workbench.html
|
||||
|
|
@ -83,100 +83,91 @@ Index: code-server/lib/vscode/src/vs/code/browser/workbench/workbench.html
|
|||
+ <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">
|
||||
<link rel="stylesheet" href="{{WORKBENCH_WEB_BASE_URL}}/out/vs/code/browser/workbench/workbench.css">
|
||||
|
||||
</head>
|
||||
@@ -38,7 +38,7 @@
|
||||
<script src="{{WORKBENCH_WEB_BASE_URL}}/out/vs/loader.js"></script>
|
||||
<script src="{{WORKBENCH_WEB_BASE_URL}}/out/vs/webPackagePaths.js"></script>
|
||||
@@ -36,7 +36,7 @@
|
||||
|
||||
<!-- Startup (do not modify order of script tags!) -->
|
||||
<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}/node_modules/${key}/${self.webPackagePaths[key]}`;
|
||||
});
|
||||
globalThis._VSCODE_FILE_ROOT = baseUrl + '/out/';
|
||||
</script>
|
||||
<script>
|
||||
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
|
||||
});
|
||||
}
|
||||
}
|
||||
-
|
||||
-
|
||||
-
|
||||
@@ -282,6 +282,7 @@ export class BrowserSocketFactory implem
|
||||
connect({ host, port }: WebSocketRemoteConnection, path: string, query: string, debugLabel: string): Promise<ISocket> {
|
||||
return new Promise<ISocket>((resolve, reject) => {
|
||||
const webSocketSchema = (/^https:/.test(mainWindow.location.href) ? 'wss' : 'ws');
|
||||
+ path = (mainWindow.location.pathname + "/" + path).replace(/\/\/+/g, "/")
|
||||
const socket = this._webSocketFactory.create(`${webSocketSchema}://${(/:/.test(host) && !/\[/.test(host)) ? `[${host}]` : host}:${port}${path}?${query}&skipWebSocketFrames=false`, debugLabel);
|
||||
const disposables = new DisposableStore();
|
||||
disposables.add(socket.onError(reject));
|
||||
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,12 +267,11 @@ export class WebClientServer {
|
||||
return res.end();
|
||||
}
|
||||
@@ -245,7 +245,9 @@ export class WebClientServer {
|
||||
};
|
||||
|
||||
- const getFirstHeader = (headerName: string) => {
|
||||
- const val = req.headers[headerName];
|
||||
- return Array.isArray(val) ? val[0] : val;
|
||||
- };
|
||||
-
|
||||
- const remoteAuthority = getFirstHeader('x-original-host') || getFirstHeader('x-forwarded-host') || req.headers.host;
|
||||
// Prefix routes with basePath for clients
|
||||
- const basePath = getFirstHeader('x-forwarded-prefix') || this._basePath;
|
||||
+ const rootBase = relativeRoot(getOriginalUrl(req))
|
||||
+ const vscodeBase = relativePath(getOriginalUrl(req))
|
||||
+ const basePath = vscodeBase || getFirstHeader('x-forwarded-prefix') || this._basePath;
|
||||
|
||||
const queryConnectionToken = parsedUrl.query[connectionTokenQueryName];
|
||||
if (typeof queryConnectionToken === 'string') {
|
||||
@@ -284,10 +286,14 @@ export class WebClientServer {
|
||||
};
|
||||
|
||||
const useTestResolver = (!this._environmentService.isBuilt && this._environmentService.args['use-test-resolver']);
|
||||
+ // For now we are getting the remote authority from the client to avoid
|
||||
+ // needing specific configuration for reverse proxies to work. Set this to
|
||||
+ // something invalid to make sure we catch code that is using this value
|
||||
+ // from the backend when it should not.
|
||||
+ const remoteAuthority = 'remote';
|
||||
let remoteAuthority = (
|
||||
useTestResolver
|
||||
? 'test+test'
|
||||
- : (getFirstHeader('x-original-host') || getFirstHeader('x-forwarded-host') || req.headers.host)
|
||||
+ : 'remote'
|
||||
);
|
||||
if (!remoteAuthority) {
|
||||
return serveError(req, res, 400, `Bad request.`);
|
||||
}
|
||||
@@ -298,6 +297,8 @@ export class WebClientServer {
|
||||
scopes: [['user:email'], ['repo']]
|
||||
} : undefined;
|
||||
@@ -334,6 +340,7 @@ export class WebClientServer {
|
||||
|
||||
+ const base = relativeRoot(getOriginalUrl(req))
|
||||
+ const vscodeBase = relativePath(getOriginalUrl(req))
|
||||
|
||||
const workbenchWebConfiguration = {
|
||||
remoteAuthority,
|
||||
@@ -309,6 +310,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,
|
||||
@@ -326,8 +328,10 @@ export class WebClientServer {
|
||||
const values: { [key: string]: string } = {
|
||||
WORKBENCH_WEB_CONFIGURATION: asJSON(workbenchWebConfiguration),
|
||||
const productConfiguration: Partial<Mutable<IProductConfiguration>> = {
|
||||
codeServerVersion: this._productService.codeServerVersion,
|
||||
+ rootEndpoint: rootBase,
|
||||
embedderIdentifier: 'server-distro',
|
||||
extensionsGallery: this._webExtensionResourceUrlTemplate && this._productService.extensionsGallery ? {
|
||||
...this._productService.extensionsGallery,
|
||||
@@ -387,7 +394,9 @@ export class WebClientServer {
|
||||
WORKBENCH_AUTH_SESSION: authSessionInfo ? asJSON(authSessionInfo) : '',
|
||||
- WORKBENCH_WEB_BASE_URL: this._staticRoute,
|
||||
- WORKBENCH_NLS_BASE_URL: nlsBaseUrl ? `${nlsBaseUrl}${!nlsBaseUrl.endsWith('/') ? '/' : ''}${this._productService.commit}/${this._productService.version}/` : '',
|
||||
+ WORKBENCH_WEB_BASE_URL: vscodeBase + this._staticRoute,
|
||||
+ WORKBENCH_NLS_BASE_URL: vscodeBase + (nlsBaseUrl ? `${nlsBaseUrl}${!nlsBaseUrl.endsWith('/') ? '/' : ''}${this._productService.commit}/${this._productService.version}/` : ''),
|
||||
+ BASE: base,
|
||||
+ VS_BASE: vscodeBase,
|
||||
WORKBENCH_WEB_BASE_URL: staticRoute,
|
||||
WORKBENCH_NLS_URL,
|
||||
- WORKBENCH_NLS_FALLBACK_URL: `${staticRoute}/out/nls.messages.js`
|
||||
+ WORKBENCH_NLS_FALLBACK_URL: `${staticRoute}/out/nls.messages.js`,
|
||||
+ BASE: rootBase,
|
||||
+ VS_BASE: basePath,
|
||||
};
|
||||
|
||||
|
||||
@@ -344,7 +348,7 @@ export class WebClientServer {
|
||||
// DEV ---------------------------------------------------------------------------------------
|
||||
@@ -424,7 +433,7 @@ export class WebClientServer {
|
||||
'default-src \'self\';',
|
||||
'img-src \'self\' https: data: blob:;',
|
||||
'media-src \'self\';',
|
||||
- `script-src 'self' 'unsafe-eval' ${this._getScriptCspHashes(data).join(' ')} 'sha256-fh3TwPMflhsEIpR8g1OYTIMVWhXTLcjQ9kh2tIpmv54=' http://${remoteAuthority};`, // the sha is the same as in src/vs/workbench/services/extensions/worker/webWorkerExtensionHostIframe.html
|
||||
+ `script-src 'self' 'unsafe-eval' ${this._getScriptCspHashes(data).join(' ')} 'sha256-fh3TwPMflhsEIpR8g1OYTIMVWhXTLcjQ9kh2tIpmv54=';`, // the sha is the same as in src/vs/workbench/services/extensions/worker/webWorkerExtensionHostIframe.html
|
||||
- `script-src 'self' 'unsafe-eval' ${WORKBENCH_NLS_BASE_URL ?? ''} blob: 'nonce-1nline-m4p' ${this._getScriptCspHashes(data).join(' ')} '${webWorkerExtensionHostIframeScriptSHA}' 'sha256-/r7rqQ+yrxt57sxLuQ6AMYcy/lUpvAIzHjIJt/OeLWU=' ${useTestResolver ? '' : `http://${remoteAuthority}`};`, // the sha is the same as in src/vs/workbench/services/extensions/worker/webWorkerExtensionHostIframe.html
|
||||
+ `script-src 'self' 'unsafe-eval' ${WORKBENCH_NLS_BASE_URL ?? ''} blob: 'nonce-1nline-m4p' ${this._getScriptCspHashes(data).join(' ')} '${webWorkerExtensionHostIframeScriptSHA}' 'sha256-/r7rqQ+yrxt57sxLuQ6AMYcy/lUpvAIzHjIJt/OeLWU=' ${useTestResolver ? '' : ``};`, // the sha is the same as in src/vs/workbench/services/extensions/worker/webWorkerExtensionHostIframe.html
|
||||
'child-src \'self\';',
|
||||
`frame-src 'self' https://*.vscode-cdn.net data:;`,
|
||||
'worker-src \'self\' data:;',
|
||||
@@ -417,3 +421,70 @@ export class WebClientServer {
|
||||
return res.end(data);
|
||||
'worker-src \'self\' data: blob:;',
|
||||
@@ -497,3 +506,70 @@ export class WebClientServer {
|
||||
return void res.end(data);
|
||||
}
|
||||
}
|
||||
+
|
||||
|
|
@ -250,7 +241,7 @@ 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
|
||||
@@ -66,6 +66,7 @@ export type ExtensionVirtualWorkspaceSup
|
||||
|
||||
export interface IProductConfiguration {
|
||||
readonly codeServerVersion?: string
|
||||
|
|
@ -262,39 +253,53 @@ 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
|
||||
});
|
||||
@@ -339,7 +339,8 @@ class LocalStorageURLCallbackProvider ex
|
||||
this.startListening();
|
||||
}
|
||||
|
||||
- return URI.parse(mainWindow.location.href).with({ path: this._callbackRoute, query: queryParams.join('&') });
|
||||
+ const path = (mainWindow.location.pathname + "/" + this._callbackRoute).replace(/\/\/+/g, "/");
|
||||
+ return URI.parse(mainWindow.location.href).with({ path: path, query: queryParams.join('&') });
|
||||
}
|
||||
|
||||
+ path = (window.location.pathname + "/" + path).replace(/\/\/+/g, "/")
|
||||
return URI.parse(window.location.href).with({ path, query });
|
||||
private startListening(): void {
|
||||
@@ -584,17 +585,6 @@ class WorkspaceProvider implements IWork
|
||||
}
|
||||
}
|
||||
|
||||
@@ -496,7 +497,7 @@ function doCreateUri(path: string, query
|
||||
-function readCookie(name: string): string | undefined {
|
||||
- const cookies = document.cookie.split('; ');
|
||||
- for (const cookie of cookies) {
|
||||
- if (cookie.startsWith(name + '=')) {
|
||||
- return cookie.substring(name.length + 1);
|
||||
- }
|
||||
- }
|
||||
-
|
||||
- return undefined;
|
||||
-}
|
||||
-
|
||||
(function () {
|
||||
|
||||
// Find config by checking for DOM
|
||||
@@ -604,8 +594,8 @@ function readCookie(name: string): strin
|
||||
if (!configElement || !configElementAttribute) {
|
||||
throw new Error('Missing web configuration element');
|
||||
}
|
||||
- const config: IWorkbenchConstructionOptions & { folderUri?: UriComponents; workspaceUri?: UriComponents; callbackRoute: string } = JSON.parse(configElementAttribute);
|
||||
- const secretStorageKeyPath = readCookie('vscode-secret-key-path');
|
||||
+ const config: IWorkbenchConstructionOptions & { folderUri?: UriComponents; workspaceUri?: UriComponents; callbackRoute: string } = { ...JSON.parse(configElementAttribute), remoteAuthority: location.host }
|
||||
+ const secretStorageKeyPath = (window.location.pathname + "/mint-key").replace(/\/\/+/g, "/");
|
||||
const secretStorageCrypto = secretStorageKeyPath && ServerKeyedAESCrypto.supported()
|
||||
? new ServerKeyedAESCrypto(secretStorageKeyPath) : new TransparentCrypto();
|
||||
|
||||
// Create workbench
|
||||
create(document.body, {
|
||||
Index: code-server/lib/vscode/src/vs/workbench/services/extensionResourceLoader/common/extensionResourceLoader.ts
|
||||
Index: code-server/lib/vscode/src/vs/platform/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' }));
|
||||
--- code-server.orig/lib/vscode/src/vs/platform/extensionResourceLoader/common/extensionResourceLoader.ts
|
||||
+++ code-server/lib/vscode/src/vs/platform/extensionResourceLoader/common/extensionResourceLoader.ts
|
||||
@@ -120,7 +120,7 @@ export abstract class AbstractExtensionR
|
||||
: 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;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -8,67 +8,20 @@ To test:
|
|||
2. Open code-server
|
||||
3. Open terminal
|
||||
4. Open another code-server window
|
||||
5. Run code-server with a file or directory argument
|
||||
5. Run node ./out/node/entry.js with a file or directory argument
|
||||
|
||||
The file or directory should only open from the instance attached to that
|
||||
terminal.
|
||||
|
||||
Index: code-server/lib/vscode/src/vs/server/node/remoteTerminalChannel.ts
|
||||
===================================================================
|
||||
--- code-server.orig/lib/vscode/src/vs/server/node/remoteTerminalChannel.ts
|
||||
+++ code-server/lib/vscode/src/vs/server/node/remoteTerminalChannel.ts
|
||||
@@ -89,7 +89,7 @@ export class RemoteTerminalChannel exten
|
||||
uriTransformer: IURITransformer;
|
||||
}>();
|
||||
|
||||
- private readonly _onExecuteCommand = this._register(new Emitter<{ reqId: number; commandId: string; commandArgs: any[] }>());
|
||||
+ private readonly _onExecuteCommand = this._register(new Emitter<{ reqId: number; terminalId: number; commandId: string; commandArgs: any[] }>());
|
||||
readonly onExecuteCommand = this._onExecuteCommand.event;
|
||||
|
||||
constructor(
|
||||
@@ -241,20 +241,20 @@ export class RemoteTerminalChannel exten
|
||||
const ipcHandlePath = createRandomIPCHandle();
|
||||
env.VSCODE_IPC_HOOK_CLI = ipcHandlePath;
|
||||
const commandsExecuter: ICommandsExecuter = {
|
||||
- executeCommand: <T>(id: string, ...args: any[]): Promise<T> => this._executeCommand(id, args, uriTransformer)
|
||||
+ executeCommand: <T>(commandId: string, ...args: any[]): Promise<T> => this._executeCommand(terminalId, commandId, args, uriTransformer)
|
||||
};
|
||||
const cliServer = new CLIServerBase(commandsExecuter, this._logService, ipcHandlePath);
|
||||
|
||||
- const id = await this._ptyService.createProcess(shellLaunchConfig, initialCwd, args.cols, args.rows, args.unicodeVersion, env, baseEnv, args.options, args.shouldPersistTerminal, args.workspaceId, args.workspaceName);
|
||||
- this._ptyService.onProcessExit(e => e.id === id && cliServer.dispose());
|
||||
+ const terminalId = await this._ptyService.createProcess(shellLaunchConfig, initialCwd, args.cols, args.rows, args.unicodeVersion, env, baseEnv, args.options, args.shouldPersistTerminal, args.workspaceId, args.workspaceName);
|
||||
+ this._ptyService.onProcessExit(e => e.id === terminalId && cliServer.dispose());
|
||||
|
||||
return {
|
||||
- persistentTerminalId: id,
|
||||
+ persistentTerminalId: terminalId,
|
||||
resolvedShellLaunchConfig: shellLaunchConfig
|
||||
};
|
||||
}
|
||||
|
||||
- private _executeCommand<T>(commandId: string, commandArgs: any[], uriTransformer: IURITransformer): Promise<T> {
|
||||
+ private _executeCommand<T>(terminalId: number, commandId: string, commandArgs: any[], uriTransformer: IURITransformer): Promise<T> {
|
||||
let resolve!: (data: any) => void;
|
||||
let reject!: (err: any) => void;
|
||||
const result = new Promise<T>((_resolve, _reject) => {
|
||||
@@ -277,6 +277,7 @@ export class RemoteTerminalChannel exten
|
||||
});
|
||||
this._onExecuteCommand.fire({
|
||||
reqId,
|
||||
+ terminalId,
|
||||
commandId,
|
||||
commandArgs: serializedCommandArgs
|
||||
});
|
||||
Index: code-server/lib/vscode/src/vs/workbench/contrib/terminal/browser/remoteTerminalBackend.ts
|
||||
===================================================================
|
||||
--- code-server.orig/lib/vscode/src/vs/workbench/contrib/terminal/browser/remoteTerminalBackend.ts
|
||||
+++ code-server/lib/vscode/src/vs/workbench/contrib/terminal/browser/remoteTerminalBackend.ts
|
||||
@@ -94,10 +94,14 @@ class RemoteTerminalBackend extends Base
|
||||
this._remoteTerminalChannel.onExecuteCommand(async e => {
|
||||
@@ -107,10 +107,14 @@ class RemoteTerminalBackend extends Base
|
||||
}
|
||||
const reqId = e.reqId;
|
||||
const commandId = e.commandId;
|
||||
+ const terminalId = e.terminalId;
|
||||
+ const terminalId = e.persistentProcessId;
|
||||
if (!allowedCommands.includes(commandId)) {
|
||||
this._remoteTerminalChannel.sendCommandResult(reqId, true, 'Invalid remote cli command: ' + commandId);
|
||||
return;
|
||||
|
|
@ -79,18 +32,3 @@ Index: code-server/lib/vscode/src/vs/workbench/contrib/terminal/browser/remoteTe
|
|||
const commandArgs = e.commandArgs.map(arg => revive(arg));
|
||||
try {
|
||||
const result = await this._commandService.executeCommand(e.commandId, ...commandArgs);
|
||||
Index: code-server/lib/vscode/src/vs/workbench/contrib/terminal/common/remoteTerminalChannel.ts
|
||||
===================================================================
|
||||
--- code-server.orig/lib/vscode/src/vs/workbench/contrib/terminal/common/remoteTerminalChannel.ts
|
||||
+++ code-server/lib/vscode/src/vs/workbench/contrib/terminal/common/remoteTerminalChannel.ts
|
||||
@@ -88,8 +88,8 @@ export class RemoteTerminalChannelClient
|
||||
get onProcessOrphanQuestion(): Event<{ id: number }> {
|
||||
return this._channel.listen<{ id: number }>('$onProcessOrphanQuestion');
|
||||
}
|
||||
- get onExecuteCommand(): Event<{ reqId: number; commandId: string; commandArgs: any[] }> {
|
||||
- return this._channel.listen<{ reqId: number; commandId: string; commandArgs: any[] }>('$onExecuteCommand');
|
||||
+ get onExecuteCommand(): Event<{ reqId: number; terminalId: number; commandId: string; commandArgs: any[] }> {
|
||||
+ return this._channel.listen<{ reqId: number; terminalId: number; commandId: string; commandArgs: any[] }>('$onExecuteCommand');
|
||||
}
|
||||
get onDidRequestDetach(): Event<{ requestId: number; workspaceId: string; instanceId: number }> {
|
||||
return this._channel.listen<{ requestId: number; workspaceId: string; instanceId: number }>('$onDidRequestDetach');
|
||||
|
|
|
|||
135
patches/clipboard.diff
Normal file
135
patches/clipboard.diff
Normal file
|
|
@ -0,0 +1,135 @@
|
|||
Index: code-server/lib/vscode/src/vs/workbench/api/browser/mainThreadCLICommands.ts
|
||||
===================================================================
|
||||
--- code-server.orig/lib/vscode/src/vs/workbench/api/browser/mainThreadCLICommands.ts
|
||||
+++ code-server/lib/vscode/src/vs/workbench/api/browser/mainThreadCLICommands.ts
|
||||
@@ -8,6 +8,7 @@ import { isWeb } from '../../../base/com
|
||||
import { isString } from '../../../base/common/types.js';
|
||||
import { URI, UriComponents } from '../../../base/common/uri.js';
|
||||
import { localize } from '../../../nls.js';
|
||||
+import { IClipboardService } from '../../../platform/clipboard/common/clipboardService.js';
|
||||
import { CommandsRegistry, ICommandService } from '../../../platform/commands/common/commands.js';
|
||||
import { IExtensionGalleryService, IExtensionManagementService } from '../../../platform/extensionManagement/common/extensionManagement.js';
|
||||
import { ExtensionManagementCLI } from '../../../platform/extensionManagement/common/extensionManagementCLI.js';
|
||||
@@ -95,6 +96,11 @@ CommandsRegistry.registerCommand('_remot
|
||||
|
||||
});
|
||||
|
||||
+CommandsRegistry.registerCommand('_remoteCLI.setClipboard', function (accessor: ServicesAccessor, content: string) {
|
||||
+ const clipboardService = accessor.get(IClipboardService);
|
||||
+ clipboardService.writeText(content);
|
||||
+})
|
||||
+
|
||||
class RemoteExtensionManagementCLI extends ExtensionManagementCLI {
|
||||
|
||||
private _location: string | undefined;
|
||||
Index: code-server/lib/vscode/src/vs/workbench/api/node/extHostCLIServer.ts
|
||||
===================================================================
|
||||
--- code-server.orig/lib/vscode/src/vs/workbench/api/node/extHostCLIServer.ts
|
||||
+++ code-server/lib/vscode/src/vs/workbench/api/node/extHostCLIServer.ts
|
||||
@@ -44,7 +44,12 @@ export interface ExtensionManagementPipe
|
||||
force?: boolean;
|
||||
}
|
||||
|
||||
-export type PipeCommand = OpenCommandPipeArgs | StatusPipeArgs | OpenExternalCommandPipeArgs | ExtensionManagementPipeArgs;
|
||||
+export interface ClipboardPipeArgs {
|
||||
+ type: 'clipboard';
|
||||
+ content: string;
|
||||
+}
|
||||
+
|
||||
+export type PipeCommand = OpenCommandPipeArgs | StatusPipeArgs | OpenExternalCommandPipeArgs | ExtensionManagementPipeArgs | ClipboardPipeArgs;
|
||||
|
||||
export interface ICommandsExecuter {
|
||||
executeCommand<T>(id: string, ...args: any[]): Promise<T>;
|
||||
@@ -106,6 +111,9 @@ export class CLIServerBase {
|
||||
case 'extensionManagement':
|
||||
returnObj = await this.manageExtensions(data);
|
||||
break;
|
||||
+ case 'clipboard':
|
||||
+ returnObj = await this.clipboard(data);
|
||||
+ break;
|
||||
default:
|
||||
sendResponse(404, `Unknown message type: ${data.type}`);
|
||||
break;
|
||||
@@ -173,6 +181,10 @@ export class CLIServerBase {
|
||||
return await this._commands.executeCommand<string | undefined>('_remoteCLI.getSystemStatus');
|
||||
}
|
||||
|
||||
+ private async clipboard(data: ClipboardPipeArgs): Promise<undefined> {
|
||||
+ return await this._commands.executeCommand('_remoteCLI.setClipboard', data.content);
|
||||
+ }
|
||||
+
|
||||
dispose(): void {
|
||||
this._server.close();
|
||||
|
||||
Index: code-server/lib/vscode/src/vs/workbench/contrib/terminal/browser/remoteTerminalBackend.ts
|
||||
===================================================================
|
||||
--- code-server.orig/lib/vscode/src/vs/workbench/contrib/terminal/browser/remoteTerminalBackend.ts
|
||||
+++ code-server/lib/vscode/src/vs/workbench/contrib/terminal/browser/remoteTerminalBackend.ts
|
||||
@@ -98,7 +98,7 @@ class RemoteTerminalBackend extends Base
|
||||
}
|
||||
});
|
||||
|
||||
- const allowedCommands = ['_remoteCLI.openExternal', '_remoteCLI.windowOpen', '_remoteCLI.getSystemStatus', '_remoteCLI.manageExtensions'];
|
||||
+ const allowedCommands = ['_remoteCLI.openExternal', '_remoteCLI.windowOpen', '_remoteCLI.getSystemStatus', '_remoteCLI.manageExtensions', '_remoteCLI.setClipboard'];
|
||||
this._remoteTerminalChannel.onExecuteCommand(async e => {
|
||||
// Ensure this request for for this window
|
||||
const pty = this._ptys.get(e.persistentProcessId);
|
||||
Index: code-server/lib/vscode/src/vs/platform/environment/common/argv.ts
|
||||
===================================================================
|
||||
--- code-server.orig/lib/vscode/src/vs/platform/environment/common/argv.ts
|
||||
+++ code-server/lib/vscode/src/vs/platform/environment/common/argv.ts
|
||||
@@ -137,6 +137,7 @@ export interface NativeParsedArgs {
|
||||
'disable-chromium-sandbox'?: boolean;
|
||||
sandbox?: boolean;
|
||||
'enable-coi'?: boolean;
|
||||
+ 'stdin-to-clipboard'?: boolean;
|
||||
'unresponsive-sample-interval'?: string;
|
||||
'unresponsive-sample-period'?: string;
|
||||
'enable-rdp-display-tracking'?: boolean;
|
||||
Index: code-server/lib/vscode/src/vs/platform/environment/node/argv.ts
|
||||
===================================================================
|
||||
--- code-server.orig/lib/vscode/src/vs/platform/environment/node/argv.ts
|
||||
+++ code-server/lib/vscode/src/vs/platform/environment/node/argv.ts
|
||||
@@ -105,6 +105,7 @@ export const OPTIONS: OptionDescriptions
|
||||
'user-data-dir': { type: 'string', cat: 'o', args: 'dir', description: localize('userDataDir', "Specifies the directory that user data is kept in. Can be used to open multiple distinct instances of Code.") },
|
||||
'profile': { type: 'string', 'cat': 'o', args: 'profileName', description: localize('profileName', "Opens the provided folder or workspace with the given profile and associates the profile with the workspace. If the profile does not exist, a new empty one is created.") },
|
||||
'help': { type: 'boolean', cat: 'o', alias: 'h', description: localize('help', "Print usage.") },
|
||||
+ 'stdin-to-clipboard': { type: 'boolean', cat: 'o', alias: 'c', description: localize('clipboard', "copies the STDIN to the clipboard") },
|
||||
|
||||
'extensions-dir': { type: 'string', deprecates: ['extensionHomePath'], cat: 'e', args: 'dir', description: localize('extensionHomePath', "Set the root path for extensions.") },
|
||||
'extensions-download-dir': { type: 'string' },
|
||||
Index: code-server/lib/vscode/src/vs/server/node/server.cli.ts
|
||||
===================================================================
|
||||
--- code-server.orig/lib/vscode/src/vs/server/node/server.cli.ts
|
||||
+++ code-server/lib/vscode/src/vs/server/node/server.cli.ts
|
||||
@@ -77,6 +77,7 @@ const isSupportedForPipe = (optionId: ke
|
||||
case 'verbose':
|
||||
case 'remote':
|
||||
case 'locate-shell-integration-path':
|
||||
+ case 'stdin-to-clipboard':
|
||||
return true;
|
||||
default:
|
||||
return false;
|
||||
@@ -300,6 +301,22 @@ export async function main(desc: Product
|
||||
}
|
||||
}
|
||||
} else {
|
||||
+ if (parsedArgs['stdin-to-clipboard']) {
|
||||
+ if(!hasStdinWithoutTty()) {
|
||||
+ console.error("stdin has a tty.");
|
||||
+ return;
|
||||
+ }
|
||||
+ const stdinBuffer = fs.readFileSync(0); // STDIN_FILENO = 0
|
||||
+ const clipboardContent = stdinBuffer.toString();
|
||||
+ sendToPipe({
|
||||
+ type: 'clipboard',
|
||||
+ content: clipboardContent
|
||||
+ }, verbose).catch(e => {
|
||||
+ console.error('Error when requesting status:', e);
|
||||
+ });
|
||||
+ return;
|
||||
+ }
|
||||
+
|
||||
if (parsedArgs.status) {
|
||||
await sendToPipe({
|
||||
type: 'status'
|
||||
|
|
@ -1,26 +0,0 @@
|
|||
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);
|
||||
|
|
@ -7,7 +7,7 @@ Index: code-server/lib/vscode/src/vs/workbench/contrib/extensions/browser/extens
|
|||
===================================================================
|
||||
--- 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
|
||||
@@ -237,6 +237,10 @@ export class Extension implements IExten
|
||||
@@ -341,6 +341,10 @@ export class Extension implements IExten
|
||||
if (this.type === ExtensionType.System && this.productService.quality === 'stable') {
|
||||
return false;
|
||||
}
|
||||
|
|
@ -18,14 +18,3 @@ Index: code-server/lib/vscode/src/vs/workbench/contrib/extensions/browser/extens
|
|||
if (!this.local.preRelease && this.gallery.properties.isPreReleaseVersion) {
|
||||
return false;
|
||||
}
|
||||
@@ -1122,6 +1126,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;
|
||||
|
|
|
|||
|
|
@ -1,183 +0,0 @@
|
|||
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
|
||||
@@ -267,6 +267,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 argvResource(): URI { return joinPath(this.userRoamingDataHome, 'argv.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 ----- */
|
||||
|
||||
@@ -95,6 +96,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
|
||||
@@ -304,6 +304,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, ProductQualityContext } 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';
|
||||
@@ -25,6 +24,7 @@ import { IPaneCompositePartService } fro
|
||||
import { Schemas } from 'vs/base/common/network';
|
||||
import { WebFileSystemAccess } from 'vs/platform/files/browser/webFileSystemAccess';
|
||||
import { IProductService } from 'vs/platform/product/common/productService';
|
||||
+import { IBrowserWorkbenchEnvironmentService } from 'vs/workbench/services/environment/browser/environmentService';
|
||||
|
||||
export class WorkbenchContextKeysHandler extends Disposable {
|
||||
private inputFocusedContext: IContextKey<boolean>;
|
||||
@@ -76,7 +76,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,
|
||||
@IProductService private readonly productService: IProductService,
|
||||
@IEditorService private readonly editorService: IEditorService,
|
||||
@IEditorResolverService private readonly editorResolverService: IEditorResolverService,
|
||||
@@ -199,6 +199,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
|
||||
|
||||
|
||||
|
|
@ -1,131 +1,38 @@
|
|||
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 configuredLocale since we have our own thing.
|
||||
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.
|
||||
6. Remove the redundant locale verification. It does the same as the existing
|
||||
one but is worse because it does not handle non-existent or empty files.
|
||||
7. Replace some caching and Node requires because code-server does not restart
|
||||
when changing the language unlike native Code.
|
||||
VS Code web appears to implement language support by setting a cookie and
|
||||
downloading language packs from a URL configured in the product.json. This patch
|
||||
supports language pack extensions and uses files on the remote to set the
|
||||
language instead, so it works like the desktop version.
|
||||
|
||||
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
|
||||
@@ -212,6 +212,9 @@ export async function setupServerService
|
||||
const channel = new ExtensionManagementChannel(extensionManagementService, (ctx: RemoteAgentConnectionContext) => getUriTransformer(ctx.remoteAuthority));
|
||||
socketServer.registerChannel('extensions', channel);
|
||||
@@ -12,7 +12,7 @@ import * as path from '../../base/common
|
||||
import { IURITransformer } from '../../base/common/uriIpc.js';
|
||||
import { getMachineId, getSqmMachineId, getDevDeviceId } from '../../base/node/id.js';
|
||||
import { Promises } from '../../base/node/pfs.js';
|
||||
-import { ClientConnectionEvent, IMessagePassingProtocol, IPCServer, StaticRouter } from '../../base/parts/ipc/common/ipc.js';
|
||||
+import { ClientConnectionEvent, IMessagePassingProtocol, IPCServer, ProxyChannel, StaticRouter } from '../../base/parts/ipc/common/ipc.js';
|
||||
import { ProtocolConstants } from '../../base/parts/ipc/common/ipc.net.js';
|
||||
import { IConfigurationService } from '../../platform/configuration/common/configuration.js';
|
||||
import { ConfigurationService } from '../../platform/configuration/common/configurationService.js';
|
||||
@@ -272,6 +272,9 @@ export async function setupServerService
|
||||
|
||||
+ const languagePackChannel = ProxyChannel.fromService<RemoteAgentConnectionContext>(accessor.get(ILanguagePackService));
|
||||
socketServer.registerChannel('mcpManagement', new McpManagementChannel(mcpManagementService, (ctx: RemoteAgentConnectionContext) => getUriTransformer(ctx.remoteAuthority)));
|
||||
|
||||
+ const languagePackChannel = ProxyChannel.fromService<RemoteAgentConnectionContext>(accessor.get(ILanguagePackService), disposables);
|
||||
+ socketServer.registerChannel('languagePacks', languagePackChannel);
|
||||
+
|
||||
const encryptionChannel = ProxyChannel.fromService<RemoteAgentConnectionContext>(accessor.get(IEncryptionMainService));
|
||||
socketServer.registerChannel('encryption', encryptionChannel);
|
||||
// clean up extensions folder
|
||||
remoteExtensionsScanner.whenExtensionsReady().then(() => extensionManagementService.cleanUp());
|
||||
|
||||
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
|
||||
@@ -2,8 +2,6 @@
|
||||
* Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
* Licensed under the MIT License. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
-import * as nls from 'vs/nls';
|
||||
-
|
||||
const LANGUAGE_DEFAULT = 'en';
|
||||
|
||||
let _isWindows = false;
|
||||
@@ -81,17 +79,19 @@ if (typeof navigator === 'object' && !is
|
||||
_isLinux = _userAgent.indexOf('Linux') >= 0;
|
||||
_isWeb = true;
|
||||
|
||||
- const configuredLocale = nls.getConfiguredDefaultLocale(
|
||||
- // This call _must_ be done in the file that calls `nls.getConfiguredDefaultLocale`
|
||||
- // to ensure that the NLS AMD Loader plugin has been loaded and configured.
|
||||
- // This is because the loader plugin decides what the default locale is based on
|
||||
- // how it's able to resolve the strings.
|
||||
- nls.localize({ key: 'ensureLoaderPluginIsLoaded', comment: ['{Locked}'] }, '_')
|
||||
- );
|
||||
-
|
||||
- _locale = configuredLocale || LANGUAGE_DEFAULT;
|
||||
+ _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" />
|
||||
@@ -46,15 +49,26 @@
|
||||
// Set up nls if the user is not using the default language (English)
|
||||
const nlsConfig = {};
|
||||
const locale = window.localStorage.getItem('vscode.nls.locale') || navigator.language;
|
||||
- if (!locale.startsWith('en')) {
|
||||
- nlsConfig['vs/nls'] = {
|
||||
- availableLanguages: {
|
||||
- '*': locale
|
||||
- },
|
||||
- translationServiceUrl: '{{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`,
|
||||
recordStats: true,
|
||||
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
|
||||
@@ -105,7 +105,7 @@ export abstract class AbstractNativeEnvi
|
||||
@@ -98,7 +98,7 @@ export abstract class AbstractNativeEnvi
|
||||
return URI.file(join(vscodePortable, 'argv.json'));
|
||||
}
|
||||
|
||||
|
|
@ -138,31 +45,37 @@ 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';
|
||||
@@ -3,6 +3,8 @@
|
||||
* Licensed under the MIT License. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
|
||||
+import { promises as fs } from 'fs';
|
||||
+import * as path from 'path';
|
||||
import { FileAccess } from '../../base/common/network.js';
|
||||
import { join } from '../../base/common/path.js';
|
||||
import type { INLSConfiguration } from '../../nls.js';
|
||||
@@ -33,7 +35,94 @@ export async function getNLSConfiguratio
|
||||
if (!result) {
|
||||
result = resolveNLSConfiguration({ userLocale: language, osLocale: language, commit: product.commit, userDataPath, nlsMetadataPath });
|
||||
nlsConfigurationCache.set(cacheKey, result);
|
||||
+ // If the language pack does not yet exist, it defaults to English, which is
|
||||
+ // then cached and you have to restart even if you then install the pack.
|
||||
+ result.then((r) => {
|
||||
+ if (!language.startsWith('en') && r.resolvedLanguage.startsWith('en')) {
|
||||
+ nlsConfigurationCache.delete(cacheKey);
|
||||
+ }
|
||||
+ })
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
+
|
||||
+/**
|
||||
+ * The code below is copied from from src/main.js.
|
||||
+ * Copied from from src/main.js.
|
||||
+ */
|
||||
+
|
||||
+export const getLocaleFromConfig = async (argvResource: string): Promise<string> => {
|
||||
+ try {
|
||||
+ const content = stripComments(await fs.promises.readFile(argvResource, 'utf8'));
|
||||
+ const content = stripComments(await fs.readFile(argvResource, 'utf8'));
|
||||
+ return JSON.parse(content).locale;
|
||||
+ } catch (error) {
|
||||
+ if (error.code !== "ENOENT") {
|
||||
|
|
@ -172,6 +85,9 @@ Index: code-server/lib/vscode/src/vs/server/node/remoteLanguagePacks.ts
|
|||
+ }
|
||||
+};
|
||||
+
|
||||
+/**
|
||||
+ * Copied from from src/main.js.
|
||||
+ */
|
||||
+const stripComments = (content: string): string => {
|
||||
+ const regexp = /('(?:[^\\']*(?:\\.)?)*')|('(?:[^\\']*(?:\\.)?)*')|(\/\*(?:\r?\n|.)*?\*\/)|(\/{2,}.*?(?:(?:\r?\n)|$))/g;
|
||||
+
|
||||
|
|
@ -195,106 +111,144 @@ Index: code-server/lib/vscode/src/vs/server/node/remoteLanguagePacks.ts
|
|||
+ }
|
||||
+ });
|
||||
+};
|
||||
+
|
||||
+/**
|
||||
+ * Generate translations then return a path to a JavaScript file that sets the
|
||||
+ * translations into global variables. This file is loaded by the browser to
|
||||
+ * set global variables that the loader uses when looking for translations.
|
||||
+ *
|
||||
+ * Normally, VS Code pulls these files from a CDN but we want them to be local.
|
||||
+ */
|
||||
+export async function getBrowserNLSConfiguration(locale: string, userDataPath: string): Promise<string> {
|
||||
+ if (locale.startsWith('en')) {
|
||||
+ return ''; // Use fallback translations.
|
||||
+ }
|
||||
+
|
||||
+ const nlsConfig = await getNLSConfiguration(locale, userDataPath);
|
||||
+ const messagesFile = nlsConfig?.languagePack?.messagesFile;
|
||||
+ const resolvedLanguage = nlsConfig?.resolvedLanguage;
|
||||
+ if (!messagesFile || !resolvedLanguage) {
|
||||
+ return ''; // Use fallback translations.
|
||||
+ }
|
||||
+
|
||||
+ const nlsFile = path.join(path.dirname(messagesFile), "nls.messages.js");
|
||||
+ try {
|
||||
+ await fs.stat(nlsFile);
|
||||
+ return nlsFile; // We already generated the file.
|
||||
+ } catch (error) {
|
||||
+ // ENOENT is fine, that just means we need to generate the file.
|
||||
+ if (error.code !== 'ENOENT') {
|
||||
+ throw error;
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+ const messages = (await fs.readFile(messagesFile)).toString();
|
||||
+ const content = `globalThis._VSCODE_NLS_MESSAGES=${messages};
|
||||
+globalThis._VSCODE_NLS_LANGUAGE=${JSON.stringify(resolvedLanguage)};`
|
||||
+ await fs.writeFile(nlsFile, content, "utf-8");
|
||||
+
|
||||
+ return nlsFile;
|
||||
+}
|
||||
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';
|
||||
|
||||
@@ -299,6 +300,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,
|
||||
@@ -339,6 +342,7 @@ export class WebClientServer {
|
||||
WORKBENCH_NLS_BASE_URL: vscodeBase + (nlsBaseUrl ? `${nlsBaseUrl}${!nlsBaseUrl.endsWith('/') ? '/' : ''}${this._productService.commit}/${this._productService.version}/` : ''),
|
||||
BASE: base,
|
||||
VS_BASE: vscodeBase,
|
||||
+ NLS_CONFIGURATION: asJSON(nlsConfiguration),
|
||||
@@ -25,6 +25,7 @@ import { URI } from '../../base/common/u
|
||||
import { streamToBuffer } from '../../base/common/buffer.js';
|
||||
import { IProductConfiguration } from '../../base/common/product.js';
|
||||
import { isString, Mutable } from '../../base/common/types.js';
|
||||
+import { getLocaleFromConfig, getBrowserNLSConfiguration } from './remoteLanguagePacks.js';
|
||||
import { CharCode } from '../../base/common/charCode.js';
|
||||
import { IExtensionManifest } from '../../platform/extensions/common/extensions.js';
|
||||
import { ICSSDevelopmentService } from '../../platform/cssDev/node/cssDevService.js';
|
||||
@@ -385,14 +386,22 @@ export class WebClientServer {
|
||||
};
|
||||
|
||||
const cookies = cookie.parse(req.headers.cookie || '');
|
||||
- const locale = cookies['vscode.nls.locale'] || req.headers['accept-language']?.split(',')[0]?.toLowerCase() || 'en';
|
||||
+ const locale = this._environmentService.args.locale || await getLocaleFromConfig(this._environmentService.argvResource.fsPath) || cookies['vscode.nls.locale'] || req.headers['accept-language']?.split(',')[0]?.toLowerCase() || 'en';
|
||||
let WORKBENCH_NLS_BASE_URL: string | undefined;
|
||||
let WORKBENCH_NLS_URL: string;
|
||||
if (!locale.startsWith('en') && this._productService.nlsCoreBaseUrl) {
|
||||
WORKBENCH_NLS_BASE_URL = this._productService.nlsCoreBaseUrl;
|
||||
WORKBENCH_NLS_URL = `${WORKBENCH_NLS_BASE_URL}${this._productService.commit}/${this._productService.version}/${locale}/nls.messages.js`;
|
||||
} else {
|
||||
- WORKBENCH_NLS_URL = ''; // fallback will apply
|
||||
+ try {
|
||||
+ const nlsFile = await getBrowserNLSConfiguration(locale, this._environmentService.userDataPath);
|
||||
+ WORKBENCH_NLS_URL = nlsFile
|
||||
+ ? `${vscodeBase}/vscode-remote-resource?path=${encodeURIComponent(nlsFile)}`
|
||||
+ : '';
|
||||
+ } catch (error) {
|
||||
+ console.error("Failed to generate translations", error);
|
||||
+ WORKBENCH_NLS_URL = '';
|
||||
+ }
|
||||
}
|
||||
|
||||
const values: { [key: string]: 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
|
||||
@@ -15,6 +15,7 @@ export const serverOptions: OptionDescri
|
||||
'disable-update-check': { type: 'boolean' },
|
||||
'auth': { type: 'string' },
|
||||
@@ -22,6 +22,7 @@ export const serverOptions: OptionDescri
|
||||
'disable-file-downloads': { type: 'boolean' },
|
||||
'disable-file-uploads': { type: 'boolean' },
|
||||
'disable-getting-started-override': { type: 'boolean' },
|
||||
+ 'locale': { type: 'string' },
|
||||
|
||||
/* ----- server setup ----- */
|
||||
|
||||
@@ -97,6 +98,7 @@ export interface ServerParsedArgs {
|
||||
'disable-update-check'?: boolean;
|
||||
'auth'?: string
|
||||
@@ -113,6 +114,7 @@ export interface ServerParsedArgs {
|
||||
'disable-file-downloads'?: boolean;
|
||||
'disable-file-uploads'?: boolean;
|
||||
'disable-getting-started-override'?: 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
|
||||
@@ -122,8 +122,9 @@ import 'vs/workbench/contrib/logs/browse
|
||||
// Explorer
|
||||
import 'vs/workbench/contrib/files/browser/files.web.contribution';
|
||||
|
||||
-// Localization
|
||||
-import 'vs/workbench/contrib/localization/browser/localization.contribution';
|
||||
+// Localization. This does not actually import anything specific to Electron so
|
||||
+// it should be safe.
|
||||
+import 'vs/workbench/contrib/localization/electron-sandbox/localization.contribution';
|
||||
|
||||
// Performance
|
||||
import 'vs/workbench/contrib/performance/browser/performance.web.contribution';
|
||||
Index: code-server/lib/vscode/src/vs/platform/languagePacks/browser/languagePacks.ts
|
||||
===================================================================
|
||||
--- code-server.orig/lib/vscode/src/vs/platform/languagePacks/browser/languagePacks.ts
|
||||
+++ code-server/lib/vscode/src/vs/platform/languagePacks/browser/languagePacks.ts
|
||||
@@ -4,10 +4,23 @@
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
@@ -5,18 +5,24 @@
|
||||
|
||||
import { ILanguagePackItem, LanguagePackBaseService } from 'vs/platform/languagePacks/common/languagePacks';
|
||||
+import { ProxyChannel } from 'vs/base/parts/ipc/common/ipc';
|
||||
+import { ILanguagePackService } from 'vs/platform/languagePacks/common/languagePacks';
|
||||
+import { IRemoteAgentService } from 'vs/workbench/services/remote/common/remoteAgentService';
|
||||
+import { IExtensionGalleryService } from 'vs/platform/extensionManagement/common/extensionManagement';
|
||||
import { CancellationTokenSource } from '../../../base/common/cancellation.js';
|
||||
import { URI } from '../../../base/common/uri.js';
|
||||
+import { ProxyChannel } from '../../../base/parts/ipc/common/ipc.js';
|
||||
import { IExtensionGalleryService } from '../../extensionManagement/common/extensionManagement.js';
|
||||
import { IExtensionResourceLoaderService } from '../../extensionResourceLoader/common/extensionResourceLoader.js';
|
||||
-import { ILanguagePackItem, LanguagePackBaseService } from '../common/languagePacks.js';
|
||||
+import { ILanguagePackItem, ILanguagePackService, LanguagePackBaseService } from '../common/languagePacks.js';
|
||||
import { ILogService } from '../../log/common/log.js';
|
||||
+import { IRemoteAgentService } from '../../../workbench/services/remote/common/remoteAgentService.js';
|
||||
|
||||
export class WebLanguagePacksService extends LanguagePackBaseService {
|
||||
- // Web doesn't have a concept of language packs, so we just return an empty array
|
||||
+ private readonly languagePackService: ILanguagePackService;
|
||||
+
|
||||
+ constructor(
|
||||
constructor(
|
||||
+ @IRemoteAgentService remoteAgentService: IRemoteAgentService,
|
||||
+ @IExtensionGalleryService extensionGalleryService: IExtensionGalleryService
|
||||
+ ) {
|
||||
+ super(extensionGalleryService)
|
||||
+ this.languagePackService = ProxyChannel.toService<ILanguagePackService>(remoteAgentService.getConnection()!.getChannel('languagePacks'));
|
||||
+ }
|
||||
+
|
||||
@IExtensionResourceLoaderService private readonly extensionResourceLoaderService: IExtensionResourceLoaderService,
|
||||
@IExtensionGalleryService extensionGalleryService: IExtensionGalleryService,
|
||||
@ILogService private readonly logService: ILogService
|
||||
) {
|
||||
super(extensionGalleryService);
|
||||
+ this.languagePackService = ProxyChannel.toService<ILanguagePackService>(remoteAgentService.getConnection()!.getChannel('languagePacks'))
|
||||
}
|
||||
|
||||
async getBuiltInExtensionTranslationsUri(id: string, language: string): Promise<URI | undefined> {
|
||||
@@ -72,6 +78,6 @@ export class WebLanguagePacksService ext
|
||||
|
||||
// Web doesn't have a concept of language packs, so we just return an empty array
|
||||
getInstalledLanguages(): Promise<ILanguagePackItem[]> {
|
||||
- return Promise.resolve([]);
|
||||
+ return this.languagePackService.getInstalledLanguages()
|
||||
}
|
||||
}
|
||||
Index: code-server/lib/vscode/src/vs/workbench/contrib/localization/electron-sandbox/localeService.ts
|
||||
Index: code-server/lib/vscode/src/vs/workbench/services/localization/electron-browser/localeService.ts
|
||||
===================================================================
|
||||
--- code-server.orig/lib/vscode/src/vs/workbench/contrib/localization/electron-sandbox/localeService.ts
|
||||
+++ code-server/lib/vscode/src/vs/workbench/contrib/localization/electron-sandbox/localeService.ts
|
||||
@@ -41,7 +41,8 @@ export class NativeLocaleService impleme
|
||||
--- code-server.orig/lib/vscode/src/vs/workbench/services/localization/electron-browser/localeService.ts
|
||||
+++ code-server/lib/vscode/src/vs/workbench/services/localization/electron-browser/localeService.ts
|
||||
@@ -51,7 +51,8 @@ class NativeLocaleService implements ILo
|
||||
@IProductService private readonly productService: IProductService
|
||||
) { }
|
||||
|
||||
|
|
@ -304,7 +258,7 @@ Index: code-server/lib/vscode/src/vs/workbench/contrib/localization/electron-san
|
|||
try {
|
||||
const content = await this.textFileService.read(this.environmentService.argvResource, { encoding: 'utf8' });
|
||||
|
||||
@@ -68,9 +69,6 @@ export class NativeLocaleService impleme
|
||||
@@ -78,9 +79,6 @@ class NativeLocaleService implements ILo
|
||||
}
|
||||
|
||||
private async writeLocaleValue(locale: string | undefined): Promise<boolean> {
|
||||
|
|
@ -314,19 +268,83 @@ Index: code-server/lib/vscode/src/vs/workbench/contrib/localization/electron-san
|
|||
await this.jsonEditingService.write(this.environmentService.argvResource, [{ path: ['locale'], value: locale }], true);
|
||||
return true;
|
||||
}
|
||||
Index: code-server/lib/vscode/src/vs/base/node/languagePacks.js
|
||||
Index: code-server/lib/vscode/src/vs/workbench/contrib/extensions/browser/extensionsActions.ts
|
||||
===================================================================
|
||||
--- code-server.orig/lib/vscode/src/vs/base/node/languagePacks.js
|
||||
+++ code-server/lib/vscode/src/vs/base/node/languagePacks.js
|
||||
@@ -73,7 +73,10 @@
|
||||
function getLanguagePackConfigurations(userDataPath) {
|
||||
const configFile = path.join(userDataPath, 'languagepacks.json');
|
||||
try {
|
||||
- return nodeRequire(configFile);
|
||||
+ // This must not use Node's require otherwise it will be cached forever.
|
||||
+ // Code can get away with this since the process actually restarts but
|
||||
+ // that is not currently the case with code-server.
|
||||
+ return JSON.parse(fs.readFileSync(configFile, "utf8"));
|
||||
} catch (err) {
|
||||
// Do nothing. If we can't read the file we have no
|
||||
// language pack config.
|
||||
--- code-server.orig/lib/vscode/src/vs/workbench/contrib/extensions/browser/extensionsActions.ts
|
||||
+++ code-server/lib/vscode/src/vs/workbench/contrib/extensions/browser/extensionsActions.ts
|
||||
@@ -475,9 +475,6 @@ export class InstallAction extends Exten
|
||||
if (this.extension.isBuiltin) {
|
||||
return;
|
||||
}
|
||||
- if (this.extensionsWorkbenchService.canSetLanguage(this.extension)) {
|
||||
- return;
|
||||
- }
|
||||
if (this.extension.state !== ExtensionState.Uninstalled) {
|
||||
return;
|
||||
}
|
||||
@@ -782,7 +779,7 @@ export abstract class InstallInOtherServ
|
||||
}
|
||||
|
||||
if (isLanguagePackExtension(this.extension.local.manifest)) {
|
||||
- return true;
|
||||
+ return false;
|
||||
}
|
||||
|
||||
// Prefers to run on UI
|
||||
@@ -2073,17 +2070,6 @@ export class SetLanguageAction extends E
|
||||
update(): void {
|
||||
this.enabled = false;
|
||||
this.class = SetLanguageAction.DisabledClass;
|
||||
- if (!this.extension) {
|
||||
- return;
|
||||
- }
|
||||
- if (!this.extensionsWorkbenchService.canSetLanguage(this.extension)) {
|
||||
- return;
|
||||
- }
|
||||
- if (this.extension.gallery && language === getLocale(this.extension.gallery)) {
|
||||
- return;
|
||||
- }
|
||||
- this.enabled = true;
|
||||
- this.class = SetLanguageAction.EnabledClass;
|
||||
}
|
||||
|
||||
override async run(): Promise<any> {
|
||||
@@ -2100,7 +2086,6 @@ export class ClearLanguageAction extends
|
||||
private static readonly DisabledClass = `${this.EnabledClass} disabled`;
|
||||
|
||||
constructor(
|
||||
- @IExtensionsWorkbenchService private readonly extensionsWorkbenchService: IExtensionsWorkbenchService,
|
||||
@ILocaleService private readonly localeService: ILocaleService,
|
||||
) {
|
||||
super(ClearLanguageAction.ID, ClearLanguageAction.TITLE.value, ClearLanguageAction.DisabledClass, false);
|
||||
@@ -2110,17 +2095,6 @@ export class ClearLanguageAction extends
|
||||
update(): void {
|
||||
this.enabled = false;
|
||||
this.class = ClearLanguageAction.DisabledClass;
|
||||
- if (!this.extension) {
|
||||
- return;
|
||||
- }
|
||||
- if (!this.extensionsWorkbenchService.canSetLanguage(this.extension)) {
|
||||
- return;
|
||||
- }
|
||||
- if (this.extension.gallery && language !== getLocale(this.extension.gallery)) {
|
||||
- return;
|
||||
- }
|
||||
- this.enabled = true;
|
||||
- this.class = ClearLanguageAction.EnabledClass;
|
||||
}
|
||||
|
||||
override async run(): Promise<any> {
|
||||
Index: code-server/lib/vscode/src/vs/workbench/workbench.web.main.internal.ts
|
||||
===================================================================
|
||||
--- code-server.orig/lib/vscode/src/vs/workbench/workbench.web.main.internal.ts
|
||||
+++ code-server/lib/vscode/src/vs/workbench/workbench.web.main.internal.ts
|
||||
@@ -54,7 +54,7 @@ import './services/dialogs/browser/fileD
|
||||
import './services/host/browser/browserHostService.js';
|
||||
import './services/lifecycle/browser/lifecycleService.js';
|
||||
import './services/clipboard/browser/clipboardService.js';
|
||||
-import './services/localization/browser/localeService.js';
|
||||
+import './services/localization/electron-browser/localeService.js';
|
||||
import './services/path/browser/pathService.js';
|
||||
import './services/themes/browser/browserHostColorSchemeService.js';
|
||||
import './services/encryption/browser/encryptionService.js';
|
||||
|
|
|
|||
Some files were not shown because too many files have changed in this diff Show more
Loading…
Reference in a new issue