255 Commits

Author SHA1 Message Date
Connor Peet
b9c2df39d1
cli: don't colorize file log output, collect internal logs for broadcast (#177420)
Fixes #177345
2023-03-17 17:14:41 +01:00
Connor Peet
120d0d2fdb
fix: make tunnel names case-insensitive (#177413)
Lowercase them, since Basis internally is case-sensitive.

Fixes #177222
2023-03-16 15:49:51 -07:00
Connor Peet
9fc16337d5
cli: code-insiders tunnel service install message should use code-insiders (#177394)
Fixes #177344
2023-03-16 21:18:22 +01:00
Connor Peet
eab8ba65bf
cli: add tunnel status command (#177381)
Fixes #177372
2023-03-16 12:26:56 -07:00
Connor Peet
025e3194e1
fix: missing accept server license terms arg in service install (#177366)
Fixes #177351
2023-03-16 11:23:35 -07:00
Connor Peet
0e1ec3e87d
fix: not installing extensions in the directory that is being passed (#177303)
Fixes https://github.com/microsoft/vscode-internalbacklog/issues/3595
2023-03-16 00:14:53 +01:00
Connor Peet
abab52dd94
cli: add tunnel kill/restart subcommands (#177286) 2023-03-15 15:09:12 -07:00
Connor Peet
0e7d14d32d
cli: allow client process to control singleton process (#177141)
Other connected clients will now print:

```
Connected to an existing tunnel process running on this machine. You can press:

- Ctrl+C to detach
- "x" to stop the tunnel and exit
- "r" to restart the tunnel
```

These are then sent to the server to have that take effect. This is
mostly some refactors in the singleton_server to make the lifecycle work.
2023-03-14 17:55:28 -07:00
Connor Peet
1b5fd140fb
Run tunnels as singleton process (for a --cli-data-dir) (#177002)
* wip on singleton

* wip

* windows support

* wip

* wip

* fix clippy
2023-03-14 08:09:47 -07:00
Connor Peet
863b9261a3
cli: bump tempfile->remove_dir_all for cve (#176206) 2023-03-06 10:10:01 +01:00
Simon Byrne
ef46983a3a
cli: option to disable encryption of keychain matter
* option to disable encryption of keys

Avoids issue of token invalidation when switching machines with a shared home directory, as suggested by @connor4312 in https://github.com/microsoft/vscode-remote-release/issues/8110#issuecomment-1452270922

Fixes #8110

* Update cli/src/auth.rs

Co-authored-by: Connor Peet <connor@peet.io>

* Change variable to VSCODE_CLI_DISABLE_KEYCHAIN_ENCRYPT

Co-authored-by: Connor Peet <connor@peet.io>

---------

Co-authored-by: Connor Peet <connor@peet.io>
2023-03-02 20:28:57 +01:00
Connor Peet
26fe31fc66
update openssl-prebuild for musl failures (#175731)
* update openssl-prebuild for musl failures

* reapply vendoring

* reapply macos pipeline fix
2023-03-01 08:57:45 +01:00
Connor Peet
f8119e9beb
Revert "cli: fix static import of openssl (#175681)" (#175727)
This reverts commit 7014a17b1f39f48fbbe0bb587f0df23dc9a4a947.
2023-03-01 07:43:32 +01:00
Connor Peet
7014a17b1f
cli: fix static import of openssl (#175681)
* cli: fix static import of openssl

* update dev tunnels
2023-02-28 11:20:58 -08:00
Benjamin Pasero
2cad803acf
Revert "Bump openssl-src from 111.22.0+1.1.1q to 111.25.0+1.1.1t in /cli (#173883)"
This reverts commit be0f82c93af87f53d38db9397273a8841e60d7e5.
2023-02-28 08:37:33 +01:00
dependabot[bot]
be0f82c93a
Bump openssl-src from 111.22.0+1.1.1q to 111.25.0+1.1.1t in /cli (#173883)
Bumps [openssl-src](https://github.com/alexcrichton/openssl-src-rs) from 111.22.0+1.1.1q to 111.25.0+1.1.1t.
- [Release notes](https://github.com/alexcrichton/openssl-src-rs/releases)
- [Commits](https://github.com/alexcrichton/openssl-src-rs/commits)

---
updated-dependencies:
- dependency-name: openssl-src
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-02-27 16:05:56 +00:00
Martin Aeschlimann
beb9ed3758
update tokio (#173784) 2023-02-08 17:10:14 +07:00
Connor Peet
40f31f92d0
cli: fix download for arm32 linux (#173374)
Once again, wishing target_* were statically typed...

Fixes https://github.com/microsoft/vscode-remote-release/issues/7631
2023-02-03 13:30:31 -08:00
Connor Peet
760c998cda
cli: remove debug print (#173223) 2023-02-02 15:32:47 -08:00
Connor Peet
953a039549
cli: use hostname-based generation instead of bird names (#173220)
Fixes #167708 by using a more predictable naming scheme.

```
me> Write a haiku about the extinction of birds
chatgpt>
	Silent skies above,
	Once lively songs now gone,
	Fading memories.
```
2023-02-02 15:05:38 -08:00
Connor Peet
339fd630e6
cli: fix macos build (#172712) 2023-01-28 17:43:32 -08:00
Connor Peet
b5aa3e0a3d
cli: use better approach to Windows services (#172679)
Fixes #167741

This eschews the offical Windows service system in favor of registering
into `HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Run`.
Unlike services, this can be done without administrative permissions,
does not require the current username/password, and is not blocked by
miscellaneous and mysterious system policies.

Since the process is basically unmanaged by the OS, this requires a
little legwork to start and stop the process when registering and
unregistering.
2023-01-27 15:04:56 -08:00
Connor Peet
7a04589c16
cli: fix sleep inhibition not always working (#172428)
Seems like we should prevent _both_ "useridlesystemsleep" as well as "systemsleep"

Fixes https://github.com/microsoft/vscode-remote-release/issues/7913
2023-01-25 19:50:52 +01:00
Connor Peet
5beebeb170
cli: fall back to screensaver api for linux no-sleep (#172353) 2023-01-25 16:28:30 +09:00
Connor Peet
618da1e00a
cli: fix arch check for musl arm64 (#172092)
Fixes https://github.com/microsoft/vscode-remote-release/issues/7812

Wish Rust had compilation errors for bad compile time checks :(
2023-01-23 16:50:24 -08:00
Connor Peet
6d59c82ddc
cli: add option to enable --no-sleep for tunnel (#172043)
Fixes https://github.com/microsoft/vscode-remote-release/issues/7127

Also add auth logs for debugging, seemed like my OSS retained
a bad Github token.
2023-01-23 10:44:27 -08:00
Connor Peet
3ccb3ca7c3
Merge pull request #171927 from microsoft/connor4312/nosleep-linux
cli: implement --no-sleep for linux
2023-01-21 15:29:05 -08:00
Connor Peet
4a9bf44941
Merge pull request #171894 from microsoft/connor4312/nosleep-windows
cli: implement --no-sleep for windows
2023-01-21 15:24:19 -08:00
Connor Peet
2ef991a960 cli: implement --no-sleep on linux 2023-01-21 12:29:28 -08:00
Connor Peet
bcc8232721
fix: build on windows (#171892)
🙈
2023-01-21 14:05:37 +09:00
Connor Peet
758bc69404
cli: implement --no-sleep for windows 2023-01-20 18:57:11 -08:00
Connor Peet
4cf496e905
cli: add --no-sleep flag, implementation for macos (#171885)
First part of https://github.com/microsoft/vscode-remote-release/issues/7127
2023-01-20 15:42:09 -08:00
Connor Peet
9bf083f846
fix sigpipe detection, use archive path given by client 2023-01-20 11:56:02 -08:00
Connor Peet
c600c10579
Merge remote-tracking branch 'origin/main' into connor4312/cli-wsl-control-2 2023-01-20 11:32:17 -08:00
Connor Peet
4a7adb6667
cli: use x64 server for windows arm64 (#171861)
cli: use x64 server for arm64

We don't publish an arm64 server yet. Same thing as ssh does.
2023-01-20 20:13:22 +01:00
Connor Peet
c010101bc4
wip 2023-01-19 20:03:47 -08:00
Connor Peet
a4585b072e
dep: bump the bumpalo 🦬 (#171651)
Fixes https://github.com/microsoft/vscode-internalbacklog/issues/3426
2023-01-18 16:40:11 -08:00
Connor Peet
8965c48d30
wip 2023-01-18 16:15:43 -08:00
Connor Peet
2c2ead679b
cli: initial wsl control server
Adds an stdin/out json rpc server for wsl.

Exposes a singular install_local command to install+boot the vscode server on a port from a local archive.

Also refines the common rpc layer some more. I'm decently happy with it now.
2023-01-18 08:23:04 -08:00
Connor Peet
2aecc85c22 cli: update help text of cli for standalone differentiation 2023-01-17 08:19:36 -08:00
Connor Peet
4d882322ca
cli: start to extract a generic rpc interface (#171299)
I want to use the rpc interface for communication via stdin/out in wsl,
but currently RPC is tightly coupled to the control server. The control
server also speaks msgpack instead of JSON, since it deals with binary
messages. WSL won't, and we'll want to use JSON to interact with VS
Code, so some separation is needed.

This pulls out a base set of RPC types for use in both scenarios.
Currently these are only 'helper' structs that don't actually do any
i/o, but once I figure out the model I would like to have a cleaner way
to do i/o in a unified way as well.

For the control server, previously we basically handled all methods in
one big `switch` block with nasty macros, whereas now there's
nicer `register_a/sync` functions.

Some additional small refactors were needed to preserve the strict
ordering of server messages, since they need to be order else we get
decompression errors. This is the `start_bridge_write_loop`. As a small
benefit, this means we can avoid the relatively expensive async Tokio
mutex that we were using, and instead use the standard library mutex.
2023-01-16 21:43:41 -08:00
dependabot[bot]
2584c4b68b
Bump tokio from 1.21.2 to 1.23.1 in /cli (#170729)
Bumps [tokio](https://github.com/tokio-rs/tokio) from 1.21.2 to 1.23.1.
- [Release notes](https://github.com/tokio-rs/tokio/releases)
- [Commits](https://github.com/tokio-rs/tokio/compare/tokio-1.21.2...tokio-1.23.1)

---
updated-dependencies:
- dependency-name: tokio
  dependency-type: direct:production
...

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

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-01-09 08:18:25 -08:00
logica
dda26d34a8
cli: enable code-tunnel systemd service to start when the machine booted (#170015)
fix [Install] section of systemd service file

change WhantedBy from multi-user.target to default.target
2023-01-05 21:02:22 +00:00
Connor Peet
b5ad508dfb
cli: cleanup some process querying code (#170306)
Avoid pulling system info we don't have to.

Minor cleanups while working on https://github.com/microsoft/vscode/pull/170305
2022-12-30 12:55:57 -08:00
Connor Peet
84d2eac2fc
cli: output full version (#170057)
Fixes #169635
2022-12-26 20:47:13 +01:00
Connor Peet
82b239204c
cli: print oauth errors better, respect slow_down (#169164)
For diagnosing https://github.com/microsoft/vscode/issues/169066
2022-12-14 14:06:24 -05:00
Connor Peet
25cfb20ec9
tunnels: add preview dialog for turning on tunnel access 2022-12-02 09:36:23 -08:00
Connor Peet
c87fa19f79
cli: avoid interactions when running integrated (#167780)
Fixes https://github.com/microsoft/vscode/issues/167760

The VS Code CLI gets run from a bash/shell script. This prevents interactions--in the former case, it doesn't look like a tty, and in the latter case batch scripts don't seem to support having interactive subprocesses.

This PR avoids interactions if stdin is not a tty, prompting the user to use the flag instead. Use of the flag is also persisted like an interactive agreement prompt.
2022-11-30 23:15:08 +00:00
Connor Peet
a315da7910
cli: fix service failing to install on older systemd (#167672)
Fixes https://github.com/microsoft/vscode/issues/167671

In newer systemd, enablement is apparently implicit with 'link', but it must be called for older setups.
2022-11-30 00:34:05 +00:00
Connor Peet
adcffbdce9
cli: use connection token for CLI connections (#167426)
This uses a hash of the tunnel ID to create the connection token, which
should be sufficient to resolve the issues.

We also now publish the protocol version in the tunnel tags, since the
connection token must be supplied in the resolver, which is before we
start connecting to the tunnel.

See https://github.com/microsoft/vscode-internalbacklog/issues/3287
2022-11-28 18:03:15 +01:00