Compare commits

...

16 Commits

Author SHA1 Message Date
Olivier Benz
8c077bf605 Update Code to 1.107.1 (#7606) 2026-01-08 12:41:01 -09:00
egvimo
41f7ba903f Use /healthz and reuse labels in Helm chart (#7604) 2026-01-08 12:40:04 -09:00
Asher
ac7322ce56 Update changelog 2025-12-11 16:33:07 -09:00
Timon Fiedler
68ac95b84e Add cookie-suffix flag (#7590) 2025-12-11 16:23:09 -09:00
Vladimir Mladenovic
0de7cf5679 Add configurable authorization header to marketplace API calls (#7596) 2025-12-11 16:02:42 -09:00
Olivier Benz
ea9a3a5ab2 Update Code to 1.107.0 (#7599) 2025-12-11 16:02:11 -09:00
Asher
472bf8a5fa Remove homebrew step
It has been broken for a long time (No available formula with the name
"code-server") but it looks like they have their own bot publishing
updates anyway.
2025-12-02 13:38:27 -09:00
dependabot[bot]
eccb1eb537 chore: bump actions/setup-node from 4 to 6 (#7550) 2025-12-02 13:04:45 -09:00
Asher
f128a7ac11 Update actionlint to 1.7.9 2025-12-01 12:55:13 -09:00
Asher
80996d2e08 Add VS Code web to the bug template 2025-12-01 12:49:28 -09:00
dependabot[bot]
9819b91c74 chore: bump actions/checkout from 5 to 6 (#7585) 2025-12-01 12:47:25 -09:00
Olivier Benz
2ed1098c1e Update Code to 1.106.3 (#7583) 2025-12-01 11:52:45 -09:00
Asher
85042e2910 Note settings change from VS Code web and Codespaces 2025-11-25 14:39:16 -09:00
Asher
904942a194 Increase build timeout 2025-11-19 14:02:53 -09:00
Olivier Benz
9a24e467b2 Update Code to 1.106.2 (#7571) 2025-11-19 12:54:38 -09:00
Olivier Benz
24a777491b Update Code to 1.106.1 (#7570) 2025-11-19 09:09:30 -09:00
40 changed files with 222 additions and 154 deletions

View File

@@ -86,6 +86,18 @@ body:
validations: validations:
required: true 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 - type: dropdown
attributes: attributes:
label: Does this bug reproduce in GitHub Codespaces? label: Does this bug reproduce in GitHub Codespaces?

View File

@@ -32,7 +32,7 @@ jobs:
helm: ${{ steps.filter.outputs.helm }} helm: ${{ steps.filter.outputs.helm }}
steps: steps:
- name: Checkout repo - name: Checkout repo
uses: actions/checkout@v5 uses: actions/checkout@v6
- name: Check changed files - name: Check changed files
uses: dorny/paths-filter@v3 uses: dorny/paths-filter@v3
id: filter id: filter
@@ -64,8 +64,8 @@ jobs:
runs-on: ubuntu-22.04 runs-on: ubuntu-22.04
timeout-minutes: 5 timeout-minutes: 5
steps: steps:
- uses: actions/checkout@v5 - uses: actions/checkout@v6
- uses: actions/setup-node@v4 - uses: actions/setup-node@v6
with: with:
node-version-file: .node-version node-version-file: .node-version
cache: npm cache: npm
@@ -82,8 +82,8 @@ jobs:
needs: changes needs: changes
if: needs.changes.outputs.docs == 'true' if: needs.changes.outputs.docs == 'true'
steps: steps:
- uses: actions/checkout@v5 - uses: actions/checkout@v6
- uses: actions/setup-node@v4 - uses: actions/setup-node@v6
with: with:
node-version-file: .node-version node-version-file: .node-version
cache: npm cache: npm
@@ -100,7 +100,7 @@ jobs:
needs: changes needs: changes
if: needs.changes.outputs.helm == 'true' if: needs.changes.outputs.helm == 'true'
steps: steps:
- uses: actions/checkout@v5 - uses: actions/checkout@v6
- uses: azure/setup-helm@v4 - uses: azure/setup-helm@v4
with: with:
token: ${{ secrets.GITHUB_TOKEN }} token: ${{ secrets.GITHUB_TOKEN }}
@@ -114,8 +114,8 @@ jobs:
needs: changes needs: changes
if: needs.changes.outputs.code == 'true' if: needs.changes.outputs.code == 'true'
steps: steps:
- uses: actions/checkout@v5 - uses: actions/checkout@v6
- uses: actions/setup-node@v4 - uses: actions/setup-node@v6
with: with:
node-version-file: .node-version node-version-file: .node-version
cache: npm cache: npm
@@ -132,11 +132,11 @@ jobs:
if: needs.changes.outputs.ci == 'true' if: needs.changes.outputs.ci == 'true'
steps: steps:
- name: Checkout repo - name: Checkout repo
uses: actions/checkout@v5 uses: actions/checkout@v6
- name: Check workflow files - name: Check workflow files
run: | run: |
bash <(curl https://raw.githubusercontent.com/rhysd/actionlint/main/scripts/download-actionlint.bash) 1.7.1 bash <(curl https://raw.githubusercontent.com/rhysd/actionlint/main/scripts/download-actionlint.bash) 1.7.9
./actionlint -color -shellcheck= -ignore "set-output" ./actionlint -color -shellcheck= -ignore "softprops/action-gh-release"
shell: bash shell: bash
test-unit: test-unit:
@@ -146,8 +146,8 @@ jobs:
needs: changes needs: changes
if: needs.changes.outputs.code == 'true' if: needs.changes.outputs.code == 'true'
steps: steps:
- uses: actions/checkout@v5 - uses: actions/checkout@v6
- uses: actions/setup-node@v4 - uses: actions/setup-node@v6
with: with:
node-version-file: .node-version node-version-file: .node-version
cache: npm cache: npm
@@ -164,12 +164,12 @@ jobs:
build: build:
name: Build code-server name: Build code-server
runs-on: ubuntu-22.04 runs-on: ubuntu-22.04
timeout-minutes: 60 timeout-minutes: 70
env: env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
DISABLE_V8_COMPILE_CACHE: 1 DISABLE_V8_COMPILE_CACHE: 1
steps: steps:
- uses: actions/checkout@v5 - uses: actions/checkout@v6
with: with:
submodules: true submodules: true
- run: sudo apt update && sudo apt install -y libkrb5-dev - run: sudo apt update && sudo apt install -y libkrb5-dev
@@ -178,7 +178,7 @@ jobs:
packages: quilt packages: quilt
version: 1.0 version: 1.0
- run: quilt push -a - run: quilt push -a
- uses: actions/setup-node@v4 - uses: actions/setup-node@v6
with: with:
node-version-file: .node-version node-version-file: .node-version
cache: npm cache: npm
@@ -231,9 +231,9 @@ jobs:
needs: [changes, build] needs: [changes, build]
if: needs.changes.outputs.code == 'true' || needs.changes.outputs.deps == 'true' if: needs.changes.outputs.code == 'true' || needs.changes.outputs.deps == 'true'
steps: steps:
- uses: actions/checkout@v5 - uses: actions/checkout@v6
- run: sudo apt update && sudo apt install -y libkrb5-dev - run: sudo apt update && sudo apt install -y libkrb5-dev
- uses: actions/setup-node@v4 - uses: actions/setup-node@v6
with: with:
node-version-file: .node-version node-version-file: .node-version
cache: npm cache: npm
@@ -265,9 +265,9 @@ jobs:
needs: [changes, build] needs: [changes, build]
if: needs.changes.outputs.code == 'true' || needs.changes.outputs.deps == 'true' if: needs.changes.outputs.code == 'true' || needs.changes.outputs.deps == 'true'
steps: steps:
- uses: actions/checkout@v5 - uses: actions/checkout@v6
- run: sudo apt update && sudo apt install -y libkrb5-dev - run: sudo apt update && sudo apt install -y libkrb5-dev
- uses: actions/setup-node@v4 - uses: actions/setup-node@v6
with: with:
node-version-file: .node-version node-version-file: .node-version
cache: npm cache: npm

View File

@@ -30,7 +30,7 @@ jobs:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- name: Checkout repo - name: Checkout repo
uses: actions/checkout@v5 uses: actions/checkout@v6
- name: Install code-server - name: Install code-server
run: ./install.sh run: ./install.sh
@@ -44,7 +44,7 @@ jobs:
container: "alpine:3.17" container: "alpine:3.17"
steps: steps:
- name: Checkout repo - name: Checkout repo
uses: actions/checkout@v5 uses: actions/checkout@v6
- name: Install curl - name: Install curl
run: apk add curl run: apk add curl
@@ -67,7 +67,7 @@ jobs:
steps: steps:
- name: Checkout repo - name: Checkout repo
uses: actions/checkout@v5 uses: actions/checkout@v6
- name: Install code-server - name: Install code-server
run: ./install.sh run: ./install.sh

View File

@@ -25,10 +25,10 @@ jobs:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- name: Checkout code-server - name: Checkout code-server
uses: actions/checkout@v5 uses: actions/checkout@v6
- name: Install Node.js - name: Install Node.js
uses: actions/setup-node@v4 uses: actions/setup-node@v6
with: with:
node-version-file: .node-version node-version-file: .node-version
@@ -53,38 +53,6 @@ jobs:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }} NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
NPM_ENVIRONMENT: "production" 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@v5
- 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: Bump code-server homebrew version
env:
VERSION: ${{ env.VERSION }}
HOMEBREW_GITHUB_API_TOKEN: ${{secrets.HOMEBREW_GITHUB_API_TOKEN}}
run: ./ci/steps/brew-bump.sh
aur: aur:
runs-on: ubuntu-latest runs-on: ubuntu-latest
timeout-minutes: 10 timeout-minutes: 10
@@ -94,13 +62,13 @@ jobs:
steps: steps:
# We need to checkout code-server so we can get the version # We need to checkout code-server so we can get the version
- name: Checkout code-server - name: Checkout code-server
uses: actions/checkout@v5 uses: actions/checkout@v6
with: with:
fetch-depth: 0 fetch-depth: 0
path: "./code-server" path: "./code-server"
- name: Checkout code-server-aur repo - name: Checkout code-server-aur repo
uses: actions/checkout@v5 uses: actions/checkout@v6
with: with:
repository: "cdrci/code-server-aur" repository: "cdrci/code-server-aur"
token: ${{ secrets.HOMEBREW_GITHUB_API_TOKEN }} token: ${{ secrets.HOMEBREW_GITHUB_API_TOKEN }}
@@ -148,7 +116,7 @@ jobs:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- name: Checkout code-server - name: Checkout code-server
uses: actions/checkout@v5 uses: actions/checkout@v6
- name: Set up QEMU - name: Set up QEMU
uses: docker/setup-qemu-action@v3 uses: docker/setup-qemu-action@v3

View File

@@ -60,10 +60,10 @@ jobs:
steps: steps:
- name: Checkout repo - name: Checkout repo
uses: actions/checkout@v5 uses: actions/checkout@v6
- name: Install Node.js - name: Install Node.js
uses: actions/setup-node@v4 uses: actions/setup-node@v6
with: with:
node-version-file: .node-version node-version-file: .node-version
cache: npm cache: npm
@@ -134,10 +134,10 @@ jobs:
steps: steps:
- name: Checkout repo - name: Checkout repo
uses: actions/checkout@v5 uses: actions/checkout@v6
- name: Install Node.js - name: Install Node.js
uses: actions/setup-node@v4 uses: actions/setup-node@v6
with: with:
node-version-file: .node-version node-version-file: .node-version
cache: npm cache: npm
@@ -195,10 +195,10 @@ jobs:
steps: steps:
- name: Checkout repo - name: Checkout repo
uses: actions/checkout@v5 uses: actions/checkout@v6
- name: Install Node.js - name: Install Node.js
uses: actions/setup-node@v4 uses: actions/setup-node@v6
with: with:
node-version-file: .node-version node-version-file: .node-version
cache: npm cache: npm

View File

@@ -41,7 +41,7 @@ jobs:
container: "alpine:3.17" container: "alpine:3.17"
steps: steps:
- name: Checkout repo - name: Checkout repo
uses: actions/checkout@v5 uses: actions/checkout@v6
- name: Install test utilities - name: Install test utilities
run: apk add bats checkbashisms run: apk add bats checkbashisms
@@ -58,7 +58,7 @@ jobs:
timeout-minutes: 5 timeout-minutes: 5
steps: steps:
- name: Checkout repo - name: Checkout repo
uses: actions/checkout@v5 uses: actions/checkout@v6
- name: Install lint utilities - name: Install lint utilities
run: sudo apt install shellcheck run: sudo apt install shellcheck

View File

@@ -25,12 +25,12 @@ jobs:
timeout-minutes: 15 timeout-minutes: 15
steps: steps:
- name: Checkout repo - name: Checkout repo
uses: actions/checkout@v5 uses: actions/checkout@v6
with: with:
fetch-depth: 0 fetch-depth: 0
- name: Install Node.js - name: Install Node.js
uses: actions/setup-node@v4 uses: actions/setup-node@v6
with: with:
node-version-file: .node-version node-version-file: .node-version
@@ -46,7 +46,7 @@ jobs:
runs-on: ubuntu-22.04 runs-on: ubuntu-22.04
steps: steps:
- name: Checkout repo - name: Checkout repo
uses: actions/checkout@v5 uses: actions/checkout@v6
with: with:
fetch-depth: 0 fetch-depth: 0
@@ -76,7 +76,7 @@ jobs:
steps: steps:
- name: Checkout repository - name: Checkout repository
uses: actions/checkout@v5 uses: actions/checkout@v6
# Initializes the CodeQL tools for scanning. # Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL - name: Initialize CodeQL

View File

@@ -48,7 +48,7 @@ jobs:
steps: steps:
- name: Checkout code - name: Checkout code
uses: actions/checkout@v5 uses: actions/checkout@v6
- name: Run Trivy vulnerability scanner in image mode - name: Run Trivy vulnerability scanner in image mode
uses: aquasecurity/trivy-action@b6643a29fecd7f34b3597bc6acb0a98b03d33ff8 uses: aquasecurity/trivy-action@b6643a29fecd7f34b3597bc6acb0a98b03d33ff8

View File

@@ -1 +1 @@
22.20.0 22.21.1

View File

@@ -22,6 +22,69 @@ Code v99.99.999
## Unreleased ## 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 ## [4.104.2](https://github.com/coder/code-server/releases/tag/v4.104.2) - 2025-09-26
Code v1.104.2 Code v1.104.2

View File

@@ -3,10 +3,7 @@ kind: Deployment
metadata: metadata:
name: {{ include "code-server.fullname" . }} name: {{ include "code-server.fullname" . }}
labels: labels:
app.kubernetes.io/name: {{ include "code-server.name" . }} {{- include "code-server.labels" . | nindent 4 }}
helm.sh/chart: {{ include "code-server.chart" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
app.kubernetes.io/managed-by: {{ .Release.Service }}
{{- if .Values.annotations }} {{- if .Values.annotations }}
annotations: {{- toYaml .Values.annotations | nindent 4 }} annotations: {{- toYaml .Values.annotations | nindent 4 }}
{{- end }} {{- end }}
@@ -16,13 +13,11 @@ spec:
type: Recreate type: Recreate
selector: selector:
matchLabels: matchLabels:
app.kubernetes.io/name: {{ include "code-server.name" . }} {{- include "code-server.selectorLabels" . | nindent 6 }}
app.kubernetes.io/instance: {{ .Release.Name }}
template: template:
metadata: metadata:
labels: labels:
app.kubernetes.io/name: {{ include "code-server.name" . }} {{- include "code-server.selectorLabels" . | nindent 8 }}
app.kubernetes.io/instance: {{ .Release.Name }}
{{- if .Values.podAnnotations }} {{- if .Values.podAnnotations }}
annotations: {{- toYaml .Values.podAnnotations | nindent 8 }} annotations: {{- toYaml .Values.podAnnotations | nindent 8 }}
{{- end }} {{- end }}
@@ -130,11 +125,11 @@ spec:
{{- end }} {{- end }}
livenessProbe: livenessProbe:
httpGet: httpGet:
path: / path: /healthz
port: http port: http
readinessProbe: readinessProbe:
httpGet: httpGet:
path: / path: /healthz
port: http port: http
resources: resources:
{{- toYaml .Values.resources | nindent 12 }} {{- toYaml .Values.resources | nindent 12 }}

View File

@@ -9,10 +9,7 @@ metadata:
{{ toYaml . | indent 4 }} {{ toYaml . | indent 4 }}
{{- end }} {{- end }}
labels: labels:
app.kubernetes.io/name: {{ include "code-server.name" . }} {{- include "code-server.labels" . | nindent 4 }}
helm.sh/chart: {{ include "code-server.chart" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
app.kubernetes.io/managed-by: {{ .Release.Service }}
spec: spec:
accessModes: accessModes:
- {{ .Values.persistence.accessMode | quote }} - {{ .Values.persistence.accessMode | quote }}

View File

@@ -6,10 +6,7 @@ metadata:
annotations: annotations:
"helm.sh/hook": "pre-install" "helm.sh/hook": "pre-install"
labels: labels:
app.kubernetes.io/name: {{ include "code-server.name" . }} {{- include "code-server.labels" . | nindent 4 }}
helm.sh/chart: {{ include "code-server.chart" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
app.kubernetes.io/managed-by: {{ .Release.Service }}
type: Opaque type: Opaque
data: data:
{{- if .Values.password }} {{- if .Values.password }}

View File

@@ -3,10 +3,7 @@ kind: Service
metadata: metadata:
name: {{ include "code-server.fullname" . }} name: {{ include "code-server.fullname" . }}
labels: labels:
app.kubernetes.io/name: {{ include "code-server.name" . }} {{- include "code-server.labels" . | nindent 4 }}
helm.sh/chart: {{ include "code-server.chart" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
app.kubernetes.io/managed-by: {{ .Release.Service }}
spec: spec:
type: {{ .Values.service.type }} type: {{ .Values.service.type }}
ports: ports:

View File

@@ -3,9 +3,6 @@ apiVersion: v1
kind: ServiceAccount kind: ServiceAccount
metadata: metadata:
labels: labels:
app.kubernetes.io/name: {{ include "code-server.name" . }} {{- include "code-server.labels" . | nindent 4 }}
helm.sh/chart: {{ include "code-server.chart" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
app.kubernetes.io/managed-by: {{ .Release.Service }}
name: {{ template "code-server.serviceAccountName" . }} name: {{ template "code-server.serviceAccountName" . }}
{{- end -}} {{- end -}}

View File

@@ -3,16 +3,13 @@ kind: Pod
metadata: metadata:
name: "{{ include "code-server.fullname" . }}-test-connection" name: "{{ include "code-server.fullname" . }}-test-connection"
labels: labels:
app.kubernetes.io/name: {{ include "code-server.name" . }} {{- include "code-server.labels" . | nindent 4 }}
helm.sh/chart: {{ include "code-server.chart" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
app.kubernetes.io/managed-by: {{ .Release.Service }}
annotations: annotations:
"helm.sh/hook": test-success "helm.sh/hook": test
spec: spec:
containers: containers:
- name: wget - name: wget
image: busybox image: busybox
command: ['wget'] command: ['wget']
args: ['{{ include "code-server.fullname" . }}:{{ .Values.service.port }}'] args: ['{{ include "code-server.fullname" . }}:{{ .Values.service.port }}/healthz']
restartPolicy: Never restartPolicy: Never

View File

@@ -31,6 +31,7 @@
- [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 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 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 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) - [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) - [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 change the port?](#how-do-i-change-the-port)
@@ -439,6 +440,8 @@ Specific changes include:
- The ability to use your own marketplace and collect your own telemetry - The ability to use your own marketplace and collect your own telemetry
- Built-in proxy for accessing ports on the remote machine integrated into - Built-in proxy for accessing ports on the remote machine integrated into
VS Code's ports panel 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 - Wrapper process that spawns VS Code on-demand and has a separate CLI
- Notification when updates are available - Notification when updates are available
- [Some other things](https://github.com/coder/code-server/tree/main/patches) - [Some other things](https://github.com/coder/code-server/tree/main/patches)
@@ -447,6 +450,12 @@ 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 Some may make their way upstream, further closing the gap, but at the moment it
looks like there will always be some subtle differences. 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? ## Does code-server have any security login validation?
code-server supports setting a single password and limits logins to two per code-server supports setting a single password and limits logins to two per

View File

@@ -241,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.orig/lib/vscode/src/vs/base/common/product.ts
+++ code-server/lib/vscode/src/vs/base/common/product.ts +++ code-server/lib/vscode/src/vs/base/common/product.ts
@@ -65,6 +65,7 @@ export type ExtensionVirtualWorkspaceSup @@ -66,6 +66,7 @@ export type ExtensionVirtualWorkspaceSup
export interface IProductConfiguration { export interface IProductConfiguration {
readonly codeServerVersion?: string readonly codeServerVersion?: string

View File

@@ -110,7 +110,7 @@ Index: code-server/lib/vscode/src/vs/server/node/server.cli.ts
return true; return true;
default: default:
return false; return false;
@@ -295,6 +296,22 @@ export async function main(desc: Product @@ -300,6 +301,22 @@ export async function main(desc: Product
} }
} }
} else { } else {

View File

@@ -190,7 +190,7 @@ Index: code-server/lib/vscode/src/vs/server/node/serverEnvironmentService.ts
=================================================================== ===================================================================
--- code-server.orig/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 +++ code-server/lib/vscode/src/vs/server/node/serverEnvironmentService.ts
@@ -21,6 +21,7 @@ export const serverOptions: OptionDescri @@ -22,6 +22,7 @@ export const serverOptions: OptionDescri
'disable-file-downloads': { type: 'boolean' }, 'disable-file-downloads': { type: 'boolean' },
'disable-file-uploads': { type: 'boolean' }, 'disable-file-uploads': { type: 'boolean' },
'disable-getting-started-override': { type: 'boolean' }, 'disable-getting-started-override': { type: 'boolean' },
@@ -198,7 +198,7 @@ Index: code-server/lib/vscode/src/vs/server/node/serverEnvironmentService.ts
/* ----- server setup ----- */ /* ----- server setup ----- */
@@ -110,6 +111,7 @@ export interface ServerParsedArgs { @@ -113,6 +114,7 @@ export interface ServerParsedArgs {
'disable-file-downloads'?: boolean; 'disable-file-downloads'?: boolean;
'disable-file-uploads'?: boolean; 'disable-file-uploads'?: boolean;
'disable-getting-started-override'?: boolean, 'disable-getting-started-override'?: boolean,
@@ -339,7 +339,7 @@ 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.orig/lib/vscode/src/vs/workbench/workbench.web.main.internal.ts
+++ code-server/lib/vscode/src/vs/workbench/workbench.web.main.internal.ts +++ code-server/lib/vscode/src/vs/workbench/workbench.web.main.internal.ts
@@ -55,7 +55,7 @@ import './services/dialogs/browser/fileD @@ -54,7 +54,7 @@ import './services/dialogs/browser/fileD
import './services/host/browser/browserHostService.js'; import './services/host/browser/browserHostService.js';
import './services/lifecycle/browser/lifecycleService.js'; import './services/lifecycle/browser/lifecycleService.js';
import './services/clipboard/browser/clipboardService.js'; import './services/clipboard/browser/clipboardService.js';

View File

@@ -90,7 +90,7 @@ Index: code-server/lib/vscode/src/vs/server/node/serverEnvironmentService.ts
=================================================================== ===================================================================
--- code-server.orig/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 +++ code-server/lib/vscode/src/vs/server/node/serverEnvironmentService.ts
@@ -18,6 +18,8 @@ export const serverOptions: OptionDescri @@ -19,6 +19,8 @@ export const serverOptions: OptionDescri
/* ----- code-server ----- */ /* ----- code-server ----- */
'disable-update-check': { type: 'boolean' }, 'disable-update-check': { type: 'boolean' },
'auth': { type: 'string' }, 'auth': { type: 'string' },
@@ -99,7 +99,7 @@ Index: code-server/lib/vscode/src/vs/server/node/serverEnvironmentService.ts
/* ----- server setup ----- */ /* ----- server setup ----- */
@@ -104,6 +106,8 @@ export interface ServerParsedArgs { @@ -107,6 +109,8 @@ export interface ServerParsedArgs {
/* ----- code-server ----- */ /* ----- code-server ----- */
'disable-update-check'?: boolean; 'disable-update-check'?: boolean;
'auth'?: string; 'auth'?: string;

View File

@@ -28,7 +28,7 @@ Index: code-server/lib/vscode/src/vs/workbench/contrib/welcomeGettingStarted/bro
import { IEditorOpenContext, IEditorSerializer } from '../../../common/editor.js'; import { IEditorOpenContext, IEditorSerializer } from '../../../common/editor.js';
import { IWebviewElement, IWebviewService } from '../../webview/browser/webview.js'; import { IWebviewElement, IWebviewService } from '../../webview/browser/webview.js';
import './gettingStartedColors.js'; import './gettingStartedColors.js';
@@ -902,6 +902,72 @@ export class GettingStartedPage extends @@ -916,6 +916,72 @@ export class GettingStartedPage extends
$('p.subtitle.description', {}, localize({ key: 'gettingStarted.editingEvolved', comment: ['Shown as subtitle on the Welcome page.'] }, "Editing evolved")) $('p.subtitle.description', {}, localize({ key: 'gettingStarted.editingEvolved', comment: ['Shown as subtitle on the Welcome page.'] }, "Editing evolved"))
); );
@@ -101,7 +101,7 @@ Index: code-server/lib/vscode/src/vs/workbench/contrib/welcomeGettingStarted/bro
const leftColumn = $('.categories-column.categories-column-left', {},); const leftColumn = $('.categories-column.categories-column-left', {},);
const rightColumn = $('.categories-column.categories-column-right', {},); const rightColumn = $('.categories-column.categories-column-right', {},);
@@ -937,6 +1003,9 @@ export class GettingStartedPage extends @@ -951,6 +1017,9 @@ export class GettingStartedPage extends
recentList.setLimit(5); recentList.setLimit(5);
reset(leftColumn, startList.getDomElement(), recentList.getDomElement()); reset(leftColumn, startList.getDomElement(), recentList.getDomElement());
} }
@@ -181,7 +181,7 @@ Index: code-server/lib/vscode/src/vs/server/node/serverEnvironmentService.ts
=================================================================== ===================================================================
--- code-server.orig/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 +++ code-server/lib/vscode/src/vs/server/node/serverEnvironmentService.ts
@@ -20,6 +20,7 @@ export const serverOptions: OptionDescri @@ -21,6 +21,7 @@ export const serverOptions: OptionDescri
'auth': { type: 'string' }, 'auth': { type: 'string' },
'disable-file-downloads': { type: 'boolean' }, 'disable-file-downloads': { type: 'boolean' },
'disable-file-uploads': { type: 'boolean' }, 'disable-file-uploads': { type: 'boolean' },
@@ -189,7 +189,7 @@ Index: code-server/lib/vscode/src/vs/server/node/serverEnvironmentService.ts
/* ----- server setup ----- */ /* ----- server setup ----- */
@@ -108,6 +109,7 @@ export interface ServerParsedArgs { @@ -111,6 +112,7 @@ export interface ServerParsedArgs {
'auth'?: string; 'auth'?: string;
'disable-file-downloads'?: boolean; 'disable-file-downloads'?: boolean;
'disable-file-uploads'?: boolean; 'disable-file-uploads'?: boolean;

View File

@@ -172,7 +172,7 @@ Index: code-server/lib/vscode/src/vs/workbench/browser/web.main.ts
import { IProgressService } from '../../platform/progress/common/progress.js'; import { IProgressService } from '../../platform/progress/common/progress.js';
import { DelayedLogChannel } from '../services/output/common/delayedLogChannel.js'; import { DelayedLogChannel } from '../services/output/common/delayedLogChannel.js';
import { dirname, joinPath } from '../../base/common/resources.js'; import { dirname, joinPath } from '../../base/common/resources.js';
@@ -130,6 +131,9 @@ export class BrowserMain extends Disposa @@ -133,6 +134,9 @@ export class BrowserMain extends Disposa
// Startup // Startup
const instantiationService = workbench.startup(); const instantiationService = workbench.startup();
@@ -186,7 +186,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.orig/lib/vscode/src/vs/base/common/product.ts
+++ code-server/lib/vscode/src/vs/base/common/product.ts +++ code-server/lib/vscode/src/vs/base/common/product.ts
@@ -64,6 +64,8 @@ export type ExtensionVirtualWorkspaceSup @@ -65,6 +65,8 @@ export type ExtensionVirtualWorkspaceSup
}; };
export interface IProductConfiguration { export interface IProductConfiguration {

View File

@@ -8,7 +8,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.orig/lib/vscode/src/vs/base/common/product.ts
+++ code-server/lib/vscode/src/vs/base/common/product.ts +++ code-server/lib/vscode/src/vs/base/common/product.ts
@@ -67,6 +67,7 @@ export interface IProductConfiguration { @@ -68,6 +68,7 @@ export interface IProductConfiguration {
readonly codeServerVersion?: string readonly codeServerVersion?: string
readonly rootEndpoint?: string readonly rootEndpoint?: string
readonly updateEndpoint?: string readonly updateEndpoint?: string
@@ -20,7 +20,7 @@ Index: code-server/lib/vscode/src/vs/server/node/serverEnvironmentService.ts
=================================================================== ===================================================================
--- code-server.orig/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 +++ code-server/lib/vscode/src/vs/server/node/serverEnvironmentService.ts
@@ -17,6 +17,7 @@ import { join } from '../../base/common/ @@ -18,6 +18,7 @@ import { ProtocolConstants } from '../..
export const serverOptions: OptionDescriptions<Required<ServerParsedArgs>> = { export const serverOptions: OptionDescriptions<Required<ServerParsedArgs>> = {
/* ----- code-server ----- */ /* ----- code-server ----- */
'disable-update-check': { type: 'boolean' }, 'disable-update-check': { type: 'boolean' },
@@ -28,7 +28,7 @@ Index: code-server/lib/vscode/src/vs/server/node/serverEnvironmentService.ts
/* ----- server setup ----- */ /* ----- server setup ----- */
@@ -102,6 +103,7 @@ export const serverOptions: OptionDescri @@ -105,6 +106,7 @@ export const serverOptions: OptionDescri
export interface ServerParsedArgs { export interface ServerParsedArgs {
/* ----- code-server ----- */ /* ----- code-server ----- */
'disable-update-check'?: boolean; 'disable-update-check'?: boolean;

View File

@@ -90,3 +90,18 @@ Index: code-server/lib/vscode/src/vs/platform/extensionResourceLoader/common/ext
} }
} }
Index: code-server/lib/vscode/src/vs/platform/externalServices/common/marketplace.ts
===================================================================
--- code-server.orig/lib/vscode/src/vs/platform/externalServices/common/marketplace.ts
+++ code-server/lib/vscode/src/vs/platform/externalServices/common/marketplace.ts
@@ -26,6 +26,10 @@ export async function resolveMarketplace
'User-Agent': `VSCode ${version} (${productService.nameShort})`
};
+ if (productService.extensionsGallery?.authorizationHeaderToken) {
+ headers['Authorization'] = `Bearer ${productService.extensionsGallery.authorizationHeaderToken}`;
+ }
+
if (supportsTelemetry(productService, environmentService) && getTelemetryLevel(configurationService) === TelemetryLevel.USAGE) {
const serviceMachineId = await getServiceMachineId(environmentService, fileService, storageService);
headers['X-Market-User-Id'] = serviceMachineId;

View File

@@ -30,7 +30,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.orig/lib/vscode/src/vs/base/common/product.ts
+++ code-server/lib/vscode/src/vs/base/common/product.ts +++ code-server/lib/vscode/src/vs/base/common/product.ts
@@ -68,6 +68,7 @@ export interface IProductConfiguration { @@ -69,6 +69,7 @@ export interface IProductConfiguration {
readonly rootEndpoint?: string readonly rootEndpoint?: string
readonly updateEndpoint?: string readonly updateEndpoint?: string
readonly logoutEndpoint?: string readonly logoutEndpoint?: string

View File

@@ -6,7 +6,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.orig/lib/vscode/src/vs/base/common/product.ts
+++ code-server/lib/vscode/src/vs/base/common/product.ts +++ code-server/lib/vscode/src/vs/base/common/product.ts
@@ -69,6 +69,10 @@ export interface IProductConfiguration { @@ -70,6 +70,10 @@ export interface IProductConfiguration {
readonly updateEndpoint?: string readonly updateEndpoint?: string
readonly logoutEndpoint?: string readonly logoutEndpoint?: string
readonly proxyEndpointTemplate?: string readonly proxyEndpointTemplate?: string

View File

@@ -6,21 +6,21 @@ not host our source maps there and want them to be self-hosted even if we could.
To test try debugging/browsing the source of a build in a browser. To test try debugging/browsing the source of a build in a browser.
Index: code-server/lib/vscode/build/gulpfile.reh.js Index: code-server/lib/vscode/build/gulpfile.reh.ts
=================================================================== ===================================================================
--- code-server.orig/lib/vscode/build/gulpfile.reh.js --- code-server.orig/lib/vscode/build/gulpfile.reh.ts
+++ code-server/lib/vscode/build/gulpfile.reh.js +++ code-server/lib/vscode/build/gulpfile.reh.ts
@@ -257,8 +257,7 @@ function packageTask(type, platform, arc @@ -257,8 +257,7 @@ function packageTask(type: string, platf
return () => {
const src = gulp.src(sourceFolderName + '/**', { base: '.' }) const src = gulp.src(sourceFolderName + '/**', { base: '.' })
.pipe(rename(function (path) { path.dirname = path.dirname.replace(new RegExp('^' + sourceFolderName), 'out'); })) .pipe(rename(function (path) { path.dirname = path.dirname!.replace(new RegExp('^' + sourceFolderName), 'out'); }))
- .pipe(util.setExecutableBit(['**/*.sh'])) - .pipe(util.setExecutableBit(['**/*.sh']))
- .pipe(filter(['**', '!**/*.{js,css}.map'])); - .pipe(filter(['**', '!**/*.{js,css}.map']));
+ .pipe(util.setExecutableBit(['**/*.sh'])); + .pipe(util.setExecutableBit(['**/*.sh']));
const workspaceExtensionPoints = ['debuggers', 'jsonValidation']; const workspaceExtensionPoints = ['debuggers', 'jsonValidation'];
const isUIExtension = (manifest) => { const isUIExtension = (manifest: { extensionKind?: string; main?: string; contributes?: Record<string, unknown> }) => {
@@ -297,9 +296,9 @@ function packageTask(type, platform, arc @@ -298,9 +297,9 @@ function packageTask(type: string, platf
.map(name => `.build/extensions/${name}/**`); .map(name => `.build/extensions/${name}/**`);
const extensions = gulp.src(extensionPaths, { base: '.build', dot: true }); const extensions = gulp.src(extensionPaths, { base: '.build', dot: true });
@@ -31,8 +31,8 @@ Index: code-server/lib/vscode/build/gulpfile.reh.js
+ const sources = es.merge(src, extensions, extensionsCommonDependencies); + const sources = es.merge(src, extensions, extensionsCommonDependencies);
let version = packageJson.version; let version = packageJson.version;
const quality = product.quality; const quality = (product as typeof product & { quality?: string }).quality;
@@ -452,7 +451,7 @@ function tweakProductForServerWeb(produc @@ -453,7 +452,7 @@ function tweakProductForServerWeb(produc
const minifyTask = task.define(`minify-vscode-${type}`, task.series( const minifyTask = task.define(`minify-vscode-${type}`, task.series(
bundleTask, bundleTask,
util.rimraf(`out-vscode-${type}-min`), util.rimraf(`out-vscode-${type}-min`),

View File

@@ -96,7 +96,7 @@ Index: code-server/lib/vscode/src/vs/workbench/api/node/extensionHostProcess.ts
import minimist from 'minimist'; import minimist from 'minimist';
import * as nativeWatchdog from 'native-watchdog'; import * as nativeWatchdog from 'native-watchdog';
import * as net from 'net'; import * as net from 'net';
@@ -451,7 +452,28 @@ async function startExtensionHostProcess @@ -469,7 +470,28 @@ async function startExtensionHostProcess
); );
// rewrite onTerminate-function to be a proper shutdown // rewrite onTerminate-function to be a proper shutdown

View File

@@ -147,7 +147,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.orig/lib/vscode/src/vs/base/common/product.ts
+++ code-server/lib/vscode/src/vs/base/common/product.ts +++ code-server/lib/vscode/src/vs/base/common/product.ts
@@ -73,6 +73,7 @@ export interface IProductConfiguration { @@ -74,6 +74,7 @@ export interface IProductConfiguration {
readonly path: string; readonly path: string;
readonly scope: string; readonly scope: string;
} }

View File

@@ -4,7 +4,7 @@ Index: code-server/lib/vscode/src/vs/server/node/serverEnvironmentService.ts
=================================================================== ===================================================================
--- code-server.orig/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 +++ code-server/lib/vscode/src/vs/server/node/serverEnvironmentService.ts
@@ -22,6 +22,7 @@ export const serverOptions: OptionDescri @@ -23,6 +23,7 @@ export const serverOptions: OptionDescri
'disable-file-uploads': { type: 'boolean' }, 'disable-file-uploads': { type: 'boolean' },
'disable-getting-started-override': { type: 'boolean' }, 'disable-getting-started-override': { type: 'boolean' },
'locale': { type: 'string' }, 'locale': { type: 'string' },
@@ -12,7 +12,7 @@ Index: code-server/lib/vscode/src/vs/server/node/serverEnvironmentService.ts
/* ----- server setup ----- */ /* ----- server setup ----- */
@@ -112,6 +113,7 @@ export interface ServerParsedArgs { @@ -115,6 +116,7 @@ export interface ServerParsedArgs {
'disable-file-uploads'?: boolean; 'disable-file-uploads'?: boolean;
'disable-getting-started-override'?: boolean, 'disable-getting-started-override'?: boolean,
'locale'?: string 'locale'?: string

View File

@@ -93,7 +93,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.orig/lib/vscode/src/vs/base/common/product.ts
+++ code-server/lib/vscode/src/vs/base/common/product.ts +++ code-server/lib/vscode/src/vs/base/common/product.ts
@@ -66,6 +66,7 @@ export type ExtensionVirtualWorkspaceSup @@ -67,6 +67,7 @@ export type ExtensionVirtualWorkspaceSup
export interface IProductConfiguration { export interface IProductConfiguration {
readonly codeServerVersion?: string readonly codeServerVersion?: string
readonly rootEndpoint?: string readonly rootEndpoint?: string
@@ -101,6 +101,14 @@ Index: code-server/lib/vscode/src/vs/base/common/product.ts
readonly version: string; readonly version: string;
readonly date?: string; readonly date?: string;
@@ -113,6 +114,7 @@ export interface IProductConfiguration {
readonly resourceUrlTemplate: string;
readonly nlsBaseUrl: string;
readonly accessSKUs?: string[];
+ readonly authorizationHeaderToken?: string;
};
readonly mcpGallery?: {
Index: code-server/lib/vscode/src/vs/server/node/webClientServer.ts Index: code-server/lib/vscode/src/vs/server/node/webClientServer.ts
=================================================================== ===================================================================
--- code-server.orig/lib/vscode/src/vs/server/node/webClientServer.ts --- code-server.orig/lib/vscode/src/vs/server/node/webClientServer.ts
@@ -117,8 +125,8 @@ Index: code-server/lib/vscode/src/vs/server/node/serverEnvironmentService.ts
=================================================================== ===================================================================
--- code-server.orig/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 +++ code-server/lib/vscode/src/vs/server/node/serverEnvironmentService.ts
@@ -15,6 +15,8 @@ import { joinPath } from '../../base/com @@ -16,6 +16,8 @@ import { join } from '../../base/common/
import { join } from '../../base/common/path.js'; import { ProtocolConstants } from '../../base/parts/ipc/common/ipc.net.js';
export const serverOptions: OptionDescriptions<Required<ServerParsedArgs>> = { export const serverOptions: OptionDescriptions<Required<ServerParsedArgs>> = {
+ /* ----- code-server ----- */ + /* ----- code-server ----- */
@@ -126,7 +134,7 @@ Index: code-server/lib/vscode/src/vs/server/node/serverEnvironmentService.ts
/* ----- server setup ----- */ /* ----- server setup ----- */
@@ -98,6 +100,8 @@ export const serverOptions: OptionDescri @@ -101,6 +103,8 @@ export const serverOptions: OptionDescri
}; };
export interface ServerParsedArgs { export interface ServerParsedArgs {

View File

@@ -70,8 +70,8 @@ Index: code-server/lib/vscode/src/vs/workbench/contrib/webview/browser/pre/index
<meta charset="UTF-8"> <meta charset="UTF-8">
<meta http-equiv="Content-Security-Policy" <meta http-equiv="Content-Security-Policy"
- content="default-src 'none'; script-src 'sha256-ZcIhtIuU4M9PbKfs7w/CLqHimFJRK8L7mYTXOfiUv0I=' 'self'; frame-src 'self'; style-src 'unsafe-inline';"> - content="default-src 'none'; script-src 'sha256-TaWGDzV7c9rUH2q/5ygOyYUHSyHIqBMYfucPh3lnKvU=' 'self'; frame-src 'self'; style-src 'unsafe-inline';">
+ content="default-src 'none'; script-src 'sha256-dVbEBqfV68sWYG05nAX+55pv4dls0VnI6ZDMMV/0GYQ=' 'self'; frame-src 'self'; style-src 'unsafe-inline';"> + content="default-src 'none'; script-src 'sha256-nQZh+9dHKZP2cHbhYlCbWDtqxxJtGjRGBx57zNP2DZM=' 'self'; frame-src 'self'; style-src 'unsafe-inline';">
<!-- Disable pinch zooming --> <!-- Disable pinch zooming -->
<meta name="viewport" <meta name="viewport"

View File

@@ -24,6 +24,6 @@ export class HttpError extends Error {
} }
} }
export enum CookieKeys { export function getCookieSessionName(suffix?: string): string {
Session = "code-server-session", return suffix ? `code-server-session-${suffix.replace(/[^a-zA-Z0-9-]/g, "-")}` : "code-server-session"
} }

View File

@@ -53,6 +53,7 @@ export interface UserProvidedCodeArgs {
"disable-getting-started-override"?: boolean "disable-getting-started-override"?: boolean
"disable-proxy"?: boolean "disable-proxy"?: boolean
"session-socket"?: string "session-socket"?: string
"cookie-suffix"?: string
"link-protection-trusted-domains"?: string[] "link-protection-trusted-domains"?: string[]
// locale is used by both VS Code and code-server. // locale is used by both VS Code and code-server.
locale?: string locale?: string
@@ -172,6 +173,12 @@ export const options: Options<Required<UserProvidedArgs>> = {
"session-socket": { "session-socket": {
type: "string", type: "string",
}, },
"cookie-suffix": {
type: "string",
description:
"Adds a suffix to the cookie. This can prevent a collision of cookies for subdomains, making them explixit. \n" +
"Without this flag, no suffix is used. This can also be set with CODE_SERVER_COOKIE_SUFFIX set to any string.",
},
"disable-file-downloads": { "disable-file-downloads": {
type: "boolean", type: "boolean",
description: description:
@@ -616,6 +623,10 @@ export async function setDefaults(cliArgs: UserProvidedArgs, configArgs?: Config
usingEnvPassword = false usingEnvPassword = false
} }
if (process.env.CODE_SERVER_COOKIE_SUFFIX) {
args["cookie-suffix"] = process.env.CODE_SERVER_COOKIE_SUFFIX
}
if (process.env.GITHUB_TOKEN) { if (process.env.GITHUB_TOKEN) {
args["github-auth"] = process.env.GITHUB_TOKEN args["github-auth"] = process.env.GITHUB_TOKEN
} }

View File

@@ -4,7 +4,7 @@ import * as http from "http"
import * as net from "net" import * as net from "net"
import qs from "qs" import qs from "qs"
import { Disposable } from "../common/emitter" import { Disposable } from "../common/emitter"
import { CookieKeys, HttpCode, HttpError } from "../common/http" import { HttpCode, HttpError } from "../common/http"
import { normalize } from "../common/util" import { normalize } from "../common/util"
import { AuthType, DefaultedArgs } from "./cli" import { AuthType, DefaultedArgs } from "./cli"
import { version as codeServerVersion } from "./constants" import { version as codeServerVersion } from "./constants"
@@ -40,6 +40,7 @@ declare global {
heart: Heart heart: Heart
settings: SettingsProvider<CoderSettings> settings: SettingsProvider<CoderSettings>
updater: UpdateProvider updater: UpdateProvider
cookieSessionName: string
} }
} }
} }
@@ -124,7 +125,7 @@ export const authenticated = async (req: express.Request): Promise<boolean> => {
const passwordMethod = getPasswordMethod(hashedPasswordFromArgs) const passwordMethod = getPasswordMethod(hashedPasswordFromArgs)
const isCookieValidArgs: IsCookieValidArgs = { const isCookieValidArgs: IsCookieValidArgs = {
passwordMethod, passwordMethod,
cookieKey: sanitizeString(req.cookies[CookieKeys.Session]), cookieKey: sanitizeString(req.cookies[req.cookieSessionName]),
passwordFromArgs: req.args.password || "", passwordFromArgs: req.args.password || "",
hashedPasswordFromArgs: req.args["hashed-password"], hashedPasswordFromArgs: req.args["hashed-password"],
} }

View File

@@ -5,7 +5,7 @@ import { promises as fs } from "fs"
import * as path from "path" import * as path from "path"
import * as tls from "tls" import * as tls from "tls"
import { Disposable } from "../../common/emitter" import { Disposable } from "../../common/emitter"
import { HttpCode, HttpError } from "../../common/http" import { getCookieSessionName, HttpCode, HttpError } from "../../common/http"
import { plural } from "../../common/util" import { plural } from "../../common/util"
import { App } from "../app" import { App } from "../app"
import { AuthType, DefaultedArgs } from "../cli" import { AuthType, DefaultedArgs } from "../cli"
@@ -61,6 +61,8 @@ export const register = async (
const settings = new SettingsProvider<CoderSettings>(path.join(args["user-data-dir"], "coder.json")) const settings = new SettingsProvider<CoderSettings>(path.join(args["user-data-dir"], "coder.json"))
const updater = new UpdateProvider("https://api.github.com/repos/coder/code-server/releases/latest", settings) const updater = new UpdateProvider("https://api.github.com/repos/coder/code-server/releases/latest", settings)
const cookieSessionName = getCookieSessionName(args["cookie-suffix"])
const common: express.RequestHandler = (req, _, next) => { const common: express.RequestHandler = (req, _, next) => {
// /healthz|/healthz/ needs to be excluded otherwise health checks will make // /healthz|/healthz/ needs to be excluded otherwise health checks will make
// it look like code-server is always in use. // it look like code-server is always in use.
@@ -75,6 +77,7 @@ export const register = async (
req.heart = heart req.heart = heart
req.settings = settings req.settings = settings
req.updater = updater req.updater = updater
req.cookieSessionName = cookieSessionName
next() next()
} }

View File

@@ -2,7 +2,6 @@ import { Router, Request } from "express"
import { promises as fs } from "fs" import { promises as fs } from "fs"
import { RateLimiter as Limiter } from "limiter" import { RateLimiter as Limiter } from "limiter"
import * as path from "path" import * as path from "path"
import { CookieKeys } from "../../common/http"
import { rootPath } from "../constants" import { rootPath } from "../constants"
import { authenticated, getCookieOptions, redirect, replaceTemplates } from "../http" import { authenticated, getCookieOptions, redirect, replaceTemplates } from "../http"
import i18n from "../i18n" import i18n from "../i18n"
@@ -95,7 +94,7 @@ router.post<{}, string, { password?: string; base?: string } | undefined, { to?:
if (isPasswordValid) { if (isPasswordValid) {
// The hash does not add any actual security but we do it for // The hash does not add any actual security but we do it for
// obfuscation purposes (and as a side effect it handles escaping). // obfuscation purposes (and as a side effect it handles escaping).
res.cookie(CookieKeys.Session, hashedPassword, getCookieOptions(req)) res.cookie(req.cookieSessionName, hashedPassword, getCookieOptions(req))
const to = (typeof req.query.to === "string" && req.query.to) || "/" const to = (typeof req.query.to === "string" && req.query.to) || "/"
return redirect(req, res, to, { to: undefined }) return redirect(req, res, to, { to: undefined })

View File

@@ -1,5 +1,4 @@
import { Router } from "express" import { Router } from "express"
import { CookieKeys } from "../../common/http"
import { getCookieOptions, redirect } from "../http" import { getCookieOptions, redirect } from "../http"
import { sanitizeString } from "../util" import { sanitizeString } from "../util"
@@ -7,7 +6,7 @@ export const router = Router()
router.get<{}, undefined, undefined, { base?: string; to?: string }>("/", async (req, res) => { router.get<{}, undefined, undefined, { base?: string; to?: string }>("/", async (req, res) => {
// Must use the *identical* properties used to set the cookie. // Must use the *identical* properties used to set the cookie.
res.clearCookie(CookieKeys.Session, getCookieOptions(req)) res.clearCookie(req.cookieSessionName, getCookieOptions(req))
const to = sanitizeString(req.query.to) || "/" const to = sanitizeString(req.query.to) || "/"
return redirect(req, res, to, { to: undefined, base: undefined, href: undefined }) return redirect(req, res, to, { to: undefined, base: undefined, href: undefined })