Commit Graph

20 Commits

Author SHA1 Message Date
Connor Peet
bafd442c4e cli: improve code tunnel with existing tunnels (#188091)
- Apply the name/tunnel-name from the CLI to automatically
	(do a normal tag sync). Previously the CLI could host tunnels that
	were unusable unless the consumer did the tag setup, which they
	should not.
- Allow "tunnel ID" to be specified in the new `<id>.<cluster>` format
  that devtunnels has adopted.
2023-07-17 10:56:27 -07:00
Connor Peet
12340da1f1 cli: allow installation as a service from the UI (#187869)
- When turning on remote tunnel access, a quickpick is now shown asking
  users whether it should be installed as a service or just run in
	the session.
- Picking the service install will install the tunnel as a service on
  the machine, and start it.
- Turning off remote tunnel access will uninstall the service only if
  we were the ones to install it.
- This involved some refactoring to add extra state to the RemoteTunnelService.
  There's now a "mode" that includes the previous "session" and reflects
	the desired end state.
- I also did a cleanup with a `StreamSplitter` to ensure output of the
  CLI gets read line-by-line. This was depended upon by the remote tunnel
	service code, but it's not actually guaranteed.
- Changes in the CLI: allow setting the tunnel name while installing the
  service, and make both service un/installation and renames idempotent.

Closes https://github.com/microsoft/vscode/issues/184663
2023-07-13 20:23:15 -07:00
Connor Peet
d0d97015b0 cli: publish availability of wsl on tunnel tags (#186016)
I plan to use this in the explorer to add a 'connect to wsl' button on relevant tunnels
2023-06-23 12:12:18 -07:00
Taiyo Sogawa
ea97852a3b Add server message to user-facing error on 429 for tunnel creation (#185600)
* Add server message to user-facing error on 429 for tunnel creation

* Update cli/src/tunnels/dev_tunnels.rs

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

* fix lint error

---------

Co-authored-by: Connor Peet <connor@peet.io>
2023-06-19 13:16:29 -07:00
Connor Peet
5a139d4ffc cli: fix tunnel names are case sensitive but remoteAuthorities are not (#181347)
Fixes #177222
2023-05-02 18:55:11 +02:00
Connor Peet
ab6ba2ebee cli: fix problem restarting tunnel with uppercase letter in name (#180881)
Fixes #180693
2023-04-25 23:50:15 +02:00
Connor Peet
792114a7ec cli: rename tunnels to lowercase names (#178272)
* cli: rename tunnels to lowercase names

Fixes #177222

* fix lint
2023-03-25 19:43:53 -07: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
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
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
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
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
Connor Peet
707f91aaa6 cli: fix 'failed to lookup tunnel' with a name given (#166507)
Fixes https://github.com/microsoft/vscode-cli/issues/563

If a new tunnel `--name` was provided but the existing tunnel was deleted,
the CLI would error out with a lookup failed message. Instead it now
recreates it like it normally would.
2022-11-16 14:10:49 -08:00
Martin Aeschlimann
70998c096d tunnel --name should rename previous tunnel (#164753)
* tunnel --name should rename old tunnel

* fix clippy warning
2022-10-26 14:44:57 -07:00
Martin Aeschlimann
1b3bf4a550 Support starting tunnel with a given name (#163818)
* Support starting tunnel with a given name

* improve error message
2022-10-19 23:26:20 +02:00
Connor Peet
a2dd71c0fe cli: use openssl for all crypto-related activities
For compliance with SDL and MSFT crypto standards. Right now this uses
our forks of russh and secret-service. russh seems amenable to getting
this merged (https://github.com/warp-tech/russh/pull/52) but TBD about
the secret-service crate.

Fixes https://github.com/microsoft/vscode-internalbacklog/issues/3158
2022-10-14 11:09:31 -07:00
Connor Peet
b784bcdd32 cli: use hard tabs to align with vscode style 2022-09-23 14:17:01 -07:00
Connor Peet
9bcc88eafe cli: get builds in order 2022-09-23 13:28:26 -07:00
Connor Peet
3762635fe1 move cli to top level 2022-09-20 08:42:44 -07:00