Commit Graph

757 Commits

Author SHA1 Message Date
Asher 7c298653f1
Fix import of server-main.js from main
Neglected to update this import when fixing the other.
2024-10-18 10:07:05 -08:00
Olivier Benz fc6064dcd3
Update Code to 1.94.2 (#7026)
* Update Code to 1.94.2

* Convert from yarn to npm

This is to match VS Code.  We were already partially using npm for the
releases so this is some nice alignment.

* Update caniuse-lite

This was complaining on every unit test.

* Update eslint

I was having a bunch of dependency conflicts and eslint seemed to be the
culprit so I just removed it and set it up again, since it seems things
have changed quite a bit.

* Update test dependencies

I was getting oom when running the unit tests...updating seems to work.

* Remove package.json `scripts` property in release

The new pre-install script was being included, which is dev-only.

This was always the intent; did not realize jq's merge was recursive.

* Remove jest and devDependencies in release as well

* Update test extension dependencies

This appears to be conflicting with the root dependencies.

* Fix playwright exec

npm does not let you run binaries like yarn does, as far as I know.

* Fix import of server-main.js

* Fix several tests by waiting for selectors
2024-10-17 20:32:21 -08:00
Rafael Ferreira 4a703893b0
Add --abs-proxy-base-path for when code-server is not at the root (#6958) 2024-08-26 20:19:55 +00:00
Asher 34c6751bf8
Update VS Code to 1.92.2 (#6941)
* Update VS Code to 1.92.2

* Use server-main.js to load VS Code

It looks like the bootstrap files are now bundled so we can no longer
require them.  We could make them included again, but maybe it is better
to go through the main entrypoint anyway because it includes some nls
stuff which is maybe necessary.

This also fixes what looks like a bug where we could create two servers
if two requests came in.  I am not sure what the practical consequences
of that would be, but it will no longer do that.

* Drop es2020 patch

Unfortunately, VS Code will not load with this.  It seems to be because
`this` is being used in static properties, and it becomes `void 0` for
some reason under the es2020 target.  For example:

  static PREFIX_BY_CATEGORY = `${this.PREFIX}${this.SCOPE_PREFIX}`;

becomes

  AbstractGotoSymbolQuickAccessProvider.PREFIX_BY_CATEGORY = `${(void 0).PREFIX}${(void 0).SCOPE_PREFIX}`;

Which, obviously, will not work.

Older versions of Safari (and maybe other browsers) are likely affected.

* Fix display language

* Update Playwright

I think maybe because of the dropped es2020 patch that Webkit is now
failing because it is too old.

* Do not wait for networkidle in e2e tests

I am not sure what is going on but some tests on Webkit are timing out
and it seems the page is loaded but something is still trying to
download.  Not good, but for now try to at least get the tests passing.
2024-08-15 21:33:21 -08:00
Asher f2c326147d
Fix login page assets over proxy domain 2024-07-12 15:06:44 -08:00
Asher fb3e3e1546
Log custom extensions gallery 2024-07-09 12:47:24 -08:00
Asher d431c9cd9d
Fix log file path
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.
2024-06-21 09:47:44 -08:00
Asher 125a972c81
Do not add extra args in toCodeArgs
It should only convert the args that are passed in.
2024-05-06 18:39:22 -08:00
Asher fb2afbd9d6
Handle undefined body
In the latest Express it seems the body is undefined when no data is
passed (instead of being empty).
2024-04-16 11:29:12 -08:00
Asher 3d8d544f89
Refactor VS Code routes to match others 2024-04-16 11:00:33 -08:00
Asher b8d830b826
Update path syntax for Express
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.
2024-04-16 09:54:33 -08:00
Asher bec6ab2678
Fix masking exit code
Addresses the part of #6367 that we can fix.
2024-04-05 16:31:58 -08:00
Asher 132f7d1470
Default keepAlive to true for proxy agent 2024-03-11 14:13:21 -08:00
Asher fdb46d3fe5
Exit with 1 when VS Code CLI errors
Addresses part of #6367.  The script bundled with VS Code still has the
same problem but it would be better to fix that one upstream.
2024-01-11 12:46:09 -09:00
Asher d49b3bf159
Fix query string being double-encoding over path proxy
Instead of trying to piece together the original URL and re-encode what
needs to be re-encoded, strip out the base from the original URL.

Fixes #6307.
2024-01-11 12:26:06 -09:00
Jeff Miller 9622830518
Disable "Show Local" button, add --disable-file-uploads option and add file operation trace level logs (#6557) 2023-12-07 12:10:22 -09:00
Asher 26a3437849
Use debug instead of trace
Trace outputs stack traces which is entirely unnecessary for these two
log entries and makes the logs noisier than they need to be.
2023-12-06 13:19:36 -09:00
Daniel T. Lee 897e0ae1da
Modify manifest for window control overlay support (#6468)
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.
2023-10-02 18:03:37 +00:00
Asher a1131fadf2
Enable secret storage (#6450)
* Remove unused dependency patch

* Enable secret storage based on local storage

* Remove unnecessary GitHub auth patch

It works now without the patch.
2023-09-26 08:35:41 -08:00
DevMirza 5428442628
feat(lang): Add Urdu Locale (#6444) 2023-09-22 17:16:51 -08:00
Asher acc50a5d36
Update dependencies and force-update qs (#6440)
* 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
2023-09-21 16:13:34 -08:00
Kaoru Yamamoto 95bcf101d7
Add Japanese locale (#6433) 2023-09-18 17:23:03 +00:00
Asher 3e1c00e017
Run formatter
Not sure why CI missed these, will have to look into it.
2023-09-11 09:27:28 -08:00
Cyanoure a76e5241b6
Add "CODE_SERVER_HOST" environment variable (#6423) 2023-09-08 22:50:11 +00:00
Asher eb498b0d6d
Remove humanPath (#6404)
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.
2023-08-29 14:25:24 -08:00
Asher e37b35278d
Account for disabled proxy in startup logs 2023-07-27 09:26:11 -08:00
Ryan Brainard 74da5167a2
Add --disable-proxy option (#6349) 2023-07-21 15:23:21 -08:00
Alex Thillen 93e60f7b0e
add trusted-origins cli argument (#6319) 2023-07-19 14:04:03 -08:00
Asher 5c19962930
Set session socket into environment variable (#6282)
* 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
2023-06-21 22:47:01 -08:00
Asher cef2aa22dc
Move session server log after HTTP server logs
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.
2023-06-21 10:59:02 -08:00
Sean Lee b5a9ef80e7
Use unique socket per user for managing editor sessions (#6278)
Also warn if editor session manager socket cannot be created rather than failing.
2023-06-21 13:39:25 -05:00
dependabot[bot] fdeaba9581
chore: bump proxy-agent from 5.0.0 to 6.2.1 (#6247)
* chore: bump proxy-agent from 5.0.0 to 6.2.1

Bumps [proxy-agent](https://github.com/TooTallNate/proxy-agents/tree/HEAD/packages/proxy-agent) from 5.0.0 to 6.2.1.
- [Release notes](https://github.com/TooTallNate/proxy-agents/releases)
- [Changelog](https://github.com/TooTallNate/proxy-agents/blob/main/packages/proxy-agent/CHANGELOG.md)
- [Commits](https://github.com/TooTallNate/proxy-agents/commits/proxy-agent@6.2.1/packages/proxy-agent)

---
updated-dependencies:
- dependency-name: proxy-agent
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>

* Update proxy-agent usage

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Asher <ash@coder.com>
2023-06-14 14:27:15 -08:00
Sean Lee fb73742b2b
Prefer matching editor sessions when opening files. (#6191)
Signed-off-by: Sean Lee <freshdried@gmail.com>
2023-06-14 13:32:07 -08:00
Simon Merschjohann 0703ef008c
Allow {{host}} and {{port}} in domain proxy (#6225) 2023-05-31 16:31:30 -05:00
Asher b3b971480f
Support X-Forwarded-Host with multiple hosts
Closes #6215.
2023-05-17 11:51:05 -08:00
Asher 5708e6ce32
Format redacted arg lines
Pushing straight to main again.
2023-05-05 14:44:40 -08:00
Asher 3f7db15fde
Redact sensitive args from handshake debug log 2023-05-04 10:54:41 -08:00
Asher 8c99f41b90
Fix parent process log level 2023-05-04 10:48:32 -08:00
Asher e02d56dbfd
Do not trace child process messages
All this does is add a stack trace which is not helpful here.
2023-05-04 10:48:31 -08:00
Asher aac5efa046
Do not log < 500 on web sockets as errors
For example if someone spams a web socket without authentication we
should not log "forbidden".  Forbidden is normal/expected operation, not
an error.
2023-05-04 10:48:30 -08:00
smalllady 951d8ac45e
Fix proxying non-ASCII (#6154)
This only affects the path proxy since `req.originalUrl` is in escaped format.
2023-04-25 11:41:33 -08:00
Asher c995988b70
Set proxy URI to domain proxy when possible (#6115)
This will make the ports panel use it instead of the default path-based
proxy.
2023-03-30 12:01:49 -08:00
watchakorn-18k a44bd71043
Add thai language i18n (#6103) 2023-03-30 13:00:58 -05:00
Asher 19bcd043d7
Add debug log for origin check (#6096)
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.
2023-03-30 12:24:33 -05:00
Ahmed El-Sharnoby bca733de3d
Allow app-name configuration to change the name of the PWA (#6093) 2023-03-22 01:02:31 +00:00
Asher dbdd2edb62
Fix proxy error on web sockets
Fixes #6088.
2023-03-21 12:24:09 -08:00
Asher d477972c68
Add origin checks to web sockets (#6048)
* 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
2023-03-03 03:12:34 -06:00
Asher ac1fba8bde
Remove deprecated --link (#6018) 2023-02-13 16:52:48 -06:00
Asher 45aef719d3
Make sure heartbeat isActive resolves
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.
2023-02-08 11:43:40 -09:00
dependabot[bot] e5a2537aee
chore: bump limiter from 1.1.5 to 2.1.0 (#6001)
* chore: bump limiter from 1.1.5 to 2.1.0

Bumps [limiter](https://github.com/jhurliman/node-rate-limiter) from 1.1.5 to 2.1.0.
- [Release notes](https://github.com/jhurliman/node-rate-limiter/releases)
- [Commits](https://github.com/jhurliman/node-rate-limiter/commits)

---
updated-dependencies:
- dependency-name: limiter
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>

* Update limiter usage

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Asher <ash@coder.com>
2023-02-06 13:12:57 -06:00