Skip to content

Commit c252510

Browse files
authored
Merge branch 'main' into feature/k8s-lifecycle-hook
2 parents 96ee199 + 6b9bb89 commit c252510

24 files changed

+320
-90
lines changed

.github/CODEOWNERS

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
11
* @coder/code-server-reviewers
22

33
ci/helm-chart/ @Matthew-Beckett @alexgorbatchev
4+
5+
docs/install.md @GNUxeava

.github/workflows/ci.yaml

Lines changed: 90 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -198,9 +198,9 @@ jobs:
198198
# This environment "npm" requires someone from
199199
# coder/code-server-reviewers to approve the PR before this job runs.
200200
environment: npm
201-
# Only run if PR comes from base repo
201+
# Only run if PR comes from base repo or on merge request
202202
# Reason: forks cannot access secrets and this will always fail
203-
if: github.event.pull_request.head.repo.full_name == github.repository
203+
if: github.event.pull_request.head.repo.full_name == github.repository || github.event.pull_request.merged == true
204204
runs-on: ubuntu-latest
205205
steps:
206206
- name: Checkout repo
@@ -461,7 +461,6 @@ jobs:
461461
uses: actions/checkout@v3
462462
with:
463463
fetch-depth: 0
464-
submodules: true
465464

466465
- name: Install Node.js v16
467466
uses: actions/setup-node@v3
@@ -491,7 +490,7 @@ jobs:
491490
492491
- name: Install dependencies
493492
if: steps.cache-yarn.outputs.cache-hit != 'true'
494-
run: yarn --frozen-lockfile
493+
run: SKIP_SUBMODULE_DEPS=1 yarn --frozen-lockfile
495494

496495
- name: Install Playwright OS dependencies
497496
run: |
@@ -511,6 +510,93 @@ jobs:
511510
- name: Remove release packages and test artifacts
512511
run: rm -rf ./release-packages ./test/test-results
513512

513+
test-e2e-proxy:
514+
name: End-to-end tests behind proxy
515+
needs: package-linux-amd64
516+
runs-on: ubuntu-latest
517+
timeout-minutes: 25
518+
env:
519+
# Since we build code-server we might as well run tests from the release
520+
# since VS Code will load faster due to the bundling.
521+
CODE_SERVER_TEST_ENTRY: "./release-packages/code-server-linux-amd64"
522+
steps:
523+
- name: Checkout repo
524+
uses: actions/checkout@v3
525+
with:
526+
fetch-depth: 0
527+
528+
- name: Install Node.js v16
529+
uses: actions/setup-node@v3
530+
with:
531+
node-version: "16"
532+
533+
- name: Fetch dependencies from cache
534+
id: cache-yarn
535+
uses: actions/cache@v3
536+
with:
537+
path: "**/node_modules"
538+
key: yarn-build-${{ hashFiles('**/yarn.lock') }}
539+
restore-keys: |
540+
yarn-build-
541+
542+
- name: Download release packages
543+
uses: actions/download-artifact@v3
544+
with:
545+
name: release-packages
546+
path: ./release-packages
547+
548+
- name: Untar code-server release
549+
run: |
550+
cd release-packages
551+
tar -xzf code-server*-linux-amd64.tar.gz
552+
mv code-server*-linux-amd64 code-server-linux-amd64
553+
554+
- name: Install dependencies
555+
if: steps.cache-yarn.outputs.cache-hit != 'true'
556+
run: SKIP_SUBMODULE_DEPS=1 yarn --frozen-lockfile
557+
558+
- name: Install Playwright OS dependencies
559+
run: |
560+
./test/node_modules/.bin/playwright install-deps
561+
./test/node_modules/.bin/playwright install
562+
563+
- name: Cache Caddy
564+
uses: actions/cache@v2
565+
id: caddy-cache
566+
with:
567+
path: |
568+
~/.cache/caddy
569+
key: cache-caddy-2.5.2
570+
571+
- name: Install Caddy
572+
env:
573+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
574+
if: steps.caddy-cache.outputs.cache-hit != 'true'
575+
run: |
576+
gh release download v2.5.2 --repo caddyserver/caddy --pattern "caddy_2.5.2_linux_amd64.tar.gz"
577+
mkdir -p ~/.cache/caddy
578+
tar -xzf caddy_2.5.2_linux_amd64.tar.gz --directory ~/.cache/caddy
579+
580+
- name: Start Caddy
581+
run: sudo ~/.cache/caddy/caddy start --config ./ci/Caddyfile
582+
583+
- name: Run end-to-end tests
584+
run: yarn test:e2e:proxy
585+
586+
- name: Stop Caddy
587+
if: always()
588+
run: sudo ~/.cache/caddy/caddy stop --config ./ci/Caddyfile
589+
590+
- name: Upload test artifacts
591+
if: always()
592+
uses: actions/upload-artifact@v3
593+
with:
594+
name: failed-test-videos-proxy
595+
path: ./test/test-results
596+
597+
- name: Remove release packages and test artifacts
598+
run: rm -rf ./release-packages ./test/test-results
599+
514600
trivy-scan-repo:
515601
permissions:
516602
contents: read # for actions/checkout to fetch code

.github/workflows/installer.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ jobs:
3939
alpine:
4040
name: Test installer on Alpine
4141
runs-on: ubuntu-latest
42-
container: "alpine:3.14"
42+
container: "alpine:3.16"
4343
steps:
4444
- name: Checkout repo
4545
uses: actions/checkout@v3

.github/workflows/scripts.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ jobs:
3838
name: Run script unit tests
3939
runs-on: ubuntu-latest
4040
# This runs on Alpine to make sure we're testing with actual sh.
41-
container: "alpine:3.14"
41+
container: "alpine:3.16"
4242
steps:
4343
- name: Checkout repo
4444
uses: actions/checkout@v3

ci/Caddyfile

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
{
2+
admin localhost:4444
3+
}
4+
:8000 {
5+
@portLocalhost path_regexp port ^/([0-9]+)\/ide
6+
handle @portLocalhost {
7+
uri strip_prefix {re.port.1}/ide
8+
reverse_proxy localhost:{re.port.1}
9+
}
10+
11+
handle {
12+
respond "Bad hostname" 400
13+
}
14+
15+
}

docs/MAINTAINING.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,7 @@ If you're the current release manager, follow these steps:
175175
1. Bump chart version in `Chart.yaml`.
176176
1. Summarize the major changes in the release notes and link to the relevant
177177
issues.
178-
1. Change the @ to target the version branch. Example: `v3.9.0 @ Target: v3.9.0`
178+
1. Change the @ to target the version branch. Example: `v3.9.0 @ Target: release/v3.9.0`
179179
1. Wait for the `npm-package`, `release-packages` and `release-images` artifacts
180180
to build.
181181
1. Run `yarn release:github-assets` to download the `release-packages` artifact.

docs/install.md

Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
- [Debian, Ubuntu](#debian-ubuntu)
1010
- [Fedora, CentOS, RHEL, SUSE](#fedora-centos-rhel-suse)
1111
- [Arch Linux](#arch-linux)
12+
- [Artix Linux](#artix-linux)
1213
- [macOS](#macos)
1314
- [Docker](#docker)
1415
- [Helm](#helm)
@@ -190,6 +191,72 @@ sudo systemctl enable --now code-server@$USER
190191
# Now visit http://127.0.0.1:8080. Your password is in ~/.config/code-server/config.yaml
191192
```
192193

194+
## Artix Linux
195+
196+
```bash
197+
# Install code-server from the AUR
198+
git clone https://aur.archlinux.org/code-server.git
199+
cd code-server
200+
makepkg -si
201+
```
202+
203+
Save the file as `code-server` in `/etc/init.d/` and make it executable with `chmod +x code-server`. Put your username in line 3.
204+
205+
```bash
206+
#!/sbin/openrc-run
207+
name=$RC_SVCNAME
208+
description="$name - VS Code on a remote server"
209+
user="" # your username here
210+
homedir="/home/$user"
211+
command="$(which code-server)"
212+
# Just because you can do this does not mean you should. Use ~/.config/code-server/config.yaml instead
213+
#command_args="--extensions-dir $homedir/.local/share/$name/extensions --user-data-dir $homedir/.local/share/$name --disable-telemetry"
214+
command_user="$user:$user"
215+
pidfile="/run/$name/$name.pid"
216+
command_background="yes"
217+
extra_commands="report"
218+
219+
depend() {
220+
use logger dns
221+
need net
222+
}
223+
224+
start_pre() {
225+
checkpath --directory --owner $command_user --mode 0755 /run/$name /var/log/$name
226+
}
227+
228+
start() {
229+
default_start
230+
report
231+
}
232+
233+
stop() {
234+
default_stop
235+
}
236+
237+
status() {
238+
default_status
239+
report
240+
}
241+
242+
report() {
243+
# Report to the user
244+
einfo "Reading configuration from ~/.config/code-server/config.yaml"
245+
}
246+
```
247+
248+
Start on boot with default runlevel
249+
250+
```
251+
rc-update add code-server default
252+
```
253+
254+
Start the service immediately
255+
256+
```
257+
rc-service code-server start
258+
```
259+
193260
## macOS
194261

195262
```bash

docs/termux.md

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
# Termux
44

55
- [Install](#install)
6+
- [Yarn Installation](#yarn-installation)
67
- [Upgrade](#upgrade)
78
- [Known Issues](#known-issues)
89
- [Git won't work in `/sdcard`](#git-wont-work-in-sdcard)
@@ -65,6 +66,59 @@ curl -fsSL https://code-server.dev/install.sh | sh
6566
> 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.\
6667
> Learn how to add a user [here](#create-a-new-user).
6768
69+
## Yarn Installation
70+
71+
1. Get [Termux](https://f-droid.org/en/packages/com.termux/) from **F-Droid**.
72+
73+
2. We will now change using the following command.
74+
75+
```sh
76+
termux-change-repo
77+
```
78+
79+
Now select `Main Repository` then change repo to `Mirrors by Grimler Hosted on grimler.se`.
80+
81+
3. After successfully updating of repository update and upgrade all the packages by the following command
82+
83+
```sh
84+
pkg update
85+
pkg upgrade -y
86+
```
87+
88+
4. Now let's install requirement dependancy.
89+
90+
```sh
91+
pkg install -y \
92+
build-essential \
93+
binutils \
94+
pkg-config \
95+
python3 \
96+
yarn \
97+
nodejs-lts
98+
npm config set python python3
99+
node -v
100+
```
101+
102+
you will get node version `v16.15.0`
103+
104+
5. Now install code-server
105+
106+
```sh
107+
yarn global add code-server
108+
```
109+
110+
6. Congratulation code-server is installed on your device using the following command.
111+
112+
```sh
113+
code-server --auth none
114+
```
115+
116+
7. If already installed then use the following command for upgradation.
117+
118+
```
119+
yarn upgrade code-server
120+
```
121+
68122
## Upgrade
69123

70124
1. Remove all previous installs `rm -rf ~/.local/lib/code-server-*`

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
"release:github-assets": "./ci/build/release-github-assets.sh",
1919
"release:prep": "./ci/build/release-prep.sh",
2020
"test:e2e": "VSCODE_IPC_HOOK_CLI= ./ci/dev/test-e2e.sh",
21+
"test:e2e:proxy": "USE_PROXY=1 ./ci/dev/test-e2e.sh",
2122
"test:unit": "./ci/dev/test-unit.sh --forceExit --detectOpenHandles",
2223
"test:integration": "./ci/dev/test-integration.sh",
2324
"test:scripts": "./ci/dev/test-scripts.sh",

src/node/routes/vscode.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,7 @@ export class CodeServerRouteWrapper {
170170

171171
constructor() {
172172
this.router.get("/", this.ensureCodeServerLoaded, this.$root)
173-
this.router.get(/manifest.json$/, this.manifest)
173+
this.router.get("/manifest.json", this.manifest)
174174
this.router.all("*", ensureAuthenticated, this.ensureCodeServerLoaded, this.$proxyRequest)
175175
this._wsRouterWrapper.ws("*", ensureAuthenticated, this.ensureCodeServerLoaded, this.$proxyWebsocket)
176176
}

0 commit comments

Comments
 (0)