- We have a labeling bot that is marking issues as upstream (so far
correctly) now Ranger is closing them right away and it felt too
aggressive to me.
- It keeps posting its comment twice. Not sure how to fix that.
There is a `yarn ci` script which was using audit-ci but this does not
appear to be called anywhere.
The security worflow uses `yarn audit` and `npm audit` which seem fine
enough anyway.
It is not working. I test this manually anyway so for now just remove
the test, but I think maybe we have to watch for code-server to extract
the language files, and then reload the page, or maybe we have to
install the language from the UI.
Ideally we can drop our patch in the future anyway...
The first argument is a file name, not a path. When the log gets
rotated it prepends the date which ends up creating a path in the
current working directory.
Might make sense to cache the rest as well, and evict from the cache
periodically. For now this is enough to fix a hang I often see in our
deployment of Coder. Might only be surfacing now because new telemetry
calls were added to startup.
Additionally:
- Update Node to 20.11.1
- Update documentation
- Disable extension signature verification
This works around an issue where the Open VSX is not returning the
expected zip. Verification is skipped later anyway because
@vscode/vsce-sign is missing in the OSS version.
It seems that * matches a literal * now, so we have to use a regular
expression.
Parentheses around a parameter no longer works (it causes it to match on
the parameter name literally) and I am not sure why we had it anyway as
it had no effect previously.
Matching with a leading / does not appear to work either, but we do not
need the leading / anyway since the proxy logic was changed to use the
whole path. Consequently it will never be / anymore from what I can
tell but I left that check in just in case. I turned it into a named
parameter as well, because that seems better.
- Remove the redundant title prefix.
- Remove outdated assignees.
- Improve reproduction step description (trying to get folks to submit
more specific/detailed reproductions).
- Render logs with shell (not sure if this actually changes anything).
- Use dropdowns for testing in VS Code and Codespaces. I think the
existing checkboxes are still confusing so hopefully this sorts it.
These checkboxes keep getting checked despite the submitter using an
insecure context or not having tested upstream. I think two things are
at play here:
1. Folks might be interpreting "cannot reproduce" as "did not
reproduce" or "did not have time to reproduce".
2. The checkboxes are required to submit the issue so folks might be
marking them just so they can get their issue submitted; maybe they
are not even reading the checkboxes and are just seeing the error
that they need to be marked and blindly marking them because while
in some cases folks will add "I had to check this but it is not
true", usually they say nothing.
In any case, hopefully these changes make the checkboxes more accurate,
and then if they are unchecked we can ask them to go reproduce in VS
Code or use a secure context or whatever the case may be.
This is just a guard in case there are paths where the workspace is
already marked as initialized but the workspace configuration is not and
we end up actually un-initializing it.
And fix the workspace bug. It is caused by an issue with how some
global variables are being used asynchronously and is exacerbated by the
delay reading settings from the remote introduces.
1. The workspace is created and is marked as not initialized.
2. The configuration's change handler is triggered, and now
initialization is complete.
3. The handler tries to set the global workspace variable to initialized
but the workspace has not been set yet so we get an undefined error.
4. The workspace global is now set, but it is set to the old value with
initialized still set to false.
5. Workspace is never marked as initialized until something else
triggers the on change handler again.
Fixes#3061, and closes#6546.
My guess is this logic changed in one of the VS Code updates,
introducing this async bug but never getting caught probably because for
them the settings are always local thus minimal delay.
The main goal of this patch was to make user settings stored on disk
instead of in the browser, but this stopped working some time ago. Not
only that but it is causing a bug where a workspace will not fully open.
A secondary goal was to fix the Vim extension but the extension appears
to work just fine without this change now (both the server and browser
versions).
This patch is not useful anymore anyway because there are remote-level
settings that *do* get stored on disk and can be used instead of
user-level settings when necessary.
Fixes#3061, and possibly #6153.
This should make it much easier to update. Also use 18.15.0
specifically since that is what VS Code ships with.
Additionally, it fixes the post-install script being skipped due to
a Yarn v1 bug that happens when Yarn installs node-gyp, which
it does because 18.18 onward stopped bundling node-gyp.
* Update Code to 1.83.1
* Patch out lookbehind for Safari support
Not sure why it needs a lookbehind unless a number followed by a capital
letter is not supposed to be considered a new word, which seems wrong to
me. The tests do not contain any numbers so I can only guess.
---------
Co-authored-by: Asher <ash@coder.com>
Since the release of code-server v4.17.0 (Code 1.82), "Command Center" has become a default option. However, the current code-server PWA app lacks support for the Windows control overlay, resulting in an untidy appearance of the title bar. This commit introduces modifications to the manifest file to enable support for the window control overlay.
Also remove github.com from the trusted domains. This causes the
browser to block the popup instead (probably because the space between
interaction and popup is too great), which is difficult to notice in
Chromium. Even in Firefox with the extra bar they add at the top it can
be easy to miss.
* Fix building from source on arm
Not building from source causes argon2 to pull the wrong arch, so we
have to build from source.
But building from source is causing the new Kerberos module to fail on
arm64 and keytar to fail on both.
The latter has been very difficult to debug because the GitHub image
provides a different result to containers based on Ubuntu 20.04.
Because of this, use a container instead.
Use debian:buster as the container because it is easier to set up the
architecture sources (no need to modify the sources) and because it
seems to come with glibc 2.28 rather than 2.31.
Also use the exact version of Node (18.15.0) for reproducibility.
* Set owner and group during tar to zero
Otherwise you get IDs that can cause (benign) errors while extracting,
which might be confusing. At the very least, I did not see these errors
from previous tars (although they seem to use 1001).
There is no guarantee what IDs might exist so 0 seems the most
reasonable.
The comment said the issue with argon2 was related to CentOS 7 but the
cross-compile steps never used CentOS 7 so maybe the real issue is with
the architecture.
* Avoid packaging yarn.lock
Since the shrinkwrap is what we want everything to use.
* Build with npm
It seems we stuck with yarn because npm was giving us errors but I will try
sorting it out now so we can build with npm as originally intended.
* Remove build from source
Not using CentOS 7 anymore so based on the comment we no longer need
this. Keytar seems to install fine now.
* Update missed Node version
These numbers are all over the place.
* npm_config_arch must be lowercase
* Patch out Kerberos
I am not sure exactly how it is used but I think it is not a path code-server
worries about, at least not right now. Just going to patch it out rather than
figure out how to build it on armv7l but we can revisit later.
* Update dependencies and force-update qs
This is mainly an attempt to get rid of as many resolutions as possible
since it seems they are unnecessary except for qs (according to yarn/npm
audit).
For qs use 6.9.7 since Express is using 6.9.6 and that matches the most
closely.
Also add overrides since this is npm's version of yarn's resolutions and
we need it for the shrinkwrap to generate with the right dependencies.
Decided to keep pinning @types/node as well although I am not sure it is
necessary. Express is pulling in v20 types. Since this is
development-only we only need it in resolutions.
* Run formatter
Some rules seem to have changed with the dependency updates.
* Replace deprecated bodyParser.json() usage
* Audit npm shrinkwrap as well
* Skip installing dependencies in audit
It seems the tools only require the lock files.
* Fix tests when using ipv6
* Add missing openssl dependency to flake
At least, for the standalone and for anyone running on default Node 18.
If support for 2.17 is needed then one would need to build Node 18 with 2.17 and then build code-server with that version (specifically, the native npm modules).
* Update VS Code to 1.82.2
* Add new libkrb5 dependency
* Update patches
The only changes were to context except:
- The URL callback provider uses a new _callbackRoute argument and moved
locations.
- The telemetry provider gets passed the request service as the first
argument now.
- CSP hash changed, as usual.
* Update Node to v18
* Revert back to es2020
es2022 is breaking Safari.
The tilde is ambiguous and it can be helpful to know exactly what paths
code-server is trying to use, especially if it is running as a different
user than you expected.
Added a guide on proxying to a Svelte app since there wasn't one already. Used the vue and angular guides as a template and included a link to an issue post on sveltekits website which adds some context.
* Avoid spawning code-server with --reuse-window and --new-window
These flags mean the user explicitly wants to open in an existing
instance so if the socket is down it should error rather than try to
spawn code-server normally.
* Set session socket into environment variable
While I was at it I added a CLI flag to override the default. I also
swapped the default to --user-data-dir.
The value is set on an environment variable so it can be used by the
extension host similar to VSCODE_IPC_HOOK_CLI.
* Add e2e test for opening files externally
The indented logs technically apply to the HTTP server so move the
session server log afterward to avoid making them look like they apply
to the session server.
Mostly just the usual shifting or changing of the surrounding context
but I did refactor the getting started block we insert because it keeps
getting mangled on each update. Instead of shifting things around the
columns I just prepend it to the right column.
Getting 404s on some vsda module but everything seems to work
without it and I do not see it referenced in the package.json nor a
nywhere on npmjs.com so it seems to be optional.
This is not a valid ID (to install a specific version you use @) and,
quite strangely, Code is now returning an "extension not found" error if
the ID is invalid, breaking the test since we expect it to error about
the marketplace not existing.
* Update to 1.78.1
No changes needed in the patches other than moving some lines around and
updating the CSP hash as usual.
The flake had to be updated as it was using Node 16.16 and 16.17 is
required at minimum now. Also python seems to install python2 which is
marked as deprecated so explicitly install python3.
* Update to 1.78.2
Patches applied without any conflicts.
* Update commit environment variable
This was causing the commit not to be set. It broke display languages
since that has a hard dependency on the commit for directory names.
Possibly broke other things.
Extracted host detection into a separate function to avoid multiple log
lines on each return and went with a thrown error to consolidate the
common log text.
* Update Code to 1.76.1
- worker-src already contains blob so we can avoid patching that.
- localeService moved.
- Remaining changes were just line changes.
* Make language extensions installable again
Still might want to look into making the native language support work
but for now it seems better not to break backwards compatibility since
the native implementation is quite different.
* Avoid "install in browser" for language packs
It will not work.
* Import correct locale service
I believe before the contributions imported this but now we have to do
it here.
Looks like the images got updated to v18 so they started failing. For
npm install v16 and for Docker just run the script directly, it seems
silly to waste time installing v16 just to run a script through yarn.
* Move splitOnFirstEquals to util
I will be making use of this to parse the forwarded header.
* Type splitOnFirstEquals with two items
Also add some test cases.
* Check origin header on web sockets
* Update changelog with origin check
* Fix web sockets not closing with error code
- Move differences to the Codespaces section since they apply to both
Codespaces and OpenVSCode-Server
- Add some important missing differences
- Exclude settings sync (not being worked on)
- Exclude the plugin API (deprecated)
- Exclude certificate support (browsers these days are starting to
require trusted certs so better not to recommend using this)
This does not seem to actually cause an issue (not resolving ends up
with the same behavior as resolving with false) but I am not sure if the
hanging promises would be a memory leak so seems best to fix.
* Update Code to 1.75.0
- getting-started.diff: The way to get an icon's class changed
- proxy-uri.diff: The product service is passed in so we can get the
proxy URI from that now instead of passing it in separately.
* Remove workspace trust test
Something in how/when Code displays the trust dialog appears to have
changed, failing the test. I am not sure it makes sense for us to be
testing upstream code anyway.
* Use regular Node for watch
Since we spawn the watch script with ts-node it was using ts-node for
the web server spawn as well. With latest Code there are for some
reason type errors (it cannot find @types/node) but this is already
compiled code which already passed type checks; any type errors here are
useless. To fix spawn with regular Node.
* Fix some workers not loading
This is failing CI on Dependabot PRs. Opted to just remove it since
most (all?) PRs will be from forks and this workflow will not run
anyway. If we figure out the secret situation we can add it back.
It is causing CI to fail for Dependabot (no access to the token) and it
does not work with forks and currently there is no one who pushes
straight to the repo so this will never be used.
Can always add it back if we figure out how to make the secrets work.
* docs: add difference between Coder
Add a short block explaining the difference between code-server and
Coder.
* docs: add new doc coder.md under Install
This adds a new doc explaining how to install code-server in a Coder
workspace using Terraform.
* feat: add i18n in login page
* fix: add word space and put the app name into the title
* fix: remove duplicate replace title
* fix: prettier format code
* fix: fix typescript check warning
* fix: add zh-cn locale file code owner
* fix: use existing flag locale to the login page
Co-authored-by: Joe Previte <jjprevite@gmail.com>
* feat(ci): add lint-actions step to build.yaml
This adds a new job to the Build CI pipeline to lint our GitHub Actions.
By doing this, we can prevent typos from slipping in.
Fixes#5776
* fix: disable shellcheck in actionlint
I don't think we want to enable this for now.
* fix: ignore set-output warnings for now
It's deprecated but there isn't a reason to move away from using it yet.
* chore: update renovate.json ignoreDeps
ansi-regex, env-paths and limiter all switch to ESM which we can't
support at the moment so ignore updates for now.
* chore: update actions/cache@v3
* chore: update minor deps
* chore: add pretteir to renovate.json
* chore: upgrade Code to 1.74.1
* chore: remove require in integration.diff
I don't know what the impact of this is but in 192c67db71
they removed the usage of `require` in `server.main.ts`.
More details in PR: https://github.com/microsoft/vscode/pull/165831
* chore: update marketplace.diff
* chore: update sha hash in webview.diff
* chore: update disable-builtin-ext-update.diff
If my logic is right, then this patch is now simplified thanks to this:
https://github.com/microsoft/vscode/blob/1.74.1/src/vs/workbench/contrib/extensions/browser/extensionsWorkbenchService.ts#L1238
* chore: refresh proxy-uri patch
* chore: refresh local-storage.diff
* chore: refresh sourcemaps.diff
* chore: refresh disable-downloads.diff
* chore: refresh display-language.diff
* chore: refresh getting-started.diff
* docs: update testing notes for cli-window-open
* docs: update telemetry testing instructions
* fix: add GITHUB_TOKEN to build code-server job
Downloading @vscode/ripgrep is failing only in CI so adding this
environment variable to see if it increases the rate limit.
Ref: https://github.com/microsoft/vscode-ripgrep#github-api-limit-note
* refactor: use own cache key build code-server job
* temp: disable vscode test
* refactor: delete wrapper test
* Revert "refactor: delete wrapper test"
This reverts commit 3999279b73.
* refactor: move vscode tests to e2e (#5911)
* wip: migrate vscode tests to e2e
* feat: add codeWorkspace to global setup
* refactor: only use dir in spawn when we should
* wip: migrate more tests
* refactor: move all vscode tests to e2e
* refactor(ci): move unit to own job
* fixup: add codecov to unit test step
* Update test/e2e/models/CodeServer.ts
* Update test/e2e/models/CodeServer.ts
* docs: add note about intercept requests
* refactor: rm unused clean() calls
* refactor: delete duplicate test
* refactor: update 'should not redirect' test
* refactor: rm unused imports
* refactor: rm unnecessary navigate call in test
* fixup: formatting
* wip: update test
* refactor: modify assertion for proxy
* fixup: use REVERSE_PROXY_BASE_PATH
* refactor: add helper fn getMaybeProxiedPathname
* fixup: formatting
* fixup: rm unused import
* chore: increase playwright timeout
* Revert "chore: increase playwright timeout"
This reverts commit a059129252.
* chore: rm timeout
* refactor: remove keytar dep in cross-compile
* refactor: try other keytar package
* refactor: remove keytar step in cross-compile
* fix: manually remove keytar
* try this first
* I think this is it
* Revert "I think this is it"
This reverts commit 5c566b0c01.
* okay this is it
* fixup
* try legacy peer
* remove keytar before standalone
* wrong path
* maybe
* revert: change *npm* back to npm*
* revert: don't uninstall keytar
* fix: use npm run standalone-release
* fixup formatting
* Revert "refactor: remove yarn.lock steps (#5850)"
This reverts commit 907747d394.
* fixup: remove the --exclude
* refactor: remove yarn.lock check
* try ddd in postinstall
* refactor: cache before release:standalone
* refactor: add os to cache key in release
* chore: formatting
* Update ci/build/npm-postinstall.sh
* fixup: formatting
* refactor: remove keytar dep in cross-compile
* refactor: try other keytar package
* refactor: remove keytar step in cross-compile
* fix: manually remove keytar
* try this first
* I think this is it
* Revert "I think this is it"
This reverts commit 5c566b0c01.
* okay this is it
* fixup
* try legacy peer
* remove keytar before standalone
* wrong path
* maybe
* revert: change *npm* back to npm*
* revert: don't uninstall keytar
* fix: use npm run standalone-release
* fixup formatting
* Revert "refactor: remove yarn.lock steps (#5850)"
This reverts commit 907747d394.
* fixup: remove the --exclude
* refactor: remove yarn.lock check
Co-authored-by: repo-ranger[bot] <39074581+repo-ranger[bot]@users.noreply.github.com>
When I did the last release, `VERSION` wasn't defined which lead to a
blank string in the PR title and the commit message here:
https://github.com/coder/code-server-aur/pull/24
This should fix that.
* refactor: default to npm in postinstall.sh
yarn has a bug where it will try to update dependencies even if
`yarn.lock` is present. Therefore we're defaulting to `npm` to prevent
further issues.
* refactor: exclude yarn.lock in standalone
By excluding `yarn.lock`, we prevent issues where the user must use
`yarn` instead of `npm` to install code-server.
* wip: changelog
* fixup
* fix: add +x to product.json in build-vscode
While testing a pre-release, there seems to be a bug with the file
permissions for `product.json`. Adding `chmod +x` to see if that fixes
it.
* chore: increase timeout
* fix: keep product.json file permissions in release
When we added the change to modify the `package.json` version using `mv`
and `jq` we didn't account for lost file permissions.
This caused a bug only happening in CI.
This should fix it by giving it 755 via `chmod`.
* trigger ci
* chore: update package.json bust cache
* fixup!: fix: keep product.json file permissions in release
* Revert "fix: add +x to product.json in build-vscode"
This reverts commit fc4d2b532f.
* chore: pin ubuntu runner in build code-server
* chore: update prettierignore
* chore: add notes to changelog
* chore: use ubuntu-22.04 for e2e
* chore: pin all jobs in build to ubuntu 20.04
* feat(wrapper): add tests for isChild
* fixup: include description ts-expect-error comment
* chore: update CHANGELOG
* chore: update Helm chart
* fixup: use our childProcess
* Update CHANGELOG.md
Co-authored-by: Asher <ash@coder.com>
Co-authored-by: Asher <ash@coder.com>
This adds documentation for the flag `--edge` which we've had for a
while but forgot to document.
Fixes#5717
Co-authored-by: repo-ranger[bot] <39074581+repo-ranger[bot]@users.noreply.github.com>
* chore: upgrade Code to 1.73.0
This upgrades Code to 1.73.0 via the tag.
* chore: refresh integration patch
* chore: clean up base-path patch
Only change here was they moved
lib/vscode/src/vs/platform/extensionResourceLoader/common/extensionResourceLoader.ts
so I had to update it. Code still looks the same though.
* chore: refresh proposed-api patch
* chore: update marketplace patch
Simlar to a previous patch, the location of
lib/vscode/src/vs/platform/extensionResourceLoader/common/extensionResourceLoader.ts
changed so I had to update this patch.
No changes to code itself.
* chore: update hash in webview patch
I believe there was only one to update but I may have missed one.
* chore: refresh disable-builtin-ext-update.diff
* chore: refresh update-check
quilt couldn't apply it so I had to add one change in manually to
lib/vscode/src/vs/server/node/serverEnvironmentService.ts
* chore: refresh logout patch
* chore: refresh proxy-uri patch
* chore: refresh local-storage patch
* chore: refresh sourcemaps patch
* chore: refresh disable-downloads patch
* chore: refresh telemetry patch
* refactor: re-apply display-language patch
This kinda got removed but I added it back in.
* refactor: drop exec-argv patch
This was accepted upstream! :tada
* chore: refresh getting-started patch
* fixup: add missing slash in marketplace
* fixup: update notes proposed-api patch
* fixup: support this.args.log as string
Seems like upstream now uses a string[] for this. For now, support
string.
See
2b50ab06b1
* Revert "fixup: support this.args.log as string"
This reverts commit 78c02a1f13.
* fixup!: add log to toCodeArgs
This was changed upstream from `string` to `string[]` so now we convert
to an array in `toCodeArgs`.
See 78c02a1f13
* fixup: update telemetry description
* refactor: get version dynamically
* chore: remove version
* fixup: missing quotes
* refactor: drop global VERSION
* wip: updating ersion in publish
* refactor: update publish.yaml with version changes
* refactor: release.yaml with new version changes
* refactor: update build.yaml with version changes
* chore: update maintainer
* fixup: update version in build-vscode
* fixup: fix github env version
* try macos only
* try again
* last resort
* joe again
* this oneee
* fixup: this should work
* try using inputs
* docs: update release notes
* fixup!: use env.VERSION in docker step
* fixup!: comment get and set version
* fixup!: remove compress release package comment
* fixup!: use $VERSION in npm-version
* refactor: set VERSION in build VS Code step
* refactor: use 0.0.0 in package.json version
* refactor: delete release-prep script
* Update ci/build/build-vscode.sh
* fixup!: remove extra VERSION set in aur
* Improve getting started Coder CTA
This wasn't very standout-ish before, and I think it's
wise for us to experiment with directing users to Coder.
* Update nix flake
* Update diff
* Add advert to code-server install
* Fix patch to reset columns if getting started is disabled
* Update text for advert
* chore: bump version to 4.8.2
* chore: update CHANGELOG
* docs: add back line in publishing release
See https://github.com/coder/code-server/pull/5732#discussion_r1010685933
* Revert "chore: bump version to 4.8.2"
This reverts commit 5d70994f22.
* fixup: use 4.8.2-rc.1
* docs: add release candidate notes
* refactor: warn plugin range incompatibble
* chore: bump version 4.8.2
* fix: use * for test plugin engines
This removes the need to update this version with every version change.
* refactor: use npm-package in release assets
This adds a new job to `release.yaml` to upload the `npm-package` to the
release assets which will also allow us to download it in the
`publish.yaml` workflow.
* docs: update release instructions
* fixup!: use package.tar.gz
* fix: use * for test plugin engines
This removes the need to update this version with every version change.
* refactor: use npm-package in release assets
This adds a new job to `release.yaml` to upload the `npm-package` to the
release assets which will also allow us to download it in the
`publish.yaml` workflow.
* docs: update release instructions
* feat: add getting-started patch
This modifies the text on the Getting Started page to promote
coder/coder.
* feat: add --disable-getting-started-override
This adds a new CLI flag to code-server called
`--disable-getting-started` which will be used in Code to not use
Coder's custom Getting Started text.
* refactor: conditionally show coder getting started
This modifies the getting started patch changes to work with the new
`--disable-getting-started-override`.
The flag is false by default meaning the Coder getting started is shown.
By passing the flag to code-server, it will not be shown.
* docs: update faq for getting started override
* docs: update getting-started patch description
* fixup!: update patch
* fixup!: unit test
* feat: add more tests
* fixup!: use correct env var in tests
Co-authored-by: repo-ranger[bot] <39074581+repo-ranger[bot]@users.noreply.github.com>
* fix: update hashes in webview patch
We missed a hash update and also had the wrong hash for another HTML
file which caused issues in 4.8.0.
* refactor: move parent-origin into webview
Not sure why but we were seeing argon2/node-gyp issues after this
upgrade while running `yarn release:standalone`. For now, downgrading to
0.29.0 seems to fix the issue when testing locally.
Co-authored-by: repo-ranger[bot] <39074581+repo-ranger[bot]@users.noreply.github.com>
* feat: enable ports panel in proxy-uri patch
This makes the forwarded ports panel enabled by default.
* feat: add tunnelProvider in proxy-uri patch
This adds a `tunnelProvider` along with a `tunnelFactory` so that ports
are forwarded and use code-server's built-in proxy.
* fixup!: update import
* fix: skip uri modification if authority host match
This adds a check in our `resolveExternalUri` patch to skip modifying if
the `authority` and the `location.host` match to prevent
`localhost:<port>/proxy/<port>` from being modified.
* fixup!: refresh patch
* fixup!: move authority check up
* fixup!: remove comment
* fixup!: add trailing slash
* fix: add handle for resolveExternalUri
This adds a fix to properly handle `resolveExternalUri` which is used by
extensions like Tabnine.
* fixup!: update patch
* fixup!: force update proxy patch
* fixup!: use proxyEndpointTemplate else manually add
* fixup!: throw error if productConfiguration missing
* feat(testing): add asExternalUri
This modifies the test extension used in e2e test by registering a new
command for testing `asExternalUri`.
* feat: add e2e test for asExternalUri
* docs: update playwright setup comments
* feat: add support for VSCODE_PROXY_URI
* chore: refresh patches
* feat: add test for VSCODE_PROXY_URI
* chore: add metadata to lang extension
* fixup!: fix part of service-worker patch
* fixup!: remove e2e test, update patch notes
* fixup!: refresh disable-downloads
* fixup!: formatting
* add customization options for the login page
* add unit tests
* add test for correct welcome text when none is set but app-name is
Signed-off-by: niwla23 <46248939+niwla23@users.noreply.github.com>
* add test for no app-name set and check in title too
Signed-off-by: niwla23 <46248939+niwla23@users.noreply.github.com>
Signed-off-by: niwla23 <46248939+niwla23@users.noreply.github.com>
Co-authored-by: Joe Previte <jjprevite@gmail.com>
* docs: add toc to CODE OF CONDUCT
* chore: add prettier ignore blocks to docs
* chore: update styles for Dockerfile
* refactor: separate prettier, doctoc
This does a couple things:
- update `.prettierignore`
- split `prettier` and `doctoc` commands. you can still run with `yarn
fmt`
- delete `fmt.sh` and add `doctoc.sh`
By doing so, we can run tasks in parallel in CI and we should also have
less false positives than before with `yarn fmt` locally.
* refactor: update prettier job, add doctoc
This modifies the prettier job to use actionsx/prettier. It also adds a
job for `doctoc`.
* chore: upgrade to prettier 2.7.1
* chore: pin doctoc to 2.0.0
* fixup!: add .pc to prettierignore
* feat: add --cache to prettier cmd
the link for installing with NPM on line 103 was written as
[installing with npm][./npm.md](./npm.md) `[installing with npm][./npm.md](./npm.md)`
I fixed it to look like
[installing with npm](./npm.md) `[installing with npm](./npm.md)`
In freebsd, su -c expects a login class argument instead of a command, if -c is preceded by a username, then -c and the arguments that follow will be passed as shell arguments
* chore: update code to 1.71.2
* chore: update telemetry patch
It appears part of the fix has been implemented upstream.
* refactor: drop safari-console patch
This has been fixed upstream.
* refactor: remove stylelint
* refactor: move shellcheck to separate job
* refactor: add helm script and job
* refactor: add eslint job and yarn script
* fix(test/tsconfig): exclude test-plugin
* refactor: delete lint, add typecheck job
* refactor: remove prebuild
* wip: add notes about unit test refactor
* refactor: delete buggy socket test
This test was really added to in get cover specific lines but it's buggy
and only passes sometimes locally. I think it's okay to remove because:
- it's an implementation detail (not user facing)
- not preventing any specific regressions
* refactor: move test-plugin to integration suite
This seems more appropriate given this tests how a plugin might work
within code-server.
* wip
* wip: refactor vscode integration tests
* refactor: move unit tests to separate job
* fix: formatting
* Revert "wip: refactor vscode integration tests"
This reverts commit 13286bf4c9.
* Revert "refactor: move unit tests to separate job"
This reverts commit 6c87b540b4.
* feat: collect codecov integration tests
* fixup! feat: collect codecov integration tests
* fixup! feat: collect codecov integration tests
* fixup!: move helm step
* fixup!: update ids for caching
* trigger ci
* trigger ci
* chore: clean up names in security.yaml
* fixup!: remove .tsx
* fixup!: change to src/**"
* fixup!: move helm cmd to yaml
* fixup!: always build test plugin
* fixup!: fix plugin typings
* fixup! add back flakey test
* fixup!: only install helm deps if changes
* fixup!: revert node mod caching
* dont keep, test for asher
* fixup!: add make to centos
* refactor: add test:native
This adds a new script to run native tests (i.e. --help which should run
in ci on all platforms).
* try updating glibc
* try 2.25
* Revert "refactor: move test-plugin to integration suite"
This reverts commit bc02005dc0.
I couldn't get past some GLIBC errors in CI so moving back to unit
tests.
* Revert "try updating glibc"
This reverts commit 02ed560f22.
* fixup!
* asher: again
* try this for ts changes
* fixup
* refactor: scripts.yml -> scripts.yaml
* fixup!: move lint-sh to scripts.yaml
* fixup!: use apk for lint scripts
* fixup! fixup!: use apk for lint scripts
* fixup!: remove typecheck step
* fix: pattern for lint ts files
* test: lint should fail
* fixup! fixup!: use apk for lint scripts
* Revert "test: lint should fail"
This reverts commit 158c64db04.
* fixup!: skip cancel workflow on forks
Looks like the cancel action workflow can't run on forks due to secrets.
See https://github.com/andymckay/cancel-action/issues/4
* fixup: remove cancel-workflow
* fixup! fixup! fixup!: use apk for lint scripts
* fixup! fixup! fixup!: use apk for lint scripts
* fixup!: fix yarn key
* fixup!: add fetch-depth 0
* docs: update MAINTAINING
* refactor: use branch name in release-prep
This makes a minor improvement to the `release-prep.sh` script to grab
the version to update to from the branch name.
* chore(release): bump version to 4.7.0
* fixup: bump version
* docs: use latest instead of version
* fixup: bump Chart version
* chore: update CHANGELOG
* chore: add license to test package.json
* chore: bump @coder/logging to 3.0.0
* fix: change level to Warn
* chore: update upstream code
* update patches for vs 1.71.0
the cli fix seems to be fixed in upstream, the telemtry patch requires (again) some fixing and adjustments.
* add safari fix.
* increase ci timeout
Co-authored-by: Joe Previte <jjprevite@gmail.com>
* feat(e2e): add language extension to setup
This adds a slimmed-down version of the Spanish Language Pack and also
adds a `languagepacks.json` to the e2e `workspaceDir` which allows use
to run a test suite passing the `--locale es` flags to simulate a
different display language.
* feat: add e2e test for display language patch
This tests loading code-server in Spanish using the `--locale` flag.
* fixup!: use JSON.stringify for readability
* fixup!: add comment about langaugepacks temp fix
* fixup!: slim down translations
* fixup!: slim down package.json for lang. ext
* Use fork instead of spawn
We no longer do in-place updating so no need for the spawn. The
advantage of a fork is that it preserves flags like --prof which you can
use to profile code-server.
Also I am not sure the comment about not being able to reload in place
with fork was even true to begin with.
* Refresh heartbeat patch
Seems to have gotten out of date a little.
* Propagate execArgv to extension host
This will let us profile the extension host.
* chore: clean up logging in npm script
* fix: catch error if npm version missing
npm changed the way the `npm view` command handles missing versions.
Before it exited with a non-error. Now it errors.
Ref: https://github.com/npm/cli/pull/5035
This modifies the script logic to handle those new changes.
This adds a new job called aur which checkouts code-server-aur, updates
the files with the new version then opens a PR into the repo.
Co-authored-by: repo-ranger[bot] <39074581+repo-ranger[bot]@users.noreply.github.com>
* Update upstream Code to 1.70
* Update CSP hashes
* Update comment on remote authority
Also remove it from script-src since it is invalid anyway.
* Use absolute path for disable download patch
Just to keep it consistent with the other imports. We initially added
the patch like this so it was not part of the upgrade but might as well
fix it now.
* Fix inability to change language while code-server is running
Co-authored-by: Asher <ash@coder.com>
`proxy` should `await` for result of `authenticated` call otherwise since otherwise it will always appear to be authenticated as the promise is truthy.
Co-authored-by: Asher <ash@coder.com>
Now that we have a test for `--help` which checks to make sure native
modules are working as expected, we don't need the `--install-extension`
test or the `--list-extensions` test.
We can also remove the `.vsix` fixture since we're not using that
either.
* Update Node types to 16
* Update Express core types
Fixes a number of conflicts it has with Node 16.
* Fix websocket router types
It seems req was `any` before so now we have to handle the types. Also
it seems the socket is of type `stream.Duplex`, not `net.Socket`.
The ws types had to be updated to support the new type.
Unfortunately Code still uses the old type so cast for now.
In the web socket router just use a cast for the extra properties we
add. We could add the types to the Express namespace but I am not sure
we really want these commonly accessible so keep with the casts for now.
Likely we should use Express's `locals` or something instead.
* Add missing return
Not sure why it only just now started complaining though.
Co-authored-by: Asher <ash@coder.com>
* refactor: add env arg to runCodeServerCommand
This allows yous to pass environment variables to code-server's helper
when running integration tests.
* feat: add EXTENSIONS_GALLERY integration test
This test ensures EXTENSIONS_GALLERY is read when set and using the
`--install-extension` flag.
Co-authored-by: repo-ranger[bot] <39074581+repo-ranger[bot]@users.noreply.github.com>
* docs: update maintaining
* chore(e2e): add maxFailures to playwright
* fix(ci): skip submodule in e2e job
We don't need the submodules for the e2e job. This will speed up the
checkout step.
* feat(ci): add test-e2e-proxy job
This adds a new job to CI to run our tests behind Caddy and simulate
code-server running against a reverse-proxy.
* refactor: make e2e work with reverse proxy
This refactors the e2e test in a couple ways:
- remove setting cookie in localStorage (instead we pass --auth none)
- refactor address() method to account for reverse proxy logic
* Update test/e2e/models/CodeServer.ts
* Update test/playwright.config.ts
* Update test/utils/constants.ts
Co-authored-by: Asher <ash@coder.com>
* Update test/utils/helpers.ts
Co-authored-by: Asher <ash@coder.com>
Co-authored-by: Asher <ash@coder.com>
* Include bin scripts for all platforms
These will get symlinked as part of the postinstall. These scripts
provide everything ours does inside the integrated terminal plus more.
* Improve OS detection
Specifically for Windows although we do not yet support Windows.
Also standardize the duplicate arch functions since they had drifted
from each other bit.
* Remove duplicate asar symlink
Since standalone releases run the postinstall they will get the asar
symlink there. That means the symlink will not exist for the npm
package and we will not need to ignore it.
The symlink portion is split out so it can be re-used for other
symlinks (for example linking bin scripts).
* Add symlinks to bin scripts
* Add test for opening a file from the terminal
* Add global Playwright timeout
Otherwise it will exceed the Actions timeout and get rudely killed
without any output.
* Make sed work on macOS
* Fix Node path in bin scripts
* Disable shellcheck expansion error
* Make scripts executable
* Remove .bak files created by sed
* Include Code build script in cache hash
Otherwise if we change the script it will not rebuild Code.
* Make sure the terminal opens
The selector was timing out even though it matched more than one element
but matching on the focused one appears to work.
In addition add a loop so it can keep trying to open the terminal
if something goes wrong with the focus.
* chore(release): bump version to 4.5.1
* chore: bump helm chart
* chore: update CHANGELOG
* Revert "chore: bump helm chart"
This reverts commit 703b03b665.
* chore: bump helm chart to 3.0.0
* revert: remove bad change to manifes.json icon
* fix(ci): add package.json.version to code cachekey
Before this, creating a release sometimes prevented vscode from
rebuilding and using the cache instead. Now we use the
package.json.version in the cache key to "bust" the cache if the
package.json version is updated (aka a release).
Fixes#5316
* Update .github/workflows/ci.yaml
Co-authored-by: Asher <ash@coder.com>
* fixup: formatting
* Revert "refactor: remove version check e2e test"
This reverts commit b23c398b7d.
Co-authored-by: Asher <ash@coder.com>
Having NODE_OPTIONS set is unexpected and although the later flag should
override the previous flag it is not certain that will always be the
case.
Also some users are having issues with the 2 GB limit.
We were using an overrides command in our `.prettierrc.yaml` which
quickly became out of sync with Code's Prettier styles.
Instead, we simply tell Prettier to ignore `lib/vscode`.
This way, if you have `formatOnSave` on and you save inside
`lib/vscode`, you won't convert the file to use code-server's styles.
When using `window.location.origin` to create a new URL for loading
web packages, it constructs a URL that is not relative, leading to the
terminal breaking when code-server is served not via the root (i.e. /ide
instead of /).
* chore(release): bump version to 4.5.0
* chore: update CHANGELOG
* chore: bump chart version
* docs: update MAINTAINING
* fix: add VSCODE_DEV=1 to e2e script
I'm not sure what changed in the latest version but without setting
VSCODE_DEV=1, code-server won't load. This fixes that.
* Revert "fix: add VSCODE_DEV=1 to e2e script"
This reverts commit 58c4826af8.
* fix: try setting VSCODE_DEV=1
* Revert "fix: try setting VSCODE_DEV=1"
This reverts commit 902f5f2f30.
* refactor: remove version check e2e test
I am not sure why this is passing locally and failing CI. I need to
further investigate this since it fails depending on where you test.
* refactor: switch to codecov-uploader GitHub Action
codecov deprecated their Node wrapper for uploading coverage reports.
This removes that and uses their new uploaded along with the v2 GitHub
Action they maintain.
* fix: update broken integration test
* feat: add installExtension integration test
This adds a new helper function called `runCodeServerCommand` along with
a test for `--install-extension`. We can use this approach for writing
integration tests (i.e. testing a real code-server build, CLI commands,
etc).
* refactor: s/ test:standalone with test:integration
This replaces our integration approach to use Jest instead of a single
bash script. By doing this, we will be able to easily maintain and add
to our integration test suite.
* refactor: filter unit tests
Now that our integration tests also use Jest, we need to update our unit
test script to ignore `test/integration`.
* refactor: add SKIP_SUBMODULE_DEPS to postinstall
* refactor: add SKIP_SUBMODULE_DEPS to postinstall
* fixup!: skip submod deps
* refactor: move runCodeServerCommand into sep. file
When Jest runs a test, it loads all the files and imports for that test.
This means you might be "requiring" code that's unrelated to your tests.
This leads to unexpected errors depending on where the code runs.
Moved this file to avoid GLIBC and other errors relaed to argon2 when
running integration tests in CI.
* fizup: formatting
* fizup: increase timeout
* refactor: use fixture in installExtension test
Instead of relying on a network to install an extension, we use a
fixture - vsix file in the repo. This is also faster.
* feat: add integration test for listExtensions
* chore: ignore integration fixtures
* fixup: formatting
* fixup: remove custom-hacks.css
* fixup: formatting
* Update test/integration/installExtension.test.ts
Co-authored-by: Asher <ash@coder.com>
* Update test/integration/listExtensions.test.ts
Co-authored-by: Asher <ash@coder.com>
* Update test/integration/installExtension.test.ts
Co-authored-by: Asher <ash@coder.com>
* Update test/integration/listExtensions.test.ts
Co-authored-by: Asher <ash@coder.com>
* fixup: contributing integration tests section
* fixup: update ci/readme
* fixup: use RELEASE_PATH in test-integration.sh
* refactor: unzip vsix for listExtensions
* refactor: use exec instead of spawn
* Update docs/CONTRIBUTING.md
Co-authored-by: Asher <ash@coder.com>
* Update test/integration/listExtensions.test.ts
Co-authored-by: Asher <ash@coder.com>
* Update test/integration/listExtensions.test.ts
Co-authored-by: Asher <ash@coder.com>
* Update test/integration/listExtensions.test.ts
Co-authored-by: Asher <ash@coder.com>
* refactor: use different default binary path
* fixup!: formatting
Co-authored-by: Asher <ash@coder.com>
* chore: update Code to 1.67
Was able to remove our changes to common/webview.ts since they are
upstream now.
Other than that no serious changes, just context diffs.
* chore: update Code to 1.68
- Upstream moved the web socket endpoint so change the Express route
from / to *. That will let web sockets work at any endpoint.
- Everything in the workbench config is basically the same but
de-indented (upstream extracted it into a separate object which
resulted in a de-indent), the ordering is slightly different, and
instead of vscodeBase we now need vscodeBase + this._staticRoute since
everything is served from a sub-path now.
- Move manifest link back to the root since that is where we host our
manifest.
- Change RemoteAuthoritiesImpl to use the same path building method as
in other places (+ instead of using URI.parse/join).
- Use existing host/port in RemoteAuthoritiesImpl and
BrowserSocketFactory instead of patching them to use window.location
(these are set from window.location to begin with so it should be the
same result but with less patching).
- Since BrowserSocketFactory includes a sub-path now (endpoints were
changed upstream to serve from /quality/commit instead of from the
root) the patch there has changed to prepend the base to that
path (instead of using the base directly).
- The workbench HTML now natively supports a base URL in the form of
WORKBENCH_WEB_BASE_URL so no need for VS_BASE patches there anymore.
- Upstream added type="image/x-icon" so I did as well.
- Move the language patch to the end of the series so it is easier to
eventually remove.
- Remove the existing NLS config in favor of one that supports
extensions.
- Upstream deleted webview main.js and inlined it into the HTML so move
that code (the parent origin check) into both those HTML files
(index.html and index-no-csp.html).
- The remaining diff is from changes to the surrounding context or a
line was changed slightly by upstream (for example renamed files or
new arguments like to the remote authority resolver).
* fix: modify product.json before building
Code injects this into the client during the build process so it needs
to be updated before we build.
* fix: update inline script nonces
* Update HTML base path test
* fix: missing commit
Code overrides it with nothing.
The date is also already injected.
* fix: web extensions breaking when the commit changes
By just using the marketplace directly instead of going through the
backend. I am not sure what the point is when searching extensions
already goes directly to the marketplace anyway.
But also remove the prefix that breaks this as well because otherwise
existing installations will break.
* refactor: fix type annotations in open
There was no clear reason as to why we needed to use type assertions
when initializing both `args` and `options` in `open` so I refactored
them both.
* refactor: create constructOpenOptions
* refactor: add urlSearch and remove options
* feat: add tests for constructOpenOptions
* fix: install nfpm straight from GitHub
install.goreleaser.com appears to no longer be available.
* Add -f to curl commands
This might have made it so we got the right error rather than erroring
on the envsubst step.
Applies Caddy installations documentation fixes and also resolves the following issue when trying to install Caddy:
W: GPG error: https://dl.cloudsmith.io/public/caddy/stable/deb/debian any-version InRelease: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY ABA1F9B8875A6661
See:
- 930109ec33
- 2e255b1ee3
- 0f4885e592
* feat: set up new test for beat twice
* refactor: make Heart.beat() async
This allows us to properly await heart.beat() in our tests and remove
the HACK I added before.
* refactor: bind heart methods .beat and .alive
This allows the functions to maintain access to the Heart instance (or
`this`) even when they are passed to other functions. We do this because
we pass both `isActive` and `beat` to `heartbeatTimer`.
* feat(heart): add test to ensure no warnings called
* fixup!: revert setTimeout for heartbeatTimer
* fixup!: return promise in beat
* chore: upgrade Code to 1.66
* docs: update docs for Code upgrades
* fixup!: docs
* chore: update vscode submodule
* chore: update integration patch
* chore: update node-version patch
* chore: update github-auth patch
They completely changed how auth is handled for GitHub in
https://github.com/microsoft/vscode/pull/145424 so our patch may not
work. Will need to test and revisit.
* refactor: remove postinstall patch
It appears they renamed postinstall.js to postinstall.mjs and removed
the use of `rimraf` which means our patch is no longer needed! 🎉b0e8554cce
* chore: refresh local-storage patch
* chore: refresh service-worker patch
* chore: bulk refresh patches
* fixup!: docs formatting
* refactor: remove unused last-opened patch
* fixup!: formatting docs
* fixup!: formatting docs
* refactor: remove rsync postinstall
* Revert "refactor: remove rsync postinstall"
This reverts commit 8d6b613e9d.
* refactor: update postinstall.js to .mjs
* feat(patches): add parent-origin bypass
* docs(patches): add notes for testing store-socket
* docs(patches): update testing info for node-version
* refactor(patches): delete github-auth.diff patch
* docs(patches): add notes for testing connection-type
* fixup!: delete github-auth patch
* fixup!: update connection type testing
* docs(patches): add notes to insecure-notification.diff
* docs(patches): add nots for update-check.diff
* fixup!: remove comma in integration patch
* fix(e2e): disable workspace trust
* refactor: add --no-default-rc for yarn install
* feat(patches): remove yarnrc in presinstall
* fixup!: silly mistake
* docs: add note about KEEP_MODULES=1
* docs(patches): add testing notes for node-version
* refactor(patches): remove node-version
It appears this is no longer needed due to the `remote/package.json` now which
targets node rather than electron.
* fixup!: add cd ../.. to code upgrade instructions
* fixup!: add note to yarn --production flag
* fixup!: make parent-origin easier to upstream
* Revert "refactor(patches): delete github-auth.diff patch"
This reverts commit 31a354a343.
* Revert "fixup!: delete github-auth patch"
This reverts commit bdeb5212e8.
* Merge webview origin patch into webview patch
* Remove unused post-install patch
* Prevent builtin extensions from updating
* Refresh sourcemaps patch
* Update Node to v16
This matches the version in ./lib/vscode/remote/.yarnrc.
I changed the engine to exactly 16 since if you use any different
version it will just not work since the modules will have been built for
16 (due to the .yarnrc).
* Replace fs.rmdir with fs.rm
Node is showing a deprecation warning about it.
* Update github-auth patch
The local credentials provider is no longer used when there is a remote
so this code moved into the backend web credential provider.
* Prevent fs.rm from erroring about non-existent files
We were using fs.rmdir which presumably did not have the same behavior
in v14 (in v16 fs.rmdir also errors).
* Install Python 3 in CentOS CI container
Co-authored-by: Asher <ash@coder.com>
This is because Node uses SIGUSR1 to enable the debug listener so even
if you just want to restart code-server you end up enabling the debug
listener as well.
Opted to leave the SIGUSR1 handler in to avoid breaking existing
workflows even though it does mean even if you only want to enable the
debug listener you will end up restarting code-server as well. We could
consider removing it after a transition phase.
After some feedback, we realized it is more intuitive to disable file
downloads by setting the environment variable
`CS_DISABLE_FILE_DOWNLOADS` to `true` than `1`. This commit adds support
for both.
* refactor: add timeout for race condition in heart test
* fixup!: set mtime to 0 and check for update
* fixup!: use utimes directly instead of file open
* fixup!: remove import
* refactor(heart): extract logic into heartbeatTimer fn
To make it easier to test, I extract heartbeatTimer into it's own
function.
* feat(testing): add tests for heart.ts
* fixup
* fixup!: remove unneeded heart call
* Update src/node/heart.ts
Co-authored-by: Asher <ash@coder.com>
* fixup!: use mockResolvedValue everywhere
* fixup!: add stat test for timestamp check
Co-authored-by: Asher <ash@coder.com>
We tried to switch from `yarn` to `npm` because `yarn` ignores lockfiles
but learned that we missed a few key things.
For now, we are reverting docs and a few other changes that suggested
using `npm` instead of `yarn` until we fully remove `yarn` from the
codebase.
t Please enter the commit message for your changes. Lines starting
* Update termux.md
1) Updated information to use PRoot (simpler than Andronix and the way supported by Termux) to create and access the Debian distro.
2) Added helpful information on using PRoot with your dev environment.
3) Cleaned up spelling, grammar, and made documentation more consistent between sections.
* docs: Termux correct packages to install
Updated some erroneously missing packages (vim and sudo) necessary for multi-user setup.
* docs: cleaned up verbiage
Co-authored-by: Joe Previte <jjprevite@gmail.com>
* docs: corrected punctuation
Co-authored-by: Joe Previte <jjprevite@gmail.com>
* docs: correct punctuation
Co-authored-by: Joe Previte <jjprevite@gmail.com>
* docs: clarify pkg command shorthand
* Ran yarn fmt on docs
Co-authored-by: Joe Previte <jjprevite@gmail.com>
* Link upstream sync section in MAINTAINING to CONTRIBUTING
* Update MAINTAINING.md table of contents
Co-authored-by: Joe Previte <jjprevite@gmail.com>
* Fix code-server version not appearing in other languages
It needs to be separate from the localize call since the language
version of that string is used and it will not include a spot for the
code-server version.
I also moved the "v" so we do not get "vUnknown".
* Add code-server version to product configuration
Before 1.64 the entire product configuration was sent to the client but
that was removed so we have to add anything we want to use on the
client, like the code-server version (used in the about dialog).
Fixes#5027.
* Refresh patches
* Change version test to look for specific version
This will catch if we are not sending the actual version to the client.
* Use --exclude to skip node_modules
Instead of copying and then deleting them. This will also catch some
node_modules directories that were missed.
* Remove per-extension dependency install
Code packages all the dependencies using webpack for each extension so
there are no dependencies to install.
* Include source maps
I also moved this to its own patch because it feels sufficiently
standalone.
Fixes#5026.
* Refresh language patch
The base is slightly different so it needed to be refreshed.
* Add missing package.json
This was caused by switching to Code's package step which does not
include the package.json.
Fixes#5019.
* Include keytar
It seems this actually is used now.
* fix: source lib.sh in docker-buildx-push for tagging version
* chore: use ubuntu and update git config homebrew job
* refactor: simplify brew-bump.sh script
* Revert "fix: source lib.sh in docker-buildx-push for tagging version"
This reverts commit 2f7a3610cb.
* Regenerate last opened patch
The lines were a bit off.
* Remove packaged .gitignore files
Fixes#4964.
* Remove extra Node binary
This gets overidden in the standalone but it was getting uselessly
included in the npm package.
* Move integration types into code-server
This will be easier to maintain than to have it as a patch.
* Disable connection token
Using a flag means we will not need to patch it out. I think this is
new from 1.64?
* Add product.json to build process
This way we do not have to patch it.
* Ship with remote agent package.json
Instead of the root one. This contains fewer dependencies.
* Let Code handle errors
This way we will not have to patch Code to make this work and I think it
makes sense to let Code handle the request.
If we do want to handle errors we can do it cleanly by patching their
error handler to throw instead.
* Move manifest override into code-server
This way we will not have to patch it.
* Move to patches
- Switch submodule to track upstream
- Add quilt to the process
- Add patches
The node-* ignore was ignoring one of the diffs so I removed it. This
was added when we were curling Node as node-v{version}-darwin-x64 for
the macOS build but this no longer happens (we use the Node action to
install a specific version now so we just use the system-wide Node).
* Use pre-packaged Code
* refactor: checkout homebrew-core in action instead of script
This moves the git clone step from the `brew-bump.sh` script into the
`npm-brew.yaml` as part of the job using actions/checkout instead.
* refactor: clean up brew-bump.sh script
* fixup
* fixup!: remove step to clean up homebrew repo
* fixup!: use correct ./ci path steps-lib.sh
* fixup!: add exit code 0 for duplicate PRs
* fix(ci): correctly download npm artifact
* fixup! fix(ci): correctly download npm artifact
* docs: update MAINTAINING
* fixup! docs: update MAINTAINING
* fixup! Merge branch 'main' into 4949-chore-fix-npm-workflow
* chore: get ci to run
* refactor: use vVERSION branch name instead of release
* refactor: use new download artifact in docker workflow
* refactor: clean up release-github-assets script
* fixup: remove extra v
* fixup! fixup: remove extra v
* feat(npm): use DEV_PACKAGE_NAME for development
* feat(ci): use npm v7 in npm job
* fixup: add npm version
* fixup: always set package name
* wip
* fix: check for npm and npm v7
* fixup
* fixup: move after release dir created
* fixup: use jq
* fixup: use jq correctly
* Move Code to a submodule
Closes#4901.
* Base Code cache on hash and re-enable node_modules cache
The current setup appears to only rebuild VS Code if the dependencies
change but we need to rebuild it if anything changes.
I also re-enabled the commented out node_modules caches. They look like
they should work to me with the submodule method. I think the problem
occurred because Code itself was being installed in the yarn step.
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`).
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 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?
description:Please try reproducing this issue in VS Code
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
- 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.
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-20.04
steps:
- name:Checkout code-server
uses:actions/checkout@v4
- 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 }}
# NOTE@jsjoeio - we do this so we can strip out the v
"description": "code-server provides a built-in proxy to help in developing web-based applications. This is the code for the domain-based proxy.\n\nAlso documented here: [https://github.com/coder/code-server/blob/master/docs/FAQ.md#how-do-i-securely-access-web-services](https://github.com/coder/code-server/blob/master/docs/FAQ.md#how-do-i-securely-access-web-services)"
"description": "code-server provides a built-in proxy to help in developing web-based applications. This is the code for the domain-based proxy.\n\nAlso documented here: [https://github.com/coder/code-server/blob/main/docs/FAQ.md#how-do-i-securely-access-web-services](https://github.com/coder/code-server/blob/main/docs/FAQ.md#how-do-i-securely-access-web-services)"
},
{
"file": "src/node/routes/pathProxy.ts",
"line": 19,
"description": "Here is the path-based version of the proxy.\n\nAlso documented here: [https://github.com/coder/code-server/blob/master/docs/FAQ.md#how-do-i-securely-access-web-services](https://github.com/coder/code-server/blob/master/docs/FAQ.md#how-do-i-securely-access-web-services)"
"description": "Here is the path-based version of the proxy.\n\nAlso documented here: [https://github.com/coder/code-server/blob/main/docs/FAQ.md#how-do-i-securely-access-web-services](https://github.com/coder/code-server/blob/main/docs/FAQ.md#how-do-i-securely-access-web-services)"
},
{
"file": "src/node/proxy.ts",
@ -95,7 +95,7 @@
{
"file": "src/node/routes/health.ts",
"line": 5,
"description": "A simple endpoint that lets you see if code-server is up.\n\nAlso documented here: [https://github.com/coder/code-server/blob/master/docs/FAQ.md#healthz-endpoint](https://github.com/coder/code-server/blob/master/docs/FAQ.md#healthz-endpoint)"
"description": "A simple endpoint that lets you see if code-server is up.\n\nAlso documented here: [https://github.com/coder/code-server/blob/main/docs/FAQ.md#healthz-endpoint](https://github.com/coder/code-server/blob/main/docs/FAQ.md#healthz-endpoint)"
},
{
"file": "src/node/routes/login.ts",
@ -143,9 +143,9 @@
"description": "Static images and the manifest live here in `src/browser/media` (see the explorer)."
},
{
"directory": "vendor/modules/code-oss-dev",
"directory": "lib/vscode",
"line": 1,
"description": "code-server makes use of VS Code's frontend web/remote support. Most of the modifications implement the remote server since that portion of the code is closed source and not released with VS Code.\n\nWe also have a few bug fixes and have added some features (like client-side extensions). See [https://github.com/coder/code-server/blob/master/docs/CONTRIBUTING.md#modifications-to-vs-code](https://github.com/coder/code-server/blob/master/docs/CONTRIBUTING.md#modifications-to-vs-code) for a list.\n\nWe make an effort to keep the modifications as few as possible."
"description": "code-server makes use of VS Code's frontend web/remote support. Most of the modifications implement the remote server since that portion of the code is closed source and not released with VS Code.\n\nWe also have a few bug fixes and have added some features (like client-side extensions). See [https://github.com/coder/code-server/blob/main/docs/CONTRIBUTING.md#modifications-to-vs-code](https://github.com/coder/code-server/blob/main/docs/CONTRIBUTING.md#modifications-to-vs-code) for a list.\n\nWe make an effort to keep the modifications as few as possible."
"description": "## Commands\n\nTo start developing, make sure you have Node 14+ and the [required dependencies](https://github.com/Microsoft/vscode/wiki/How-to-Contribute#prerequisites) installed. Then, run the following commands:\n\n1. Install dependencies:\n>> yarn\n\n3. Start development mode (and watch for changes):\n>> yarn watch"
"description": "## Commands\n\nTo start developing, make sure you have Node 16+ and the [required dependencies](https://github.com/Microsoft/vscode/wiki/How-to-Contribute#prerequisites) installed. Then, run the following commands:\n\n1. Install dependencies:\n>> yarn\n\n3. Start development mode (and watch for changes):\n>> yarn watch"
},
{
"file": "src/node/app.ts",
@ -20,7 +20,7 @@
{
"file": "src/node/app.ts",
"line": 62,
"description": "## That's it!\n\n\nThat's all there is to it! When this tour ends, your terminal session may stop, but just use `yarn watch` to start developing from here on out!\n\n\nIf you haven't already, be sure to check out these resources:\n- [Tour: Contributing](command:codetour.startTourByTitle?[\"Contributing\")\n- [Docs: FAQ.md](https://github.com/coder/code-server/blob/master/docs/FAQ.md)\n- [Docs: CONTRIBUTING.md](https://github.com/coder/code-server/blob/master/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 `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)"
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.
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.
These are required by VS 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
The current development workflow is a bit tricky because we have this repo and we use our `coder/vscode` fork inside it with [`yarn link`](https://classic.yarnpkg.com/lang/en/docs/cli/link/).
Here are these steps you should follow to get your dev environment setup:
3. `cd vscode && yarn install` - install the dependencies in the `vscode` repo
4. `cd code-server && yarn install` - install the dependencies in the `code-server` repo
5. `cd vscode && yarn link` - use `yarn` to create a symlink to the `vscode` repo (`code-oss-dev` package)
6. `cd code-server && yarn link code-oss-dev --modules-folder vendor/modules` - links your local `vscode` repo (`code-oss-dev` package) inside your local version of code-server
7. `cd code-server && yarn watch` - this will spin up code-server on localhost:8080 which you can start developing. It will live reload changes to the source.
3. `quilt push -a` - Apply patches to the `vscode` submodule.
4. `yarn` - Install dependencies
5. `yarn watch` - Launch code-server localhost:8080. code-server will be live
reloaded when changes are made; the browser needs to be refreshed manually.
### Updates to VS Code
When pulling down changes that include modifications to the patches you will
need to apply them with `quilt`. If you pull down changes that update the
`vscode` submodule you will need to run `git submodule update --init` and
re-apply the patches.
If changes are made and merged into `main` in the [`coder/vscode`](https://github.com/coder/vscode) repo, then you'll need to update the version in the `code-server` repo by following these steps:
When you make a change that affects people deploying the marketplace please
update the changelog as part of your PR.
1. Update the package tag listed in `vendor/package.json`:
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.
```json
{
"devDependencies": {
"vscode": "coder/vscode#<latest-commit-sha>"
}
}
```
Display language (Spanish, etc) support only works in a full build; it will not
work in development mode.
2. From the code-server **project root**, run `yarn install`.
Then, test code-server locally to make sure everything works.
3. 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.
4. Open a PR
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).
> Watch for updates to
> `vendor/modules/code-oss-dev/src/vs/code/browser/workbench/workbench.html`. You may need to
> make changes to `src/browser/pages/vscode.html`.
### Version updates to Code
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 ../..`
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 `yarn install`.
5. Check the Node.js version that's used by Electron (which is shipped with VS
Code. If necessary, update our version of Node.js to match.
### Patching Code
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.
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.
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
git submodule update --init
quilt push -a
yarn install
yarn build
yarn build:vscode
VERSION=0.0.0 yarn build:vscode
yarn release
```
This does not keep `node_modules`. If you want them to be kept, use
`KEEP_MODULES=1 yarn release`
Run your build:
```shell
cd release
yarn --production
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:standalone-release
yarn test:integration
yarn 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 `yarn 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.
Try popping off the patches with `quilt pop -a` and reapplying with `quilt push
-a`.
#### "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`.
### 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
@ -166,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
@ -174,13 +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 a script called
[test-standalone-release.sh](../ci/build/test-standalone-release.sh), which
ensures that code-server's CLI is working.
These are a work in progress. We build code-server and run tests with `yarn
test:integration`, which ensures that code-server builds work on their
respective platforms.
Our integration tests look at components that rely on one another. For example,
testing the CLI requires us to build and package code-server.
@ -201,106 +249,48 @@ 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 VS
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).
Most of the meaty parts are in the VS Code portion of the codebase under
[vendor/modules/code-oss-dev](../vendor/modules/code-oss-dev), which we describe next.
Most of the meaty parts are in the Code portion of the codebase under
[lib/vscode](../lib/vscode), which we describe next.
### Modifications to VS Code
### Modifications to Code
In v1 of code-server, we had a patch of VS Code that split the codebase into a
front-end and a server. The front-end consisted of the UI code, while the server
ran the extensions and exposed an API to the front-end for file access and all
UI needs.
Our modifications to Code can be found in the [patches](../patches) directory.
We pull in Code as a submodule pointing to an upstream release branch.
Over time, Microsoft added support to VS Code to run it on the web. They have
made the front-end open source, but not the server. As such, code-server v2 (and
later) uses the VS Code front-end and implements the server. We do this by using
a Git subtree to fork and modify VS Code. This code lives under
In v1 of code-server, we had Code as a submodule and used a single massive patch
that split the codebase into a front-end and a server. The front-end consisted
of the UI code, while the server ran the extensions and exposed an API to the
front-end for file access and all UI needs.
Some noteworthy changes in our version of VS Code include:
Over time, Microsoft added support to Code to run it on the web. They had made
the front-end open source, but not the server. As such, code-server v2 (and
later) uses the Code front-end and implements the server. We did this by using a
Git subtree to fork and modify Code.
- Adding our build file, [`vendor/modules/code-oss-dev/coder.js`](../vendor/modules/code-oss-dev/coder.js), which includes build steps specific to code-server
- Node.js version detection changes in [`build/lib/node.ts`](../vendor/modules/code-oss-dev/build/lib/node.ts) and [`build/lib/util.ts`](../vendor/modules/code-oss-dev/build/lib/util.ts)
- Allowing extra extension directories
- Added extra arguments to [`src/vs/platform/environment/common/argv.ts`](../vendor/modules/code-oss-dev/src/vs/platform/environment/common/argv.ts) and to [`src/vs/platform/environment/node/argv.ts`](../vendor/modules/code-oss-dev/src/vs/platform/environment/node/argv.ts)
- Added extra environment state to [`src/vs/platform/environment/common/environment.ts`](../vendor/modules/code-oss-dev/src/vs/platform/environment/common/environment.ts);
- Added extra getters to [`src/vs/platform/environment/common/environmentService.ts`](../vendor/modules/code-oss-dev/src/vs/platform/environment/common/environmentService.ts)
- Added extra scanning paths to [`src/vs/platform/extensionManagement/node/extensionsScanner.ts`](../vendor/modules/code-oss-dev/src/vs/platform/extensionManagement/node/extensionsScanner.ts)
- Additions/removals from [`package.json`](../vendor/modules/code-oss-dev/package.json):
- Removing `electron`, `keytar` and `native-keymap` to avoid pulling in desktop dependencies during build on Linux
- Removing `gulp-azure-storage` and `gulp-tar` (unsued in our build process, may pull in outdated dependencies)
- Adding `proxy-agent`, `proxy-from-env` (for proxying) and `rimraf` (used during build/install steps)
- Removing azure/macOS signing related dependencies from [`build/package.json`](../vendor/modules/code-oss-dev/build/package.json)
- Modifying `.gitignore` to allow us to add files to `src/vs/server` and modifying `.eslintignore` to ignore lint on the shared files below (we use different formatter settings than VS Code).
- Sharing some files with our codebase via symlinks:
- [`src/vs/base/common/ipc.d.ts`](../vendor/modules/code-oss-dev/src/vs/base/common/ipc.d.ts) points to [`typings/ipc.d.ts`](../typings/ipc.d.ts)
- [`src/vs/base/common/util.ts`](../vendor/modules/code-oss-dev/src/vs/base/common/util.ts) points to [`src/common/util.ts`](../src/common/util.ts)
- [`src/vs/base/node/proxy_agent.ts`](../vendor/modules/code-oss-dev/src/vs/base/node/proxy_agent.ts) points to [`src/node/proxy_agent.ts`](../src/node/proxy_agent.ts)
- Allowing socket changes by adding `setSocket` in [`src/vs/base/parts/ipc/common/ipc.net.ts`](../vendor/modules/code-oss-dev/src/vs/base/parts/ipc/common/ipc.net.ts)
- We use this for connection persistence in our server-side code.
- Added our server-side Node.JS code to `src/vs/server`.
- This code includes the logic to spawn the various services (extension host, terminal, etc.) and some glue
- Added [`src/vs/workbench/browser/client.ts`](../vendor/modules/code-oss-dev/src/vs/workbench/browser/client.ts) to hold some server customizations.
- Includes the functionality for the Log Out command and menu item
- Also, imported and called `initialize` from the main web file, [`src/vs/workbench/browser/web.main.ts`](../vendor/modules/code-oss-dev/src/vs/workbench/browser/web.main.ts)
- Added a (hopefully temporary) hotfix to [`src/vs/workbench/common/resources.ts`](../vendor/modules/code-oss-dev/src/vs/workbench/common/resources.ts) to get context menu actions working for the Git integration.
- Added connection type to WebSocket query parameters in [`src/vs/platform/remote/common/remoteAgentConnection.ts`](../vendor/modules/code-oss-dev/src/vs/platform/remote/common/remoteAgentConnection.ts)
- Added `CODE_SERVER*` variables to the sanitization list in [`src/vs/base/common/processes.ts`](../vendor/modules/code-oss-dev/src/vs/base/common/processes.ts)
- Added code to allow server to inject settings to [`src/vs/platform/product/common/product.ts`](../vendor/modules/code-oss-dev/src/vs/platform/product/common/product.ts)
- Extension fixes:
- Avoid disabling extensions by extensionKind in [`src/vs/workbench/services/extensionManagement/browser/extensionEnablementService.ts`](../vendor/modules/code-oss-dev/src/vs/workbench/services/extensionManagement/browser/extensionEnablementService.ts) (Needed for vscode-icons)
- Remove broken symlinks in [`extensions/postinstall.js`](../vendor/modules/code-oss-dev/extensions/postinstall.js)
- Add tip about extension gallery in [`src/vs/workbench/contrib/extensions/browser/extensionsViewlet.ts`](../vendor/modules/code-oss-dev/src/vs/workbench/contrib/extensions/browser/extensionsViewlet.ts)
- Use our own server for GitHub authentication in [`extensions/github-authentication/src/githubServer.ts`](../vendor/modules/code-oss-dev/extensions/github-authentication/src/githubServer.ts)
- Settings persistence on the server in [`src/vs/workbench/services/environment/browser/environmentService.ts`](../vendor/modules/code-oss-dev/src/vs/workbench/services/environment/browser/environmentService.ts)
- Add extension install fallback in [`src/vs/workbench/services/extensionManagement/common/extensionManagementService.ts`](../vendor/modules/code-oss-dev/src/vs/workbench/services/extensionManagement/common/extensionManagementService.ts)
- Add proxy-agent monkeypatch and keep extension host indefinitely running in [`src/vs/workbench/services/extensions/node/extensionHostProcessSetup.ts`](../vendor/modules/code-oss-dev/src/vs/workbench/services/extensions/node/extensionHostProcessSetup.ts)
- Patch build system to avoid removing extension dependencies for `yarn global add` users in [`build/lib/extensions.ts`](../vendor/modules/code-oss-dev/build/lib/extensions.ts)
- Allow all extensions to use proposed APIs in [`src/vs/workbench/services/environment/browser/environmentService.ts`](../vendor/modules/code-oss-dev/src/vs/workbench/services/environment/browser/environmentService.ts)
- Make storage writes async to allow extensions to wait for them to complete in [`src/vs/platform/storage/common/storage.ts`](../vendor/modules/code-oss-dev/src/vs/platform/storage/common/storage.ts)
- Specify webview path in [`src/vs/code/browser/workbench/workbench.ts`](../vendor/modules/code-oss-dev/src/vs/code/browser/workbench/workbench.ts)
- URL readability improvements for folder/workspace in [`src/vs/code/browser/workbench/workbench.ts`](../vendor/modules/code-oss-dev/src/vs/code/browser/workbench/workbench.ts)
- Added code to write out IPC path in [`src/vs/workbench/api/node/extHostCLIServer.ts`](../vendor/modules/code-oss-dev/src/vs/workbench/api/node/extHostCLIServer.ts)
Microsoft eventually made the server open source and we were able to reduce our
changes significantly. Some time later we moved back to a submodule and patches
(managed by `quilt` this time instead of the mega-patch).
As the web portion of VS Code matures, we'll be able to shrink and possibly
eliminate our modifications. In the meantime, upgrading the VS Code version requires
us to ensure that our changes are still applied and work as intended. In the future,
we'd like to run VS Code unit tests against our builds to ensure that features
work as expected.
As the web portion of Code continues to mature, we'll be able to shrink and
possibly eliminate our patches. In the meantime, upgrading the Code version
requires us to ensure that our changes are still applied correctly and work as
intended. In the future, we'd like to run Code unit tests against our builds to
ensure that features work as expected.
> We have [extension docs](../ci/README.md) on the CI and build system.
If the functionality you're working on does NOT depend on code from VS Code, please
If the functionality you're working on does NOT depend on code from Code, please
move it out and into code-server.
### Currently Known Issues
- Creating custom VS Code extensions and debugging them doesn't work
- Creating custom Code extensions and debugging them doesn't work
- Extension profiling and tips are currently disabled
<!-- 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)
If you want to run multiple code-servers on shared infrastructure, we recommend
@ -359,6 +389,15 @@ 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,24 @@ 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
- 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.
## Does code-server have any security login validation?
@ -416,3 +465,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
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 VS Code
The VS Code portion of code-server lives under [`coder/vscode`](https://github.com/coder/vscode). To update VS Code for code-server, follow these steps:
1. `git checkout -b vscode-update` - Create a new branch locally based off `main`
3. `git merge upstream/release/1.64` - Merge it locally
1. replace `1.64` with the version you're upgrading to
1. If there are merge conflicts, commit first, then fix them locally.
4. Open a PR merging your branch (`vscode-update`) into `main` and add the code-server review team
Ideally, our fork stays as close to upstream as possible. See the differences between our fork and upstream [here](https://github.com/microsoft/vscode/compare/main...coder:main).
## 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 `yarn test:unit` and look at the coverage chart. You'll see all the
uncovered lines. This is a good place to start.
- look at `test/scripts` to see which scripts are tested. We can always use more
tests there.
- look at `test/e2e`. We can always use more end-to-end tests.
Otherwise, talk to a current maintainer and ask which part of the codebase is lacking most when it comes to tests.
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
[!["GitHub Discussions"](https://img.shields.io/badge/%20GitHub-%20Discussions-gray.svg?longCache=true&logo=github&colorB=purple)](https://github.com/coder/code-server/discussions) [!["Join us on Slack"](https://img.shields.io/badge/join-us%20on%20slack-gray.svg?longCache=true&logo=slack&colorB=brightgreen)](https://coder.com/community) [![Twitter Follow](https://img.shields.io/twitter/follow/CoderHQ?label=%40CoderHQ&style=social)](https://twitter.com/coderhq) [![codecov](https://codecov.io/gh/coder/code-server/branch/main/graph/badge.svg?token=5iM9farjnC)](https://codecov.io/gh/coder/code-server) [![See v4.0.2 docs](https://img.shields.io/static/v1?label=Docs&message=see%20v4.0.2%20&color=blue)](https://github.com/coder/code-server/tree/v4.0.2/docs)
[!["GitHub Discussions"](https://img.shields.io/badge/%20GitHub-%20Discussions-gray.svg?longCache=true&logo=github&colorB=purple)](https://github.com/coder/code-server/discussions) [!["Join us on Slack"](https://img.shields.io/badge/join-us%20on%20slack-gray.svg?longCache=true&logo=slack&colorB=brightgreen)](https://coder.com/community) [![Twitter Follow](https://img.shields.io/twitter/follow/CoderHQ?label=%40CoderHQ&style=social)](https://twitter.com/coderhq) [![codecov](https://codecov.io/gh/coder/code-server/branch/main/graph/badge.svg?token=5iM9farjnC)](https://codecov.io/gh/coder/code-server) [![See latest](https://img.shields.io/static/v1?label=Docs&message=see%20latest&color=blue)](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.
![Screenshot](./assets/screenshot.png)
![Screenshot](./assets/screenshot-1.png)
![Screenshot](./assets/screenshot-2.png)
## Highlights
@ -14,19 +15,16 @@ access it in the browser.
- Preserve battery life when you're on the go; all intensive tasks run on your
server
| 🔔 code-server is a free browser-based IDE while [Coder](https://coder.com/) is our enterprise developer workspace platform. For more information, visit [Coder.com](https://coder.com/docs/comparison)
| ---
## 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 CPUs
**TL;DR:** Linux machine with WebSockets enabled, 1 GB RAM, and 2 vCPUs
## Getting started
There are three ways to get started:
There are four ways to get started:
1. Using the [install
script](https://github.com/coder/code-server/blob/main/install.sh), which
@ -34,7 +32,8 @@ There are three ways to get started:
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):
curl -1sLf 'https://dl.cloudsmith.io/public/caddy/stable/cfg/setup/config.deb.txt?distro=debian&version=any-version' | sudo tee -a /etc/apt/sources.list.d/caddy-stable.list
curl -1sLf 'https://dl.cloudsmith.io/public/caddy/stable/debian.deb.txt' | sudo tee /etc/apt/sources.list.d/caddy-stable.list
sudo apt update
sudo apt install caddy
```
@ -135,9 +136,9 @@ sudo apt install caddy
1. Replace `/etc/caddy/Caddyfile` using `sudo` so that the file looks like this:
```text
mydomain.com
reverse_proxy 127.0.0.1:8080
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:
@ -187,7 +188,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;
@ -314,12 +315,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
@ -382,92 +403,32 @@ module.exports = {
Read more about `publicPath` in the [Vue.js docs](https://cli.vuejs.org/config/#publicpath)
## SSH into code-server on VS Code
### Proxying to an Angular app
[![SSH](https://img.shields.io/badge/SSH-363636?style=for-the-badge&logo=GNU+Bash&logoColor=ffffff)](https://ohmyz.sh/) [![Terminal](https://img.shields.io/badge/Terminal-2E2E2E?style=for-the-badge&logo=Windows+Terminal&logoColor=ffffff)](https://img.shields.io/badge/Terminal-2E2E2E?style=for-the-badge&logo=Windows+Terminal&logoColor=ffffff) [![Visual Studio Code](https://img.shields.io/badge/Visual_Studio_Code-007ACC?style=for-the-badge&logo=Visual+Studio+Code&logoColor=ffffff)](vscode:extension/ms-vscode-remote.remote-ssh)
In order to use code-server's built-in proxy with Angular, you need to make the following changes in your app:
Follow these steps where code-server is running:
1. use `<base href="./.">` in `src/index.html`
2. add `--serve-path /absproxy/4200` to `ng serve` in your `package.json`
1. Install `openssh-server`, `wget`, and `unzip`.
For additional context, see [this GitHub Discussion](https://github.com/coder/code-server/discussions/5439#discussioncomment-3371983).
```bash
# example for Debian and Ubuntu operating systems
sudo apt update
sudo apt install wget unzip openssh-server
### Proxying to a Svelte app
In order to use code-server's built-in proxy with Svelte, you need to make the following changes in your app:
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):
```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
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)" \
@ -228,14 +297,15 @@ 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.
@ -85,19 +92,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 +112,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
@ -21,8 +21,8 @@ for communication between the browser and the server.
The following steps walk you through setting up a VM running Debian using Google
Cloud (though you are welcome to use any machine or VM provider).
If you're [signing up with Google](https://console.cloud.google.com/getting-started) for the first time, you should get a 12-month trial with
$300 of credits.
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.
After you sign up and create a new Google Cloud Provider (GCP) project, create a
new Compute Engine VM instance:
Some files were not shown because too many files have changed in this diff
Show More
Reference in New Issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.