Commit Graph

136 Commits

Author SHA1 Message Date
Josh Spicer
6cc2564bf9 remote: configurable 'reconnection grace time' (#274910)
* reconnection grace period prototype

* plumb through CLI

* polish

* Apply suggestions from code review

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

---------

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
2025-11-12 18:51:28 -08:00
Connor Peet
3331d2d87d chore: update to rust 1.85 (#242609) 2025-03-04 21:58:23 +01:00
Sandeep Somavarapu
4920694ece fix #234843 (#235955)
* fix #234843

* fix lint error
2024-12-12 16:48:37 +01:00
Connor Peet
c4efcbdfb4 cli: remove stray debug log (#233714) 2024-11-12 10:42:28 -08:00
Hamir Mahal
a744313eb7 style: simplify string formatting for readability (#231763)
* style: simplify string formatting for readability

* fix: formatting in `.rs` files in `src/`
2024-10-22 16:30:46 +00:00
Connor Peet
4d221c6b85 cli: reapply "code server-web when offline" 2024-09-09 09:18:56 -07:00
Robo
746ba5bc68 cli: revert "code server-web when offline" (#227981)
* Revert "Merge pull request #227830 from microsoft/connor4312/cli-offline-serve"

This reverts commit 136a5c6f5f, reversing
changes made to 9d388bbf8b.

* chore: bump distro
2024-09-09 16:21:08 +02:00
Connor Peet
077bd2f1b4 fixups
- Don't set a config option for update interval. We don't let the one
  in core be configurable, don't see a huge need for this.
- Don't start the server when the update is available
- Fix some race conditions
- Fix some clippy lints on Rust 1.81
2024-09-06 12:20:13 -07:00
Connor Peet
03d781a755 cli: fix closing incorrectly if updated failed (#215595) 2024-06-15 00:54:51 +02:00
Connor Peet
54dd0ecc65 forwarding: make https work for port forwarding (#213943)
Closes https://github.com/microsoft/vscode/issues/201465
2024-05-30 21:42:51 -07:00
Connor Peet
0f2b535662 cli: automatically remove servers that fail to start (#211500)
Fixes https://github.com/microsoft/vscode-remote-release/issues/9823
2024-04-27 06:54:06 -07:00
Connor Peet
60bd03a02e cli: fix tunnels not working on Windows (#211498)
I made a change this past iteration to use `CREATE_BREAKAWAY_FROM_JOB`
in order to allow the code-server process to outlive SSH connections run
from the exec server.

However, it appears that this _can_ break things if it's run from a job
that doesn't have the JOB_OBJECT_LIMIT_BREAKAWAY_OK flag set. I'm not
a winapi expert, so this is a simple though perhaps inefficient change
to probe whether we can do this via an echo command before starting the
server.
2024-04-27 01:38:38 +02:00
Connor Peet
85178f0fb4 cli: bubble error from setup to the remote server (#210967)
cli: bubble error from setup to the remote server logs
2024-04-22 23:57:44 +02:00
Connor Peet
21e0716833 cli: update proc macro and clippy (#210414) 2024-04-15 20:27:34 +02:00
Connor Peet
d30b358ac7 cli: ensure vscode server outlives CLI on windows (#210279) 2024-04-13 01:50:34 +02:00
Connor Peet
26edf9ca9f cli: add progress for extraction (#209499)
For https://github.com/microsoft/vscode-remote-tunnels/issues/724
2024-04-03 17:08:49 -07:00
Connor Peet
8558da1335 cli: allow public port forwarding via tunnels (#209489) 2024-04-04 00:28:00 +02:00
Connor Peet
2ffe804c46 cli: allow specifying a server-data-dir and extensions-dir (#208225) 2024-03-20 18:09:51 +01:00
Connor Peet
1ab312aeed cli: try to automatically reload services during tunnel service install (#208119)
Fixes #208094
2024-03-19 15:29:30 -07:00
Connor Peet
7015a87618 cli: avoid adoption of tunnels with existing host connections (#208033)
Fixes https://github.com/microsoft/vscode-remote-release/issues/9655
2024-03-18 19:44:07 +01:00
Connor Peet
6269ab41b4 cli: add --install-extension command for use with tunnel server (#207741)
* cli: add --install-extension command for use with tunnel server

* fix clippy
2024-03-14 19:05:20 +01:00
Connor Peet
f99981ed56 cli: fix compressor not draining and leading to truncated responses (#206464)
* cli: fix compressor not draining and leading to truncated responses

Fixes https://github.com/microsoft/vscode-remote-release/issues/9594

* fix lint
2024-02-28 20:47:31 +01:00
Connor Peet
7e0c93cec5 cli: skip integrity check when prereq skip flag is present (#203912) 2024-01-31 18:33:55 +01:00
Connor Peet
d7cfba7af7 cli: update dev tunnel sdk (#203763) 2024-01-30 03:01:21 +01:00
samhanic
74c419b5bd add cli update-extensions prototype 2023-12-03 14:25:40 +01:00
Connor Peet
7771124ebd cli: add tcpConnect exec server command, add proposed methods to .d.ts (#197692) 2023-11-07 16:23:48 -08:00
Connor Peet
7d2c73944d cli: use bit flags for publishing tunnel data (#197164)
And it now publishes the OS it runs on, which is used to fix part of #195938
2023-11-01 20:05:53 +01:00
Connor Peet
d6707fd3fd cli: explicitly deny anonymous control port access (#197093)
* cli: explicitly deny anonymous control port access

Prevents inheriting any ACL set at the tunnel level which may allow different access for forwarded ports

* testing: make ui more clear for discovery errors (#197115)

* testing: make ui more clear for discovery errors

Fixes #196546

* undo

* fix tests
2023-11-01 19:59:46 +01:00
Connor Peet
ad29091f39 fix: don't wait for stdin pump to end before propagating process exit (#196306) 2023-10-23 10:59:05 -07:00
Connor Peet
4aa04c7db2 cli: add extra fs operations for container
Ref https://github.com/microsoft/vscode-remote-tunnels/issues/695
2023-10-18 20:28:02 -07:00
Connor Peet
96d5db84d1 cli: fix closing before stdio is drained
Fixes https://github.com/microsoft/vscode-remote-tunnels/issues/693
2023-10-18 20:28:02 -07:00
Connor Peet
3d01829e87 cli: increase socket search timeout (#195837)
Fixes #195823
2023-10-17 16:06:32 -07:00
Connor Peet
e0502b5442 cli: update dev tunnels (#195183) 2023-10-09 12:44:12 -07:00
Connor Peet
e250c8066d cli: fix command prompt showing up on windows (#194946)
cli: fix wsl prompt up on windows machine

Fixes #190425 again
2023-10-06 17:09:47 +01:00
Connor Peet
44bd95e6e5 cli: tunnel default name should satisfy any requirements (#194848)
Fixes #194755
2023-10-05 00:29:36 +01:00
Connor Peet
fe318d50e0 cli: add refresh loop for tunnel, touch GH token (#194834)
Fixes #194658
2023-10-04 22:36:40 +01:00
Connor Peet
f92db2f96e cli: fix renamed self-update name, cleanup old binaries
Fixes #192948
2023-09-21 14:37:33 -07:00
Connor Peet
35425d369a cli: propagate server closing (#192824)
Previously this was never needed since the connection was only used for
the ext host, which never closed.

Part 1 of fixing #192521
2023-09-12 00:45:39 +02:00
Connor Peet
fbdc92cac0 cli: fix delegated http requests not working (#192620)
From a refactor last literation. I don't think this is candidate worthy
as it's an uncommon path with remote-tunnels, and we can just toggle
this off for remote-ssh for this iteration.
2023-09-08 13:26:36 -07:00
Connor Peet
0ee7a576b6 tunnels: fix command prompt windows show up on windows machine (#192016)
Fixes #190425
2023-09-01 22:17:58 +02:00
Connor Peet
8813aca705 cli: recycle all tunnels the cli creates for all scenarios (#191800)
Fixes #191749
2023-08-30 17:37:00 +02:00
Connor Peet
5cc83f7994 cli: verify vscode server integrity before committing to cache (#191792)
Fixes #191469
2023-08-30 17:20:08 +02:00
Connor Peet
8ef6961789 server-web: implement secret storage provider (#191538)
Works quite similarly to vscode.dev. The client has a key stored in
secret storage. The server has a key stored server-side, and issues
an http-only cookie to the client. The client can ask the server to
combine its key and the http-only cookie key to a key component, which
it combines with its local key to encrypt and decrypt data.

This logic kicks in if the web server bits see a `vscode-secret-key-path`
cookie set when it loads.
2023-08-28 17:48:09 -07:00
Connor Peet
db135a575a cli: fix decompression loop stalling (#191512)
Fixes #191501

It turns out this was a difference in inflate/deflate implementations
between the extension/SDK and the CLI. The SDK uses Node's zlib bindings,
while by default Rust's flate2 library uses a rust port of [miniz][1].
The 'logic' in the CLI was good, but miniz does not appear to flush
decompressed data as nicely on SYNC'd boundaries as zlib does, which
caused data to 'stall'. Telling the flate2 crate to use the native
bindings fixed this.

This could also be the cause of the flakiness occasionally seen on idle
tunnel connections!

[1]: https://github.com/richgel999/miniz
2023-08-28 21:51:04 +02:00
Connor Peet
1fe8359ed0 cli: implement 'server of server' for a local web server (#191014)
Closes https://github.com/microsoft/vscode/issues/168492

This implements @aeschli's 'server server' concept in a new
`code serve-web` command.

Command line args are similar to the standalone web server. The first
time a user hits that page, the latest version of the VS Code web server
will be downloaded and run. Thanks to Martin's previous PRs, all
resources the page requests are prefixed with `/<quality-<commit>`.

The latest release version is cached, but when the page is loaded again
and there's a new release, a the new server version will be downloaded
and started up.

Behind the scenes the servers all listen on named pipes/sockets and the
CLI acts as a proxy server to those sockets. Servers without connections
for an hour will be shut down automatically.
2023-08-22 17:29:51 -07:00
Connor Peet
52840e3ca5 cli: cleanup build (#190213)
- Remove the `prepare` script entirely
- Variables are now populated from the product.json during build. Most
  variables are mapped automatically, with some special handling in a
	few cases. `build.rs` is now much more self-contained.
- Look for the `product.overrides.json` for vscode developers instead of
  looking for a peer `vscode-distro` folder

Fixes #178691
2023-08-10 20:14:30 -07:00
Connor Peet
2e9459b34c cli: add more details to the status command (#190212)
For azml's integration

Closes https://github.com/microsoft/vscode-remote-tunnels/issues/669
2023-08-10 20:13:14 -07:00
Connor Peet
05b62dd315 cli: adopt existing tunnel if one exists by name (#190110)
* wip

* cli: adopt existing tunnel if one exists by name

Gets rid of an error state users could sometimes get into.

Fixes #189830
2023-08-10 11:19:55 +10:00
Connor Peet
71282c3d52 forwarding: add built-in tunnel forwarding extension (#189874)
* forwarding: add built-in tunnel forwarding extension

- Support public/private ports, which accounts for most of the work in
  the CLI. Previously ports were only privat.
- Make the extension built-in. Ported from the remote-containers
  extension with some tweaks for privacy and durability.
- This also removes the opt-in flag, by not reimplementing it 😛

Fixes https://github.com/microsoft/vscode/issues/189677
Fixes https://github.com/microsoft/vscode/issues/189678

* fixup! comments

---------

Co-authored-by: Raymond Zhao <7199958+rzhao271@users.noreply.github.com>
2023-08-08 22:00:03 +01:00
Connor Peet
4c469c5f8e use winapi constant instead 2023-08-03 10:57:02 -07:00